[Devel] fix_nated_sdp(flags,IP) does not update the IP inside SDP

Bogdan-Andrei Iancu bogdan at voice-system.ro
Wed Jun 7 11:05:05 CEST 2006


Hi Ovidiu,

indeed there was a bogus ERROR message in extract_mediaip() - I removed it.

regarding the fix_nated_sdp("1", "10.111.5.15 <http://10.111.5.15>"); 
call, the problem is that you do not set the flag for replacing the IP 
in c= or o= line (02 or 08 flags). The flag presence is mandatory since 
the IP can be pushed in different locations into the SDP - and via flags 
you control where to be pushed. I made a note in the docs in order to 
avoid this kind of misunderstanding for the feature.

regards,
bogdan


Ovidiu Sas wrote:

> Hi Bogdan,
>
> Here's the setup:
>  - openser is running on a multihomed box: 10.110.1.174/10.111.5.15 
> <http://10.110.1.174/10.111.5.15>
>  - the mhomed is set to 1
>  - an INVITE is received on 10.110.1.174 <http://10.110.1.174> 
> interface and sent out on the 10.111.5.15 <http://10.111.5.15> one
>
> I will provide two scenarios: working and non-working:
>
> Here's a working example:
> pls note the ERROR probe inside the logs:
>
> <openser.cfg>
>                                 if (!search("^Content-Length:[ ]*0")) {
>                                         xlog("L_INFO", "S 
> fix_nated_sdp(3)\n");
>                                         fix_nated_sdp("3");
>                                         xlog("L_INFO", "E 
> fix_nated_sdp()\n");
>                                 };
>
> openser.log:
>  S fix_nated_sdp(3)
>  parse_headers: flags=ffffffffffffffff
>  DEBUG:check_content_type: type <application/sdp> found valid
>  ERROR: extract_mediaip: no `c=' in SDP
>  xl_printf: final buffer length 18
>  E fix_nated_sdp()
>
>
> incoming INVITE:
> INVITE sip:4163481513 at 10.110.1.174 :5060;transport=udp SIP/2.0.
> Record-Route: <sip:10.110.48.7 
> <http://10.110.48.7>;ftag=6cf2bcbc-soma;lr>.
> Record-Route: <sip:10.110.49.7 
> <http://10.110.49.7>;r2=on;ftag=6cf2bcbc-soma;lr=on>.
> Record-Route: <sip:10.110.50.1 
> <http://10.110.50.1>;r2=on;ftag=6cf2bcbc-soma;lr=on>.
> Via: SIP/2.0/UDP 10.110.48.7 
> <http://10.110.48.7>;branch=z9hG4bK225e.8aade426.0.
> Via: SIP/2.0/UDP 10.110.49.7 
> <http://10.110.49.7>;branch=z9hG4bK225e.14b9ec51.0.
> Via: SIP/2.0/UDP 10.110.50.4:5060 
> <http://10.110.50.4:5060>;branch=z9hG54b5de05.
> From: line0 < sip:4165550002 at 10.110.48.7 
> <mailto:sip:4165550002 at 10.110.48.7>>;tag=6cf2bcbc-soma.
> To: <sip:4163481513 at 10.110.48.7 <mailto:sip:4163481513 at 10.110.48.7>>.
> Call-ID: 3ba8f990-53ac15fc at 10.110.50.4 
> <mailto:3ba8f990-53ac15fc at 10.110.50.4>.
> CSeq: 69 INVITE.
> Contact: line0 <sip:4165550002 at 10.110.50.4 
> <mailto:sip:4165550002 at 10.110.50.4>;transport=udp>.
> Max-Forwards: 68.
> User-Agent: ssua-v6.1.6.
> Organization: .
> Priority: normal.
> Supported: 100rel.
> P-Preferred-Identity: line0 <sip:4165550002 at 10.110.48.7 
> <mailto:sip:4165550002 at 10.110.48.7>>.
> Remote-Party-ID: line0 <sip:4165550002 at 10.110.48.7 
> <mailto:sip:4165550002 at 10.110.48.7>>;party=calling;screen=yes;privacy=off.
> SOMA-Extension: testcall.
> Supported: timer.
> Min-SE: 600.
> Allow: ACK, BYE, CANCEL, INFO, INVITE, PRACK, NOTIFY, OPTIONS, SUBSCRIBE.
> Accept: application/sdp, application/simple-message-summary.
> Content-Type: application/sdp.
> Content-Length:   210.
> .
> v=0.
> o=ssua-v6.1.6 34 1 IN IP4 10.110.50.4 <http://10.110.50.4>.
> s=Session SDP.
> c=IN IP4 10.110.50.4 <http://10.110.50.4> .
> t=0 0.
> m=audio 10038 RTP/AVP 18 101.
> a=rtpmap:18 G729/8000.
> a=fmtp:18 annexb=yes.
> a=ptime:10.
> a=rtpmap:101 telephone-event/8000.
>
> outgoing INVITE:
> INVITE sip:4163481513 at 10.111.3.241:5060;transport=udp SIP/2.0
> Record-Route: <sip:10.111.5.15 
> <http://10.111.5.15>;r2=on;lr;ftag=6cf2bcbc-soma>
> Record-Route: <sip:10.110.1.174 
> <http://10.110.1.174>;r2=on;lr;ftag=6cf2bcbc-soma>
> Record-Route: <sip: 10.110.48.7 
> <http://10.110.48.7>;ftag=6cf2bcbc-soma;lr>
> Record-Route: <sip:10.110.49.7 
> <http://10.110.49.7>;r2=on;ftag=6cf2bcbc-soma;lr=on>
> Record-Route: <sip: 10.110.50.1 
> <http://10.110.50.1>;r2=on;ftag=6cf2bcbc-soma;lr=on>
> Via: SIP/2.0/UDP 10.111.5.15 
> <http://10.111.5.15>;branch=z9hG4bK225e.5f208097.0
> Via: SIP/2.0/UDP 10.110.48.7 
> <http://10.110.48.7>;branch=z9hG4bK225e.8aade426.0
> Via: SIP/2.0/UDP 10.110.49.7 
> <http://10.110.49.7>;branch=z9hG4bK225e.14b9ec51.0
> Via: SIP/2.0/UDP 10.110.50.4:5060 
> <http://10.110.50.4:5060>;branch=z9hG54b5de05
> From: line0 < sip:4165550002 at 10.110.48.7 
> <mailto:sip:4165550002 at 10.110.48.7>>;tag=6cf2bcbc-soma
> To: <sip:4163481513 at 10.110.48.7 <mailto:sip:4163481513 at 10.110.48.7>>
> Call-ID: 3ba8f990-53ac15fc at 10.110.50.4 
> <mailto:3ba8f990-53ac15fc at 10.110.50.4>
> CSeq: 69 INVITE
> Contact: line0 <sip:4165550002 at 10.110.50.4 
> <mailto:sip:4165550002 at 10.110.50.4>;transport=udp>
> Max-Forwards: 67
> User-Agent: ssua-v6.1.6
> Organization:
> Priority: normal
> Supported: 100rel
> P-Preferred-Identity: line0 <sip:4165550002 at 10.110.48.7 
> <mailto:sip:4165550002 at 10.110.48.7>>
> Remote-Party-ID: line0 <sip:4165550002 at 10.110.48.7 
> <mailto:sip:4165550002 at 10.110.48.7>>;party=calling;screen=yes;privacy=off
> SOMA-Extension: testcall
> Supported: timer
> Min-SE: 600
> Allow: ACK, BYE, CANCEL, INFO, INVITE, PRACK, NOTIFY, OPTIONS, SUBSCRIBE
> Accept: application/sdp, application/simple-message-summary
> Content-Type: application/sdp
> Content-Length: 256
>
> v=0
> o=ssua-v6.1.6 34 1 IN IP4 10.110.50.4 <http://10.110.50.4>
> s=Session SDP
> c=IN IP4 10.110.48.7 <http://10.110.48.7>
> t=0 0
> m=audio 10038 RTP/AVP 18 101
> a=rtpmap:18 G729/8000
> a=fmtp:18 annexb=yes
> a=ptime:10
> a=rtpmap:101 telephone-event/8000
> a=direction:active
> a=oldmediaip:10.110.50.4 <http://10.110.50.4>
>
>
> Note: the outgoing INVITE is big and it was fragmented!!!
>
>
>
> The non-working scenario:
>
> <openser.cfg>
>                                 if (!search("^Content-Length:[ ]*0")) {
>                                         xlog("L_INFO", "S 
> fix_nated_sdp(1, 10.111.5.15 <http://10.111.5.15>)\n");
>                                         fix_nated_sdp("1", 
> "10.111.5.15 <http://10.111.5.15>");
>                                         xlog("L_INFO", "E 
> fix_nated_sdp()\n");
>                                 };
>
>
> openser.log:
>  S fix_nated_sdp(1, 10.111.5.15 <http://10.111.5.15>)
>  parse_headers: flags=ffffffffffffffff
>  DEBUG:check_content_type: type <application/sdp> found valid
>  xl_printf: final buffer length 18
>  E fix_nated_sdp()
>
>
> Incoming INVITE:
> INVITE sip:4163481513 at 10.110.1.174:5060;transport=udp SIP/2.0.
> Record-Route: <sip:10.110.48.7 
> <http://10.110.48.7>;ftag=755cbe38-soma;lr>.
> Record-Route: <sip:10.110.49.7 
> <http://10.110.49.7>;r2=on;ftag=755cbe38-soma;lr=on>.
> Record-Route: <sip:10.110.50.1 
> <http://10.110.50.1>;r2=on;ftag=755cbe38-soma;lr=on>.
> Via: SIP/2.0/UDP 10.110.48.7 
> <http://10.110.48.7>;branch=z9hG4bK0e74.76905b42.0.
> Via: SIP/2.0/UDP 10.110.49.7 
> <http://10.110.49.7>;branch=z9hG4bK0e74.8a13c771.0.
> Via: SIP/2.0/UDP 10.110.50.4:5060 
> <http://10.110.50.4:5060>;branch=z9hG25465b05.
> From: line0 <sip:4165550002 at 10.110.48.7 
> <mailto:sip:4165550002 at 10.110.48.7>>;tag=755cbe38-soma.
> To: <sip:4163481513 at 10.110.48.7 <mailto:sip:4163481513 at 10.110.48.7>>.
> Call-ID: 5444e91a-0e972555 at 10.110.50.4 
> <mailto:5444e91a-0e972555 at 10.110.50.4>.
> CSeq: 73 INVITE.
> Contact: line0 <sip:4165550002 at 10.110.50.4 
> <mailto:sip:4165550002 at 10.110.50.4>;transport=udp>.
> Max-Forwards: 68.
> User-Agent: ssua-v6.1.6.
> Organization: .
> Priority: normal.
> Supported: 100rel.
> P-Preferred-Identity: line0 <sip:4165550002 at 10.110.48.7 
> <mailto:sip:4165550002 at 10.110.48.7> >.
> Remote-Party-ID: line0 <sip:4165550002 at 10.110.48.7 
> <mailto:sip:4165550002 at 10.110.48.7>>;party=calling;screen=yes;privacy=off.
> SOMA-Extension: testcall.
> Supported: timer.
> Min-SE: 600.
> Allow: ACK, BYE, CANCEL, INFO, INVITE, PRACK, NOTIFY, OPTIONS, SUBSCRIBE.
> Accept: application/sdp, application/simple-message-summary.
> Content-Type: application/sdp.
> Content-Length:   210.
> .
> v=0.o=ssua-v6.1.6 36 1 IN IP4 10.110.50.4 <http://10.110.50.4>.
> s=Session SDP.
> c=IN IP4 10.110.50.4 <http://10.110.50.4>.
> t=0 0.
> m=audio 10094 RTP/AVP 18 101.
> a=rtpmap:18 G729/8000.
> a=fmtp:18 annexb=yes.
> a=ptime:10.
> a=rtpmap:101 telephone-event/8000.
>
>
> Outgoing INVITE:
> INVITE sip:4163481513 at 10.111.3.241:5060;transport=udp SIP/2.0
> Record-Route: <sip:10.111.5.15 
> <http://10.111.5.15>;r2=on;lr;ftag=755cbe38-soma>
> Record-Route: <sip:10.110.1.174 
> <http://10.110.1.174>;r2=on;lr;ftag=755cbe38-soma>
> Record-Route: <sip:10.110.48.7 <http://10.110.48.7>;ftag=755cbe38-soma;lr>
> Record-Route: <sip: 10.110.49.7 
> <http://10.110.49.7>;r2=on;ftag=755cbe38-soma;lr=on>
> Record-Route: <sip:10.110.50.1 
> <http://10.110.50.1>;r2=on;ftag=755cbe38-soma;lr=on>
> Via: SIP/2.0/UDP 10.111.5.15 
> <http://10.111.5.15>;branch=z9hG4bK0e74.66d85c63.0
> Via: SIP/2.0/UDP 10.110.48.7 
> <http://10.110.48.7>;branch=z9hG4bK0e74.76905b42.0
> Via: SIP/2.0/UDP 10.110.49.7 
> <http://10.110.49.7>;branch=z9hG4bK0e74.8a13c771.0
> Via: SIP/2.0/UDP 10.110.50.4:5060 
> <http://10.110.50.4:5060>;branch=z9hG25465b05
> From: line0 <sip:4165550002 at 10.110.48.7 
> <mailto:sip:4165550002 at 10.110.48.7>>;tag=755cbe38-soma
> To: < sip:4163481513 at 10.110.48.7 <mailto:sip:4163481513 at 10.110.48.7>>
> Call-ID: 5444e91a-0e972555 at 10.110.50.4 
> <mailto:5444e91a-0e972555 at 10.110.50.4>
> CSeq: 73 INVITE
> Contact: line0 < sip:4165550002 at 10.110.50.4 
> <mailto:sip:4165550002 at 10.110.50.4>;transport=udp>
> Max-Forwards: 67
> User-Agent: ssua-v6.1.6
> Organization:
> Priority: normal
> Supported: 100rel
> P-Preferred-Identity: line0 < sip:4165550002 at 10.110.48.7 
> <mailto:sip:4165550002 at 10.110.48.7>>
> Remote-Party-ID: line0 <sip:4165550002 at 10.110.48.7 
> <mailto:sip:4165550002 at 10.110.48.7>>;party=calling;screen=yes;privacy=off
> SOMA-Extension: testcall
> Supported: timer
> Min-SE: 600
> Allow: ACK, BYE, CANCEL, INFO, INVITE, PRACK, NOTIFY, OPTIONS, SUBSCRIBE
> Accept: application/sdp, application/simple-message-summary
> Content-Type: application/sdp
> Content-Length: 230
>
> v=0
> o=ssua-v6.1.6 36 1 IN IP4 10.110.50.4 <http://10.110.50.4>
> s=Session SDP
> c=IN IP4 10.110.50.4 <http://10.110.50.4>
> t=0 0
> m=audio 10094 RTP/AVP 18 101
> a=rtpmap:18 G729/8000
> a=fmtp:18 annexb=yes
> a=ptime:10
> a=rtpmap:101 telephone-event/8000
> a=direction:active
>
>
> Note: there are no ERROR probes like in the previous scenario, but the 
> IP is untouched.
>
>
>
> Regards,
> -ovi
>




More information about the Devel mailing list