<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px"><div>Hi all,</div><div><br></div><div>I have a fresh install of Kamailio 4.0.3 - built from source - and rtpproxy, version:</div><div><br></div></div>
<blockquote style="font-family:arial,sans-serif;font-size:13px;margin:0px 0px 0px 40px;border:none;padding:0px"><div>Basic version: 20040107<br></div><div>Extension 20050322: Support for multiple RTP streams and MOH</div>
<div>Extension 20060704: Support for extra parameter in the V command</div><div>Extension 20071116: Support for RTP re-packetization</div><div>Extension 20071218: Support for forking (copying) RTP stream</div><div>Extension 20080403: Support for RTP statistics querying</div>
<div>Extension 20081102: Support for setting codecs in the update/lookup command</div><div>Extension 20081224: Support for session timeout notifications</div></blockquote><div style="font-family:arial,sans-serif;font-size:13px">
<div><br></div><div>My system is Ubuntu 13.04.</div><div><br></div><div>My box is dual homed - eth0 is <a href="http://10.64.5.16/24" target="_blank">10.64.5.16/24</a>, eth1 is <a href="http://172.16.230.128/24" target="_blank">172.16.230.128/24</a></div>
<div><br></div><div>My rtpproxy command line is:</div><div><br></div></div><blockquote style="font-family:arial,sans-serif;font-size:13px;margin:0px 0px 0px 40px;border:none;padding:0px">/usr/sbin/rtpproxy -s udp:<a href="http://127.0.0.1:7722/" target="_blank">127.0.0.1:7722</a> -u rtpproxy:rtpproxy -p /var/run/rtpproxy/rtpproxy.pid -l <a href="http://172.16.230.128/10.64.5.16" target="_blank">172.16.230.128/10.64.5.16</a></blockquote>
<div style="font-family:arial,sans-serif;font-size:13px"><div><br></div><div>My Kamalio config is "out of the box", except that I defined "WITH_NAT", added "mhomed=1" and added a couple of aliases.</div>
<div><br></div><div>I have a soft phone running on another box.  Also dual homed on 10.64.5.146 and 172.16.230.1.<br></div><div><br></div><div>The soft phone is configured to register to a server that is here called "<a href="http://xxx.connection-telecom.com/" target="_blank">xxx.connection-telecom.com</a>".   That server is an OpenSIPs instance with Asterisk behind it.  No rtpproxy on that side, but nathelper is used.</div>
<div><br></div><div>There is no NAT between the <a href="http://10.64.5.0/24" target="_blank">10.64.5.0/24</a> network and the <a href="http://xxx.connection-telecom.com/" target="_blank">xxx.connection-telecom.com</a> server.</div>
<div>From <a href="http://xxx.connection-telecom.com/" target="_blank">xxx.connection-telecom.com</a> <a href="http://172.16.230.0/24" target="_blank">172.16.230.0/24</a> cannot be reached.</div><div><br></div><div>The soft phone uses 172.16.230.128 as its outbound proxy.</div>
<div><br></div><div>The idea is to test outbound calling from the soft phone via Kamailio/RTPProxy.  I'm expecting "bridge mode" - IE for rtp to get passed through rtpproxy, passing the RTP between the two interfaces.</div>
<div><br></div><div>What I actually get is one way audio - audio from 172.16.230.1 gets to <a href="http://xxx.connection-telecom.com/" target="_blank">xxx.connection-telecom.com</a>; audio back does not.</div><div>Also, the call drops after 30 seconds.</div>
<div><br></div><div><br></div><div>I'll pick up the trace with the authenticated INVITE from the phone:</div><div><br></div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
<div>So here is the invite from the phone:</div><div><br></div></div><blockquote style="font-family:arial,sans-serif;font-size:13px;margin:0px 0px 0px 40px;border:none;padding:0px"><div>U <a href="http://172.16.230.1:61762/" target="_blank">172.16.230.1:61762</a> -> <a href="http://172.16.230.128:5060/" target="_blank">172.16.230.128:5060</a></div>
<div>INVITE <a href="mailto:sip%3A7171001@xxx.connection-telecom.com" target="_blank">sip:7171001@xxx.connection-telecom.com</a>;transport=udp SIP/2.0.</div><div>Via: SIP/2.0/UDP 172.16.230.1:61762;branch=z9hG4bK-d8754z-b743784d961b291c-1---d8754z-;rport.</div>
<div>Max-Forwards: 70.</div><div>Contact: <sip:2686959@172.16.230.1:61762;transport=udp>.</div><div>To: <<a href="mailto:sip%3A7171001@xxx.connection-telecom.com" target="_blank">sip:7171001@xxx.connection-telecom.com</a>>.</div>
<div>From: "vc2 2686959"<<a href="mailto:sip%3A2686959@xxx.connection-telecom.com" target="_blank">sip:2686959@xxx.connection-telecom.com</a>>;tag=c601fd36.</div><div>Call-ID: ZTU1ODYyODY0YjJmMzk2ZmVhZmM5YTUzYWQzZTEzNGU.</div>
<div>CSeq: 2 INVITE.</div><div>Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO.</div><div>Content-Type: application/sdp.</div><div>Proxy-Authorization: Digest username="2686959",realm="<a href="http://xxx.connection-telecom.com/" target="_blank">xxx.connection-telecom.com</a>",nonce="520e1e50ef047461c3b0dbc731ccdc19e99990ce",uri="<a href="mailto:sip%3A7171001@xxx.connection-telecom.com" target="_blank">sip:7171001@xxx.connection-telecom.com</a>;transport=udp",response="yyyyyyy",algorithm=MD5.</div>
<div>Supported: replaces.</div><div>User-Agent: Bria 3 release 3.5.3 stamp 70600.</div><div>Content-Length: 256.</div><div>.</div><div>v=0.</div><div>o=- 1376656946792420 1 IN IP4 172.16.230.1.</div><div>s=Bria 3 release 3.5.3 stamp 70600.</div>
<div>c=IN IP4 172.16.230.1.</div><div>t=0 0.</div><div>m=audio 59984 RTP/AVP 8 18 101.</div><div>a=rtpmap:18 G729/8000.</div><div>a=fmtp:18 annexb=yes.</div><div>a=rtpmap:101 telephone-event/8000.</div><div>a=fmtp:101 0-15.</div>
<div>a=sendrecv.</div><div><br></div><div><br></div></blockquote><span style="font-family:arial,sans-serif;font-size:13px">"Trying" from Kamailio:</span><br style="font-family:arial,sans-serif;font-size:13px"><blockquote style="font-family:arial,sans-serif;font-size:13px;margin:0px 0px 0px 40px;border:none;padding:0px">
<div><br></div><div>#</div><div>U <a href="http://172.16.230.128:5060/" target="_blank">172.16.230.128:5060</a> -> <a href="http://172.16.230.1:61762/" target="_blank">172.16.230.1:61762</a></div><div>SIP/2.0 100 trying -- your call is important to us.</div>
<div>Via: SIP/2.0/UDP 172.16.230.1:61762;branch=z9hG4bK-d8754z-b743784d961b291c-1---d8754z-;rport=61762.</div><div>To: <<a href="mailto:sip%3A7171001@xxx.connection-telecom.com" target="_blank">sip:7171001@xxx.connection-telecom.com</a>>.</div>
<div>From: "vc2 2686959"<<a href="mailto:sip%3A2686959@xxx.connection-telecom.com" target="_blank">sip:2686959@xxx.connection-telecom.com</a>>;tag=c601fd36.</div><div>Call-ID: ZTU1ODYyODY0YjJmMzk2ZmVhZmM5YTUzYWQzZTEzNGU.</div>
<div>CSeq: 2 INVITE.</div><div>Server: kamailio (4.0.3 (i386/linux)).</div><div>Content-Length: 0.</div><div><br></div><div><br></div></blockquote><span style="font-family:arial,sans-serif;font-size:13px">Here's what Kamailio sent to the remote server.</span><br style="font-family:arial,sans-serif;font-size:13px">
<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">* The from address is set to the eth0 interface address thanks to mhomed=1 (without that it uses the 172.16 address)</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">* But In sdp, wrong address is used.  It is changed to "our" address, but our address on the eth1 interface.</span><div style="font-family:arial,sans-serif;font-size:13px">
  Surely since we are talking on the eth0 side, 10.64.5.16 should have been used?<br>* Contact is not changed (not sure if it should be?)<div><br><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>
