<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
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;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hello,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Consider the following Kamailio script:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>route {<o:p></o:p></p><p class=MsoNormal>                ….<o:p></o:p></p><p class=MsoNormal>                route(DISPATCH);<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                route(RELAY); <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>route[DISPATCH] {<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>ds_select_domain("1", "8");<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>return;<o:p></o:p></p><p class=MsoNormal>}<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Dispatcher Table<o:p></o:p></p><table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 style='border-collapse:collapse;border:none'><tr><td width=213 valign=top style='width:159.6pt;border:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt'><p class=MsoNormal>SetID<o:p></o:p></p></td><td width=213 valign=top style='width:159.6pt;border:solid windowtext 1.0pt;border-left:none;padding:0in 5.4pt 0in 5.4pt'><p class=MsoNormal>Destination<o:p></o:p></p></td></tr><tr><td width=213 valign=top style='width:159.6pt;border:solid windowtext 1.0pt;border-top:none;padding:0in 5.4pt 0in 5.4pt'><p class=MsoNormal>1<o:p></o:p></p></td><td width=213 valign=top style='width:159.6pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt'><p class=MsoNormal>192.168.1.10<o:p></o:p></p></td></tr><tr><td width=213 valign=top style='width:159.6pt;border:solid windowtext 1.0pt;border-top:none;padding:0in 5.4pt 0in 5.4pt'><p class=MsoNormal>1<o:p></o:p></p></td><td width=213 valign=top style='width:159.6pt;border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0in 5.4pt 0in 5.4pt'><p class=MsoNormal>192.168.1.11<o:p></o:p></p></td></tr></table><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Algorithm 8 uses the first destination, but if it’s not available, it uses the next one. <o:p></o:p></p><p class=MsoNormal>Does the ds_select_domain function send the SIP request to the first destination or is it the responsibility of the RELAY route to do this? I believe it’s the latter, according to the documentation.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Assuming the above (message is relayed in the RELAY route).<o:p></o:p></p><p class=MsoNormal>When Kamailio can’t reach the first destination, how does it internally handle the failover? Because once the SIP request has been relayed to the host, the script doesn’t have any instructions anymore.<o:p></o:p></p></div></body></html>