<div dir="ltr">Maybe cnxcc module can help you [1].<div><br></div><div style>If you need to set a time limit you could use cnxcc_set_max_time() and when the call times out, an event route is called.</div><div style><br></div>
<div style>[1] <a href="http://kamailio.org/docs/modules/devel/modules/cnxcc.html">http://kamailio.org/docs/modules/devel/modules/cnxcc.html</a></div><div style><br></div><div style>Regards,</div><div style>Carlos</div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 21, 2013 at 8:30 AM, Federico Cabiddu <span dir="ltr"><<a href="mailto:federico.cabiddu@gmail.com" target="_blank">federico.cabiddu@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Daniel,<div>thank you for your answer.</div><div>I tried to catch the BYE with event_route[dialog:end] but I'm facing another problem.</div>
<div>When the timeout for the dialog is reached Kamailio correctly sends a BYE to the caller and to the callee but in the logs I see this:</div>


<div><br></div><div><div>DEBUG: dialog [dlg_timer.c:240]: start with tl=0x7f10937f0138 tl->prev=0x7f10937b4f20 tl->next=0x7f10937b4f20 (42641998) at 42641998 and end with end=0x7f10937b4f20</div><div>end->prev=0x7f10937f0138 end->next=0x7f10937f0138</div>



<div>DEBUG: dialog [dlg_timer.c:243]: getting tl=0x7f10937f0138 tl->prev=0x7f10937b4f20 tl->next=0x7f10937b4f20 with 42641998</div><div>DEBUG: dialog [dlg_timer.c:249]: end with tl=0x7f10937b4f20 tl->prev=0x7f10937f0138 tl->next=0x7f10937f0138 and d_timer->first.next->prev=(nil)</div>



<div>DEBUG: dialog [dlg_timer.c:282]: tl=0x7f10937f0138 next=(nil)</div><div>DEBUG: dialog [dlg_req_within.c:302]: sending BYE to caller</div><div>DEBUG: tm [uac.c:243]: DEBUG:tm:t_uac: next_hop=<sip:xxx@yyy.yyy.yyy.yyy:zzzz;transport=udp></div>



<div>DEBUG: tm [uac.c:182]: DEBUG: dlg2hash: 343</div><div>DEBUG: dialog [dlg_req_within.c:323]: BYE sent to caller</div><div>DEBUG: dialog [dlg_req_within.c:302]: sending BYE to callee</div><div>DEBUG: tm [uac.c:243]: DEBUG:tm:t_uac: next_hop=<sip:xxx@yyy.yyy.yyy.yyy:zzzz;transport=udp></div>



<div>DEBUG: tm [uac.c:182]: DEBUG: dlg2hash: 343</div><div>DEBUG: dialog [dlg_req_within.c:323]: BYE sent to callee</div><div>DEBUG: dialog [dlg_hash.c:735]: ref dlg 0x7f10937f00e0 with 1 -> 3</div><div>DEBUG: dialog [dlg_handlers.c:1474]: executing event_route 1 on state 5 </div>



<div>DEBUG: dialog [dlg_hash.c:588]: ref dlg 0x7f10937f00e0 with 1 -> 4</div><div>DEBUG: dialog [dlg_hash.c:590]: dialog id=11591 found on entry 3289</div><div>DEBUG: dialog [dlg_hash.c:753]: unref dlg 0x7f10937f00e0 with 1 -> 3</div>



<div>DEBUG: dialog [dlg_hash.c:588]: ref dlg 0x7f10937f00e0 with 1 -> 4</div><div>DEBUG: dialog [dlg_hash.c:590]: dialog id=11591 found on entry 3289</div><div>DEBUG: dialog [dlg_hash.c:753]: unref dlg 0x7f10937f00e0 with 1 -> 3</div>



