1、发送报文中INVITE sip,通过解析c=IN IP4 127.0.0.1获取源IP地址,通过解析m=audio 5000 RTP/AVP 0获取源端口信息,从而关联数据流。报文内容如下:
INVITE sip:bob@example.com SIP/2.0
Via: SIP/2.0/UDP 127.0.0.1:45298;branch=z9hG4bKrDQpyyaNWz;rport
To: "Bob" <sip:bob@example.com>
From: "Alice" <sip:alice@example.com>;tag=BFm5qD6Ufs
Call-ID: valid:0+vwD1bbZZpy@mudynamics.com
CSeq: 1 INVITE
Contact: <sip:alice@127.0.0.1:45298>
Expires: 5
Max-Forwards: 70
Allow: INVITE, PRACK, ACK, BYE, CANCEL, OPTIONS
Session-Expires: 86400
Content-Type: application/sdp
Supported: 100rel,timer
Content-Length: 205
v=0
o=- 440253649 440253649 IN IP4 127.0.0.1
s=-
c=IN IP4 127.0.0.1
t=0 0
m=audio 5000 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=rtpmap: