Hi all, can anyone help me to find out what is wrong with my setup, i have an asterisk behind a kamailio, kamailio is proxying all packages to the outside.
when the call is bridge it gets disconnected after a few seconds, it seems that our voip carrier is sending a bye because we didn't answer to their 200 ok properly, but as the trace shows we did only that kamailio is answering to the contact header ip not the ip that is sending the ok.
any help is appreciated .
thanks.
my setup
request_route {
if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); exit; }
if(is_method("OPTIONS")) { # send reply for each options request sl_send_reply("200", "ok"); exit(); }
if(method=="BYE") { #Account BYE transactions
};
if (method=="CANCEL") { if (t_check_trans()) t_relay();
exit; };
if (loose_route()) {
t_relay(); exit; }
if (is_method("INVITE")) {
record_route();
} f (!t_relay_to_udp("3.1.1.1", "5060")) { sl_reply_error(); exit; }; exit };
here is a trace to a call made to a hotel. i had changed the real ips for obvious reasons. thanks.
asterisk ip 1.1.1.1 kamailio internal 1.1.1.2 kamailio external 2.0.0.1 Voip Carrier 3.1.1.1 voip contact ip 3.1.1.2
U 2013/10/23 17:26:03.920163 1.1.1.1:5060 -> 1.1.1.2:5060 INVITE sip:23276341079@2.0.0.1 SIP/2.0. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport. Max-Forwards: 70. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. To: sip:23276341079@2.0.0.1. Contact: sip:+19812457865@1.1.1.1:5060. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 INVITE. User-Agent: Asterisk PBX 1.8.15-cert2. Date: Wed, 23 Oct 2013 21:26:46 GMT. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH. Supported: replaces, timer. Privacy: off. P-Asserted-Identity: sip:+19812457865@1.1.1.1. Cisco-Guid: 25655507-3591552378-379709 Content-Type: application/sdp. Content-Length: 333. . v=0. o=root 519803789 519803789 IN IP4 1.1.1.1. s=Asterisk PBX 1.8.15-cert2. c=IN IP4 1.1.1.1. t=0 0. m=audio 49926 RTP/AVP 0 18 3 8 101. a=rtpmap:0 PCMU/8000. a=rtpmap:18 G729/8000. a=fmtp:18 annexb=no. a=rtpmap:3 GSM/8000. a=rtpmap:8 PCMA/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. a=ptime:20. a=sendrecv.
U 2013/10/23 17:26:03.921355 1.1.1.2:5060 -> 1.1.1.1:5060 SIP/2.0 100 trying -- your call is important to us. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport=5060. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. To: sip:23276341079@2.0.0.1. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 INVITE. Server: kamailio (4.0.4 (x86_64/linux)). Content-Length: 0. .
U 2013/10/23 17:26:03.921544 1.1.1.2:5060 -> 3.1.1.1:5060 INVITE sip:76890723276341079@3.1.1.1:5060 SIP/2.0. Record-Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9. Via: SIP/2.0/UDP 2.0.0.1:5060;branch=z9hG4bK887c.94fdcd27.0. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport=5060. Max-Forwards: 16. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. To: sip:76890723276341079@3.1.1.1. Contact: sip:+19812457865@1.1.1.1:5060. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 INVITE. User-Agent: Asterisk PBX 1.8.15-cert2. Date: Wed, 23 Oct 2013 21:26:46 GMT. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH. Supported: replaces, timer. Privacy: off. P-Asserted-Identity: sip:+19812457865@1.1.1.1. Cisco-Guid: 25655507-3591552378-379709 Content-Type: application/sdp. Content-Length: 333. . v=0. o=root 519803789 519803789 IN IP4 1.1.1.1. s=Asterisk PBX 1.8.15-cert2. c=IN IP4 1.1.1.1. t=0 0. m=audio 49926 RTP/AVP 0 18 3 8 101. a=rtpmap:0 PCMU/8000. a=rtpmap:18 G729/8000. a=fmtp:18 annexb=no. a=rtpmap:3 GSM/8000. a=rtpmap:8 PCMA/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. a=ptime:20. a=sendrecv.
U 2013/10/23 17:26:03.955394 3.1.1.1:5060 -> 1.1.1.2:5060 SIP/2.0 100 Giving a try. Via: SIP/2.0/UDP 2.0.0.1:5060;branch=z9hG4bK887c.94fdcd27.0. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport=5060. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. To: sip:76890723276341079@3.1.1.1. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 INVITE. Server: gProxy (1.8.3 (i386/Linux)). Content-Length: 0. .
U 2013/10/23 17:26:04.424330 3.1.1.1:5060 -> 1.1.1.2:5060 SIP/2.0 183 Session Progress. Via: SIP/2.0/UDP 2.0.0.1:5060;branch=z9hG4bK887c.94fdcd27.0. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport=5060. Record-Route: sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Record-Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9. To: sip:76890723276341079@3.1.1.1;tag=3591552407-393967. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 INVITE. Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE. Contact: sip:76890723276341079@3.1.1.2:5060. Call-Info: sip:3.1.1.2;method="NOTIFY;Event=telephone-event;Duration=1000". Allow-Events: telephone-event. Content-Type: application/sdp. Content-Length: 202. . v=0. o=MSXB 4755 8544 IN IP4 3.1.1.2. s=sip call. c=IN IP4 204.15.40.111. t=0 0. m=audio 33408 RTP/AVP 0 101. a=rtpmap:0 PCMU/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. a=ptime:20.
U 2013/10/23 17:26:04.424521 1.1.1.2:5060 -> 1.1.1.1:5060 SIP/2.0 183 Session Progress. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport=5060. Record-Route: sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Record-Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9. To: sip:76890723276341079@3.1.1.1;tag=3591552407-393967. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 INVITE. Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE. Contact: sip:76890723276341079@3.1.1.2:5060. Call-Info: sip:3.1.1.2;method="NOTIFY;Event=telephone-event;Duration=1000". Allow-Events: telephone-event. Content-Type: application/sdp. Content-Length: 202. . v=0. o=MSXB 4755 8544 IN IP4 3.1.1.2. s=sip call. c=IN IP4 204.15.40.111. t=0 0. m=audio 33408 RTP/AVP 0 101. a=rtpmap:0 PCMU/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. a=ptime:20.
U 2013/10/23 17:26:16.846067 3.1.1.1:5060 -> 1.1.1.2:5060 SIP/2.0 200 OK. Session-Expires: 3600;refresher=uas. Require: timer. Via: SIP/2.0/UDP 2.0.0.1:5060;branch=z9hG4bK887c.94fdcd27.0. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport=5060. Record-Route: sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Record-Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9. To: sip:76890723276341079@3.1.1.1;tag=3591552407-393967. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 INVITE. Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE. Contact: sip:76890723276341079@3.1.1.2:5060. Call-Info: sip:3.1.1.2;method="NOTIFY;Event=telephone-event;Duration=1000". Allow-Events: telephone-event. Content-Type: application/sdp. Content-Length: 202. . v=0. o=MSXB 4755 8544 IN IP4 3.1.1.2. s=sip call. c=IN IP4 204.15.40.111. t=0 0. m=audio 33408 RTP/AVP 0 101. a=rtpmap:0 PCMU/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. a=ptime:20.
U 2013/10/23 17:26:16.846201 1.1.1.2:5060 -> 1.1.1.1:5060 SIP/2.0 200 OK. Session-Expires: 3600;refresher=uas. Require: timer. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport=5060. Record-Route: sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Record-Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9. To: sip:76890723276341079@3.1.1.1;tag=3591552407-393967. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 INVITE. Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE. Contact: sip:76890723276341079@3.1.1.2:5060. Call-Info: sip:3.1.1.2;method="NOTIFY;Event=telephone-event;Duration=1000". Allow-Events: telephone-event. Content-Type: application/sdp. Content-Length: 202. . v=0. o=MSXB 4755 8544 IN IP4 3.1.1.2. s=sip call. c=IN IP4 204.15.40.111. t=0 0. m=audio 33408 RTP/AVP 0 101. a=rtpmap:0 PCMU/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. a=ptime:20.
T 2013/10/23 17:26:16.846287 1.1.1.2:55305 -> 10.0.3.54:3306 [AP] .....insert into acc (method,from_tag,to_tag,callid,sip_code,sip_reason,time,from_uri,to_uri,kekuintid,type_call,dst_ip,carriercode,callmode ) values ('INVITE','as4bc322e9','3591552407-393967',' 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060','200','OK','2013-10-23 17:26:16','sip:+19812457865@1.1.1.1','sip:23276341079@2.0.0.1 ','+19812457865','1.1.1.1','sip:76890723276341079@3.1.1.1:5060',' sip:23276341079@2.0.0.1','OUT')
U 2013/10/23 17:26:16.847421 1.1.1.1:5060 -> 1.1.1.2:5060 ACK sip:76890723276341079@3.1.1.2:5060 SIP/2.0. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK05b1c5df;rport. Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9,sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Max-Forwards: 70. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. To: sip:23276341079@2.0.0.1;tag=3591552407-393967. Contact: sip:+19812457865@1.1.1.1:5060. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 ACK. User-Agent: Asterisk PBX 1.8.15-cert2. Content-Length: 0. .
U 2013/10/23 17:26:16.847651 1.1.1.2:5060 -> 3.1.1.2:5060 ACK sip:76890723276341079@3.1.1.2:5060 SIP/2.0. Via: SIP/2.0/UDP 2.0.0.1:5060;branch=z9hG4bKcydzigwkX. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK05b1c5df;rport=5060. Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9,sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Max-Forwards: 16. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. To: sip:76890723276341079@3.1.1.2;tag=3591552407-393967. Contact: sip:+19812457865@1.1.1.1:5060. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 ACK. User-Agent: Asterisk PBX 1.8.15-cert2. Content-Length: 0. .
U 2013/10/23 17:26:17.346094 3.1.1.1:5060 -> 1.1.1.2:5060 SIP/2.0 200 OK. Session-Expires: 3600;refresher=uas. Require: timer. Via: SIP/2.0/UDP 2.0.0.1:5060;branch=z9hG4bK887c.94fdcd27.0. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport=5060. Record-Route: sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Record-Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9. To: sip:76890723276341079@3.1.1.1;tag=3591552407-393967. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 INVITE. Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE. Contact: sip:76890723276341079@3.1.1.2:5060. Call-Info: sip:3.1.1.2;method="NOTIFY;Event=telephone-event;Duration=1000". Allow-Events: telephone-event. Content-Type: application/sdp. Content-Length: 202. . v=0. o=MSXB 4755 8544 IN IP4 3.1.1.2. s=sip call. c=IN IP4 204.15.40.111. t=0 0. m=audio 33408 RTP/AVP 0 101. a=rtpmap:0 PCMU/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. a=ptime:20.
U 2013/10/23 17:26:17.346262 1.1.1.2:5060 -> 1.1.1.1:5060 SIP/2.0 200 OK. Session-Expires: 3600;refresher=uas. Require: timer. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport=5060. Record-Route: sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Record-Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9. To: sip:76890723276341079@3.1.1.1;tag=3591552407-393967. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 INVITE. Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE. Contact: sip:76890723276341079@3.1.1.2:5060. Call-Info: sip:3.1.1.2;method="NOTIFY;Event=telephone-event;Duration=1000". Allow-Events: telephone-event. Content-Type: application/sdp. Content-Length: 202. . v=0. o=MSXB 4755 8544 IN IP4 3.1.1.2. s=sip call. c=IN IP4 204.15.40.111. t=0 0. m=audio 33408 RTP/AVP 0 101. a=rtpmap:0 PCMU/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. a=ptime:20.
U 2013/10/23 17:26:17.349001 1.1.1.1:5060 -> 1.1.1.2:5060 ACK sip:76890723276341079@3.1.1.2:5060 SIP/2.0. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK675a9141;rport. Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9,sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Max-Forwards: 70. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. To: sip:23276341079@2.0.0.1;tag=3591552407-393967. Contact: sip:+19812457865@1.1.1.1:5060. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 ACK. User-Agent: Asterisk PBX 1.8.15-cert2. Content-Length: 0. .
U 2013/10/23 17:26:17.349223 1.1.1.2:5060 -> 3.1.1.2:5060 ACK sip:76890723276341079@3.1.1.2:5060 SIP/2.0. Via: SIP/2.0/UDP 2.0.0.1:5060;branch=z9hG4bKcydzigwkX. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK675a9141;rport=5060. Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9,sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Max-Forwards: 16. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. To: sip:76890723276341079@3.1.1.2;tag=3591552407-393967. Contact: sip:+19812457865@1.1.1.1:5060. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 ACK. User-Agent: Asterisk PBX 1.8.15-cert2. Content-Length: 0. .
U 2013/10/23 17:26:18.347584 3.1.1.1:5060 -> 1.1.1.2:5060 SIP/2.0 200 OK. Session-Expires: 3600;refresher=uas. Require: timer. Via: SIP/2.0/UDP 2.0.0.1:5060;branch=z9hG4bK887c.94fdcd27.0. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport=5060. Record-Route: sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Record-Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9. To: sip:76890723276341079@3.1.1.1;tag=3591552407-393967. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 INVITE. Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE. Contact: sip:76890723276341079@3.1.1.2:5060. Call-Info: sip:3.1.1.2;method="NOTIFY;Event=telephone-event;Duration=1000". Allow-Events: telephone-event. Content-Type: application/sdp. Content-Length: 202. . v=0. o=MSXB 4755 8544 IN IP4 3.1.1.2. s=sip call. c=IN IP4 204.15.40.111. t=0 0. m=audio 33408 RTP/AVP 0 101. a=rtpmap:0 PCMU/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. a=ptime:20.
U 2013/10/23 17:26:18.347767 1.1.1.2:5060 -> 1.1.1.1:5060 SIP/2.0 200 OK. Session-Expires: 3600;refresher=uas. Require: timer. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport=5060. Record-Route: sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Record-Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9. To: sip:76890723276341079@3.1.1.1;tag=3591552407-393967. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 INVITE. Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE. Contact: sip:76890723276341079@3.1.1.2:5060. Call-Info: sip:3.1.1.2;method="NOTIFY;Event=telephone-event;Duration=1000". Allow-Events: telephone-event. Content-Type: application/sdp. Content-Length: 202. . v=0. o=MSXB 4755 8544 IN IP4 3.1.1.2. s=sip call. c=IN IP4 204.15.40.111. t=0 0. m=audio 33408 RTP/AVP 0 101. a=rtpmap:0 PCMU/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. a=ptime:20.
U 2013/10/23 17:26:18.348867 1.1.1.1:5060 -> 1.1.1.2:5060 ACK sip:76890723276341079@3.1.1.2:5060 SIP/2.0. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK3fc3c548;rport. Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9,sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Max-Forwards: 70. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. To: sip:23276341079@2.0.0.1;tag=3591552407-393967. Contact: sip:+19812457865@1.1.1.1:5060. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 ACK. User-Agent: Asterisk PBX 1.8.15-cert2. Content-Length: 0. .
U 2013/10/23 17:26:18.349133 1.1.1.2:5060 -> 3.1.1.2:5060 ACK sip:76890723276341079@3.1.1.2:5060 SIP/2.0. Via: SIP/2.0/UDP 2.0.0.1:5060;branch=z9hG4bKcydzigwkX. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK3fc3c548;rport=5060. Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9,sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Max-Forwards: 16. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. To: sip:76890723276341079@3.1.1.2;tag=3591552407-393967. Contact: sip:+19812457865@1.1.1.1:5060. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 ACK. User-Agent: Asterisk PBX 1.8.15-cert2. Content-Length: 0. .
U 2013/10/23 17:26:20.352624 3.1.1.1:5060 -> 1.1.1.2:5060 SIP/2.0 200 OK. Session-Expires: 3600;refresher=uas. Require: timer. Via: SIP/2.0/UDP 2.0.0.1:5060;branch=z9hG4bK887c.94fdcd27.0. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport=5060. Record-Route: sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Record-Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9. To: sip:76890723276341079@3.1.1.1;tag=3591552407-393967. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 INVITE. Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE. Contact: sip:76890723276341079@3.1.1.2:5060. Call-Info: sip:3.1.1.2;method="NOTIFY;Event=telephone-event;Duration=1000". Allow-Events: telephone-event. Content-Type: application/sdp. Content-Length: 202. . v=0. o=MSXB 4755 8544 IN IP4 3.1.1.2. s=sip call. c=IN IP4 204.15.40.111. t=0 0. m=audio 33408 RTP/AVP 0 101. a=rtpmap:0 PCMU/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. a=ptime:20.
U 2013/10/23 17:26:20.353056 1.1.1.2:5060 -> 1.1.1.1:5060 SIP/2.0 200 OK. Session-Expires: 3600;refresher=uas. Require: timer. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport=5060. Record-Route: sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Record-Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9. To: sip:76890723276341079@3.1.1.1;tag=3591552407-393967. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 INVITE. Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE. Contact: sip:76890723276341079@3.1.1.2:5060. Call-Info: sip:3.1.1.2;method="NOTIFY;Event=telephone-event;Duration=1000". Allow-Events: telephone-event. Content-Type: application/sdp. Content-Length: 202. . v=0. o=MSXB 4755 8544 IN IP4 3.1.1.2. s=sip call. c=IN IP4 204.15.40.111. t=0 0. m=audio 33408 RTP/AVP 0 101. a=rtpmap:0 PCMU/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. a=ptime:20.
U 2013/10/23 17:26:20.354026 1.1.1.1:5060 -> 1.1.1.2:5060 ACK sip:76890723276341079@3.1.1.2:5060 SIP/2.0. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK280c4e9c;rport. Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9,sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Max-Forwards: 70. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. To: sip:23276341079@2.0.0.1;tag=3591552407-393967. Contact: sip:+19812457865@1.1.1.1:5060. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 ACK. User-Agent: Asterisk PBX 1.8.15-cert2. Content-Length: 0. .
U 2013/10/23 17:26:20.354248 1.1.1.2:5060 -> 3.1.1.2:5060 ACK sip:76890723276341079@3.1.1.2:5060 SIP/2.0. Via: SIP/2.0/UDP 2.0.0.1:5060;branch=z9hG4bKcydzigwkX. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK280c4e9c;rport=5060. Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9,sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Max-Forwards: 16. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. To: sip:76890723276341079@3.1.1.2;tag=3591552407-393967. Contact: sip:+19812457865@1.1.1.1:5060. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 ACK. User-Agent: Asterisk PBX 1.8.15-cert2. Content-Length: 0. .
U 2013/10/23 17:26:36.355580 3.1.1.1:5060 -> 1.1.1.2:5060 BYE sip:+19812457865@1.1.1.1:5060 SIP/2.0. Max-Forwards: 69. Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9. To: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. From: sip:76890723276341079@3.1.1.1;tag=3591552407-393967. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 2 BYE. Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE. Via: SIP/2.0/UDP 3.1.1.1:5060;branch=z9hG4bKce8a.db93afa3.0. Via: SIP/2.0/UDP 3.1.1.2:5060 ;branch=z9hG4bK96003ecbb11f5deaf6014235140e6952. Contact: sip:76890723276341079@3.1.1.2:5060. Content-Length: 0. .
U 2013/10/23 17:26:36.355995 1.1.1.2:5060 -> 1.1.1.1:5060 BYE sip:+19812457865@1.1.1.1:5060 SIP/2.0. Max-Forwards: 16. Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9. To: "+19812457865" sip:176822213@1.1.1.1;tag=as4bc322e9. From: 0 sip:079@3.1.1.1;tag=3591552407-393967. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 2 BYE. Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE. Via: SIP/2.0/UDP 2.0.0.1:5060;branch=z9hG4bKce8a.52d22d63.0. Via: SIP/2.0/UDP 3.1.1.1:5060;branch=z9hG4bKce8a.db93afa3.0. Via: SIP/2.0/UDP 3.1.1.2:5060 ;branch=z9hG4bK96003ecbb11f5deaf6014235140e6952. Contact: sip:76890723276341079@3.1.1.2:5060. Content-Length: 0. .
I had same problem - with BYE also. My "go around" was (replaced name of domain and IP of kamailio):
route[ACKBYE] { #!ifdef WITH_MYFORWARD if(($sht(forw=>$ft))=~$td){ $du=$sht(forw=>$ft); }else if((($td=="name.of.company.com")||($td=="ip"))&&($si=="ip")){ $du=$sht(forw=>$ft); return; } #!endif return; }
route[PSTNINVITE] { #!ifdef WITH_MYFORWARD if(is_method("INVITE")){ ds_select_dst("1","4"); $sht(forw=>$ft)=$du; sl_send_reply("100","Trying"); route(RELAY); exit(); } #!endif
return; }
Meaning - during invite, I store du (to allow more then one Asterisk behind kamailio) and on ACK or BYE - I check td and si. Not sure I am correct, but it works from long time, although load is not high. PS You will need to set in the beginning modparam("htable", "htable", "forw=>size=8;autoexpire=7200;")
and you need to put routes in proper places.
Thank you Stoyan, i tried but i ended up creating a loop with the carrier, i believe this is more a asterisk receiving the package and ignoring the record-route and because i am just proxying the signalling it does ack to the contact, i have to find a way to tell asterisk that answer everything to kamailio and kamailio must respond to the carrier to the proper to header i am clueless here, now thinking to install rtpproxy to achieve that, any other sugestions . thanks.
U 2013/10/23 17:26:16.846067 3.1.1.1:5060 -> 1.1.1.2:5060 SIP/2.0 200 OK. Session-Expires: 3600;refresher=uas. Require: timer. Via: SIP/2.0/UDP 2.0.0.1:5060;branch=z9hG4bK887c.94fdcd27.0. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport=5060. Record-Route: sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Record-Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9. To: sip:76890723276341079@3.1.1.1;tag=3591552407-393967. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 INVITE. Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE. Contact: sip:76890723276341079@3.1.1.2:5060. Call-Info: sip:3.1.1.2;method="NOTIFY;Event=telephone-event;Duration=1000". Allow-Events: telephone-event. Content-Type: application/sdp. Content-Length: 202. . v=0. o=MSXB 4755 8544 IN IP4 3.1.1.2. s=sip call. c=IN IP4 204.15.40.111. t=0 0. m=audio 33408 RTP/AVP 0 101. a=rtpmap:0 PCMU/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. a=ptime:20.
U 2013/10/23 17:26:16.846201 1.1.1.2:5060 -> 1.1.1.1:5060 SIP/2.0 200 OK. Session-Expires: 3600;refresher=uas. Require: timer. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport=5060. Record-Route: sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Record-Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9. To: sip:76890723276341079@3.1.1.1;tag=3591552407-393967. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 INVITE. Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE. Contact: sip:76890723276341079@3.1.1.2:5060. Call-Info: sip:3.1.1.2;method="NOTIFY;Event=telephone-event;Duration=1000". Allow-Events: telephone-event. Content-Type: application/sdp. Content-Length: 202. . v=0. o=MSXB 4755 8544 IN IP4 3.1.1.2. s=sip call. c=IN IP4 204.15.40.111. t=0 0. m=audio 33408 RTP/AVP 0 101. a=rtpmap:0 PCMU/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. a=ptime:20.
T 2013/10/23 17:26:16.846287 1.1.1.2:55305 -> 10.0.3.54:3306 [AP] .....insert into acc (method,from_tag,to_tag,callid,sip_code,sip_reason,time,from_uri,to_uri,kekuintid,type_call,dst_ip,carriercode,callmode ) values ('INVITE','as4bc322e9','3591552407-393967',' 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060','200','OK','2013-10-23 17:26:16','sip:+19812457865@1.1.1.1','sip:23276341079@2.0.0.1 ','+19812457865','1.1.1.1','sip:76890723276341079@3.1.1.1:5060',' sip:23276341079@2.0.0.1','OUT')
U 2013/10/23 17:26:16.847421 1.1.1.1:5060 -> 1.1.1.2:5060 ACK sip:76890723276341079@3.1.1.2:5060 SIP/2.0. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK05b1c5df;rport. Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9,sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Max-Forwards: 70. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. To: sip:23276341079@2.0.0.1;tag=3591552407-393967. Contact: sip:+19812457865@1.1.1.1:5060. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 ACK. User-Agent: Asterisk PBX 1.8.15-cert2. Content-Length: 0. .
On Thu, Oct 24, 2013 at 12:59 PM, Stoyan Mihaylov < stoyan.v.mihaylov@gmail.com> wrote:
I had same problem - with BYE also. My "go around" was (replaced name of domain and IP of kamailio):
route[ACKBYE] { #!ifdef WITH_MYFORWARD if(($sht(forw=>$ft))=~$td){ $du=$sht(forw=>$ft); }else if((($td=="name.of.company.com")||($td=="ip"))&&($si=="ip")){ $du=$sht(forw=>$ft); return; } #!endif return; }
route[PSTNINVITE] { #!ifdef WITH_MYFORWARD if(is_method("INVITE")){ ds_select_dst("1","4"); $sht(forw=>$ft)=$du; sl_send_reply("100","Trying"); route(RELAY); exit(); } #!endif
return; }
Meaning - during invite, I store du (to allow more then one Asterisk behind kamailio) and on ACK or BYE - I check td and si. Not sure I am correct, but it works from long time, although load is not high. PS You will need to set in the beginning modparam("htable", "htable", "forw=>size=8;autoexpire=7200;")
and you need to put routes in proper places.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
I am not sure about your situation, but in my case - Asterisk respond to any message, and wrong paths were corrected the way I showed. By the way - I am using also rtpproxy. Although it should not interfere here at all. I used wireshark on Asterisk and on Kamailio servers to find what exactly happens. The idea is - I check "target" (for ACK and BYE) and if target is Kamailio server, I forward package to Asterisk. As I mentioned - I am not sure what exactly is wrong - with my setup, or Kamailio or Asterisk - but my go around works well for me.
On Fri, Oct 25, 2013 at 7:17 PM, anfecora anfecora@gmail.com wrote:
Thank you Stoyan, i tried but i ended up creating a loop with the carrier, i believe this is more a asterisk receiving the package and ignoring the record-route and because i am just proxying the signalling it does ack to the contact, i have to find a way to tell asterisk that answer everything to kamailio and kamailio must respond to the carrier to the proper to header i am clueless here, now thinking to install rtpproxy to achieve that, any other sugestions . thanks.
U 2013/10/23 17:26:16.846067 3.1.1.1:5060 -> 1.1.1.2:5060 SIP/2.0 200 OK. Session-Expires: 3600;refresher=uas. Require: timer. Via: SIP/2.0/UDP 2.0.0.1:5060;branch=z9hG4bK887c.94fdcd27.0. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport=5060. Record-Route: sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Record-Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9. To: sip:76890723276341079@3.1.1.1;tag=3591552407-393967. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 INVITE. Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE. Contact: sip:76890723276341079@3.1.1.2:5060. Call-Info: sip:3.1.1.2;method="NOTIFY;Event=telephone-event;Duration=1000". Allow-Events: telephone-event. Content-Type: application/sdp. Content-Length: 202. . v=0. o=MSXB 4755 8544 IN IP4 3.1.1.2. s=sip call. c=IN IP4 204.15.40.111. t=0 0. m=audio 33408 RTP/AVP 0 101. a=rtpmap:0 PCMU/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. a=ptime:20.
U 2013/10/23 17:26:16.846201 1.1.1.2:5060 -> 1.1.1.1:5060 SIP/2.0 200 OK. Session-Expires: 3600;refresher=uas. Require: timer. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK4bd52990;rport=5060. Record-Route: sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Record-Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9. To: sip:76890723276341079@3.1.1.1;tag=3591552407-393967. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 INVITE. Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE. Contact: sip:76890723276341079@3.1.1.2:5060. Call-Info: sip:3.1.1.2;method="NOTIFY;Event=telephone-event;Duration=1000". Allow-Events: telephone-event. Content-Type: application/sdp. Content-Length: 202. . v=0. o=MSXB 4755 8544 IN IP4 3.1.1.2. s=sip call. c=IN IP4 204.15.40.111. t=0 0. m=audio 33408 RTP/AVP 0 101. a=rtpmap:0 PCMU/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16. a=ptime:20.
T 2013/10/23 17:26:16.846287 1.1.1.2:55305 -> 10.0.3.54:3306 [AP] .....insert into acc (method,from_tag,to_tag,callid,sip_code,sip_reason,time,from_uri,to_uri,kekuintid,type_call,dst_ip,carriercode,callmode ) values ('INVITE','as4bc322e9','3591552407-393967',' 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060','200','OK','2013-10-23 17:26:16','sip:+19812457865@1.1.1.1','sip:23276341079@2.0.0.1 ','+19812457865','1.1.1.1','sip:76890723276341079@3.1.1.1:5060',' sip:23276341079@2.0.0.1','OUT')
U 2013/10/23 17:26:16.847421 1.1.1.1:5060 -> 1.1.1.2:5060 ACK sip:76890723276341079@3.1.1.2:5060 SIP/2.0. Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK05b1c5df;rport. Route: sip:2.0.0.1;lr=on;ftag=as4bc322e9,sip:3.1.1.1;lr;ftag=as4bc322e9;did=8b8.d7ef5a05. Max-Forwards: 70. From: "+19812457865" sip:+19812457865@1.1.1.1;tag=as4bc322e9. To: sip:23276341079@2.0.0.1;tag=3591552407-393967. Contact: sip:+19812457865@1.1.1.1:5060. Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0@1.1.1.1:5060. CSeq: 102 ACK. User-Agent: Asterisk PBX 1.8.15-cert2. Content-Length: 0. .
On Thu, Oct 24, 2013 at 12:59 PM, Stoyan Mihaylov < stoyan.v.mihaylov@gmail.com> wrote:
I had same problem - with BYE also. My "go around" was (replaced name of domain and IP of kamailio):
route[ACKBYE] { #!ifdef WITH_MYFORWARD if(($sht(forw=>$ft))=~$td){ $du=$sht(forw=>$ft); }else if((($td=="name.of.company.com")||($td=="ip"))&&($si=="ip")){ $du=$sht(forw=>$ft); return; } #!endif return; }
route[PSTNINVITE] { #!ifdef WITH_MYFORWARD if(is_method("INVITE")){ ds_select_dst("1","4"); $sht(forw=>$ft)=$du; sl_send_reply("100","Trying"); route(RELAY); exit(); } #!endif
return; }
Meaning - during invite, I store du (to allow more then one Asterisk behind kamailio) and on ACK or BYE - I check td and si. Not sure I am correct, but it works from long time, although load is not high. PS You will need to set in the beginning modparam("htable", "htable", "forw=>size=8;autoexpire=7200;")
and you need to put routes in proper places.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users