<div><div dir="auto">Hello Mark,</div></div><div dir="auto"><br></div><div dir="auto">Have you given TSILO module a try?</div><div dir="auto"><br></div><div dir="auto"><div><a href="https://kamailio.org/docs/modules/5.2.x/modules/tsilo.html">https://kamailio.org/docs/modules/5.2.x/modules/tsilo.html</a></div><br></div><div><br><div class="gmail_quote"><div dir="ltr">On Thu, Feb 7, 2019 at 12:18 Mark Hall <<a href="mailto:mark@brightvoip.co.uk">mark@brightvoip.co.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="#0563C1" vlink="#954F72"><div class="m_-8284484792490159003WordSection1"><p class="MsoNormal">Hi,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I am using Kamailio as a gateway for inbound calls to a group of Asterisk servers.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">One particular call scenario involves matching pairs of calls. Originally I was just sending the calls through to Asterisk for processing (including the ‘matching up’), but there is a further requirement that the first received call must not be answered until its matching call arrives – and this is a little awkward in Asterisk, especially if there will be many calls.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I thought of t_suspend/t_continue functionality in Kamailio.  I have implemented this:<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">CallA arrives.<u></u><u></u></p><p class="MsoNormal">Send 180-ringing<u></u><u></u></p><p class="MsoNormal">Use ds_select_dst() to choose an Asterisk to handle the paired calls<u></u><u></u></p><p class="MsoNormal">Store destination and other data in an htable so that I can match the call later.<u></u><u></u></p><p class="MsoNormal">Invoke t_suspend() for CallA.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">What I have implemented when the matching call arrives is this:<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">CallB arrives (and some logic matches it to the suspended CallA).<u></u><u></u></p><p class="MsoNormal">Invoke t_continue(‘id’,’label’,’CONTINUE_CALL’); so that CallA is now released and the route ends in t_relay() to send it on to Asterisk.<u></u><u></u></p><p class="MsoNormal">Set $du on CallB to match the destination, then t_relay() this call to send it on to the same Asterisk.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">The solution almost works, but there is a problem.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">The t_relay() for CallA is fine, and the call is forwarded.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">When the script runs the t_relay() for CallB, I get this logged:<br>ERROR: tm [t_fwd.c:1728]: t_forward_nonack(): no branches for forwarding<u></u><u></u></p><p class="MsoNormal">ERROR: sl [sl_funcs.c:362]: sl_reply_error(): stateless error reply used: I'm terribly sorry, server error occurred (6/SL)<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal" style="margin-bottom:12.0pt">AND after each call I notice an extra transaction stuck in Kamailio (when I use kamctl rpc tm.list).<u></u><u></u></p><p class="MsoNormal" style="margin-bottom:12.0pt">Can anyone point out where my Kamailio/SIP understanding has let me down? <u></u><u></u></p><p class="MsoNormal">Many Thanks,<u></u><u></u></p><p class="MsoNormal"><span>Mark Hall<u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p></div></div>_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div></div>