[local-ctx-common]
exten => start,1,NoOp(Common handler for local context)
same => n,GotoIf($["${APP_REF}" != ""]?4)
same => n,Set(APP_REF=${PJSIP_HEADER(read,X-App-Ref)})
same => n,GotoIf($["${INGRESS_NUMBER}" != ""]?6)
same => n,Set(INGRESS_NUMBER=${CUT(CUT(PJSIP_HEADER(read,To),@,1),:,2)})
same => n,GotoIf($["${CALL_DIRECTION}" != ""]?8)
same => n,Set(CALL_DIRECTION=${PJSIP_HEADER(read,X-Call-Direction)})
same => n,Set(TIMEOUT(absolute)=3600)
same => n,MixMonitor(${APP_REF}_${UNIQUEID}.wav)
same => n,Stasis(mediacontroller)
same => n,Hangup()
[local-ctx]
exten => _+X.,1,NoOp(E.164 Number: ${EXTEN})
same => n,GoSub(local-ctx-common,start,1)
same => n,Hangup()
exten => _X.,1,NoOp(Non-E.164 Number: ${EXTEN})
same => n,GoSub(local-ctx-common,start,1)
same => n,Hangup()
exten => voice,1,NoOp(Directly connecting to the Voice server)
same => n,GoSub(local-ctx-common,start,1)
same => n,Hangup()