<br></div><div>U <a href="http://10.64.5.16:5060/" target="_blank">10.64.5.16:5060</a> -> <a href="http://41.000.000.60:5060/" target="_blank">41.000.000.60:5060</a><br></div></div><div>INVITE <a href="mailto:sip%3A7171001@xxx.connection-telecom.com" target="_blank">sip:7171001@xxx.connection-telecom.com</a>;transport=udp SIP/2.0.</div>
<div>Record-Route: <sip:10.64.5.16;r2=on;lr=on;nat=yes>.</div><div>Record-Route: <sip:172.16.230.128;r2=on;lr=on;nat=yes>.</div><div>Via: SIP/2.0/UDP 10.64.5.16;branch=z9hG4bK9b0c.951b94b1.0.</div><div>Via: SIP/2.0/UDP 172.16.230.1:61762;branch=z9hG4bK-d8754z-b743784d961b291c-1---d8754z-;rport=61762.</div>
<div>Max-Forwards: 16.</div><div>Contact: <sip:2686959@172.16.230.1:61762;transport=udp>.</div><div>To: <<a href="mailto:sip%3A7171001@xxx.connection-telecom.com" target="_blank">sip:7171001@xxx.connection-telecom.com</a>>.</div>
<div>From: "vc2 2686959"<<a href="mailto:sip%3A2686959@xxx.connection-telecom.com" target="_blank">sip:2686959@xxx.connection-telecom.com</a>>;tag=c601fd36.</div><div>Call-ID: ZTU1ODYyODY0YjJmMzk2ZmVhZmM5YTUzYWQzZTEzNGU.</div>
<div>CSeq: 2 INVITE.</div><div>Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO.</div><div>Content-Type: application/sdp.</div><div>Proxy-Authorization: Digest username="2686959",realm="<a href="http://xxx.connection-telecom.com/" target="_blank">xxx.connection-telecom.com</a>",nonce="520e1e50ef047461c3b0dbc731ccdc19e99990ce",uri="<a href="mailto:sip%3A7171001@xxx.connection-telecom.com" target="_blank">sip:7171001@xxx.connection-telecom.com</a>;transport=udp",response="yyyyyyy",algorithm=MD5.</div>
<div>Supported: replaces.</div><div>User-Agent: Bria 3 release 3.5.3 stamp 70600.</div><div>Content-Length: 278.</div><div>P-hint: outbound.</div><div>.</div><div>v=0.</div><div>o=- 1376656946792420 1 IN IP4 172.16.230.128.</div>
<div>s=Bria 3 release 3.5.3 stamp 70600.</div><div>c=IN IP4 172.16.230.128.</div><div>t=0 0.</div><div>m=audio 44320 RTP/AVP 8 18 101.</div><div>a=rtpmap:18 G729/8000.</div><div>a=fmtp:18 annexb=yes.</div><div>a=rtpmap:101 telephone-event/8000.</div>
<div>a=fmtp:101 0-15.</div><div>a=sendrecv.</div><div>a=nortpproxy:yes.</div></blockquote><div><div><br></div><div><br></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>U <a href="http://41.000.000.60:5060/" target="_blank">41.000.000.60:5060</a> -> <a href="http://10.64.5.16:5060/" target="_blank">10.64.5.16:5060</a></div>
<div>SIP/2.0 100 Giving a try.</div><div><detail skipped></div></blockquote><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>U <a href="http://41.000.000.60:5060/" target="_blank">41.000.000.60:5060</a> -> <a href="http://10.64.5.16:5060/" target="_blank">10.64.5.16:5060</a></div>
<div>SIP/2.0 180 Ringing.</div><div><detail skipped></div><div><br></div><div><br></div><div><br></div></blockquote>OK comes back:<br><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><br></div>
<div><br></div><div>U <a href="http://41.000.000.60:5060/" target="_blank">41.000.000.60:5060</a> -> <a href="http://10.64.5.16:5060/" target="_blank">10.64.5.16:5060</a></div><div>SIP/2.0 200 OK.</div><div>Via: SIP/2.0/UDP 10.64.5.16;rport=5060;received=10.64.5.16;branch=z9hG4bK9b0c.951b94b1.0.</div>
<div>Via: SIP/2.0/UDP 172.16.230.1:61762;branch=z9hG4bK-d8754z-b743784d961b291c-1---d8754z-;rport=61762.</div><div>Record-Route: <sip:41.000.000.60;lr=on;ftag=c601fd36>.</div><div>Record-Route: <sip:10.64.5.16;r2=on;lr=on;nat=yes>.</div>
<div>Record-Route: <sip:172.16.230.128;r2=on;lr=on;nat=yes>.</div><div>From: "vc2 2686959"<<a href="mailto:sip%3A2686959@xxx.connection-telecom.com" target="_blank">sip:2686959@xxx.connection-telecom.com</a>>;tag=c601fd36.</div>
<div>To: <<a href="mailto:sip%3A7171001@xxx.connection-telecom.com" target="_blank">sip:7171001@xxx.connection-telecom.com</a>>;tag=as2a8e6d98.</div><div>Call-ID: ZTU1ODYyODY0YjJmMzk2ZmVhZmM5YTUzYWQzZTEzNGU.</div><div>
CSeq: 2 INVITE.</div><div>Server: Enswitch.</div><div>Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH.</div><div>Supported: replaces, timer.</div><div>Contact: <<a href="http://sip:7171001@41.000.000.60:5070/" target="_blank">sip:7171001@41.000.000.60:5070</a>>.</div>
<div>Content-Type: application/sdp.</div><div>Content-Length: 306.</div><div>.</div><div>v=0.</div><div>o=root 1056055966 1056055966 IN IP4 41.000.000.60.</div><div>s=Asterisk PBX 1.8.12.2.</div><div>c=IN IP4 41.000.000.60.</div>
<div>t=0 0.</div><div>m=audio 18130 RTP/AVP 8 18 101.</div><div>a=rtpmap:8 PCMA/8000.</div><div>a=rtpmap:18 G729/8000.</div><div>a=fmtp:18 annexb=no.</div><div>a=rtpmap:101 telephone-event/8000.</div><div>a=fmtp:101 0-16.</div>
<div>a=ptime:20.</div><div>a=sendrecv.</div><div>a=direction:active.</div><div><br></div></blockquote>Sent on to phone, this one correctly munged.</div><div><br></div><div><br><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div>U <a href="http://172.16.230.128:5060/" target="_blank">172.16.230.128:5060</a> -> <a href="http://172.16.230.1:61762/" target="_blank">172.16.230.1:61762</a></div><div>SIP/2.0 200 OK.</div><div>Via: SIP/2.0/UDP 172.16.230.1:61762;branch=z9hG4bK-d8754z-b743784d961b291c-1---d8754z-;rport=61762.</div>
<div>Record-Route: <sip:41.000.000.60;lr=on;ftag=c601fd36>.</div><div>Record-Route: <sip:10.64.5.16;r2=on;lr=on;nat=yes>.</div><div>Record-Route: <sip:172.16.230.128;r2=on;lr=on;nat=yes>.</div><div>From: "vc2 2686959"<<a href="mailto:sip%3A2686959@xxx.connection-telecom.com" target="_blank">sip:2686959@xxx.connection-telecom.com</a>>;tag=c601fd36.</div>
<div>To: <<a href="mailto:sip%3A7171001@xxx.connection-telecom.com" target="_blank">sip:7171001@xxx.connection-telecom.com</a>>;tag=as2a8e6d98.</div><div>Call-ID: ZTU1ODYyODY0YjJmMzk2ZmVhZmM5YTUzYWQzZTEzNGU.</div><div>
CSeq: 2 INVITE.</div><div>Server: Enswitch.</div><div>Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH.</div><div>Supported: replaces, timer.</div><div>Contact: <<a href="http://sip:7171001@41.000.000.60:5070/" target="_blank">sip:7171001@41.000.000.60:5070</a>>.</div>
<div>Content-Type: application/sdp.</div><div>Content-Length: 326.</div><div>.</div><div>v=0.</div><div>o=root 1056055966 1056055966 IN IP4 172.16.230.128.</div><div>s=Asterisk PBX 1.8.12.2.</div><div>c=IN IP4 172.16.230.128.</div>
<div>t=0 0.</div><div>m=audio 41166 RTP/AVP 8 18 101.</div><div>a=rtpmap:8 PCMA/8000.</div><div>a=rtpmap:18 G729/8000.</div><div>a=fmtp:18 annexb=no.</div><div>a=rtpmap:101 telephone-event/8000.</div><div>a=fmtp:101 0-16.</div>
<div>a=ptime:20.</div><div>a=sendrecv.</div><div>a=direction:active.</div><div>a=nortpproxy:yes.</div><div><br></div></blockquote><div><br></div><div>Watching the RTP flows, on the eth1 (internal) side I can see a flow from 172.16.230.1 (the phone) to 172.16.230.128 (the rtpproxy), but no flow back.</div>
<div><br></div><div>On the eth0 side, I see a flow out from 172.16.230.128 going to my <a href="http://xxx.connection-telecom.com/" target="_blank">xxx.connection-telecom.com</a> box.  Wrong source address but it does get there and can be heard.</div>
<div>There is no return flow.</div><div><br></div><div>Most likely the Asterisk behind the opensips is sending audio to 172.16.230.128 since that is where it is getting audio from (i.e. Asterisk nat=yes).</div><div><br></div>
<div>How to get the right address in the sdp of the outgoing invite?</div><div><br></div><div>Thanks,</div><div>Steve Davies</div></div><div><br></div></div></div>