[SR-Users] Help With kamailio not responding ack propperly.

Stoyan Mihaylov stoyan.v.mihaylov at gmail.com
Fri Oct 25 18:41:42 CEST 2013


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 at 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 at 3.1.1.1>;tag=3591552407-393967.
> From: "+19812457865" <sip:+19812457865 at 1.1.1.1>;tag=as4bc322e9.
> Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0 at 1.1.1.1:5060.
> CSeq: 102 INVITE.
> Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER,
> SUBSCRIBE, PRACK, UPDATE.
> Contact: <sip:76890723276341079 at 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 at 3.1.1.1>;tag=3591552407-393967.
> From: "+19812457865" <sip:+19812457865 at 1.1.1.1>;tag=as4bc322e9.
> Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0 at 1.1.1.1:5060.
> CSeq: 102 INVITE.
> Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER,
> SUBSCRIBE, PRACK, UPDATE.
> Contact: <sip:76890723276341079 at 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 at 1.1.1.1:5060','200','OK','2013-10-23
> 17:26:16','sip:+19812457865 at 1.1.1.1','sip:23276341079 at 2.0.0.1
> ','+19812457865','1.1.1.1','sip:76890723276341079 at 3.1.1.1:5060','
> sip:23276341079 at 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 at 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 at 1.1.1.1>;tag=as4bc322e9.
> To: <sip:23276341079 at 2.0.0.1>;tag=3591552407-393967.
> Contact: <sip:+19812457865 at 1.1.1.1:5060>.
> Call-ID: 7d0ca48c1d48c14d104fac1f59194ae0 at 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 at 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 at 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 at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20131025/67211e39/attachment-0001.html>


More information about the sr-users mailing list