<div>DEBUG: <core> [parser/parse_to.c:799]: end of header reached, state=10 </div><div>DEBUG: <core> [parser/msg_parser.c:190]: DEBUG: get_hdr_field: <To> [20]; uri=[<span style="background-color:rgb(255,0,0)"><a href="mailto:you@kamailio.org" target="_blank">you@kamailio.org</a></span>]</div>



<div>DEBUG: <core> [parser/msg_parser.c:192]: DEBUG: to body [<<span style="background-color:rgb(255,0,0)"><a href="mailto:you@kamailio.org" target="_blank">you@kamailio.org</a></span>>#015#012]</div><div>DEBUG: <core> [parser/parse_to.c:176]: DEBUG: add_param: tag=123</div>



<div>DEBUG: <core> [parser/parse_to.c:799]: end of header reached, state=29 </div><div>DEBUG: <core> [parser/parse_uri.c:1292]: parse_uri: bad uri,  state 0 parsed: <you@> (4) / <<a href="mailto:you@kamailio.org" target="_blank">you@kamailio.org</a>> (16)</div>



<div>ERROR: <core> [parser/parse_from.c:113]: failed to parse From uri </div><div>ERROR: pv [pv_core.c:400]: cannot parse From URI</div><div>DEBUG: <core> [parser/parse_uri.c:1292]: parse_uri: bad uri,  state 0 parsed: <you@> (4) / <<a href="mailto:you@kamailio.org" target="_blank">you@kamailio.org</a>> (16)</div>



<div>ERROR: <core> [parser/parse_to.c:879]: failed to parse To uri</div><div>ERROR: pv [pv_core.c:394]: cannot parse To URI</div><div>INFO: <script>: event_route[dialog:end]: call-id=123 from=<null> to=<null> : (method= OPTIONS) :: dlg flag: 18446744073709551615 :: <span style="background-color:rgb(255,0,0)">DLG_lifetime</span>: <null></div>



</div><div><br></div><div>The parser error problem seems to be related to the To and From headers of FAKED_SIP_MSG, defined in lib/kcore/faked_msg.c. </div><div>If I change those URIs adding "sip: " the pv error disappears but once entered the event_route[dialog:end] </div>



<div><br></div><div><div>INFO: <script>: event_route[dialog:end]: call-id=123 from=<span style="background-color:rgb(255,0,0)">you</span> to=<span style="background-color:rgb(255,0,0)">you</span> : (method= OPTIONS) :: dlg flag: 18446744073709551615 :: <span style="background-color:rgb(255,0,0)">DLG_lifetime</span>: <null></div>



<div>WARNING: dialog [dlg_req_within.c:177]: inconsitent dlg timer data on dlg 0x7fa07e0c6fe0 [2950:12062] with clid '1518225741' and tags '717826890' '1348505040'</div></div><div><br></div><div>As you can see,  the $DLG_lifetime is <null> and we also have the message on the inconsistent dlg timer.</div>



<div><br></div><div>Probably there is something that I'm not understanding but why the event_route in this case is processing a "fake" OPTIONS message?</div><div>Another thing I noticed is that event_route[dialog:end] is not executed when a dialog is terminated by dlg_end_dlg or dlg_terminate_dlg fifo commands.</div>



<div>We really need to access the DLG_lifetime value in both cases (internal timeout or external command), any hint on how to do it?</div><div><br></div><div>Thank you in advance.</div><div><br></div><div>Regards,</div><div>



<br></div><div>Federico</div><div><br></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 21, 2013 at 12:43 AM, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hello,<br>
    <br>
    there is an event route for dialog timeout, I guess there is
    available. tm:local is executed by tm, so you may need to call the
    function that lookups the dialog.<br>
    <br>
    Cheers,<br>
    Daniel<div><div><br>
    <br>
    <div>On 6/20/13 1:47 PM, Dragos Oancea
      wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div>
      <div style="font-size:10pt;font-family:arial,helvetica,sans-serif">
        <div>Hello ,</div>
        <div><br>
        </div>
        <div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif"><br>
        </div>
        <div style="font-style:normal;font-size:13px;background-color:transparent;font-family:arial,helvetica,sans-serif">Is the <span style="white-space:pre-wrap;font-family:'Times New Roman';font-size:16px">$DLG_lifetime
            supposed to be accessed in the</span><span> event_route[tm:local-request] ?</span></div>
        <div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'Times New Roman'"><span style="white-space:pre-wrap;font-family:'Times New Roman';font-size:16px"><br>
          </span></div>
        <div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'Times New Roman'"><span style="white-space:pre-wrap;font-family:'Times New Roman';font-size:16px">We are trying to access
            it and it always reports null with kamailio 4.0.0 .</span></div>
        <div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'Times New Roman'"><span style="white-space:pre-wrap;font-family:'Times New Roman';font-size:16px"><br>
          </span></div>
        <div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'Times New Roman'"><span style="white-space:pre-wrap;font-family:'Times New Roman';font-size:16px">We found a reference
            about this here: </span></div>
        <div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'Times New Roman'"><span style="white-space:pre-wrap;font-family:'Times New Roman';font-size:16px"><a href="http://www.kamailio.org/pub/kamailio/3.3.3/ChangeLog" style="font-family:arial,helvetica,sans-serif;font-size:10pt" target="_blank">http://www.kamailio.org/pub/kamailio/3.3.3/ChangeLog</a> </span></div>



        <div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'Times New Roman'"><span style="white-space:pre-wrap;font-family:'Times New Roman';font-size:16px"><br>
          </span></div>
        <div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'Times New Roman'"><span style="white-space:pre-wrap;font-family:'Times New Roman';font-size:16px">.....</span></div>



        <div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'Times New Roman'"><span style="white-space:pre-wrap;font-family:'Times New Roman';font-size:16px"></span></div>



        <pre style="word-wrap:break-word;white-space:pre-wrap">  dialog(k): run event route after setting cfg dlg vars
    
    - in this way they (e.g., $DLG_lifetime) should be accessible in event
      route
    (cherry picked from commit 2cdded28d9968a0b78f5ec8329ae6983d9ea77a9)
</pre>
        <div>.....</div>
        <div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'Times New Roman'"><span style="white-space:pre-wrap;font-family:'Times New Roman';font-size:16px"><br>
          </span></div>
        <div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'Times New Roman'"><span style="white-space:pre-wrap;background-color:transparent">Apparently it should have been possible. </span><br>



        </div>
        <div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'Times New Roman'"><span style="white-space:pre-wrap;font-family:'Times New Roman';font-size:16px">Any hints on this ? </span></div>



        <div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'Times New Roman'"><span style="white-space:pre-wrap;font-family:'Times New Roman';font-size:16px"><br>
          </span></div>
        <div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'Times New Roman'"><span style="white-space:pre-wrap;font-family:'Times New Roman';font-size:16px">Thank you!</span></div>



        <div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'Times New Roman'"><span style="white-space:pre-wrap;font-family:'Times New Roman';font-size:16px"><br>
          </span></div>
        <div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'Times New Roman'"><span style="white-space:pre-wrap;font-family:'Times New Roman';font-size:16px">Regards,</span></div>



        <div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'Times New Roman'"><span style="white-space:pre-wrap;font-family:'Times New Roman';font-size:16px">Dragos & Federico </span></div>



        <div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'Times New Roman'"><span style="white-space:pre-wrap;font-family:'Times New Roman';font-size:16px"><br>
          </span></div>
        <div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'Times New Roman'"><span style="white-space:pre-wrap;font-family:'Times New Roman';font-size:16px"><br>
          </span></div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><span><font color="#888888">
</font></span></pre><span><font color="#888888">
    </font></span></blockquote><span><font color="#888888">
    <br>
    <pre cols="72">-- 
Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
</pre>
  </font></span></div>

<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Carlos<div><a href="http://caruizdiaz.com" target="_blank">http://caruizdiaz.com</a></div><div>+595981146623</div>
</div>