<div dir="ltr"><div dir="ltr"><div><br></div><div>Hello,</div><div><br></div><div>I do use dlg_manage after loose_route, but only for the BYE Method, should i use it for all methods? see below the current configuration:</div><div><br></div><div>if (loose_route()) {<br>    if (is_method("BYE")) {<br>      dlg_manage();<br>      setflag(FLAG_ACC);<br>      setflag(FLAG_ACCMISSED);<br>      $dlg_var(billsec) = $DLG_lifetime;<br>    }<br>    route(RELAY);<br>    exit;<br>  };</div><div><br></div><div>Regarding dialog match mode, by setting it to 0 or 1 I'm getting a weird issues by duplicating  rr_param for SOME calls only!, see below the sip trace:</div><div><br></div><div>Working Call:</div><div>------------------------------------------------------------------------------------------------------------------</div><div>Invite coming from Asterisk PBX:<br></div><div><br></div><div>INVITE <a href="mailto:sip%3A%2B123456789@192.168.1.1">sip:+123456789@192.168.1.1</a> SIP/2.0<br>Via: SIP/2.0/UDP 10.10.10.142:5060;branch=z9hG4bK48707bad<br>Max-Forwards: 70<br>From: <<a href="mailto:sip%3A%2B987654321@10.10.10.142">sip:+987654321@10.10.10.142</a>>;tag=as7dee9847<br>To: <<a href="mailto:sip%3A%2B123456789@192.168.1.1">sip:+123456789@192.168.1.1</a>><br>Contact: <<a href="http://sip:+987654321@10.10.10.142:5060">sip:+987654321@10.10.10.142:5060</a>><br>Call-ID: 
<a href="http://44bb5a3969sglksg987e548091ca4@10.10.10.142:5060">44bb5a3969sglksg987e548091ca4@10.10.10.142:5060</a><br>CSeq: 102 INVITE<br>User-Agent: Asterisk<br>Date: Sun, 26 Jul 2020 10:53:47 GMT<br>Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE<br>Supported: replaces, timer<br>Content-Type: application/sdp<br>Content-Length: 251</div><div><br></div><div>Invite Proxied by Kamailio Server:</div><div><br></div><div>INVITE <a href="mailto:sip%3A%2B123456789@192.168.1.156">sip:+123456789@192.168.1.156</a> SIP/2.0<br>Record-Route: <sip:172.16.0.16;ftag=as7dee9847;lr=on;did=4cd.b83><br>Via: SIP/2.0/UDP 172.16.0.16;branch=z9hG4bK39c2.03cce3e8c8f6fa5800adc2ae8a8d51d4.0<br>Via: SIP/2.0/UDP 10.10.10.142:5060;branch=z9hG4bK48707bad<br>Max-Forwards: 70<br>From: <<a href="mailto:sip%3A%2B987654321@10.10.10.142">sip:+987654321@10.10.10.142</a>>;tag=as7dee9847<br>To: <<a href="mailto:sip%3A%2B123456789@192.168.1.156">sip:+123456789@192.168.1.156</a>><br>Contact: <<a href="http://sip:+987654321@10.10.10.142:5060">sip:+987654321@10.10.10.142:5060</a>><br>Call-ID: <a href="http://44bb5a3969sglksg987e548091ca4@10.10.10.142:5060">44bb5a3969sglksg987e548091ca4@10.10.10.142:5060</a><br>CSeq: 102 INVITE<br>User-Agent: Company<br>Date: Sun, 26 Jul 2020 10:53:47 GMT<br>Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE<br>Supported: replaces, timer<br>Content-Type: application/sdp<br>Content-Length: 251<br>Server: SIP Server</div><div>

<pre style="box-sizing:border-box;color:rgb(0,0,0);font-size:11px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"></pre>

</div><div>Non Working Call:<br>
</div><div>------------------------------------------------------------------------------------------------------------------

