[asterisk-users] PJSIP_AOR Slow

Daniel Journo dan at keshercommunications.com
Sun Nov 19 05:38:48 CST 2017


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20171119/1b0f921e/attachment.html>


More information about the asterisk-users mailing list