Skip to content

Commit

Permalink
Merge pull request #64 from negbie/master
Browse files Browse the repository at this point in the history
sync
  • Loading branch information
negbie committed Jul 28, 2018
2 parents 203e930 + 9743d9f commit 60f1d36
Show file tree
Hide file tree
Showing 15 changed files with 312 additions and 371 deletions.
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Config struct {
HepNodeID uint
Network string
Protobuf bool
Reassembly bool
}

type InterfacesConfig struct {
Expand Down
4 changes: 3 additions & 1 deletion decoder/correlator.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ import (
"github.com/negbie/logp"
)

var ipPort bytes.Buffer

// cacheSDPIPPort will extract the source IP, source Port from SDP body and CallID from SIP header.
// It will do this only for SIP messages which have the strings "c=IN IP4 " and "m=audio " in the SDP body.
// If there is one rtcp attribute in the SDP body it will use it as RTCP port. Otherwise it will add 1 to
// the RTP source port. These data will be used for the SDPCache as key:value pairs.
func cacheSDPIPPort(payload []byte) {
if posSDPIP := bytes.Index(payload, []byte("c=IN IP")); posSDPIP > 0 {
if posSDPPort := bytes.Index(payload, []byte("m=audio ")); posSDPPort > 0 {
var ipPort bytes.Buffer
ipPort.Reset()
restIP := payload[posSDPIP:]
// Minimum IPv4 length of "c=IN IP4 1.1.1.1" = 16
if posRestIP := bytes.Index(restIP, []byte("\r\n")); posRestIP >= 16 {
Expand Down
Loading

0 comments on commit 60f1d36

Please sign in to comment.