</div><div>Invite coming from Asterisk box:</div><div><br></div><div>INVITE <a href="mailto:sip%3A%2B123456789@192.168.1.1">sip:+123456789@192.168.1.1</a> SIP/2.0<br>Via: SIP/2.0/UDP 10.10.10.142:5060;branch=z9hG4bK6bafe911<br>Max-Forwards: 70<br>From: <<a href="mailto:sip%3A%2B987654321@10.10.10.142">sip:+987654321@10.10.10.142</a>>;tag=as16522a1c<br>To: <<a href="mailto:sip%3A%2B123456789@192.168.1.1">sip:+123456789@192.168.1.1</a>><br>Contact: <<a href="http://sip:+987654321@10.10.10.142:5060">sip:+987654321@10.10.10.142:5060</a>><br>Call-ID: 
<a href="http://5a3670c622h45g54ju64j8fee66a@10.10.10.142:5060">5a3670c622h45g54ju64j8fee66a@10.10.10.142:5060</a><br>CSeq: 102 INVITE<br>User-Agent: Asterisk<br>Date: Sun, 26 Jul 2020 10:53:50 GMT<br>Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE<br>Supported: replaces, timer<br>Content-Type: application/sdp<br>Content-Length: 251<br><br></div><div><br></div><div>Invite proxied by Kamailio with dlg_match_mode set to 1:</div><div><br></div><div>INVITE <a href="mailto:sip%3A%2B123456789@192.168.1.156">sip:+123456789@192.168.1.156</a> SIP/2.0<br>Record-Route: <sip:172.16.0.16;ftag=as16522a1c;lr=on;<b>did=427.7a51;did=d8b.1b71</b>><br>Via: SIP/2.0/UDP 172.16.0.16;branch=z9hG4bKd5a1.964d7662519a933a42759ebc8ef99f9c.0<br>Via: SIP/2.0/UDP 10.10.10.142:5060;branch=z9hG4bK6bafe911<br>Max-Forwards: 70<br>From: <<a href="mailto:sip%3A%2B987654321@10.10.10.142">sip:+987654321@10.10.10.142</a>>;tag=as16522a1c<br>To: <<a href="mailto:sip%3A%2B123456789@192.168.1.156">sip:+123456789@192.168.1.156</a>><br>Contact: <<a href="http://sip:+987654321@10.10.10.142:5060">sip:+987654321@10.10.10.142:5060</a>><br>Call-ID: <a href="http://5a3670c622h45g54ju64j8fee66a@10.10.10.142:5060">5a3670c622h45g54ju64j8fee66a@10.10.10.142:5060</a><br>CSeq: 102 INVITE<br>User-Agent: Company<br>Date: Sun, 26 Jul 2020 10:53:50 GMT<br>Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE<br>Supported: replaces, timer<br>Content-Type: application/sdp<br>Content-Length: 251<br>Server: SIP Server<br><br></div><div>As you can see, in the second case for some reason I'm getting the rr_param doubled with 2 different values (<b>did=427.7a51;did=d8b.1b71</b>), I'm not sure, if that's normal, but the upstream provider is complaining about that. And, that's happening only with a few calls, i checked all routes which both calls (working and non-working) are going through - and there is no difference, both of them are using the same configuration routes.</div><div><br></div><div>
Even more, if I'm setting the dlg_match_mode to 2, then I'm still getting the parameter 
rr_param enabled in the Record Route header for some calls, I can't find any difference (at the SIP level, either at the configuration level) between those 2 calls, so I have no idea why Kamailio is adding this parameter to the RR header, if it's disabled at the module level. <br></div><div><br></div><div>That's the current module configuration:</div><div><br></div><div>modparam("dialog", "enable_stats", 1)<br>modparam("dialog", "rr_param", "did")<br>modparam("dialog", "dlg_match_mode", 2)<br>modparam("dialog", "default_timeout", 10800)<br>modparam("dialog", "early_timeout", 180)<br>modparam("dialog", "noack_timeout", 90)<br>modparam("dialog", "track_cseq_updates", 1)<br>modparam("dialog", "dlg_extra_hdrs", "Hint: Inactivity Timeout\r\n")<br>modparam("dialog", "detect_spirals", 1)<br>modparam("dialog", "db_mode", 1)<br>modparam("dialog", "profiles_with_value", "inboundExtCalls; outboundExtCalls")</div><div><br></div><div>Using the latest stable version:</div><div><br></div><div>version: kamailio 5.3.5 (x86_64/linux) 9e70e8</div><div><br></div><div>Phone Numbers and IP Address has been obfuscated.</div><div><br></div><div>Thanks.<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">În vin., 24 iul. 2020 la 15:30, Ilie Soltanici <<a href="mailto:iliusha.md@gmail.com">iliusha.md@gmail.com</a>> a scris:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Yes, I do use the Record-Route header and in the SIP Trace on Kamailio Server I can see the ACK/BYE Messages messages going through.</div><div><br></div><div>

