<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 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        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:"Verdana","sans-serif";
        color:windowtext;
        font-weight:normal;
        font-style:normal;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;
        mso-fareast-language:EN-US;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Verdana","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
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=NL link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'>Hello Daniel,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'>Yes, dlg_manage() is being called in the BYE, yet it sometimes still occurs that dialogs aren’t being cleared.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'>It is critical for us the dialogs are being cleared as we have an application which heavily relies on this.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'>Kind regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'>Grant Bagdasarian<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext;mso-fareast-language:NL'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext;mso-fareast-language:NL'> Daniel-Constantin Mierla [mailto:miconda@gmail.com] <br><b>Sent:</b> donderdag 8 november 2012 8:03<br><b>To:</b> SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List<br><b>Cc:</b> Grant Bagdasarian<br><b>Subject:</b> Re: [SR-Users] Dialog module not decrementing profile size<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt'>Hello,<o:p></o:p></p><div><p class=MsoNormal>On 10/30/12 10:51 AM, Grant Bagdasarian wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>Hello Community,</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif"'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>I’ve recently started to use the Dialog module to manage the amount of incoming calls from our SIP provider allowed to pass through by using profiles_with_values and setting the size of these profiles to a certain amount.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>Most of the time this works as it should, but sometimes the ‘slots’ available for a profile aren’t cleared even though a dialog has finished. This seems to happen when an high amount of regular traffic is hitting kamailio.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif"'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>Has anyone else experienced this? Are there perhaps any other ways to control the slots available for certain incoming SIP traffic?</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif"'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>Below parts of my configuration file. Perhaps I’m doing something wrong which causes this to happen.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>In my route[WITHINDLG] -> loose_route -> is_method(“BYE”) I’m not calling dlg_manage(), could this be the problem?</span><o:p></o:p></p></blockquote><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:NL'>is the dlg_manage() executed or not for BYE? You say no above, but the example has it. Because you have dlg_match_mode=2, you must call dlg_manage() for BYE explicitly.<br><br>Cheers,<br>Daniel<br><br><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif"'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>Other comments are welcome too, as I’m fairly new to Kamailio.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>modparam("dialog", "enable_stats", 1)</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>modparam("dialog", "dlg_flag", 4)</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>modparam("dialog", "hash_size", 4096)</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>modparam("dialog", "profiles_with_value", "318005004");</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>modparam("dialog", "default_timeout", 43200)</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>modparam("dialog", "dlg_match_mode",2)</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>modparam("dialog", "detect_spirals", 1)</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>request_route {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> # per request initial checks</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> route(REQINIT);</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> # handle requests within SIP dialogs</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> route(WITHINDLG);</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> ### only initial requests (no To tag)</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> # CANCEL processing</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if (is_method("CANCEL"))</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if (t_check_trans())</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> t_relay();</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> exit;</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> }</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> t_check_trans();</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> # record routing for dialog forming requests (in case they are routed)</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> # - remove preloaded route headers</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> remove_hf("Route");</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if (is_method("INVITE")) {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> xlog("L_INFO", "Incoming request for $rU from $fU");</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if ($rU == "318005004") {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> route(DIALOG);</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> } </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> }</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> # handle registrations</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> route(REGISTRAR);</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if ($rU==$null)</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> # request with no Username in RURI</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> sl_send_reply("484","Address Incomplete");</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> exit;</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> }</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> # dispatch destinations</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> route(DISPATCH);</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> route(RELAY);</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>}</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>route[DIALOG] {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> dlg_manage();</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> record_route();</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> $var(SIZE) = 0;</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> sql_query("vf", "exec dbo.SelectAvailableSlots '00$rU'", "ra");</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> $avp(s:limit) = $dbr(ra=>[0,7]);</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> xlog("L_INFO", "Maximum simultaneous calls is configured at $avp(s:limit) ....");</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> sql_result_free("ra");</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if ($rU == "318005004") {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> get_profile_size("318005004", "$rU", "$var(SIZE)");</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> }</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> xlog("L_INFO", "There are currently $var(SIZE) calls for $rU, excluding the current call");</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if($var(SIZE) >= $avp(s:limit)) {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> xlog("L_INFO", "Simultaneous calls limit of $avp(s:limit) reached for $rU: $var(SIZE)\n");</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> sl_send_reply("603", "Simultaneous calls limit reached");</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> exit;</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> }</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if ($rU == "318005004") {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> set_dlg_profile("318005004", "$rU"); </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> } </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if ($rU == "318005004") {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if(get_profile_size("318005004", "$var(SIZE)")) {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> xlog("L_INFO", "There are currently $var(SIZE) calls for $rU, including the current call");</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> }</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> } </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>}</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif"'> </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'>route[WITHINDLG] {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if (has_totag()) {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> # sequential request withing a dialog should</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> # take the path determined by record-routing</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if (loose_route()) {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> #Used for call transfer</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if($fU == "318005004") {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if (is_method("UPDATE")) {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> sl_send_reply("405","Method not allowed");</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> xlog("L_INFO", "Dropping UPDATE message...\n");</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> exit;</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> }</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if (is_method("INVITE")) {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> record_route();</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> } </span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if (is_method("BYE")) {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> dlg_manage();</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> }</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> }</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if (is_method("BYE")) {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> setflag(1); # do accounting ...</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> setflag(3); # ... even if the transaction fails</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> }</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> route(RELAY);</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> } else {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if (is_method("SUBSCRIBE") && uri == myself) {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> # in-dialog subscribe requests</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> route(PRESENCE);</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> exit;</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> }</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if ( is_method("ACK") ) {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> if ( t_check_trans() ) {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> # non loose-route, but stateful ACK;</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> # must be ACK after a 487 or e.g. 404 from upstream server</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> t_relay();</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> exit;</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> } else {</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> # ACK without matching transaction ... ignore and discard.</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> exit;</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> }</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> }</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> sl_send_reply("404","Not here");</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.0pt;font-family:"Courier New"'> </span><span style='font-size:9.0pt;font-family:"Courier New"'>}</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'> exit;</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'> }</span><o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>}</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif"'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif"'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>Regards,</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif"'> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>Grant</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:NL'><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><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:NL'><br><br><o:p></o:p></span></p><pre>-- <o:p></o:p></pre><pre>Daniel-Constantin Mierla - <a href="http://www.asipto.com">http://www.asipto.com</a><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>Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - <a href="http://asipto.com/u/kat">http://asipto.com/u/kat</a><o:p></o:p></pre><pre>Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012 - <a href="http://asipto.com/u/katu">http://asipto.com/u/katu</a><o:p></o:p></pre></div></body></html>