[OpenSIPS-Users] Reversed behaviour when setting up opensips with rtpproxy

Boris Ratner ratner2 at gmail.com
Tue Mar 29 12:00:36 CEST 2011


Hi all!

Please tell me know if this behaviour is intentional:
Problem with proxying rtp:
UAC receives ip in the UAS' subnet while UAS receives the ip of UAC's
subnet of rtp proxy by default.


IP-Phone is on 10.200.10.195.

Network configuration:

ast1.local  <----------->  opensips+rtpproxy <---------> ast2.local
192.168.56.3           192.168.56.2/192.168.58.2       192.168.58.3
10.200.10.something
for ip phone.

SIP:
ast1 configured with outboundproxy .56.2
ast2 configured with outboundproxy .58.2
no ip routing is done on the ALG

OpenSIPS 1.6.4:
configured to rtpproxy_offer(); on INVITE
and to rtpproxy_answer(); on reply to it.

rtpproxy 1.2.1:
in bridge mode 192.168.56.2/192.168.58.2

SIP works fine:
<ast1>
Reliably Transmitting (no NAT) to 192.168.56.2:5060:
OPTIONS sip:ast2.local SIP/2.0
Via: SIP/2.0/UDP 192.168.56.3:5060;branch=z9hG4bK2a985f57;rport
From: "asterisk" <sip:asterisk at 192.168.56.3>;tag=as7d368e85
To: <sip:ast2.local>
Contact: <sip:asterisk at 192.168.56.3>
Call-ID: 1a0cd5082af8bd525e2071c10edf2920 at 192.168.56.3
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX
Max-Forwards: 70
Date: Mon, 07 Mar 2011 21:54:17 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Content-Length: 0

<ast2>
<--- Transmitting (no NAT) to 192.168.58.2:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP
192.168.58.2;branch=z9hG4bK5054.135a9ff1.0;received=192.168.58.2
Via: SIP/2.0/UDP
192.168.56.3:5060;received=192.168.56.3;branch=z9hG4bK2a985f57;rport=5060
Record-Route: <sip:192.168.58.2;r2=on;lr=on>
Record-Route: <sip:192.168.56.2;r2=on;lr=on>
From: "asterisk" <sip:asterisk at 192.168.56.3>;tag=as7d368e85
To: <sip:ast2.local>;tag=as63b00332
Call-ID: 1a0cd5082af8bd525e2071c10edf2920 at 192.168.56.3
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Contact: <sip:192.168.58.3>
Accept: application/sdp
Content-Length: 0

THE CALL: from ast1 to ast2

<ast1>
<------------>
    -- Executing [565656 at incoming:1] Dial("SIP/bratner-000000a9",
"SIP/ast2/565656") in new stack
Audio is at 192.168.56.3 port 18922
Adding codec 0x2 (gsm) to SDP
Adding codec 0x4 (ulaw) to SDP
Adding codec 0x8 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 192.168.56.2:5060:
INVITE sip:565656 at ast2.local SIP/2.0
Via: SIP/2.0/UDP 192.168.56.3:5060;branch=z9hG4bK391f49a8;rport
From: "Extension 1001" <sip:bratner at 192.168.56.3>;tag=as6826385c
To: <sip:565656 at ast2.local>
Contact: <sip:bratner at 192.168.56.3>
Call-ID: 2d167b8f4108d4467ff3ea4e1cff7218 at 192.168.56.3
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Date: Mon, 07 Mar 2011 21:58:03 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Content-Type: application/sdp
Content-Length: 287

v=0
o=root 19589 19589 IN IP4 192.168.56.3
s=session
c=IN IP4 192.168.56.3
t=0 0
m=audio 18922 RTP/AVP 3 0 8 101
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

<RTP PROXY>

DBUG:handle_command: received command "U
2d167b8f4108d4467ff3ea4e1cff7218 at 192.168.56.3 192.168.56.3 18922
as6826385c;1"
INFO:handle_command: new session
2d167b8f4108d4467ff3ea4e1cff7218 at 192.168.56.3, tag as6826385c;1
requested, type strong
INFO:handle_command: BRAT: given remote address 192.168.56.3
INFO:create_twinlistener: BINDING TO 0.0.0.0
INFO:create_twinlistener: BINDING TO 0.0.0.0
INFO:handle_command: new session on a port 50026 created, tag as6826385c;1
INFO:handle_command: pre-filling caller's address with 192.168.56.3:18922
DBUG:doreply: sending reply "50026"



<ast2>
<--- SIP read from 192.168.58.2:5060 --->
INVITE sip:565656 at ast2.local SIP/2.0
Record-Route: <sip:192.168.58.2;r2=on;lr=on>
Record-Route: <sip:192.168.56.2;r2=on;lr=on>
Via: SIP/2.0/UDP 192.168.58.2;branch=z9hG4bKc05.3917bd94.0
Via: SIP/2.0/UDP
192.168.56.3:5060;received=192.168.56.3;branch=z9hG4bK391f49a8;rport=5060
From: "Extension 1001" <sip:bratner at 192.168.56.3>;tag=as6826385c
To: <sip:565656 at ast2.local>
Contact: <sip:bratner at 192.168.56.3>
Call-ID: 2d167b8f4108d4467ff3ea4e1cff7218 at 192.168.56.3
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 69
Date: Mon, 07 Mar 2011 21:58:03 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Content-Type: application/sdp
Content-Length: 305
P-hint: thehelldoiknow

