<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
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;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;}
@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 lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="NL">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="NL"><o:p> </o:p></span></p>
<p class="MsoNormal">I’m trying to use multiple destination sets which may include the same destination.<o:p></o:p></p>
<p class="MsoNormal">For instance: <o:p></o:p></p>
<p class="MsoNormal">SET ID: 1<o:p></o:p></p>
<p class="MsoNormal"><a href="sip:10.0.0.1:5060">sip:10.0.0.1:5060</a><o:p></o:p></p>
<p class="MsoNormal"><a href="sip:10.0.0.2:5060">sip:10.0.0.2:5060</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">SET ID: 2<o:p></o:p></p>
<p class="MsoNormal"><a href="sip:10.0.0.1:5060">sip:10.0.0.1:5060</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Whenever a new SIP INVITE is sent to the Kamailio instance it will use SET ID 1. If then for some reason this call attempt fails, failure_route will trigger and SET ID 2 will be used.  At first glance this might not make any sense, but
 there is some business logic behind this, but it’s not relevant for this case.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">For some reason, the dst_avp variable still contains the destinations of SET ID 1 in failure_route.<o:p></o:p></p>
<p class="MsoNormal">Is there a built-in way to reset this variable for every call to ds_select_domain(), such that only the destinations of passed SET ID will be loaded into the avp?<o:p></o:p></p>
<p class="MsoNormal">I tried setting the avp to $null before calling ds_select_domain, but that had some undesirable effects.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The reason I’m asking this is the destinations the call is being sent to are Freeswitch instances, which will return a 482 Request Merged when the same INVITE is sent to the same Freeswitch within 4 seconds (default T4 timer).
<o:p></o:p></p>
<p class="MsoNormal">I’m trying to match the previously selected destination in failure_route with the next destination and skip if they’re the same, or stop processing when they are the same and no more destinations are available.
<o:p></o:p></p>
<p class="MsoNormal">I know I can mess with the T4 timer in Freeswitch and perhaps even sleep in failure route to deal with the 482 failure, but I rather fix this in a normal way.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regards,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:0cm 0cm 1.5pt 0cm">
<p class="MsoNormal"><span style="font-size:16.0pt;color:#1657EA">Grant Bagdasarian</span><span style="font-size:12.0pt;color:#1657EA"><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:0cm 0cm 15.0pt 0cm">
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Senior Developer</span><span style="font-size:9.0pt;color:black"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span lang="NL"><o:p> </o:p></span></p>
</div>
</body>
</html>