Timo,<div><br></div><div>   Some interesting results indeed.  If I place the same block of code with or without dlg_get first then dlg_bye AFTER loose_route -- kamailio ignores the packet.</div><div><br></div><div>If I place it before loose_route WITH dlg_get FIRST - it works as expected.</div>
<div><br></div><div>Sincerely,</div><div>Brandon Armstead<br><div><br><div class="gmail_quote">On Tue, Nov 1, 2011 at 4:42 PM, Timo Reimann <span dir="ltr">&lt;<a href="mailto:sr@foo-lounge.de">sr@foo-lounge.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hey Brandon,<br>
<br>
<br>
Am 02.11.2011 um 00:32 schrieb Brandon Armstead:<br>
<div class="im">&gt;     Thats correct - however I am calling this before loose_route, perhaps that is my problem and need for calling dlg_get?  Let me give this a go - and I will respond back with my findings, thanks!<br>

<br>
</div>Yeah, that should be it -- linking to the currently active dialog is being implemented as a callback to record-routed messages which takes place after a call to loose_route().<br>
<br>
Looking forward to hearing your findings. :)<br>
<div><div></div><div class="h5"><br>
<br>
Cheers,<br>
<br>
--Timo<br>
<br>
<br>
<br>
&gt; On Tue, Nov 1, 2011 at 4:21 PM, Timo Reimann &lt;<a href="mailto:sr@foo-lounge.de">sr@foo-lounge.de</a>&gt; wrote:<br>
&gt; Hey Brandon,<br>
&gt;<br>
&gt;<br>
&gt; Am 01.11.2011 um 23:44 schrieb Brandon Armstead:<br>
&gt; &gt;     Thank you for the input - I actually just figured out a resolution.<br>
&gt; &gt;<br>
&gt; &gt; Apparently dlg_bye(&quot;all&quot;) must be called after dlg_get - so what I&#39;m doing now is simply checking for request with a special request uri with the callid / from tag / to tag in the request that correlates to the call I desire to terminate.  I am then feeding $ci, $tt, and $ft into dlg_get and then calling dlg_bye(&quot;all&quot;) - in which Kamailio then proceeds to send BYE out to both legs of the call.<br>

&gt; &gt;<br>
&gt; &gt; I think we can mark this as resolved :).<br>
&gt;<br>
&gt; OK, very good. :)<br>
&gt;<br>
&gt; Let me make sure that this isn&#39;t a dialog module bug: You are now calling dlg_get() followed by dlg_bye() with proper parameters from within the Kamailio configuration script? if so, you shouldn&#39;t need to call dlg_get() in the first place, at least not if you place dlg_bye() after the call to loose_route(). Contrary, using certain dialog features (including dlg_bye()) from reply routes isn&#39;t completely possible yet which could explain your findings.<br>

&gt;<br>
&gt;<br>
&gt; Cheers,<br>
&gt;<br>
&gt; --Timo<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &gt; On Tue, Nov 1, 2011 at 3:21 PM, Timo Reimann &lt;<a href="mailto:sr@foo-lounge.de">sr@foo-lounge.de</a>&gt; wrote:<br>
&gt; &gt; Hey Brandon,<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Am 01.11.2011 um 22:48 schrieb Brandon Armstead:<br>
&gt; &gt; &gt;     I am attempting to tear down a call with a BYE packet generated externally (kind of similar to Kamailio fifo dlg_end_dlg).<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Let me describe what I am trying to do in more depth and then I will continue to tell you the problem I think I am experiencing.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; [PSTN SIP Proxy] -&gt; [CORE SIP Proxy] -&gt; [REGISTRAR] -&gt; [UAC]<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; So the above layout is the normal call flow / structure of calls (incoming when originating from pstn) (outgoing when originating from uac).<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I then have an &quot;external&quot; host - I am attempting to generate a BYE to [CORE SIP Proxy] and have it go both directions [PSTN] + [UAC].<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; So far I am able to get the call to tear down in only a single direction (only kill call with PSTN) or (only kill call with UAC).<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I have not been able to kill both legs of the call.<br>
&gt; &gt;<br>
&gt; &gt; [snip]<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; &gt; My Question - what am I doing wrong - or what is the best method to tackle this task?<br>
&gt; &gt;<br>
&gt; &gt; If I get you right you are trying to emulate Kamailio&#39;s dlg_end_dlg functionality without involving Kamailio at all (except for passing forward the BYE requests). This makes your question sort of off-topic as processing BYE requests is a matter of RFC 3261 alone.<br>

&gt; &gt;<br>
&gt; &gt; Apart from that, what you could do is take a look at the dialog module code and check how it implements dlg_end_dlg. An idea I have what you could possibly be doing wrong is not using the CSeq numbers that each party expects. I don&#39;t have the details at hand but if either CSeq number is off your UAs won&#39;t accept the BYE request.<br>

&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Cheers,<br>
&gt; &gt;<br>
&gt; &gt; --Timo<br>
&gt;<br>
<br>
</div></div></blockquote></div><br></div></div>