On Sun, Nov 19, 2017 at 5:38 AM, Daniel Journo <d...@keshercommunications.com > wrote:
> Hi, > > > > 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. > > But PJSIP_AOR seems to take about 0.9 seconds to return. If I’m checking > 10 endpoints, that can cause a significant delay. > > > > Is there a better way to check the status of an endpoint pre-dialling > within the dialplan? > > > > Here is a sample of what I’m doing. > > > > exten => example_839,9,ExecIf($["${PJSIP_AOR(example_220,contact) > }"=""]?Set(UNAVAILABLEPEER=${UNAVAILABLEPEER} example_220)) > > exten => example_839,10,ExecIf($["${PJSIP_AOR(example_220,contact) > }"!=""]?Set(WORKINGPEERFOUND=1)) > > exten => example_839,11,NoOp(${PJSIP_AOR(example_223,contact)}) > > exten => example_839,12,ExecIf($["${PJSIP_AOR(example_223,contact) > }"=""]?Set(UNAVAILABLEPEER=${UNAVAILABLEPEER} example_223)) > > exten => example_839,13,ExecIf($["${PJSIP_AOR(example_223,contact) > }"!=""]?Set(WORKINGPEERFOUND=1)) > > exten => example_839,14,NoOp(${PJSIP_AOR(example_224,contact)}) > > exten => example_839,15,ExecIf($["${PJSIP_AOR(example_224,contact) > }"=""]?Set(UNAVAILABLEPEER=${UNAVAILABLEPEER} example_224)) > > exten => example_839,16,ExecIf($["${PJSIP_AOR(example_224,contact) > }"!=""]?Set(WORKINGPEERFOUND=1)) > > exten => example_839,17,NoOp(${PJSIP_AOR(example_226,contact)}) > > exten => example_839,18,ExecIf($["${PJSIP_AOR(example_226,contact) > }"=""]?Set(UNAVAILABLEPEER=${UNAVAILABLEPEER} example_226)) > > exten => example_839,19,ExecIf($["${PJSIP_AOR(example_226,contact) > }"!=""]?Set(WORKINGPEERFOUND=1)) > > exten => example_839,20,NoOp(${PJSIP_AOR(example_227,contact)}) > > exten => example_839,21,ExecIf($["${PJSIP_AOR(example_227,contact) > }"=""]?Set(UNAVAILABLEPEER=${UNAVAILABLEPEER} example_227)) > > exten => example_839,22,ExecIf($["${PJSIP_AOR(example_227,contact) > }"!=""]?Set(WORKINGPEERFOUND=1)) > > exten => example_839,23,NoOp(${PJSIP_AOR(example_240,contact)}) > > exten => example_839,24,ExecIf($["${PJSIP_AOR(example_240,contact) > }"=""]?Set(UNAVAILABLEPEER=${UNAVAILABLEPEER} example_240)) > > exten => example_839,25,ExecIf($["${PJSIP_AOR(example_240,contact) > }"!=""]?Set(WORKINGPEERFOUND=1)) > > exten => example_839,26,GotoIf($[${WORKINGPEERFOUND}=0]?227) > > > > Many thanks > > Dan > > > Where are the AORs for your endpoints stored? Static conf file, database, etc.? Are you using any type of caching via sorcery? -- Matthew Jordan Digium, Inc. | CTO 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA Check us out at: http://digium.com & http://asterisk.org
-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users