v=0
o=root 19589 19589 IN IP4 192.168.56.3
s=session
c=IN IP4 192.168.56.2
t=0 0
m=audio 50026 RTP/AVP 3 0 8 101
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
a=nortpproxy:yes


<--- Reliably Transmitting (no NAT) to 192.168.58.2:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.58.2;branch=z9hG4bKc05.3917bd94.0;received=192.168.58.2
Via: SIP/2.0/UDP
192.168.56.3:5060;received=192.168.56.3;branch=z9hG4bK391f49a8;rport=5060
Record-Route: <sip:192.168.58.2;r2=on;lr=on>
Record-Route: <sip:192.168.56.2;r2=on;lr=on>
From: "Extension 1001" <sip:bratner at 192.168.56.3>;tag=as6826385c
To: <sip:565656 at ast2.local>;tag=as112d0057
Call-ID: 2d167b8f4108d4467ff3ea4e1cff7218 at 192.168.56.3
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Contact: <sip:565656 at 192.168.58.3>
Content-Type: application/sdp
Content-Length: 285

v=0
o=root 4755 4755 IN IP4 192.168.58.3
s=session
c=IN IP4 192.168.58.3
t=0 0
m=audio 19452 RTP/AVP 3 0 8 101
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv


<RTPPROXY>

DBUG:handle_command: received command "L
2d167b8f4108d4467ff3ea4e1cff7218 at 192.168.56.3 192.168.58.3 19452
as6826385c;1 as112d0057;1"
INFO:handle_command: BRAT: given internal address 192.168.58.3
INFO:create_twinlistener: BINDING TO 0.0.0.0
INFO:create_twinlistener: BINDING TO 0.0.0.0
INFO:handle_command: lookup on ports 50026/52556, session timer restarted
INFO:handle_command: pre-filling callee's address with 192.168.58.3:19452
DBUG:doreply: sending reply "52556"

<back at ast1>

<--- SIP read from 192.168.56.2:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP
192.168.56.3:5060;received=192.168.56.3;branch=z9hG4bK391f49a8;rport=5060
Record-Route: <sip:192.168.58.2;r2=on;lr=on>
Record-Route: <sip:192.168.56.2;r2=on;lr=on>
From: "Extension 1001" <sip:bratner at 192.168.56.3>;tag=as6826385c
To: <sip:565656 at ast2.local>;tag=as112d0057
Call-ID: 2d167b8f4108d4467ff3ea4e1cff7218 at 192.168.56.3
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Contact: <sip:565656 at 192.168.58.3>
Content-Type: application/sdp
Content-Length: 303unforce_rtp_proxy();

v=0
o=root 4755 4755 IN IP4 192.168.58.3
s=session
c=IN IP4 192.168.58.2
t=0 0
m=audio 52556 RTP/AVP 3 0 8 101
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
a=nortpproxy:yes




rtp debug on ast1:

Got  RTP packet from    10.200.10.195:24466 (type 18, seq 052716, ts
1254981560, len 000020)
Sent RTP packet to      192.168.58.2:52556 (type 00, seq 062080, ts
1254981560, len 000160)
Got  RTP packet from    10.200.10.195:24466 (type 18, seq 052717, ts
1254981720, len 000020)
Sent RTP packet to      192.168.58.2:52556 (type 00, seq 062081, ts
1254981720, len 000160)
Got  RTP packet from    10.200.10.195:24466 (type 18, seq 052718, ts
1254981880, len 000020)
Sent RTP packet to      192.168.58.2:52556 (type 00, seq 062082, ts
1254981880, len 000160)
Got  RTP packet from    10.200.10.195:24466 (type 18, seq 052719, ts
1254982040, len 000020)
Sent RTP packet to      192.168.58.2:52556 (type 00, seq 062083, ts
1254982040, len 000160)

there is no route to .58.2 from ast1.local


rtp debug on ast2:

<------------->
--- (11 headers 0 lines) ---
Sent RTP packet to      192.168.56.2:50026 (type 00, seq 005309, ts
000320, len 000160)
Sent RTP packet to      192.168.56.2:50026 (type 00, seq 005310, ts
000480, len 000160)
Sent RTP packet to      192.168.56.2:50026 (type 00, seq 005311, ts
000640, len 000160)
Sent RTP packet to      192.168.56.2:50026 (type 00, seq 005312, ts
000800, len 000160)
Sent RTP packet to      192.168.56.2:50026 (type 00, seq 005313, ts
000960, len 000160)
Sent RTP packet to      192.168.56.2:50026 (type 00, seq 005314, ts
001120, len 000160)
Sent RTP packet to      192.168.56.2:50026 (type 00, seq 005315, ts
001280, len 000160)
Sent RTP packet to      192.168.56.2:50026 (type 00, seq 005316, ts
001440, len 000160)
Sent RTP packet to      192.168.56.2:50026 (type 00, seq 005317, ts
001600, len 000160)
Sent RTP packet to      192.168.56.2:50026 (type 00, seq 005318, ts
001760, len 000160)
Sent RTP packet to      192.168.56.2:50026 (type 00, seq 005319, ts
001920, len 000160)

there is no route to .56.2 from this host.



More information about the Users mailing list