route[uac_nat]
{
if(has_body("application/sdp"))
{
xlog("route[1], method=INVITE from behind nat,
rtpproxy(fier)");
force_rport();
if(*rtpproxy_offer("feir")*)
{
t_on_reply("uac_nat");
}
}
else
{
xlog("route[1], method=INVITE, without sdp");
setflag(12);
}
}
onreply_route[uac_nat]
{
if(!isflagset(12))
{
* if(has_body("application/sdp"))*
{
xlog("onreply_route, method=$rm, call initiator
seems to be behind nat");
rtpproxy_answer("fier");
}
}
}
Still have errors about drouting, but I think it comes from somewhere
else...
Apr 5 10:07:41 opensips-preprod /sbin/opensips[17300]: route[1] START, To URI Domain td=10.7.59.2, from domain fd=10.7.59.1 Apr 5 10:07:41 opensips-preprod /sbin/opensips[17300]: route[1], INVITE, debug ru=sip:[email protected] and du=<null> Apr 5 10:07:41 opensips-preprod /sbin/opensips[17300]: route[1],INVITE, call initiator seems to be behind nat Apr 5 10:07:41 opensips-preprod /sbin/opensips[17300]: route[1], method=INVITE from behind nat, rtpproxy(fier) Apr 5 10:07:41 opensips-preprod /sbin/opensips[17300]: route[1], INVITE, destination gw is NOT behind nat Apr 5 10:07:45 opensips-preprod /sbin/opensips[17298]: has totag, no loose_route or match_dialog Apr 5 10:07:46 opensips-preprod /sbin/opensips[17295]: onreply_route, method=INVITE, call initiator seems to be behind nat Apr 5 10:07:48 opensips-preprod /sbin/opensips[17297]: onreply_route, method=INVITE, call initiator seems to be behind nat Apr 5 10:07:48 opensips-preprod /sbin/opensips[17301]: has totag, loose_route or match_dialog Apr 5 10:07:48 opensips-preprod /sbin/opensips[17301]: route[1] START, To URI Domain td=10.7.59.2, from domain fd=10.7.59.1 Apr 5 10:07:48 opensips-preprod /sbin/opensips[17301]: ERROR:drouting:build_ruri: stripping 0 makes username <> null Apr 5 10:07:48 opensips-preprod /sbin/opensips[17301]: ERROR:drouting:push_gw_for_usage: failed to build new ruri Apr 5 10:07:48 opensips-preprod /sbin/opensips[17301]: ERROR:drouting:do_routing: failed to use gw <1>, skipping Apr 5 10:07:48 opensips-preprod /sbin/opensips[17301]: INFO:drouting:do_routing: All the gateways are disabled Apr 5 10:07:48 opensips-preprod /sbin/opensips[17298]: onreply_route, method=INVITE, call initiator seems to be behind nat Apr 5 10:07:48 opensips-preprod /sbin/opensips[17299]: has totag, loose_route or match_dialog Apr 5 10:07:48 opensips-preprod /sbin/opensips[17299]: route[1] START, To URI Domain td=10.7.59.2, from domain fd=10.7.59.1 Apr 5 10:07:48 opensips-preprod /sbin/opensips[17299]: ERROR:drouting:build_ruri: stripping 0 makes username <> null Apr 5 10:07:48 opensips-preprod /sbin/opensips[17299]: ERROR:drouting:push_gw_for_usage: failed to build new ruri Apr 5 10:07:48 opensips-preprod /sbin/opensips[17299]: ERROR:drouting:do_routing: failed to use gw <1>, skipping Apr 5 10:07:48 opensips-preprod /sbin/opensips[17299]: INFO:drouting:do_routing: All the gateways are disabled
Cédric Le 05/04/2013 09:05, OCEANET - Cédric BASSAGET a écrit :
Hi Ovidiu, It does not change anything, I've already tried. Here's the routing scenario the call goes through (simplified) : route[uac_nat] { if (is_method("INVITE") && has_body("application/sdp")) { force_rport(); if(engage_rtp_proxy("feir")) { t_on_reply("uac_nat"); } } } onreply_route[uac_nat] {xlog("onreply_route, call initiator seems to be behind nat");rtpproxy_answer("fier"); } usrloc looks good :Contact:: <sip:[email protected]:1029>;q=;expires=150;flags=0x0;cflags=0x300;socket=<udp:10.7.59.2:5060>;methods=0xFFFFFFFF;*received=<sip:10.7.59.1:1028*>;user_agent=<Oceanet-test>Cédric Le 04/04/2013 18:32, Ovidiu Sas a écrit :You need to use "ie" on offer and "ei" on answer on one call direction. For the opposite call direction, use "ei" on offer an "ie" on answer. Regards, Ovidiu Sas On Thu, Apr 4, 2013 at 12:24 PM, OCEANET - Cédric BASSAGET <[email protected]> wrote:Hello, For my first post on this mailing list, I'm trying to make opensips working in this scheme (that's a lab test, so don't take care of my "public" ip addresses) : UAC (asterisk) <---------------------> routeur(nat) <------------------> opensips (mhomed) <----------> sip privoder 10.10.1.1 10.10.1.254 / 10.7.59.1 10.7.59.2 / 10.0.95.10 10.0.95.1 mhomed is set to 1 I have a rtpproxy set in bridge mode on my opensips, like this : /usr/local/bin/rtpproxy -p /var/run/rtpproxy.pid -u rtpproxy -d DBUG LOG_LOCAL5 -m 10000 -M 20000 -l 10.0.95.10 10.7.59.2 -s udp:127.0.0.1 9999 I'm trying to establish a call from my asterisk to a public phone number, but I have a problem with SDP reply (200 OK) , from my opensips to my UAC. SDP c= value is still 10.0.95.10, instead of 10.7.59.2. That's the only thing that is not correct in the SIP session. I can't find why c= value is not correct in the 200 OK. I use engage_rtp_proxy("fr"), but I tried with many combinations (rtpproxy_offer / answer, params=fier, params=feir). If somebody has already been in this situation, I would appreciate his help. Thanks for your replies, please tell me if you need more captures or anything else Here's a short description of SIP requests, seen from OpenSIPS : ##### INVITE FROM MY UAC TO OPENSIPS ############### U 2013/04/04 18:18:09.621724 10.7.59.1:1028 -> 10.7.59.2:5060 INVITEsip:[email protected] SIP/2.0 Via: SIP/2.0/UDP 10.7.59.1:1029;branch=z9hG4bK13253a27;rport Max-Forwards: 70 From: "100"<sip:[email protected]:1029>;tag=as747d5e5b To:<sip:[email protected]> Contact:<sip:[email protected]:1029> Call-ID:[email protected]:5060 CSeq: 102 INVITE User-Agent: Oceanet-test Date: Thu, 04 Apr 2013 16:12:34 GMT Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH Supported: replaces Content-Type: application/sdp Content-Length: 282 v=0 o=root 1416933599 1416933599 IN IP4 10.10.1.1 s=Asterisk PBX 1.8.20.1 c=IN IP4 10.7.59.1 t=0 0 m=audio 17282 RTP/AVP 9 0 101 a=rtpmap:9 G722/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=silenceSupp:off - - - - a=ptime:20 a=sendrecv #####INVITE FROM OPENSIPS TO PROVIDER ############### U 2013/04/04 18:18:09.622378 10.0.95.10:5060 -> 10.0.95.1:5060 INVITEsip:[email protected] SIP/2.0 Via: SIP/2.0/UDP 10.0.95.10;branch=z9hG4bKbd97.ced0f0b2.0 Max-Forwards: 69 From: "100"<sip:[email protected]:1029>;tag=as747d5e5b To:<sip:[email protected]> Contact:<sip:10.0.95.10;did=b0b.7e82f333> Call-ID:[email protected]:5060 CSeq: 102 INVITE User-Agent: Oceanet-test Date: Thu, 04 Apr 2013 16:12:34 GMT Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH Supported: replaces Content-Type: application/sdp Content-Length: 283 v=0 o=root 1416933599 1416933599 IN IP4 10.10.1.1 s=Asterisk PBX 1.8.20.1 c=IN IP4 10.0.95.10 t=0 0 m=audio 19392 RTP/AVP 9 0 101 a=rtpmap:9 G722/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=silenceSupp:off - - - - a=ptime:20 a=sendrecv ##### REPLY FROM PROVIDER TO OPENSIPS ############### U 2013/04/04 18:18:16.327567 10.0.95.1:5060 -> 10.0.95.10:5060 SIP/2.0 200 OK Via: SIP/2.0/UDP 10.0.95.10;branch=z9hG4bKbd97.ced0f0b2.0 Call-ID:[email protected]:5060 From: "100"<sip:[email protected]:1029>;tag=as747d5e5b To:<sip:[email protected]>;tag=a94c095b773be1dd6e8d668a785a9c84530b7132 Contact:<sip:10.0.95.1;did=b0b.c3c431b5> CSeq: 102 INVITE Server: Dialogic-SIP/10.5.3.360 ACKBAR 0 Allow: INVITE, BYE, REGISTER, ACK, OPTIONS, CANCEL, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE Supported: path, replaces, timer, tdialog Accept: application/sdp, application/dtmf-relay, text/plain Content-Type: application/sdp Content-Length: 238 v=0 o=Dialogic_SDP 2521466 0 IN IP4 91.213.145.116 s=Dialogic-SIP c=IN IP4 10.0.95.3 t=0 0 m=audio 10018 RTP/AVP 0 101 a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=silenceSupp:off - - - - a=ptime:20 #### REPLY FROM OPENSIPS TO UAC WITH WRONG SDP ################ U 2013/04/04 18:18:16.328296 10.7.59.2:5060 -> 10.7.59.1:1028 SIP/2.0 200 OK Via: SIP/2.0/UDP 10.7.59.1:1029;branch=z9hG4bK13253a27;rport Call-ID:[email protected]:5060 From: "100"<sip:[email protected]:1029>;tag=as747d5e5b To:<sip:[email protected]>;tag=a94c095b773be1dd6e8d668a785a9c84530b7132 Contact:<sip:10.7.59.2;did=b0b.7e82f333> CSeq: 102 INVITE Server: Dialogic-SIP/10.5.3.360 ACKBAR 0 Allow: INVITE, BYE, REGISTER, ACK, OPTIONS, CANCEL, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE Supported: path, replaces, timer, tdialog Accept: application/sdp, application/dtmf-relay, text/plain Content-Type: application/sdp Content-Length: 239 v=0 o=Dialogic_SDP 2521466 0 IN IP4 91.213.145.116 s=Dialogic-SIP c=IN IP4 10.0.95.10 t=0 0 m=audio 11526 RTP/AVP 0 101 a=rtpmap:0 PCMU/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=silenceSupp:off - - - - a=ptime:20 Cédric _______________________________________________ Users mailing list [email protected] http://lists.opensips.org/cgi-bin/mailman/listinfo/users-- OCEANET --------------------------------------------------------------- [AGENCE DU MANS] 7, rue des Frênes ZAC de la Pointe 72190 SARGE LES LE MANS [t] +33 (0)2.43.50.26.50 [f] +33 (0)2.43.72.21.14 [AGENCE D'ANGERS] 5, rue Fleming Angers Technopole 49066 ANGERS [t] +33 (0)2.41.19.28.65 [f] +33 (0)2.52.19.22.00 http://www.oceanet.com http://www.oceanet-telecom.com
-- OCEANET --------------------------------------------------------------- [AGENCE DU MANS] 7, rue des Frênes ZAC de la Pointe 72190 SARGE LES LE MANS [t] +33 (0)2.43.50.26.50 [f] +33 (0)2.43.72.21.14 [AGENCE D'ANGERS] 5, rue Fleming Angers Technopole 49066 ANGERS [t] +33 (0)2.41.19.28.65 [f] +33 (0)2.52.19.22.00 http://www.oceanet.com http://www.oceanet-telecom.com
_______________________________________________ Users mailing list [email protected] http://lists.opensips.org/cgi-bin/mailman/listinfo/users