<a href="https://static.md/g/33oz9T#&gid=1&pid=1" target="_blank">https://static.md/g/33oz9T#&gid=1&pid=1</a>

</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">În vin., 24 iul. 2020 la 11:46, Ilie Soltanici <<a href="mailto:iliusha.md@gmail.com" target="_blank">iliusha.md@gmail.com</a>> a scris:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello,</div><div><br></div><div>I'm trying to get CDR working in Kamailio by using the acc and dialog modules. Everything seemed to be working fine - until i noticed that for some of the calls the call duration is 0, even if that call has been successfully established and duration was for about a few minutes. In the Kamailio logs I'm getting such errors:</div><div><br></div><div>WARNING: dialog [dlg_handlers.c:1649]: dlg_ontimeout(): timeout for dlg with CallID '304bad142b50bb3a7a117816439ea3d5' and tags 'as3adde5c7' '7d28152f-e0e3-4bcf-9d5c-21c3723b95c5'</div><div>WARNING: acc [acc_cdr.c:230]: db_write_cdr(): fallback to dlg_only search because of message doesn't exist.</div><div><br></div><div>This error I'm getting at about 2 min after the ACK message for 200 OK. I'm not sure that this is related to the dialog timeout, but below you can see the related configuration for the dialog module:</div><div><br></div><div>

<div style="color:rgb(171,178,191);background-color:rgb(40,44,52);font-family:"Fira Code",Consolas,"Courier New",monospace;font-weight:normal;font-size:14px;line-height:19px;white-space:pre-wrap"><div><span style="color:rgb(198,120,221)">modparam</span><span style="color:rgb(171,178,191)">(</span><span style="color:rgb(152,195,121)">"dialog"</span><span style="color:rgb(171,178,191)">, </span><span style="color:rgb(152,195,121)">"default_timeout"</span><span style="color:rgb(171,178,191)">, </span><span style="color:rgb(209,154,102)">10800</span><span style="color:rgb(171,178,191)">) </span><span style="color:rgb(92,99,112);font-style:italic"># 3 hours</span></div><div><span style="color:rgb(198,120,221)">modparam</span><span style="color:rgb(171,178,191)">(</span><span style="color:rgb(152,195,121)">"dialog"</span><span style="color:rgb(171,178,191)">, </span><span style="color:rgb(152,195,121)">"early_timeout"</span><span style="color:rgb(171,178,191)">, </span><span style="color:rgb(209,154,102)">180</span><span style="color:rgb(171,178,191)">)</span></div><div><span style="color:rgb(198,120,221)">modparam</span><span style="color:rgb(171,178,191)">(</span><span style="color:rgb(152,195,121)">"dialog"</span><span style="color:rgb(171,178,191)">, </span><span style="color:rgb(152,195,121)">"noack_timeout"</span><span style="color:rgb(171,178,191)">, </span><span style="color:rgb(209,154,102)">90</span><span style="color:rgb(171,178,191)">)</span></div></div>

</div><div><br></div><div>Unfortunately, I'm not able to reproduce this issue, as that's happening randomly and just a few times per day. On the SIP Level i didn't notice any strange issues. <br></div><div><br></div><div>Any ideas why is that happening?</div><div>Thank you.<br></div></div>
</blockquote></div>
</blockquote></div></div>