<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Menlo;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Times New Roman \,serif";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hi Daniel,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">As suggested, I’ve add the t_newtran() after the SIP INVITE and did work. Now the responses are being send correctly (which is great!), and in fact no need did notice that the 487 response is sent automatically,
 and thus no need to explicitly generate one. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Curious to understand why is that. I gathered that t_newtran() – assuming this is the proper function – was used to create a new transaction, let’s say if needed to generate a new SIP INVITE req from the server
 (UAS) side. Why in that sense would I need to create a “new” transaction?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Many Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Joao<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">  <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:windowtext">From:</span></b><span style="color:windowtext"> sr-users [mailto:sr-users-bounces@lists.sip-router.org]
<b>On Behalf Of </b>Daniel-Constantin Mierla<br>
<b>Sent:</b> segunda-feira, 15 de Junho de 2015 18:45<br>
<b>To:</b> Kamailio (SER) - Users Mailing List<br>
<b>Subject:</b> Re: [SR-Users] CANCEL request and subsequent 487 response to INVTE configuration problem<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hello,<br>
<br>
have you created the transaction for INVITE request?<br>
<br>
There is also a function t_cancel_callid() that could help better than t_reply_callid().<br>
<br>
Cheers,<br>
Daniel<span style="font-size:12.0pt"><o:p></o:p></span></p>
<div>
<p class="MsoNormal">On 15/06/15 19:29, Joao Alves wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I’m creating a configuration is for a SIP <> HTTP gateway (performing protocol conversion) and thus all SIP messages and responses needs to be generated from the kamailio config file.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I’m failing to create the case where the calling user abandons the session, and thus, following the reception of a CANCEL a 200 “OK” needs to be sent to this transaction and later the 487 “Request Terminated” to the SIP INVITE original
 session.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">On the traces I see:<o:p></o:p></p>
<p class="MsoNormal">SIP INVITE (Cseq 1 INVITE) --><o:p></o:p></p>
<p class="MsoNormal">100 Trying (Cseq 1 INVITE) <--<o:p></o:p></p>
<p class="MsoNormal">180 Ringing (Cseq 1 INVITE) <--<o:p></o:p></p>
<p class="MsoNormal">SIP CANCEL (Cseq 1 CANCEL) --><o:p></o:p></p>
<p class="MsoNormal">200 Ok (CSeq 1 CANCEL) <--<o:p></o:p></p>
<p class="MsoNormal">487 Request Terminated (CSeq 1 CANCEL) <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Have then tried several options, trying to force the CSeq 1 INVITE but without success.
<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">t_reply_callid("$ci", "$cs", "487", " Request Terminated ");<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">t_reply_callid("$ci", "$rm", "487", "Request Terminated");<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">t_reply_callid("$ci", "1", "487", "Request Terminated");<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">For instance, for the last I get the following log.<o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:Menlo"> 6(60226) exec: *** cfgtrace:request_route=[REQINIT] c=[/etc/kamailio/kamailio.cfg] l=705 a=28 n=t_reply_callid</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:Menlo"> 6(60226) DEBUG: tm [t_lookup.c:1715]: t_lookup_callid(): created comparable call_id header field: >Call-ID: 76589ZTJmNTAwZDhlOTZiM2I3MjhhYzllNjgyOWVjZGZmMzk</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:Menlo">< </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:Menlo"> 6(60226) DEBUG: tm [t_lookup.c:1719]: t_lookup_callid(): created comparable cseq header field: >CSeq: 1 INVITE<</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:Menlo"> 6(60226) DEBUG: tm [t_lookup.c:1722]: t_lookup_callid(): just locked hash index 18668, looking for transactions there:</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:Menlo"> 6(60226) DEBUG: tm [t_lookup.c:1749]: t_lookup_callid(): DEBUG: t_lookup_callid: transaction not found.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:Menlo"> 6(60226) DEBUG: tmx [tmx_mod.c:500]: t_reply_callid(): Lookup failed - no transaction</span><o:p></o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt"> <o:p></o:p></p>
<p class="MsoNormal">Could you assist here?<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Joao<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><b><span style="font-size:9.0pt;font-family:"Verdana",sans-serif">Joao Alves</span></b><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Verdana",sans-serif">Solution Architect, Unified Communications</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt;font-family:"Verdana",sans-serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt;font-family:"Verdana",sans-serif">+351 214094660 (desk)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt;font-family:"Verdana",sans-serif">+351 912783702 (mobile)</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:12.0pt;font-family:"Times New Roman ,serif",serif"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:18.0pt;text-indent:-18.0pt"><b><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#747665">AMDOCS |</span></b><b><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#EF8200">EMBRACE
 CHALLENGE</span></b><b><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#AAB300">EXPERIENCE SUCCESS</span></b><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif">This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement, you may review at
<a href="http://www.amdocs.com/email_disclaimer.asp">http://www.amdocs.com/email_disclaimer.asp</a>
<br>
<br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<o:p></o:p></pre>
<pre><a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><o:p></o:p></pre>
<pre><a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif"><br>
<br>
<o:p></o:p></span></p>
<pre>-- <o:p></o:p></pre>
<pre>Daniel-Constantin Mierla<o:p></o:p></pre>
<pre><a href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a><o:p></o:p></pre>
<pre>Book: SIP Routing With Kamailio - <a href="http://www.asipto.com">http://www.asipto.com</a><o:p></o:p></pre>
</div>
</body>
</html>