<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:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
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;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@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 lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">In my dialplans, I’m currently using PJSIP_AOR to check the status of a contact before dialling so that I can route the call differently if the endpoint is offline.<o:p></o:p></p>
<p class="MsoNormal">But PJSIP_AOR seems to take about 0.9 seconds to return. If I’m checking 10 endpoints, that can cause a significant delay.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Is there a better way to check the status of an endpoint pre-dialling within the dialplan?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Here is a sample of what I’m doing.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">exten => example_839,9,ExecIf($["${PJSIP_AOR(example_220,contact)}"=""]?Set(UNAVAILABLEPEER=${UNAVAILABLEPEER} example_220))<o:p></o:p></p>
<p class="MsoNormal">exten => example_839,10,ExecIf($["${PJSIP_AOR(example_220,contact)}"!=""]?Set(WORKINGPEERFOUND=1))<o:p></o:p></p>
<p class="MsoNormal">exten => example_839,11,NoOp(${PJSIP_AOR(example_223,contact)})<o:p></o:p></p>
<p class="MsoNormal">exten => example_839,12,ExecIf($["${PJSIP_AOR(example_223,contact)}"=""]?Set(UNAVAILABLEPEER=${UNAVAILABLEPEER} example_223))<o:p></o:p></p>
<p class="MsoNormal">exten => example_839,13,ExecIf($["${PJSIP_AOR(example_223,contact)}"!=""]?Set(WORKINGPEERFOUND=1))<o:p></o:p></p>
<p class="MsoNormal">exten => example_839,14,NoOp(${PJSIP_AOR(example_224,contact)})<o:p></o:p></p>
<p class="MsoNormal">exten => example_839,15,ExecIf($["${PJSIP_AOR(example_224,contact)}"=""]?Set(UNAVAILABLEPEER=${UNAVAILABLEPEER} example_224))<o:p></o:p></p>
<p class="MsoNormal">exten => example_839,16,ExecIf($["${PJSIP_AOR(example_224,contact)}"!=""]?Set(WORKINGPEERFOUND=1))<o:p></o:p></p>
<p class="MsoNormal">exten => example_839,17,NoOp(${PJSIP_AOR(example_226,contact)})<o:p></o:p></p>
<p class="MsoNormal">exten => example_839,18,ExecIf($["${PJSIP_AOR(example_226,contact)}"=""]?Set(UNAVAILABLEPEER=${UNAVAILABLEPEER} example_226))<o:p></o:p></p>
<p class="MsoNormal">exten => example_839,19,ExecIf($["${PJSIP_AOR(example_226,contact)}"!=""]?Set(WORKINGPEERFOUND=1))<o:p></o:p></p>
<p class="MsoNormal">exten => example_839,20,NoOp(${PJSIP_AOR(example_227,contact)})<o:p></o:p></p>
<p class="MsoNormal">exten => example_839,21,ExecIf($["${PJSIP_AOR(example_227,contact)}"=""]?Set(UNAVAILABLEPEER=${UNAVAILABLEPEER} example_227))<o:p></o:p></p>
<p class="MsoNormal">exten => example_839,22,ExecIf($["${PJSIP_AOR(example_227,contact)}"!=""]?Set(WORKINGPEERFOUND=1))<o:p></o:p></p>
<p class="MsoNormal">exten => example_839,23,NoOp(${PJSIP_AOR(example_240,contact)})<o:p></o:p></p>
<p class="MsoNormal">exten => example_839,24,ExecIf($["${PJSIP_AOR(example_240,contact)}"=""]?Set(UNAVAILABLEPEER=${UNAVAILABLEPEER} example_240))<o:p></o:p></p>
<p class="MsoNormal">exten => example_839,25,ExecIf($["${PJSIP_AOR(example_240,contact)}"!=""]?Set(WORKINGPEERFOUND=1))<o:p></o:p></p>
<p class="MsoNormal">exten => example_839,26,GotoIf($[${WORKINGPEERFOUND}=0]?227)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB">Many thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB">Dan<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>