PJSIP_AOR Slow

Home » Asterisk Users » PJSIP_AOR Slow
Asterisk Users 1 Comment

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

One thought on - PJSIP_AOR Slow