Custom Context Condition

Hi,

Is there a way to add condition in CC when ext answered the call ?

EXT 1234 with virtual ext (custom application 111)
when ext 1234 rings , custom application is triggered and invoke 111 and run the following script
I need to find out if this script only run when ext answered the call otherwise just exit from the script.

[email-notify-DM]
exten=> _.,1,Set(user=admin)
same=>n,Set(Answer=${CURL(https://example.com/admin/client_data_received?client_id="${CALLERID(number)}"&token=adFki1234861252235fgh1))
same=>n,Goto(${ARG1},${ARG2},${ARG3})

Use the Asterisk U Dial option

https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Application_Dial

1 Like

What is U Dial ? I am not very much familiar with AEstrix AMI, do you have an example of the command ? here is my full code, I am not sure how to handle the following ?

1.If Extension doesn’t answer then simply exit and don’t process the customer context.

[Test-notify-OPS]

;PHP INSERT
same=>n,Set(Answer=${CURL(https://testct.com/VitalCalls.php?fname=$[${fname}]&lname=$[${lname}]&phone=${CALLERID(num)}&queue=${EXTEN}&callee=${CALLEE}&email=$[${getemail}]&callId=${CHANNEL(LINKEDID)})})

Change the dial profile to also use the U option

U(Test-notify-OPS)

You will also need the Test-notify-OPS to have an extension with priority 1

I tested the following with and without answer, not running the script, am I missing anything ?

U(Test-notify-OPS)

;PHP INSERT
same=>n,Set(Answer=${CURL(https://testct.com/VitalCalls.php?fname=$[${fname}]&lname=$[${lname}]&

image

Have you changed it?

If so, please provide a call trace via pastebin.

I had to change the name of the script now it is U(GLPI-notify-OPS)

ext 3000022 called 333 and 333 answered the call


Connected to Asterisk 18.10.0 currently running on phone (pid = 1376)
    -- Executing [333@cos-all:1] NoOp("PJSIP/3000019-0000003b", "More than on digit pattern") in new stack
    -- Executing [333@cos-all:2] Gosub("PJSIP/3000019-0000003b", "s,1(333)") in new stack
    -- Executing [s@cos-all:1] Set("PJSIP/3000019-0000003b", "EXTENSION=333") in new stack
    -- Executing [s@cos-all:2] NoOp("PJSIP/3000019-0000003b", "Dialing 333 from 3000019") in new stack
    -- Executing [s@cos-all:3] Gosub("PJSIP/3000019-0000003b", "sub-set-global-vars,s,1(6787bde866811108,333,parking-1)") in new stack
    -- Executing [s@sub-set-global-vars:1] NoOp("PJSIP/3000019-0000003b", "Setting Global Vars") in new stack
    -- Executing [s@sub-set-global-vars:2] Set("PJSIP/3000019-0000003b", "TENANT_PATH=6787bde866811108") in new stack
    -- Executing [s@sub-set-global-vars:3] Set("PJSIP/3000019-0000003b", "PREFIX=") in new stack
    -- Executing [s@sub-set-global-vars:4] Set("PJSIP/3000019-0000003b", "__PICKUPMARK=333") in new stack
    -- Executing [s@sub-set-global-vars:5] Set("PJSIP/3000019-0000003b", "__PARKINGLOT=parking-1") in new stack
    -- Executing [s@sub-set-global-vars:6] Set("PJSIP/3000019-0000003b", "__DYNAMIC_FEATURES=custom-features") in new stack
    -- Executing [s@sub-set-global-vars:7] Set("PJSIP/3000019-0000003b", "ICALL=no") in new stack
    -- Executing [s@sub-set-global-vars:8] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s@cos-all:4] Gosub("PJSIP/3000019-0000003b", "sub-set-call-vars,s,1(6787bde866811108,333,1,cos-all,ARS-all)") in new stack
    -- Executing [s@sub-set-call-vars:1] NoOp("PJSIP/3000019-0000003b", "Setting Call Vars") in new stack
    -- Executing [s@sub-set-call-vars:2] Set("PJSIP/3000019-0000003b", "_TENANT=6787bde866811108") in new stack
    -- Executing [s@sub-set-call-vars:3] Set("PJSIP/3000019-0000003b", "_CALL_DESTINATION=333") in new stack
    -- Executing [s@sub-set-call-vars:4] Set("PJSIP/3000019-0000003b", "_COS_ID=1") in new stack
    -- Executing [s@sub-set-call-vars:5] Set("PJSIP/3000019-0000003b", "_COS_NAME=cos-all") in new stack
    -- Executing [s@sub-set-call-vars:6] Set("PJSIP/3000019-0000003b", "__TRANSFER_CONTEXT=cos-all") in new stack
    -- Executing [s@sub-set-call-vars:7] Set("PJSIP/3000019-0000003b", "_ARS=ARS-all") in new stack
    -- Executing [s@sub-set-call-vars:8] Set("PJSIP/3000019-0000003b", "CDR(tenant)=vitalpbx") in new stack
    -- Executing [s@sub-set-call-vars:9] Set("PJSIP/3000019-0000003b", "CDR(destination)=333") in new stack
    -- Executing [s@sub-set-call-vars:10] Set("PJSIP/3000019-0000003b", "CDR(trunk)=") in new stack
    -- Executing [s@sub-set-call-vars:11] Set("PJSIP/3000019-0000003b", "CDR(did)=") in new stack
    -- Executing [s@sub-set-call-vars:12] Set("PJSIP/3000019-0000003b", "__CALLID=1661899383.242") in new stack
    -- Executing [s@sub-set-call-vars:13] ExecIf("PJSIP/3000019-0000003b", "0?Set(CHANNEL(language)=)") in new stack
    -- Executing [s@sub-set-call-vars:14] ExecIf("PJSIP/3000019-0000003b", "0?Set(CHANNEL(language)=)") in new stack
    -- Executing [s@sub-set-call-vars:15] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s@cos-all:5] Gosub("PJSIP/3000019-0000003b", "sub-construct-cid,s,1") in new stack
    -- Executing [s@sub-construct-cid:1] NoOp("PJSIP/3000019-0000003b", "Building CID") in new stack
    -- Executing [s@sub-construct-cid:2] Set("PJSIP/3000019-0000003b", "_CALL_SOURCE=3000019") in new stack
    -- Executing [s@sub-construct-cid:3] Set("PJSIP/3000019-0000003b", "_CS=3000019") in new stack
    -- Executing [s@sub-construct-cid:4] GotoIf("PJSIP/3000019-0000003b", "0?return") in new stack
    -- Executing [s@sub-construct-cid:5] Gosub("PJSIP/3000019-0000003b", "sub-get-device-tree,s,1") in new stack
    -- Executing [s@sub-get-device-tree:1] NoOp("PJSIP/3000019-0000003b", "Configuring Device Tree") in new stack
    -- Executing [s@sub-get-device-tree:2] Set("PJSIP/3000019-0000003b", "DEV_TECHNOLOGY=PJSIP") in new stack
    -- Executing [s@sub-get-device-tree:3] GosubIf("PJSIP/3000019-0000003b", "0?s-local,1") in new stack
    -- Executing [s@sub-get-device-tree:4] GotoIf("PJSIP/3000019-0000003b", "0?return") in new stack
    -- Executing [s@sub-get-device-tree:5] GotoIf("PJSIP/3000019-0000003b", "1?pjsip") in new stack
    -- Goto (sub-get-device-tree,s,9)
    -- Executing [s@sub-get-device-tree:9] NoOp("PJSIP/3000019-0000003b", "A PJSIP") in new stack
    -- Executing [s@sub-get-device-tree:10] Set("PJSIP/3000019-0000003b", "DEV_USER=3000019") in new stack
    -- Executing [s@sub-get-device-tree:11] Goto("PJSIP/3000019-0000003b", "build_interface") in new stack
    -- Goto (sub-get-device-tree,s,13)
    -- Executing [s@sub-get-device-tree:13] Set("PJSIP/3000019-0000003b", "_INTERFACE=PJSIP/3000019") in new stack
    -- Executing [s@sub-get-device-tree:14] Set("PJSIP/3000019-0000003b", "DEV_TREE=devices/PJSIP/3000019") in new stack
    -- Executing [s@sub-get-device-tree:15] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s@sub-construct-cid:6] GotoIf("PJSIP/3000019-0000003b", "0?return") in new stack
    -- Executing [s@sub-construct-cid:7] Set("PJSIP/3000019-0000003b", "_CALL_SOURCE=3000019") in new stack
    -- Executing [s@sub-construct-cid:8] Set("PJSIP/3000019-0000003b", "_CS=3000019") in new stack
    -- Executing [s@sub-construct-cid:9] ExecIf("PJSIP/3000019-0000003b", "1?Set(CALLERID(all)="3000019" <3000019>)") in new stack
    -- Executing [s@sub-construct-cid:10] Set("PJSIP/3000019-0000003b", "_CID_CONSTRUCTED=yes") in new stack
    -- Executing [s@sub-construct-cid:11] NoOp("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s@sub-construct-cid:12] Set("PJSIP/3000019-0000003b", "CDR(source)=3000019") in new stack
    -- Executing [s@sub-construct-cid:13] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s@cos-all:6] Gosub("PJSIP/3000019-0000003b", "set-global-tenant-vars,s,1") in new stack
    -- Executing [s@set-global-tenant-vars:1] NoOp("PJSIP/3000019-0000003b", "Setting Global Vars for vitalpbx Tenant") in new stack
    -- Executing [s@set-global-tenant-vars:2] Set("PJSIP/3000019-0000003b", "__TENANT_PATH=6787bde866811108") in new stack
    -- Executing [s@set-global-tenant-vars:3] Set("PJSIP/3000019-0000003b", "__TENANT_PREFIX=") in new stack
    -- Executing [s@set-global-tenant-vars:4] Set("PJSIP/3000019-0000003b", "__QUEUE_AGENTS_CONTEXT=queue-call-to-agents") in new stack
    -- Executing [s@set-global-tenant-vars:5] Set("PJSIP/3000019-0000003b", "__FOLLOWME_CONTEXT=ext-followme") in new stack
    -- Executing [s@set-global-tenant-vars:6] Set("PJSIP/3000019-0000003b", "__HINTS_CONTEXT=extension-hints") in new stack
    -- Executing [s@set-global-tenant-vars:7] Set("PJSIP/3000019-0000003b", "__DEFAULT_COS=cos-all") in new stack
    -- Executing [s@set-global-tenant-vars:8] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s@cos-all:7] GotoIf("PJSIP/3000019-0000003b", "0?local-dialing") in new stack
    -- Executing [s@cos-all:8] NoOp("PJSIP/3000019-0000003b", "Check if is an Emergency Call") in new stack
    -- Executing [s@cos-all:9] GotoIf("PJSIP/3000019-0000003b", "0?emergency-calls,333,1") in new stack
    -- Executing [s@cos-all:10] Gosub("PJSIP/3000019-0000003b", "sub-lockphone-check,s,1") in new stack
    -- Executing [s@sub-lockphone-check:1] NoOp("PJSIP/3000019-0000003b", "SUB: LOCK PHONE CHECK") in new stack
    -- Executing [s@sub-lockphone-check:2] GotoIf("PJSIP/3000019-0000003b", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:3] GotoIf("PJSIP/3000019-0000003b", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:4] GotoIf("PJSIP/3000019-0000003b", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:5] GotoIf("PJSIP/3000019-0000003b", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:6] GotoIf("PJSIP/3000019-0000003b", "0?:unlock") in new stack
    -- Goto (sub-lockphone-check,s,12)
    -- Executing [s@sub-lockphone-check:12] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s@cos-all:11] Gosub("PJSIP/3000019-0000003b", "sub-local-dialing,s,1") in new stack
    -- Executing [s@sub-local-dialing:1] NoOp("PJSIP/3000019-0000003b", "Trying to determine if is a local extension") in new stack
    -- Executing [s@sub-local-dialing:2] GotoIf("PJSIP/3000019-0000003b", "1?:return") in new stack
    -- Executing [s@sub-local-dialing:3] Set("PJSIP/3000019-0000003b", "EXTENSION_TO_DIAL=333") in new stack
    -- Executing [s@sub-local-dialing:4] Goto("PJSIP/3000019-0000003b", "333,1") in new stack
    -- Goto (sub-local-dialing,333,1)
    -- Executing [333@sub-local-dialing:1] NoOp("PJSIP/3000019-0000003b", "Dialing Local Extension") in new stack
    -- Executing [333@sub-local-dialing:2] ExecIf("PJSIP/3000019-0000003b", "0?NoCDR()") in new stack
    -- Executing [333@sub-local-dialing:3] Gosub("PJSIP/3000019-0000003b", "sub-setup-call-type,s,1(internal)") in new stack
    -- Executing [s@sub-setup-call-type:1] NoOp("PJSIP/3000019-0000003b", "Determinating Call Type") in new stack
    -- Executing [s@sub-setup-call-type:2] GotoIf("PJSIP/3000019-0000003b", "0?return") in new stack
    -- Executing [s@sub-setup-call-type:3] Gosub("PJSIP/3000019-0000003b", "s-internal,1()") in new stack
    -- Executing [s-internal@sub-setup-call-type:1] NoOp("PJSIP/3000019-0000003b", "Internal Call") in new stack
    -- Executing [s-internal@sub-setup-call-type:2] Set("PJSIP/3000019-0000003b", "__CALL_TYPE=1") in new stack
    -- Executing [s-internal@sub-setup-call-type:3] Set("PJSIP/3000019-0000003b", "__CALL_TYPE_LABEL=LOCAL") in new stack
    -- Executing [s-internal@sub-setup-call-type:4] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s@sub-setup-call-type:4] Set("PJSIP/3000019-0000003b", "__CALL_TYPE_CONFIGURED=yes") in new stack
    -- Executing [s@sub-setup-call-type:5] Set("PJSIP/3000019-0000003b", "CDR(calltype)=1") in new stack
    -- Executing [s@sub-setup-call-type:6] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [333@sub-local-dialing:4] Set("PJSIP/3000019-0000003b", "_DESTINATION_STATE=NOT_INUSE") in new stack
    -- Executing [333@sub-local-dialing:5] Set("PJSIP/3000019-0000003b", "_DESTINATION_NUMBER=333") in new stack
    -- Executing [333@sub-local-dialing:6] Set("PJSIP/3000019-0000003b", "_DESTINATION_COS_NAME=cos-all") in new stack
    -- Executing [333@sub-local-dialing:7] Gosub("PJSIP/3000019-0000003b", "sub-check-cos-privacy,s,1(cos-all,1,cos-all)") in new stack
    -- Executing [s@sub-check-cos-privacy:1] NoOp("PJSIP/3000019-0000003b", "Checking Privacy of CoS: cos-all") in new stack
    -- Executing [s@sub-check-cos-privacy:2] GotoIf("PJSIP/3000019-0000003b", "1?:no_local") in new stack
    -- Executing [s@sub-check-cos-privacy:3] Set("PJSIP/3000019-0000003b", "CALLER_COS_ID=1") in new stack
    -- Executing [s@sub-check-cos-privacy:4] Set("PJSIP/3000019-0000003b", "CALLER_COS_NAME=cos-all") in new stack
    -- Executing [s@sub-check-cos-privacy:5] Set("PJSIP/3000019-0000003b", "CALLED_COS_ID=1") in new stack
    -- Executing [s@sub-check-cos-privacy:6] GotoIf("PJSIP/3000019-0000003b", "1?same_cos") in new stack
    -- Goto (sub-check-cos-privacy,s,17)
    -- Executing [s@sub-check-cos-privacy:17] NoOp("PJSIP/3000019-0000003b", "The caller CoS and Callee CoS are the same") in new stack
    -- Executing [s@sub-check-cos-privacy:18] Goto("PJSIP/3000019-0000003b", "return") in new stack
    -- Goto (sub-check-cos-privacy,s,22)
    -- Executing [s@sub-check-cos-privacy:22] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [333@sub-local-dialing:8] Set("PJSIP/3000019-0000003b", "DIAL_STRING=PJSIP/333_1&PJSIP/333&Local/7010@cos-all") in new stack
    -- Executing [333@sub-local-dialing:9] Set("PJSIP/3000019-0000003b", "DB(6787bde866811108/LASTCALLER/333)=3000019") in new stack
    -- Executing [333@sub-local-dialing:10] Set("PJSIP/3000019-0000003b", "IGNORE_DIVERSIONS=") in new stack
    -- Executing [333@sub-local-dialing:11] Set("PJSIP/3000019-0000003b", "QUEUE_CALL=") in new stack
    -- Executing [333@sub-local-dialing:12] GosubIf("PJSIP/3000019-0000003b", "0?sub-queue-members,s,1") in new stack
    -- Executing [333@sub-local-dialing:13] GosubIf("PJSIP/3000019-0000003b", "0?:sub-check-diversions,s,1(predialing)") in new stack
    -- Executing [s@sub-check-diversions:1] NoOp("PJSIP/3000019-0000003b", "Checking diversions for extension 333") in new stack
    -- Executing [s@sub-check-diversions:2] Set("PJSIP/3000019-0000003b", "OLD_CALLER_ID="3000019" <3000019>") in new stack
    -- Executing [s@sub-check-diversions:3] GosubIf("PJSIP/3000019-0000003b", "0?:return") in new stack
    -- Executing [s@sub-check-diversions:9] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s@sub-check-diversions:4] ExecIf("PJSIP/3000019-0000003b", "0?Set(CALLERID(all)="Asmar Kahn" <333>)") in new stack
    -- Executing [s@sub-check-diversions:5] Set("PJSIP/3000019-0000003b", "__CALL_ORIGIN=diversions") in new stack
    -- Executing [s@sub-check-diversions:6] Set("PJSIP/3000019-0000003b", "__DIVERSION_ORIGIN=333") in new stack
    -- Executing [s@sub-check-diversions:7] Gosub("PJSIP/3000019-0000003b", "s-predialing,1") in new stack
    -- Executing [s-predialing@sub-check-diversions:1] NoOp("PJSIP/3000019-0000003b", "Diversions on pre-dialing") in new stack
    -- Executing [s-predialing@sub-check-diversions:2] GosubIf("PJSIP/3000019-0000003b", "0?:diversion-testing,1(Do not Disturb,DND,,,dnd)") in new stack
    -- Executing [diversion-testing@sub-check-diversions:1] NoOp("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [diversion-testing@sub-check-diversions:2] Set("PJSIP/3000019-0000003b", "FROM_NUMBER=333") in new stack
    -- Executing [diversion-testing@sub-check-diversions:3] GotoIf("PJSIP/3000019-0000003b", "0?:next-diversion") in new stack
    -- Goto (sub-check-diversions,diversion-testing,36)
    -- Executing [diversion-testing@sub-check-diversions:36] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s-predialing@sub-check-diversions:3] Gosub("PJSIP/3000019-0000003b", "diversion-testing,1(Call Forward Immeditely,CFI,,,toggle_cfi)") in new stack
    -- Executing [diversion-testing@sub-check-diversions:1] NoOp("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [diversion-testing@sub-check-diversions:2] Set("PJSIP/3000019-0000003b", "FROM_NUMBER=333") in new stack
    -- Executing [diversion-testing@sub-check-diversions:3] GotoIf("PJSIP/3000019-0000003b", "0?:next-diversion") in new stack
    -- Goto (sub-check-diversions,diversion-testing,36)
    -- Executing [diversion-testing@sub-check-diversions:36] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s-predialing@sub-check-diversions:4] GosubIf("PJSIP/3000019-0000003b", "0?:diversion-testing,1(Boss Secretray,BOSS,,,boss_secretary)") in new stack
    -- Executing [diversion-testing@sub-check-diversions:1] NoOp("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [diversion-testing@sub-check-diversions:2] Set("PJSIP/3000019-0000003b", "FROM_NUMBER=333") in new stack
    -- Executing [diversion-testing@sub-check-diversions:3] GotoIf("PJSIP/3000019-0000003b", "0?:next-diversion") in new stack
    -- Goto (sub-check-diversions,diversion-testing,36)
    -- Executing [diversion-testing@sub-check-diversions:36] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s-predialing@sub-check-diversions:5] GosubIf("PJSIP/3000019-0000003b", "0?:diversion-testing,1(Personal Assistant,PEA,sub-personal-assistant,s,1)") in new stack
    -- Executing [diversion-testing@sub-check-diversions:1] NoOp("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [diversion-testing@sub-check-diversions:2] Set("PJSIP/3000019-0000003b", "FROM_NUMBER=333") in new stack
    -- Executing [diversion-testing@sub-check-diversions:3] GotoIf("PJSIP/3000019-0000003b", "0?:next-diversion") in new stack
    -- Goto (sub-check-diversions,diversion-testing,36)
    -- Executing [diversion-testing@sub-check-diversions:36] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s-predialing@sub-check-diversions:6] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s@sub-check-diversions:8] Set("PJSIP/3000019-0000003b", "CALLERID(all)="3000019" <3000019>") in new stack
    -- Executing [s@sub-check-diversions:9] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [333@sub-local-dialing:14] GotoIf("PJSIP/3000019-0000003b", "0?post-dial") in new stack
    -- Executing [333@sub-local-dialing:15] Gosub("PJSIP/3000019-0000003b", "parse-dial-string,s,1") in new stack
    -- Executing [s@parse-dial-string:1] NoOp("PJSIP/3000019-0000003b", "Parsing dial string: PJSIP/333_1&PJSIP/333&Local/7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:2] Set("PJSIP/3000019-0000003b", "NEW_DIAL_STRING=") in new stack
    -- Executing [s@parse-dial-string:3] Set("PJSIP/3000019-0000003b", "COUNTER=1") in new stack
    -- Executing [s@parse-dial-string:4] Set("PJSIP/3000019-0000003b", "CURRENT_DEVICE=PJSIP/333_1") in new stack
    -- Executing [s@parse-dial-string:5] While("PJSIP/3000019-0000003b", "1") in new stack
    -- Executing [s@parse-dial-string:6] Set("PJSIP/3000019-0000003b", "TECHNOLOGY=PJSIP") in new stack
    -- Executing [s@parse-dial-string:7] Set("PJSIP/3000019-0000003b", "USER=333_1") in new stack
    -- Executing [s@parse-dial-string:8] GotoIf("PJSIP/3000019-0000003b", "1?:regular") in new stack
    -- Executing [s@parse-dial-string:9] Goto("PJSIP/3000019-0000003b", "regular-pjsip") in new stack
    -- Goto (parse-dial-string,s,12)
    -- Executing [s@parse-dial-string:12] Set("PJSIP/3000019-0000003b", "PARSED_DEV=PJSIP/333_1/sip:72.39.80.82:51238;transport=ws") in new stack
    -- Executing [s@parse-dial-string:13] ExecIf("PJSIP/3000019-0000003b", "0?Set(PARSED_DEV=PJSIP/333_1)") in new stack
    -- Executing [s@parse-dial-string:14] Goto("PJSIP/3000019-0000003b", "append") in new stack
    -- Goto (parse-dial-string,s,16)
    -- Executing [s@parse-dial-string:16] GotoIf("PJSIP/3000019-0000003b", "1?:concatenate") in new stack
    -- Executing [s@parse-dial-string:17] Set("PJSIP/3000019-0000003b", "NEW_DIAL_STRING=PJSIP/333_1/sip:72.39.80.82:51238;transport=ws") in new stack
    -- Executing [s@parse-dial-string:18] Goto("PJSIP/3000019-0000003b", "next") in new stack
    -- Goto (parse-dial-string,s,21)
    -- Executing [s@parse-dial-string:21] Set("PJSIP/3000019-0000003b", "COUNTER=2") in new stack
    -- Executing [s@parse-dial-string:22] Set("PJSIP/3000019-0000003b", "CURRENT_DEVICE=PJSIP/333") in new stack
    -- Executing [s@parse-dial-string:23] EndWhile("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s@parse-dial-string:5] While("PJSIP/3000019-0000003b", "1") in new stack
    -- Executing [s@parse-dial-string:6] Set("PJSIP/3000019-0000003b", "TECHNOLOGY=PJSIP") in new stack
    -- Executing [s@parse-dial-string:7] Set("PJSIP/3000019-0000003b", "USER=333") in new stack
    -- Executing [s@parse-dial-string:8] GotoIf("PJSIP/3000019-0000003b", "1?:regular") in new stack
    -- Executing [s@parse-dial-string:9] Goto("PJSIP/3000019-0000003b", "regular-pjsip") in new stack
    -- Goto (parse-dial-string,s,12)
    -- Executing [s@parse-dial-string:12] Set("PJSIP/3000019-0000003b", "PARSED_DEV=") in new stack
    -- Executing [s@parse-dial-string:13] ExecIf("PJSIP/3000019-0000003b", "1?Set(PARSED_DEV=PJSIP/333)") in new stack
    -- Executing [s@parse-dial-string:14] Goto("PJSIP/3000019-0000003b", "append") in new stack
    -- Goto (parse-dial-string,s,16)
    -- Executing [s@parse-dial-string:16] GotoIf("PJSIP/3000019-0000003b", "0?:concatenate") in new stack
    -- Goto (parse-dial-string,s,19)
    -- Executing [s@parse-dial-string:19] GotoIf("PJSIP/3000019-0000003b", "1?:next") in new stack
    -- Executing [s@parse-dial-string:20] Set("PJSIP/3000019-0000003b", "NEW_DIAL_STRING=PJSIP/333_1/sip:72.39.80.82:51238;transport=ws&PJSIP/333") in new stack
    -- Executing [s@parse-dial-string:21] Set("PJSIP/3000019-0000003b", "COUNTER=3") in new stack
    -- Executing [s@parse-dial-string:22] Set("PJSIP/3000019-0000003b", "CURRENT_DEVICE=Local/7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:23] EndWhile("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s@parse-dial-string:5] While("PJSIP/3000019-0000003b", "1") in new stack
    -- Executing [s@parse-dial-string:6] Set("PJSIP/3000019-0000003b", "TECHNOLOGY=Local") in new stack
    -- Executing [s@parse-dial-string:7] Set("PJSIP/3000019-0000003b", "USER=7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:8] GotoIf("PJSIP/3000019-0000003b", "0?:regular") in new stack
    -- Goto (parse-dial-string,s,15)
    -- Executing [s@parse-dial-string:15] Set("PJSIP/3000019-0000003b", "PARSED_DEV=Local/7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:16] GotoIf("PJSIP/3000019-0000003b", "0?:concatenate") in new stack
    -- Goto (parse-dial-string,s,19)
    -- Executing [s@parse-dial-string:19] GotoIf("PJSIP/3000019-0000003b", "1?:next") in new stack
    -- Executing [s@parse-dial-string:20] Set("PJSIP/3000019-0000003b", "NEW_DIAL_STRING=PJSIP/333_1/sip:72.39.80.82:51238;transport=ws&PJSIP/333&Local/7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:21] Set("PJSIP/3000019-0000003b", "COUNTER=4") in new stack
    -- Executing [s@parse-dial-string:22] Set("PJSIP/3000019-0000003b", "CURRENT_DEVICE=") in new stack
    -- Executing [s@parse-dial-string:23] EndWhile("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s@parse-dial-string:5] While("PJSIP/3000019-0000003b", "0") in new stack
    -- Executing [s@parse-dial-string:24] NoOp("PJSIP/3000019-0000003b", "New dialstring: PJSIP/333_1/sip:72.39.80.82:51238;transport=ws&PJSIP/333&Local/7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:25] Set("PJSIP/3000019-0000003b", "DIAL_STRING=PJSIP/333_1/sip:72.39.80.82:51238;transport=ws&PJSIP/333&Local/7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:26] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [333@sub-local-dialing:16] NoOp("PJSIP/3000019-0000003b", "Configuring Dial Settings") in new stack
    -- Executing [333@sub-local-dialing:17] Set("PJSIP/3000019-0000003b", "RING_TIME=30") in new stack
    -- Executing [333@sub-local-dialing:18] Set("PJSIP/3000019-0000003b", "RING_TIME=30") in new stack
    -- Executing [333@sub-local-dialing:19] Set("PJSIP/3000019-0000003b", "RING_TIME=30") in new stack
    -- Executing [333@sub-local-dialing:20] Set("PJSIP/3000019-0000003b", "DIAL_OPTIONS=kKtr") in new stack
    -- Executing [333@sub-local-dialing:21] Set("PJSIP/3000019-0000003b", "DIAL_OPTIONS=kKtr") in new stack
    -- Executing [333@sub-local-dialing:22] GotoIf("PJSIP/3000019-0000003b", "0?:answermode") in new stack
    -- Goto (sub-local-dialing,333,26)
    -- Executing [333@sub-local-dialing:26] Set("PJSIP/3000019-0000003b", "ANSWER_MODE=disable") in new stack
    -- Executing [333@sub-local-dialing:27] Set("PJSIP/3000019-0000003b", "ANSWER_MODE=disable") in new stack
    -- Executing [333@sub-local-dialing:28] GotoIf("PJSIP/3000019-0000003b", "0?check-hd") in new stack
    -- Executing [333@sub-local-dialing:29] ExecIf("PJSIP/3000019-0000003b", "0?Set(EXEC_AA=yes)") in new stack
    -- Executing [333@sub-local-dialing:30] ExecIf("PJSIP/3000019-0000003b", "0?Set(EXEC_AA=yes)") in new stack
    -- Executing [333@sub-local-dialing:31] Set("PJSIP/3000019-0000003b", "IS_HOT_DESK=no") in new stack
    -- Executing [333@sub-local-dialing:32] Set("PJSIP/3000019-0000003b", "MOH_CLASS=default") in new stack
    -- Executing [333@sub-local-dialing:33] GosubIf("PJSIP/3000019-0000003b", "0?sub-set-moh,s,1(default)") in new stack
    -- Executing [333@sub-local-dialing:34] GotoIf("PJSIP/3000019-0000003b", "0?busy-here") in new stack
    -- Executing [333@sub-local-dialing:35] Set("PJSIP/3000019-0000003b", "FORCE_RECORDING=no") in new stack
    -- Executing [333@sub-local-dialing:36] Set("PJSIP/3000019-0000003b", "DIAL_OPTIONS=kKtrb(sub-before-connecting-call^s^1(6787bde866811108^3000019^333^^))") in new stack
    -- Executing [333@sub-local-dialing:37] Set("PJSIP/3000019-0000003b", "DIAL_OPTIONS=kKtrb(sub-before-connecting-call^s^1(6787bde866811108^3000019^333^^))U(sub-before-bridging-call^6787bde866811108^3000019^333^no)") in new stack
    -- Executing [333@sub-local-dialing:38] Set("PJSIP/3000019-0000003b", "__TRANSFERED_CALL=TRUE") in new stack
    -- Executing [333@sub-local-dialing:39] NoOp("PJSIP/3000019-0000003b", "Enable Follow-Me Ring Time If needed") in new stack
    -- Executing [333@sub-local-dialing:40] GotoIf("PJSIP/3000019-0000003b", "0?:check-rt") in new stack
    -- Goto (sub-local-dialing,333,47)
    -- Executing [333@sub-local-dialing:47] GotoIf("PJSIP/3000019-0000003b", "0?post-dial") in new stack
    -- Executing [333@sub-local-dialing:48] GotoIf("PJSIP/3000019-0000003b", "0?end_call") in new stack
    -- Executing [333@sub-local-dialing:49] Gosub("PJSIP/3000019-0000003b", "sub-udpate-virtual-dev-state,s,1(333,BUSY)") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:1] NoOp("PJSIP/3000019-0000003b", "Update Virtual Devices State") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:2] Set("PJSIP/3000019-0000003b", "EXT_NUM=333") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:3] Set("PJSIP/3000019-0000003b", "NEW_STATUS=BUSY") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:4] Set("PJSIP/3000019-0000003b", "EXTENSION_ID=7") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:5] Set("PJSIP/3000019-0000003b", "ODBC_ID=89") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:6] GotoIf("PJSIP/3000019-0000003b", "0?no_rows") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:7] Set("PJSIP/3000019-0000003b", "COUNTER=1") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:8] While("PJSIP/3000019-0000003b", "1") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:9] Set("PJSIP/3000019-0000003b", "VDevice=33") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:10] Set("PJSIP/3000019-0000003b", "DEVICE_STATE(Custom:VirtualDev33)=BUSY") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:11] Set("PJSIP/3000019-0000003b", "COUNTER=2") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:12] EndWhile("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:8] While("PJSIP/3000019-0000003b", "0") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:13] ODBCFinish("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:14] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [333@sub-local-dialing:50] Dial("PJSIP/3000019-0000003b", "PJSIP/333_1/sip:72.39.80.82:51238;transport=ws&PJSIP/333&Local/7010@cos-all,30,kKtrb(sub-before-connecting-call^s^1(6787bde866811108^3000019^333^^))U(sub-before-bridging-call^6787bde866811108^3000019^333^no)") in new stack
[2022-08-31 00:43:03] ERROR[7806]: res_pjsip.c:4096 ast_sip_create_dialog_uac: Endpoint '333': Could not create dialog to invalid URI '333'.  Is endpoint registered and reachable?
[2022-08-31 00:43:03] ERROR[7806]: chan_pjsip.c:2657 request: Failed to create outgoing session to endpoint '333'
[2022-08-31 00:43:03] WARNING[1278][C-0000022d]: app_dial.c:2663 dial_exec_full: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)
    -- PJSIP/333_1-0000003c Internal Gosub(sub-before-connecting-call,s,1(6787bde866811108,3000019,333,,)) start
    -- Executing [s@sub-before-connecting-call:1] NoOp("PJSIP/333_1-0000003c", "Executing routines in the newly created channel before initiaing the call") in new stack
    -- Executing [s@sub-before-connecting-call:2] Set("PJSIP/333_1-0000003c", "TENANT=6787bde866811108") in new stack
    -- Executing [s@sub-before-connecting-call:3] Set("PJSIP/333_1-0000003c", "CALLER=3000019") in new stack
    -- Executing [s@sub-before-connecting-call:4] Set("PJSIP/333_1-0000003c", "CALLEE=333") in new stack
    -- Executing [s@sub-before-connecting-call:5] Set("PJSIP/333_1-0000003c", "EXEC_AA=") in new stack
    -- Executing [s@sub-before-connecting-call:6] Set("PJSIP/333_1-0000003c", "CUSTOM_ALERT_INFO=") in new stack
    -- Executing [s@sub-before-connecting-call:7] Set("PJSIP/333_1-0000003c", "APP_TYPE=NONE") in new stack
    -- Executing [s@sub-before-connecting-call:8] GosubIf("PJSIP/333_1-0000003c", "0?sub-auto-answer,s,1") in new stack
    -- Executing [s@sub-before-connecting-call:9] GosubIf("PJSIP/333_1-0000003c", "0?sub-set-custom-header,s,1(Alert-Info,)") in new stack
    -- Executing [s@sub-before-connecting-call:10] GosubIf("PJSIP/333_1-0000003c", "0?sub-set-custom-header,s,1(Call-Info,)") in new stack
    -- Executing [s@sub-before-connecting-call:11] Gosub("PJSIP/333_1-0000003c", "sub-set-custom-header,s,1(CALL-TYPE,LOCAL)") in new stack
    -- Executing [s@sub-set-custom-header:1] NoOp("PJSIP/333_1-0000003c", "Setting up custom header") in new stack
    -- Executing [s@sub-set-custom-header:2] GotoIf("PJSIP/333_1-0000003c", "0?set-sip") in new stack
    -- Executing [s@sub-set-custom-header:3] NoOp("PJSIP/333_1-0000003c", "Add PJSIP Headers") in new stack
    -- Executing [s@sub-set-custom-header:4] Set("PJSIP/333_1-0000003c", "PJSIP_HEADER(add,CALL-TYPE)=LOCAL") in new stack
    -- Executing [s@sub-set-custom-header:5] Goto("PJSIP/333_1-0000003c", "end") in new stack
    -- Goto (sub-set-custom-header,s,8)
    -- Executing [s@sub-set-custom-header:8] Return("PJSIP/333_1-0000003c", "") in new stack
    -- Executing [s@sub-before-connecting-call:12] Gosub("PJSIP/333_1-0000003c", "sub-set-custom-header,s,1(APPLICATION,NONE)") in new stack
    -- Executing [s@sub-set-custom-header:1] NoOp("PJSIP/333_1-0000003c", "Setting up custom header") in new stack
    -- Executing [s@sub-set-custom-header:2] GotoIf("PJSIP/333_1-0000003c", "0?set-sip") in new stack
    -- Executing [s@sub-set-custom-header:3] NoOp("PJSIP/333_1-0000003c", "Add PJSIP Headers") in new stack
    -- Executing [s@sub-set-custom-header:4] Set("PJSIP/333_1-0000003c", "PJSIP_HEADER(add,APPLICATION)=NONE") in new stack
    -- Executing [s@sub-set-custom-header:5] Goto("PJSIP/333_1-0000003c", "end") in new stack
    -- Goto (sub-set-custom-header,s,8)
    -- Executing [s@sub-set-custom-header:8] Return("PJSIP/333_1-0000003c", "") in new stack
    -- Executing [s@sub-before-connecting-call:13] GosubIf("PJSIP/333_1-0000003c", "0?sub-set-custom-header,s,1(QUEUE-NAME,)") in new stack
    -- Executing [s@sub-before-connecting-call:14] GosubIf("PJSIP/333_1-0000003c", "0?before-connecting-call-hook,s,1") in new stack
    -- Executing [s@sub-before-connecting-call:15] Return("PJSIP/333_1-0000003c", "") in new stack
  == Spawn extension (cos-all, 333, 1) exited non-zero on 'PJSIP/333_1-0000003c'
    -- PJSIP/333_1-0000003c Internal Gosub(sub-before-connecting-call,s,1(6787bde866811108,3000019,333,,)) complete GOSUB_RETVAL=
    -- Local/7010@cos-all-0000002c;1 Internal Gosub(sub-before-connecting-call,s,1(6787bde866811108,3000019,333,,)) start
    -- Executing [s@sub-before-connecting-call:1] NoOp("Local/7010@cos-all-0000002c;1", "Executing routines in the newly created channel before initiaing the call") in new stack
    -- Executing [s@sub-before-connecting-call:2] Set("Local/7010@cos-all-0000002c;1", "TENANT=6787bde866811108") in new stack
    -- Executing [s@sub-before-connecting-call:3] Set("Local/7010@cos-all-0000002c;1", "CALLER=3000019") in new stack
    -- Executing [s@sub-before-connecting-call:4] Set("Local/7010@cos-all-0000002c;1", "CALLEE=333") in new stack
    -- Executing [s@sub-before-connecting-call:5] Set("Local/7010@cos-all-0000002c;1", "EXEC_AA=") in new stack
    -- Executing [s@sub-before-connecting-call:6] Set("Local/7010@cos-all-0000002c;1", "CUSTOM_ALERT_INFO=") in new stack
    -- Executing [s@sub-before-connecting-call:7] Set("Local/7010@cos-all-0000002c;1", "APP_TYPE=NONE") in new stack
    -- Executing [s@sub-before-connecting-call:8] GosubIf("Local/7010@cos-all-0000002c;1", "0?sub-auto-answer,s,1") in new stack
    -- Executing [s@sub-before-connecting-call:9] GosubIf("Local/7010@cos-all-0000002c;1", "0?sub-set-custom-header,s,1(Alert-Info,)") in new stack
    -- Executing [s@sub-before-connecting-call:10] GosubIf("Local/7010@cos-all-0000002c;1", "0?sub-set-custom-header,s,1(Call-Info,)") in new stack
    -- Executing [s@sub-before-connecting-call:11] Gosub("Local/7010@cos-all-0000002c;1", "sub-set-custom-header,s,1(CALL-TYPE,LOCAL)") in new stack
    -- Executing [s@sub-set-custom-header:1] NoOp("Local/7010@cos-all-0000002c;1", "Setting up custom header") in new stack
    -- Executing [s@sub-set-custom-header:2] GotoIf("Local/7010@cos-all-0000002c;1", "0?set-sip") in new stack
    -- Executing [s@sub-set-custom-header:3] NoOp("Local/7010@cos-all-0000002c;1", "Add PJSIP Headers") in new stack
    -- Executing [s@sub-set-custom-header:4] Set("Local/7010@cos-all-0000002c;1", "PJSIP_HEADER(add,CALL-TYPE)=LOCAL") in new stack
[2022-08-31 00:43:03] ERROR[1278][C-0000022d]: res_pjsip_header_funcs.c:680 func_write_header: This function requires a PJSIP channel.
    -- Executing [s@sub-set-custom-header:5] Goto("Local/7010@cos-all-0000002c;1", "end") in new stack
    -- Goto (sub-set-custom-header,s,8)
    -- Executing [s@sub-set-custom-header:8] Return("Local/7010@cos-all-0000002c;1", "") in new stack
    -- Executing [s@sub-before-connecting-call:12] Gosub("Local/7010@cos-all-0000002c;1", "sub-set-custom-header,s,1(APPLICATION,NONE)") in new stack
    -- Executing [s@sub-set-custom-header:1] NoOp("Local/7010@cos-all-0000002c;1", "Setting up custom header") in new stack
    -- Executing [s@sub-set-custom-header:2] GotoIf("Local/7010@cos-all-0000002c;1", "0?set-sip") in new stack
    -- Executing [s@sub-set-custom-header:3] NoOp("Local/7010@cos-all-0000002c;1", "Add PJSIP Headers") in new stack
    -- Executing [s@sub-set-custom-header:4] Set("Local/7010@cos-all-0000002c;1", "PJSIP_HEADER(add,APPLICATION)=NONE") in new stack
[2022-08-31 00:43:03] ERROR[1278][C-0000022d]: res_pjsip_header_funcs.c:680 func_write_header: This function requires a PJSIP channel.
    -- Executing [s@sub-set-custom-header:5] Goto("Local/7010@cos-all-0000002c;1", "end") in new stack
    -- Goto (sub-set-custom-header,s,8)
    -- Executing [s@sub-set-custom-header:8] Return("Local/7010@cos-all-0000002c;1", "") in new stack
    -- Executing [s@sub-before-connecting-call:13] GosubIf("Local/7010@cos-all-0000002c;1", "0?sub-set-custom-header,s,1(QUEUE-NAME,)") in new stack
    -- Executing [s@sub-before-connecting-call:14] GosubIf("Local/7010@cos-all-0000002c;1", "0?before-connecting-call-hook,s,1") in new stack
    -- Executing [s@sub-before-connecting-call:15] Return("Local/7010@cos-all-0000002c;1", "") in new stack
  == Spawn extension (cos-all, 333, 1) exited non-zero on 'Local/7010@cos-all-0000002c;1'
    -- Local/7010@cos-all-0000002c;1 Internal Gosub(sub-before-connecting-call,s,1(6787bde866811108,3000019,333,,)) complete GOSUB_RETVAL=
    -- Called PJSIP/333_1/sip:72.39.80.82:51238;transport=ws
    -- Called Local/7010@cos-all
    -- Executing [7010@cos-all:1] NoOp("Local/7010@cos-all-0000002c;2", "More than on digit pattern") in new stack
    -- Executing [7010@cos-all:2] Gosub("Local/7010@cos-all-0000002c;2", "s,1(7010)") in new stack
    -- Executing [s@cos-all:1] Set("Local/7010@cos-all-0000002c;2", "EXTENSION=7010") in new stack
    -- Executing [s@cos-all:2] NoOp("Local/7010@cos-all-0000002c;2", "Dialing 7010 from 3000019") in new stack
    -- Executing [s@cos-all:3] Gosub("Local/7010@cos-all-0000002c;2", "sub-set-global-vars,s,1(6787bde866811108,7010,parking-1)") in new stack
    -- Executing [s@sub-set-global-vars:1] NoOp("Local/7010@cos-all-0000002c;2", "Setting Global Vars") in new stack
    -- Executing [s@sub-set-global-vars:2] Set("Local/7010@cos-all-0000002c;2", "TENANT_PATH=6787bde866811108") in new stack
    -- Executing [s@sub-set-global-vars:3] Set("Local/7010@cos-all-0000002c;2", "PREFIX=") in new stack
    -- Executing [s@sub-set-global-vars:4] Set("Local/7010@cos-all-0000002c;2", "__PICKUPMARK=7010") in new stack
    -- Executing [s@sub-set-global-vars:5] Set("Local/7010@cos-all-0000002c;2", "__PARKINGLOT=parking-1") in new stack
    -- Executing [s@sub-set-global-vars:6] Set("Local/7010@cos-all-0000002c;2", "__DYNAMIC_FEATURES=custom-features") in new stack
    -- Executing [s@sub-set-global-vars:7] Set("Local/7010@cos-all-0000002c;2", "ICALL=no") in new stack
    -- Executing [s@sub-set-global-vars:8] Return("Local/7010@cos-all-0000002c;2", "") in new stack
    -- Executing [s@cos-all:4] Gosub("Local/7010@cos-all-0000002c;2", "sub-set-call-vars,s,1(6787bde866811108,7010,1,cos-all,ARS-all)") in new stack
    -- Executing [s@sub-set-call-vars:1] NoOp("Local/7010@cos-all-0000002c;2", "Setting Call Vars") in new stack
    -- Executing [s@sub-set-call-vars:2] Set("Local/7010@cos-all-0000002c;2", "_TENANT=6787bde866811108") in new stack
    -- Executing [s@sub-set-call-vars:3] Set("Local/7010@cos-all-0000002c;2", "_CALL_DESTINATION=7010") in new stack
    -- Executing [s@sub-set-call-vars:4] Set("Local/7010@cos-all-0000002c;2", "_COS_ID=1") in new stack
    -- Executing [s@sub-set-call-vars:5] Set("Local/7010@cos-all-0000002c;2", "_COS_NAME=cos-all") in new stack
    -- Executing [s@sub-set-call-vars:6] Set("Local/7010@cos-all-0000002c;2", "__TRANSFER_CONTEXT=cos-all") in new stack
    -- Executing [s@sub-set-call-vars:7] Set("Local/7010@cos-all-0000002c;2", "_ARS=ARS-all") in new stack
    -- Executing [s@sub-set-call-vars:8] Set("Local/7010@cos-all-0000002c;2", "CDR(tenant)=vitalpbx") in new stack
    -- Executing [s@sub-set-call-vars:9] Set("Local/7010@cos-all-0000002c;2", "CDR(destination)=7010") in new stack
    -- Executing [s@sub-set-call-vars:10] Set("Local/7010@cos-all-0000002c;2", "CDR(trunk)=") in new stack
    -- Executing [s@sub-set-call-vars:11] Set("Local/7010@cos-all-0000002c;2", "CDR(did)=") in new stack
    -- Executing [s@sub-set-call-vars:12] Set("Local/7010@cos-all-0000002c;2", "__CALLID=1661899383.245") in new stack
    -- Executing [s@sub-set-call-vars:13] ExecIf("Local/7010@cos-all-0000002c;2", "0?Set(CHANNEL(language)=)") in new stack
    -- Executing [s@sub-set-call-vars:14] ExecIf("Local/7010@cos-all-0000002c;2", "1?Set(CHANNEL(language)=en)") in new stack
    -- Executing [s@sub-set-call-vars:15] Return("Local/7010@cos-all-0000002c;2", "") in new stack
    -- Executing [s@cos-all:5] Gosub("Local/7010@cos-all-0000002c;2", "sub-construct-cid,s,1") in new stack
    -- Executing [s@sub-construct-cid:1] NoOp("Local/7010@cos-all-0000002c;2", "Building CID") in new stack
    -- Executing [s@sub-construct-cid:2] Set("Local/7010@cos-all-0000002c;2", "_CALL_SOURCE=3000019") in new stack
    -- Executing [s@sub-construct-cid:3] Set("Local/7010@cos-all-0000002c;2", "_CS=3000019") in new stack
    -- Executing [s@sub-construct-cid:4] GotoIf("Local/7010@cos-all-0000002c;2", "1?return") in new stack
    -- Goto (sub-construct-cid,s,11)
    -- Executing [s@sub-construct-cid:11] NoOp("Local/7010@cos-all-0000002c;2", "") in new stack
    -- Executing [s@sub-construct-cid:12] Set("Local/7010@cos-all-0000002c;2", "CDR(source)=3000019") in new stack
    -- Executing [s@sub-construct-cid:13] Return("Local/7010@cos-all-0000002c;2", "") in new stack
    -- Executing [s@cos-all:6] Gosub("Local/7010@cos-all-0000002c;2", "set-global-tenant-vars,s,1") in new stack
    -- Executing [s@set-global-tenant-vars:1] NoOp("Local/7010@cos-all-0000002c;2", "Setting Global Vars for vitalpbx Tenant") in new stack
    -- Executing [s@set-global-tenant-vars:2] Set("Local/7010@cos-all-0000002c;2", "__TENANT_PATH=6787bde866811108") in new stack
    -- Executing [s@set-global-tenant-vars:3] Set("Local/7010@cos-all-0000002c;2", "__TENANT_PREFIX=") in new stack
    -- Executing [s@set-global-tenant-vars:4] Set("Local/7010@cos-all-0000002c;2", "__QUEUE_AGENTS_CONTEXT=queue-call-to-agents") in new stack
    -- Executing [s@set-global-tenant-vars:5] Set("Local/7010@cos-all-0000002c;2", "__FOLLOWME_CONTEXT=ext-followme") in new stack
    -- Executing [s@set-global-tenant-vars:6] Set("Local/7010@cos-all-0000002c;2", "__HINTS_CONTEXT=extension-hints") in new stack
    -- Executing [s@set-global-tenant-vars:7] Set("Local/7010@cos-all-0000002c;2", "__DEFAULT_COS=cos-all") in new stack
    -- Executing [s@set-global-tenant-vars:8] Return("Local/7010@cos-all-0000002c;2", "") in new stack
    -- Executing [s@cos-all:7] GotoIf("Local/7010@cos-all-0000002c;2", "0?local-dialing") in new stack
    -- Executing [s@cos-all:8] NoOp("Local/7010@cos-all-0000002c;2", "Check if is an Emergency Call") in new stack
    -- Executing [s@cos-all:9] GotoIf("Local/7010@cos-all-0000002c;2", "0?emergency-calls,7010,1") in new stack
    -- Executing [s@cos-all:10] Gosub("Local/7010@cos-all-0000002c;2", "sub-lockphone-check,s,1") in new stack
    -- Executing [s@sub-lockphone-check:1] NoOp("Local/7010@cos-all-0000002c;2", "SUB: LOCK PHONE CHECK") in new stack
    -- Executing [s@sub-lockphone-check:2] GotoIf("Local/7010@cos-all-0000002c;2", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:3] GotoIf("Local/7010@cos-all-0000002c;2", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:4] GotoIf("Local/7010@cos-all-0000002c;2", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:5] GotoIf("Local/7010@cos-all-0000002c;2", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:6] GotoIf("Local/7010@cos-all-0000002c;2", "0?:unlock") in new stack
    -- Goto (sub-lockphone-check,s,12)
    -- Executing [s@sub-lockphone-check:12] Return("Local/7010@cos-all-0000002c;2", "") in new stack
    -- Executing [s@cos-all:11] Gosub("Local/7010@cos-all-0000002c;2", "sub-local-dialing,s,1") in new stack
    -- Executing [s@sub-local-dialing:1] NoOp("Local/7010@cos-all-0000002c;2", "Trying to determine if is a local extension") in new stack
    -- Executing [s@sub-local-dialing:2] GotoIf("Local/7010@cos-all-0000002c;2", "0?:return") in new stack
    -- Goto (sub-local-dialing,s,5)
    -- Executing [s@sub-local-dialing:5] Return("Local/7010@cos-all-0000002c;2", "") in new stack
    -- Executing [s@cos-all:12] GotoIf("Local/7010@cos-all-0000002c;2", "0?end-call") in new stack
    -- Executing [s@cos-all:13] Goto("Local/7010@cos-all-0000002c;2", "cos-all-post,7010,1") in new stack
    -- Goto (cos-all-post,7010,1)
    -- Executing [7010@cos-all-post:1] Gosub("Local/7010@cos-all-0000002c;2", "sub-set-call-vars,app-incoming,1") in new stack
    -- Executing [app-incoming@sub-set-call-vars:1] NoOp("Local/7010@cos-all-0000002c;2", "Incoming Call App CDR") in new stack
    -- Executing [app-incoming@sub-set-call-vars:2] GotoIf("Local/7010@cos-all-0000002c;2", "0?:return") in new stack
    -- Goto (sub-set-call-vars,app-incoming,6)
    -- Executing [app-incoming@sub-set-call-vars:6] Return("Local/7010@cos-all-0000002c;2", "") in new stack
    -- Executing [7010@cos-all-post:2] NoOp("Local/7010@cos-all-0000002c;2", "Custom Application: GLPI-notify-OPS") in new stack
    -- Executing [7010@cos-all-post:3] Goto("Local/7010@cos-all-0000002c;2", "custom-contexts,cc-6,1") in new stack
    -- Goto (custom-contexts,cc-6,1)
    -- Executing [cc-6@custom-contexts:1] NoOp("Local/7010@cos-all-0000002c;2", "GLPI-notify-OPS") in new stack
    -- Executing [cc-6@custom-contexts:2] Gosub("Local/7010@cos-all-0000002c;2", "GLPI-notify-OPS,GLPI-Support,1(app-termination,hangup,1)") in new stack
[2022-08-31 00:43:03] ERROR[1279][C-0000022d]: app_stack.c:593 gosub_exec: Gosub attempted to reach non-existent destination 'GLPI-notify-OPS,GLPI-Support,1' from 'custom-contexts,cc-6,2'
  == Spawn extension (custom-contexts, cc-6, 2) exited non-zero on 'Local/7010@cos-all-0000002c;2'
  == DTLS ECDH initialized (automatic), faster PFS enabled
    -- PJSIP/333_1-0000003c connected line has changed. Saving it until answer for PJSIP/3000019-0000003b
    -- PJSIP/333_1-0000003c is ringing
       > 0x7f9f74035230 -- Strict RTP learning after remote address set to: 72.39.80.82:60908
    -- PJSIP/333_1-0000003c answered PJSIP/3000019-0000003b
    -- PJSIP/333_1-0000003c Internal Gosub(sub-before-bridging-call,s,1(6787bde866811108,3000019,333,no)) start
    -- Executing [s@sub-before-bridging-call:1] NoOp("PJSIP/333_1-0000003c", "Executing sub-routine before connecting to the calling channel") in new stack
    -- Executing [s@sub-before-bridging-call:2] Set("PJSIP/333_1-0000003c", "TENANT=6787bde866811108") in new stack
    -- Executing [s@sub-before-bridging-call:3] Set("PJSIP/333_1-0000003c", "CALLER=3000019") in new stack
    -- Executing [s@sub-before-bridging-call:4] Set("PJSIP/333_1-0000003c", "CALLEE=333") in new stack
    -- Executing [s@sub-before-bridging-call:5] Set("PJSIP/333_1-0000003c", "FORCE_CALL_RECORDING=no") in new stack
    -- Executing [s@sub-before-bridging-call:6] NoOp("PJSIP/333_1-0000003c", "Check if the follow-me confirmation sub-routine needs to be executed") in new stack
    -- Executing [s@sub-before-bridging-call:7] GotoIf("PJSIP/333_1-0000003c", "1?call-recording") in new stack
    -- Goto (sub-before-bridging-call,s,9)
    -- Executing [s@sub-before-bridging-call:9] NoOp("PJSIP/333_1-0000003c", "Executing the call-recording sub-routine") in new stack
    -- Executing [s@sub-before-bridging-call:10] Gosub("PJSIP/333_1-0000003c", "sub-call-recording,s,1(6787bde866811108,3000019,333,no)") in new stack
    -- Executing [s@sub-call-recording:1] NoOp("PJSIP/333_1-0000003c", "Check if call will be recorded on tenant 6787bde866811108") in new stack
    -- Executing [s@sub-call-recording:2] NoOp("PJSIP/333_1-0000003c", "Call Type: 1 ") in new stack
    -- Executing [s@sub-call-recording:3] Set("PJSIP/333_1-0000003c", "TENANT=6787bde866811108") in new stack
    -- Executing [s@sub-call-recording:4] Set("PJSIP/333_1-0000003c", "CALLER=3000019") in new stack
    -- Executing [s@sub-call-recording:5] Set("PJSIP/333_1-0000003c", "CALLEE=333") in new stack
    -- Executing [s@sub-call-recording:6] Set("PJSIP/333_1-0000003c", "APP_FORCE=no") in new stack
    -- Executing [s@sub-call-recording:7] GotoIf("PJSIP/333_1-0000003c", "1?:rec_no_available") in new stack
    -- Executing [s@sub-call-recording:8] GotoIf("PJSIP/333_1-0000003c", "0?perform-recording") in new stack
    -- Executing [s@sub-call-recording:9] GotoIf("PJSIP/333_1-0000003c", "1?perform-recording") in new stack
    -- Goto (sub-call-recording,s,14)
    -- Executing [s@sub-call-recording:14] Gosub("PJSIP/333_1-0000003c", "sub-perform-recording,s,1") in new stack
    -- Executing [s@sub-perform-recording:1] NoOp("PJSIP/333_1-0000003c", "Perform Call Recording") in new stack
    -- Executing [s@sub-perform-recording:2] Set("PJSIP/333_1-0000003c", "RECORDING_ID=1661899383.243") in new stack
    -- Executing [s@sub-perform-recording:3] Set("PJSIP/333_1-0000003c", "APP_TYPE=NONE") in new stack
    -- Executing [s@sub-perform-recording:4] Set("PJSIP/333_1-0000003c", "AUDIO_FILE=004308-LOCAL-NONE-3000019-333-1661899383.243") in new stack
    -- Executing [s@sub-perform-recording:5] Set("PJSIP/333_1-0000003c", "RECORDING_FORMAT=wav") in new stack
    -- Executing [s@sub-perform-recording:6] Set("PJSIP/333_1-0000003c", "__REC_FILENAME=/var/spool/asterisk/monitor/2022/08/31/004308-LOCAL-NONE-3000019-333-1661899383.243.wav") in new stack
    -- Executing [s@sub-perform-recording:7] GotoIf("PJSIP/333_1-0000003c", "0?:set_rec_file") in new stack
    -- Goto (sub-perform-recording,s,10)
    -- Executing [s@sub-perform-recording:10] Set("PJSIP/333_1-0000003c", "CDR(recfile)=/var/spool/asterisk/monitor/2022/08/31/004308-LOCAL-NONE-3000019-333-1661899383.243.wav") in new stack
    -- Executing [s@sub-perform-recording:11] MixMonitor("PJSIP/333_1-0000003c", "/var/spool/asterisk/monitor/2022/08/31/004308-LOCAL-NONE-3000019-333-1661899383.243.wav,b,") in new stack
    -- Executing [s@sub-perform-recording:12] Return("PJSIP/333_1-0000003c", "") in new stack
    -- Executing [s@sub-call-recording:15] Goto("PJSIP/333_1-0000003c", "return") in new stack
    -- Goto (sub-call-recording,s,17)
    -- Executing [s@sub-call-recording:17] Return("PJSIP/333_1-0000003c", "") in new stack
    -- Executing [s@sub-before-bridging-call:11] NoOp("PJSIP/333_1-0000003c", "Check if there's a custom sub-routine defined for executing it") in new stack
    -- Executing [s@sub-before-bridging-call:12] GosubIf("PJSIP/333_1-0000003c", "0?before-bridging-call-hook,s,1") in new stack
    -- Executing [s@sub-before-bridging-call:13] Return("PJSIP/333_1-0000003c", "") in new stack
  == Spawn extension (cos-all, , 1) exited non-zero on 'PJSIP/333_1-0000003c'
    -- PJSIP/333_1-0000003c Internal Gosub(sub-before-bridging-call,s,1(6787bde866811108,3000019,333,no)) complete GOSUB_RETVAL=
  == Begin MixMonitor Recording PJSIP/333_1-0000003c
       > 0x7f9fd0009670 -- Strict RTP learning after remote address set to: 192.168.1.18:5028
    -- Channel PJSIP/333_1-0000003c joined 'simple_bridge' basic-bridge <84563cd7-e067-403d-a1b6-6ef7a7593272>
    -- Channel PJSIP/3000019-0000003b joined 'simple_bridge' basic-bridge <84563cd7-e067-403d-a1b6-6ef7a7593272>
       > 0x7f9f74035230 -- Strict RTP learning after ICE completion
       > 0x7f9f74035230 -- Strict RTP learning after remote address set to: 72.39.80.82:60908
[2022-08-31 00:43:09] ERROR[25237]: res_pjsip_outbound_authenticator_digest.c:450 digest_create_request_with_auth: Host: '145.239.255.24:5061': There were no auth ids available
       > 0x7f9fd0009670 -- Strict RTP qualifying stream type: audio
       > 0x7f9fd0009670 -- Strict RTP switching source address to 72.39.80.82:5028
       > 0x7f9f74035230 -- Strict RTP switching to RTP target address 72.39.80.82:60908 as source
    -- Channel PJSIP/333_1-0000003c left 'simple_bridge' basic-bridge <84563cd7-e067-403d-a1b6-6ef7a7593272>
    -- Channel PJSIP/3000019-0000003b left 'simple_bridge' basic-bridge <84563cd7-e067-403d-a1b6-6ef7a7593272>
  == Spawn extension (sub-local-dialing, 333, 50) exited non-zero on 'PJSIP/3000019-0000003b'
    -- Executing [h@sub-local-dialing:1] NoOp("PJSIP/3000019-0000003b", "Finishing the call") in new stack
    -- Executing [h@sub-local-dialing:2] Gosub("PJSIP/3000019-0000003b", "sub-udpate-virtual-dev-state,s,1(333,NOT_INUSE)") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:1] NoOp("PJSIP/3000019-0000003b", "Update Virtual Devices State") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:2] Set("PJSIP/3000019-0000003b", "EXT_NUM=333") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:3] Set("PJSIP/3000019-0000003b", "NEW_STATUS=NOT_INUSE") in new stack
  == MixMonitor close filestream (mixed)
  == End MixMonitor Recording PJSIP/333_1-0000003c
    -- Executing [s@sub-udpate-virtual-dev-state:4] Set("PJSIP/3000019-0000003b", "EXTENSION_ID=7") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:5] Set("PJSIP/3000019-0000003b", "ODBC_ID=90") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:6] GotoIf("PJSIP/3000019-0000003b", "0?no_rows") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:7] Set("PJSIP/3000019-0000003b", "COUNTER=1") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:8] While("PJSIP/3000019-0000003b", "1") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:9] Set("PJSIP/3000019-0000003b", "VDevice=33") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:10] Set("PJSIP/3000019-0000003b", "DEVICE_STATE(Custom:VirtualDev33)=NOT_INUSE") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:11] Set("PJSIP/3000019-0000003b", "COUNTER=2") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:12] EndWhile("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:8] While("PJSIP/3000019-0000003b", "0") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:13] ODBCFinish("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:14] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [h@sub-local-dialing:3] GosubIf("PJSIP/3000019-0000003b", "0?dynamic-routing-connected,s,1(ANSWER,3000019)") in new stack
    -- Executing [h@sub-local-dialing:4] GotoIf("PJSIP/3000019-0000003b", "0?call_ended") in new stack
    -- Executing [h@sub-local-dialing:5] GosubIf("PJSIP/3000019-0000003b", "0?wake-up-no-answered,s,1") in new stack
    -- Executing [h@sub-local-dialing:6] Gosub("PJSIP/3000019-0000003b", "sub-call-completion-check,s,1") in new stack
    -- Executing [s@sub-call-completion-check:1] NoOp("PJSIP/3000019-0000003b", "FEATURE: CALL COMPLETION CHECK") in new stack
    -- Executing [s@sub-call-completion-check:2] Set("PJSIP/3000019-0000003b", "CC_MODE=none") in new stack
    -- Executing [s@sub-call-completion-check:3] Set("PJSIP/3000019-0000003b", "CC_MODE=none") in new stack
    -- Executing [s@sub-call-completion-check:4] Set("PJSIP/3000019-0000003b", "CC_MODE=none") in new stack
    -- Executing [s@sub-call-completion-check:5] GotoIf("PJSIP/3000019-0000003b", "1?end") in new stack
    -- Goto (sub-call-completion-check,s,17)
    -- Executing [s@sub-call-completion-check:17] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [h@sub-local-dialing:7] NoOp("PJSIP/3000019-0000003b", "Call ended") in new stack
    -- Executing [h@sub-local-dialing:8] Gosub("PJSIP/3000019-0000003b", "notify-call-hangup,s,1") in new stack
    -- Executing [s@notify-call-hangup:1] Verbose("PJSIP/3000019-0000003b", "0, Extension Hangup") in new stack
 Extension Hangup
    -- Executing [s@notify-call-hangup:2] GotoIf("PJSIP/3000019-0000003b", "1?:incoming") in new stack
    -- Executing [s@notify-call-hangup:3] UserEvent("PJSIP/3000019-0000003b", ""EXTENSIONS_SUMMARY","Data: EXT_TO_EXT,PJSIP/3000019-0000001v,PJSIP/333_1-0000003c,LOCAL"") in new stack
    -- Executing [s@notify-call-hangup:4] Goto("PJSIP/3000019-0000003b", "end") in new stack
    -- Goto (notify-call-hangup,s,7)
    -- Executing [s@notify-call-hangup:7] Return("PJSIP/3000019-0000003b", "") in new stack
    -- Executing [h@sub-local-dialing:9] Hangup("PJSIP/3000019-0000003b", "") in new stack
  == Spawn extension (sub-local-dialing, h, 9) exited non-zero on 'PJSIP/3000019-0000003b'

It doesn’t look like it was dialed using a dial profile that has this U option.

Can please share a screenshot of the modified dial profile?

image

image

I have to use like this ?

image
image
image

Hi,
I am trying the same way you have described
Thanks.

image
image
image

Can you please share a call trace now? Via pastebin, PLEASE.

EXT 3000019 to Ext 333 (with answer)

============================================
Connected to Asterisk 18.10.0 currently running on phone (pid = 1376)
[2022-08-31 16:13:09] ERROR[25237]: res_pjsip_outbound_authenticator_digest.c:450 digest_create_request_with_auth: Host: '145.239.255.24:5061': There were no auth ids available
  == WebSocket connection from '72.39.80.82:64675' for protocol 'sip' accepted using version '13'
    -- Added contact 'sip:72.39.80.82:64675;transport=ws' to AOR '333_1' with expiration of 7200 seconds
  == Endpoint 333_1 is now Reachable
    -- Contact 333_1/sip:72.39.80.82:64675;transport=ws is now Reachable.  RTT: 153.761 msec
    -- Executing [333@cos-all:1] NoOp("PJSIP/3000019-000000d8", "More than on digit pattern") in new stack
    -- Executing [333@cos-all:2] Gosub("PJSIP/3000019-000000d8", "s,1(333)") in new stack
    -- Executing [s@cos-all:1] Set("PJSIP/3000019-000000d8", "EXTENSION=333") in new stack
    -- Executing [s@cos-all:2] NoOp("PJSIP/3000019-000000d8", "Dialing 333 from 3000019") in new stack
    -- Executing [s@cos-all:3] Gosub("PJSIP/3000019-000000d8", "sub-set-global-vars,s,1(6787bde866811108,333,parking-1)") in new stack
    -- Executing [s@sub-set-global-vars:1] NoOp("PJSIP/3000019-000000d8", "Setting Global Vars") in new stack
    -- Executing [s@sub-set-global-vars:2] Set("PJSIP/3000019-000000d8", "TENANT_PATH=6787bde866811108") in new stack
    -- Executing [s@sub-set-global-vars:3] Set("PJSIP/3000019-000000d8", "PREFIX=") in new stack
    -- Executing [s@sub-set-global-vars:4] Set("PJSIP/3000019-000000d8", "__PICKUPMARK=333") in new stack
    -- Executing [s@sub-set-global-vars:5] Set("PJSIP/3000019-000000d8", "__PARKINGLOT=parking-1") in new stack
    -- Executing [s@sub-set-global-vars:6] Set("PJSIP/3000019-000000d8", "__DYNAMIC_FEATURES=custom-features") in new stack
    -- Executing [s@sub-set-global-vars:7] Set("PJSIP/3000019-000000d8", "ICALL=no") in new stack
    -- Executing [s@sub-set-global-vars:8] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s@cos-all:4] Gosub("PJSIP/3000019-000000d8", "sub-set-call-vars,s,1(6787bde866811108,333,1,cos-all,ARS-all)") in new stack
    -- Executing [s@sub-set-call-vars:1] NoOp("PJSIP/3000019-000000d8", "Setting Call Vars") in new stack
    -- Executing [s@sub-set-call-vars:2] Set("PJSIP/3000019-000000d8", "_TENANT=6787bde866811108") in new stack
    -- Executing [s@sub-set-call-vars:3] Set("PJSIP/3000019-000000d8", "_CALL_DESTINATION=333") in new stack
    -- Executing [s@sub-set-call-vars:4] Set("PJSIP/3000019-000000d8", "_COS_ID=1") in new stack
    -- Executing [s@sub-set-call-vars:5] Set("PJSIP/3000019-000000d8", "_COS_NAME=cos-all") in new stack
    -- Executing [s@sub-set-call-vars:6] Set("PJSIP/3000019-000000d8", "__TRANSFER_CONTEXT=cos-all") in new stack
    -- Executing [s@sub-set-call-vars:7] Set("PJSIP/3000019-000000d8", "_ARS=ARS-all") in new stack
    -- Executing [s@sub-set-call-vars:8] Set("PJSIP/3000019-000000d8", "CDR(tenant)=vitalpbx") in new stack
    -- Executing [s@sub-set-call-vars:9] Set("PJSIP/3000019-000000d8", "CDR(destination)=333") in new stack
    -- Executing [s@sub-set-call-vars:10] Set("PJSIP/3000019-000000d8", "CDR(trunk)=") in new stack
    -- Executing [s@sub-set-call-vars:11] Set("PJSIP/3000019-000000d8", "CDR(did)=") in new stack
    -- Executing [s@sub-set-call-vars:12] Set("PJSIP/3000019-000000d8", "__CALLID=1661955205.960") in new stack
    -- Executing [s@sub-set-call-vars:13] ExecIf("PJSIP/3000019-000000d8", "0?Set(CHANNEL(language)=)") in new stack
    -- Executing [s@sub-set-call-vars:14] ExecIf("PJSIP/3000019-000000d8", "0?Set(CHANNEL(language)=)") in new stack
    -- Executing [s@sub-set-call-vars:15] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s@cos-all:5] Gosub("PJSIP/3000019-000000d8", "sub-construct-cid,s,1") in new stack
    -- Executing [s@sub-construct-cid:1] NoOp("PJSIP/3000019-000000d8", "Building CID") in new stack
    -- Executing [s@sub-construct-cid:2] Set("PJSIP/3000019-000000d8", "_CALL_SOURCE=3000019") in new stack
    -- Executing [s@sub-construct-cid:3] Set("PJSIP/3000019-000000d8", "_CS=3000019") in new stack
    -- Executing [s@sub-construct-cid:4] GotoIf("PJSIP/3000019-000000d8", "0?return") in new stack
    -- Executing [s@sub-construct-cid:5] Gosub("PJSIP/3000019-000000d8", "sub-get-device-tree,s,1") in new stack
    -- Executing [s@sub-get-device-tree:1] NoOp("PJSIP/3000019-000000d8", "Configuring Device Tree") in new stack
    -- Executing [s@sub-get-device-tree:2] Set("PJSIP/3000019-000000d8", "DEV_TECHNOLOGY=PJSIP") in new stack
    -- Executing [s@sub-get-device-tree:3] GosubIf("PJSIP/3000019-000000d8", "0?s-local,1") in new stack
    -- Executing [s@sub-get-device-tree:4] GotoIf("PJSIP/3000019-000000d8", "0?return") in new stack
    -- Executing [s@sub-get-device-tree:5] GotoIf("PJSIP/3000019-000000d8", "1?pjsip") in new stack
    -- Goto (sub-get-device-tree,s,9)
    -- Executing [s@sub-get-device-tree:9] NoOp("PJSIP/3000019-000000d8", "A PJSIP") in new stack
    -- Executing [s@sub-get-device-tree:10] Set("PJSIP/3000019-000000d8", "DEV_USER=3000019") in new stack
    -- Executing [s@sub-get-device-tree:11] Goto("PJSIP/3000019-000000d8", "build_interface") in new stack
    -- Goto (sub-get-device-tree,s,13)
    -- Executing [s@sub-get-device-tree:13] Set("PJSIP/3000019-000000d8", "_INTERFACE=PJSIP/3000019") in new stack
    -- Executing [s@sub-get-device-tree:14] Set("PJSIP/3000019-000000d8", "DEV_TREE=devices/PJSIP/3000019") in new stack
    -- Executing [s@sub-get-device-tree:15] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s@sub-construct-cid:6] GotoIf("PJSIP/3000019-000000d8", "0?return") in new stack
    -- Executing [s@sub-construct-cid:7] Set("PJSIP/3000019-000000d8", "_CALL_SOURCE=3000019") in new stack
    -- Executing [s@sub-construct-cid:8] Set("PJSIP/3000019-000000d8", "_CS=3000019") in new stack
    -- Executing [s@sub-construct-cid:9] ExecIf("PJSIP/3000019-000000d8", "1?Set(CALLERID(all)="3000019" <3000019>)") in new stack
    -- Executing [s@sub-construct-cid:10] Set("PJSIP/3000019-000000d8", "_CID_CONSTRUCTED=yes") in new stack
    -- Executing [s@sub-construct-cid:11] NoOp("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s@sub-construct-cid:12] Set("PJSIP/3000019-000000d8", "CDR(source)=3000019") in new stack
    -- Executing [s@sub-construct-cid:13] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s@cos-all:6] Gosub("PJSIP/3000019-000000d8", "set-global-tenant-vars,s,1") in new stack
    -- Executing [s@set-global-tenant-vars:1] NoOp("PJSIP/3000019-000000d8", "Setting Global Vars for vitalpbx Tenant") in new stack
    -- Executing [s@set-global-tenant-vars:2] Set("PJSIP/3000019-000000d8", "__TENANT_PATH=6787bde866811108") in new stack
    -- Executing [s@set-global-tenant-vars:3] Set("PJSIP/3000019-000000d8", "__TENANT_PREFIX=") in new stack
    -- Executing [s@set-global-tenant-vars:4] Set("PJSIP/3000019-000000d8", "__QUEUE_AGENTS_CONTEXT=queue-call-to-agents") in new stack
    -- Executing [s@set-global-tenant-vars:5] Set("PJSIP/3000019-000000d8", "__FOLLOWME_CONTEXT=ext-followme") in new stack
    -- Executing [s@set-global-tenant-vars:6] Set("PJSIP/3000019-000000d8", "__HINTS_CONTEXT=extension-hints") in new stack
    -- Executing [s@set-global-tenant-vars:7] Set("PJSIP/3000019-000000d8", "__DEFAULT_COS=cos-all") in new stack
    -- Executing [s@set-global-tenant-vars:8] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s@cos-all:7] GotoIf("PJSIP/3000019-000000d8", "0?local-dialing") in new stack
    -- Executing [s@cos-all:8] NoOp("PJSIP/3000019-000000d8", "Check if is an Emergency Call") in new stack
    -- Executing [s@cos-all:9] GotoIf("PJSIP/3000019-000000d8", "0?emergency-calls,333,1") in new stack
    -- Executing [s@cos-all:10] Gosub("PJSIP/3000019-000000d8", "sub-lockphone-check,s,1") in new stack
    -- Executing [s@sub-lockphone-check:1] NoOp("PJSIP/3000019-000000d8", "SUB: LOCK PHONE CHECK") in new stack
    -- Executing [s@sub-lockphone-check:2] GotoIf("PJSIP/3000019-000000d8", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:3] GotoIf("PJSIP/3000019-000000d8", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:4] GotoIf("PJSIP/3000019-000000d8", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:5] GotoIf("PJSIP/3000019-000000d8", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:6] GotoIf("PJSIP/3000019-000000d8", "0?:unlock") in new stack
    -- Goto (sub-lockphone-check,s,12)
    -- Executing [s@sub-lockphone-check:12] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s@cos-all:11] Gosub("PJSIP/3000019-000000d8", "sub-local-dialing,s,1") in new stack
    -- Executing [s@sub-local-dialing:1] NoOp("PJSIP/3000019-000000d8", "Trying to determine if is a local extension") in new stack
    -- Executing [s@sub-local-dialing:2] GotoIf("PJSIP/3000019-000000d8", "1?:return") in new stack
    -- Executing [s@sub-local-dialing:3] Set("PJSIP/3000019-000000d8", "EXTENSION_TO_DIAL=333") in new stack
    -- Executing [s@sub-local-dialing:4] Goto("PJSIP/3000019-000000d8", "333,1") in new stack
    -- Goto (sub-local-dialing,333,1)
    -- Executing [333@sub-local-dialing:1] NoOp("PJSIP/3000019-000000d8", "Dialing Local Extension") in new stack
    -- Executing [333@sub-local-dialing:2] ExecIf("PJSIP/3000019-000000d8", "0?NoCDR()") in new stack
    -- Executing [333@sub-local-dialing:3] Gosub("PJSIP/3000019-000000d8", "sub-setup-call-type,s,1(internal)") in new stack
    -- Executing [s@sub-setup-call-type:1] NoOp("PJSIP/3000019-000000d8", "Determinating Call Type") in new stack
    -- Executing [s@sub-setup-call-type:2] GotoIf("PJSIP/3000019-000000d8", "0?return") in new stack
    -- Executing [s@sub-setup-call-type:3] Gosub("PJSIP/3000019-000000d8", "s-internal,1()") in new stack
    -- Executing [s-internal@sub-setup-call-type:1] NoOp("PJSIP/3000019-000000d8", "Internal Call") in new stack
    -- Executing [s-internal@sub-setup-call-type:2] Set("PJSIP/3000019-000000d8", "__CALL_TYPE=1") in new stack
    -- Executing [s-internal@sub-setup-call-type:3] Set("PJSIP/3000019-000000d8", "__CALL_TYPE_LABEL=LOCAL") in new stack
    -- Executing [s-internal@sub-setup-call-type:4] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s@sub-setup-call-type:4] Set("PJSIP/3000019-000000d8", "__CALL_TYPE_CONFIGURED=yes") in new stack
    -- Executing [s@sub-setup-call-type:5] Set("PJSIP/3000019-000000d8", "CDR(calltype)=1") in new stack
    -- Executing [s@sub-setup-call-type:6] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [333@sub-local-dialing:4] Set("PJSIP/3000019-000000d8", "_DESTINATION_STATE=NOT_INUSE") in new stack
    -- Executing [333@sub-local-dialing:5] Set("PJSIP/3000019-000000d8", "_DESTINATION_NUMBER=333") in new stack
    -- Executing [333@sub-local-dialing:6] Set("PJSIP/3000019-000000d8", "_DESTINATION_COS_NAME=cos-all") in new stack
    -- Executing [333@sub-local-dialing:7] Gosub("PJSIP/3000019-000000d8", "sub-check-cos-privacy,s,1(cos-all,1,cos-all)") in new stack
    -- Executing [s@sub-check-cos-privacy:1] NoOp("PJSIP/3000019-000000d8", "Checking Privacy of CoS: cos-all") in new stack
    -- Executing [s@sub-check-cos-privacy:2] GotoIf("PJSIP/3000019-000000d8", "1?:no_local") in new stack
    -- Executing [s@sub-check-cos-privacy:3] Set("PJSIP/3000019-000000d8", "CALLER_COS_ID=1") in new stack
    -- Executing [s@sub-check-cos-privacy:4] Set("PJSIP/3000019-000000d8", "CALLER_COS_NAME=cos-all") in new stack
    -- Executing [s@sub-check-cos-privacy:5] Set("PJSIP/3000019-000000d8", "CALLED_COS_ID=1") in new stack
    -- Executing [s@sub-check-cos-privacy:6] GotoIf("PJSIP/3000019-000000d8", "1?same_cos") in new stack
    -- Goto (sub-check-cos-privacy,s,17)
    -- Executing [s@sub-check-cos-privacy:17] NoOp("PJSIP/3000019-000000d8", "The caller CoS and Callee CoS are the same") in new stack
    -- Executing [s@sub-check-cos-privacy:18] Goto("PJSIP/3000019-000000d8", "return") in new stack
    -- Goto (sub-check-cos-privacy,s,22)
    -- Executing [s@sub-check-cos-privacy:22] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [333@sub-local-dialing:8] Set("PJSIP/3000019-000000d8", "DIAL_STRING=PJSIP/333_1&PJSIP/333&Local/7010@cos-all") in new stack
    -- Executing [333@sub-local-dialing:9] Set("PJSIP/3000019-000000d8", "DB(6787bde866811108/LASTCALLER/333)=3000019") in new stack
    -- Executing [333@sub-local-dialing:10] Set("PJSIP/3000019-000000d8", "IGNORE_DIVERSIONS=") in new stack
    -- Executing [333@sub-local-dialing:11] Set("PJSIP/3000019-000000d8", "QUEUE_CALL=") in new stack
    -- Executing [333@sub-local-dialing:12] GosubIf("PJSIP/3000019-000000d8", "0?sub-queue-members,s,1") in new stack
    -- Executing [333@sub-local-dialing:13] GosubIf("PJSIP/3000019-000000d8", "0?:sub-check-diversions,s,1(predialing)") in new stack
    -- Executing [s@sub-check-diversions:1] NoOp("PJSIP/3000019-000000d8", "Checking diversions for extension 333") in new stack
    -- Executing [s@sub-check-diversions:2] Set("PJSIP/3000019-000000d8", "OLD_CALLER_ID="3000019" <3000019>") in new stack
    -- Executing [s@sub-check-diversions:3] GosubIf("PJSIP/3000019-000000d8", "0?:return") in new stack
    -- Executing [s@sub-check-diversions:9] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s@sub-check-diversions:4] ExecIf("PJSIP/3000019-000000d8", "0?Set(CALLERID(all)="Asmar Kahn" <333>)") in new stack
    -- Executing [s@sub-check-diversions:5] Set("PJSIP/3000019-000000d8", "__CALL_ORIGIN=diversions") in new stack
    -- Executing [s@sub-check-diversions:6] Set("PJSIP/3000019-000000d8", "__DIVERSION_ORIGIN=333") in new stack
    -- Executing [s@sub-check-diversions:7] Gosub("PJSIP/3000019-000000d8", "s-predialing,1") in new stack
    -- Executing [s-predialing@sub-check-diversions:1] NoOp("PJSIP/3000019-000000d8", "Diversions on pre-dialing") in new stack
    -- Executing [s-predialing@sub-check-diversions:2] GosubIf("PJSIP/3000019-000000d8", "0?:diversion-testing,1(Do not Disturb,DND,,,dnd)") in new stack
    -- Executing [diversion-testing@sub-check-diversions:1] NoOp("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [diversion-testing@sub-check-diversions:2] Set("PJSIP/3000019-000000d8", "FROM_NUMBER=333") in new stack
    -- Executing [diversion-testing@sub-check-diversions:3] GotoIf("PJSIP/3000019-000000d8", "0?:next-diversion") in new stack
    -- Goto (sub-check-diversions,diversion-testing,36)
    -- Executing [diversion-testing@sub-check-diversions:36] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s-predialing@sub-check-diversions:3] Gosub("PJSIP/3000019-000000d8", "diversion-testing,1(Call Forward Immeditely,CFI,,,toggle_cfi)") in new stack
    -- Executing [diversion-testing@sub-check-diversions:1] NoOp("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [diversion-testing@sub-check-diversions:2] Set("PJSIP/3000019-000000d8", "FROM_NUMBER=333") in new stack
    -- Executing [diversion-testing@sub-check-diversions:3] GotoIf("PJSIP/3000019-000000d8", "0?:next-diversion") in new stack
    -- Goto (sub-check-diversions,diversion-testing,36)
    -- Executing [diversion-testing@sub-check-diversions:36] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s-predialing@sub-check-diversions:4] GosubIf("PJSIP/3000019-000000d8", "0?:diversion-testing,1(Boss Secretray,BOSS,,,boss_secretary)") in new stack
    -- Executing [diversion-testing@sub-check-diversions:1] NoOp("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [diversion-testing@sub-check-diversions:2] Set("PJSIP/3000019-000000d8", "FROM_NUMBER=333") in new stack
    -- Executing [diversion-testing@sub-check-diversions:3] GotoIf("PJSIP/3000019-000000d8", "0?:next-diversion") in new stack
    -- Goto (sub-check-diversions,diversion-testing,36)
    -- Executing [diversion-testing@sub-check-diversions:36] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s-predialing@sub-check-diversions:5] GosubIf("PJSIP/3000019-000000d8", "0?:diversion-testing,1(Personal Assistant,PEA,sub-personal-assistant,s,1)") in new stack
    -- Executing [diversion-testing@sub-check-diversions:1] NoOp("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [diversion-testing@sub-check-diversions:2] Set("PJSIP/3000019-000000d8", "FROM_NUMBER=333") in new stack
    -- Executing [diversion-testing@sub-check-diversions:3] GotoIf("PJSIP/3000019-000000d8", "0?:next-diversion") in new stack
    -- Goto (sub-check-diversions,diversion-testing,36)
    -- Executing [diversion-testing@sub-check-diversions:36] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s-predialing@sub-check-diversions:6] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s@sub-check-diversions:8] Set("PJSIP/3000019-000000d8", "CALLERID(all)="3000019" <3000019>") in new stack
    -- Executing [s@sub-check-diversions:9] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [333@sub-local-dialing:14] GotoIf("PJSIP/3000019-000000d8", "0?post-dial") in new stack
    -- Executing [333@sub-local-dialing:15] Gosub("PJSIP/3000019-000000d8", "parse-dial-string,s,1") in new stack
    -- Executing [s@parse-dial-string:1] NoOp("PJSIP/3000019-000000d8", "Parsing dial string: PJSIP/333_1&PJSIP/333&Local/7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:2] Set("PJSIP/3000019-000000d8", "NEW_DIAL_STRING=") in new stack
    -- Executing [s@parse-dial-string:3] Set("PJSIP/3000019-000000d8", "COUNTER=1") in new stack
    -- Executing [s@parse-dial-string:4] Set("PJSIP/3000019-000000d8", "CURRENT_DEVICE=PJSIP/333_1") in new stack
    -- Executing [s@parse-dial-string:5] While("PJSIP/3000019-000000d8", "1") in new stack
    -- Executing [s@parse-dial-string:6] Set("PJSIP/3000019-000000d8", "TECHNOLOGY=PJSIP") in new stack
    -- Executing [s@parse-dial-string:7] Set("PJSIP/3000019-000000d8", "USER=333_1") in new stack
    -- Executing [s@parse-dial-string:8] GotoIf("PJSIP/3000019-000000d8", "1?:regular") in new stack
    -- Executing [s@parse-dial-string:9] Goto("PJSIP/3000019-000000d8", "regular-pjsip") in new stack
    -- Goto (parse-dial-string,s,12)
    -- Executing [s@parse-dial-string:12] Set("PJSIP/3000019-000000d8", "PARSED_DEV=PJSIP/333_1/sip:72.39.80.82:64675;transport=ws") in new stack
    -- Executing [s@parse-dial-string:13] ExecIf("PJSIP/3000019-000000d8", "0?Set(PARSED_DEV=PJSIP/333_1)") in new stack
    -- Executing [s@parse-dial-string:14] Goto("PJSIP/3000019-000000d8", "append") in new stack
    -- Goto (parse-dial-string,s,16)
    -- Executing [s@parse-dial-string:16] GotoIf("PJSIP/3000019-000000d8", "1?:concatenate") in new stack
    -- Executing [s@parse-dial-string:17] Set("PJSIP/3000019-000000d8", "NEW_DIAL_STRING=PJSIP/333_1/sip:72.39.80.82:64675;transport=ws") in new stack
    -- Executing [s@parse-dial-string:18] Goto("PJSIP/3000019-000000d8", "next") in new stack
    -- Goto (parse-dial-string,s,21)
    -- Executing [s@parse-dial-string:21] Set("PJSIP/3000019-000000d8", "COUNTER=2") in new stack
    -- Executing [s@parse-dial-string:22] Set("PJSIP/3000019-000000d8", "CURRENT_DEVICE=PJSIP/333") in new stack
    -- Executing [s@parse-dial-string:23] EndWhile("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s@parse-dial-string:5] While("PJSIP/3000019-000000d8", "1") in new stack
    -- Executing [s@parse-dial-string:6] Set("PJSIP/3000019-000000d8", "TECHNOLOGY=PJSIP") in new stack
    -- Executing [s@parse-dial-string:7] Set("PJSIP/3000019-000000d8", "USER=333") in new stack
    -- Executing [s@parse-dial-string:8] GotoIf("PJSIP/3000019-000000d8", "1?:regular") in new stack
    -- Executing [s@parse-dial-string:9] Goto("PJSIP/3000019-000000d8", "regular-pjsip") in new stack
    -- Goto (parse-dial-string,s,12)
    -- Executing [s@parse-dial-string:12] Set("PJSIP/3000019-000000d8", "PARSED_DEV=") in new stack
    -- Executing [s@parse-dial-string:13] ExecIf("PJSIP/3000019-000000d8", "1?Set(PARSED_DEV=PJSIP/333)") in new stack
    -- Executing [s@parse-dial-string:14] Goto("PJSIP/3000019-000000d8", "append") in new stack
    -- Goto (parse-dial-string,s,16)
    -- Executing [s@parse-dial-string:16] GotoIf("PJSIP/3000019-000000d8", "0?:concatenate") in new stack
    -- Goto (parse-dial-string,s,19)
    -- Executing [s@parse-dial-string:19] GotoIf("PJSIP/3000019-000000d8", "1?:next") in new stack
    -- Executing [s@parse-dial-string:20] Set("PJSIP/3000019-000000d8", "NEW_DIAL_STRING=PJSIP/333_1/sip:72.39.80.82:64675;transport=ws&PJSIP/333") in new stack
    -- Executing [s@parse-dial-string:21] Set("PJSIP/3000019-000000d8", "COUNTER=3") in new stack
    -- Executing [s@parse-dial-string:22] Set("PJSIP/3000019-000000d8", "CURRENT_DEVICE=Local/7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:23] EndWhile("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s@parse-dial-string:5] While("PJSIP/3000019-000000d8", "1") in new stack
    -- Executing [s@parse-dial-string:6] Set("PJSIP/3000019-000000d8", "TECHNOLOGY=Local") in new stack
    -- Executing [s@parse-dial-string:7] Set("PJSIP/3000019-000000d8", "USER=7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:8] GotoIf("PJSIP/3000019-000000d8", "0?:regular") in new stack
    -- Goto (parse-dial-string,s,15)
    -- Executing [s@parse-dial-string:15] Set("PJSIP/3000019-000000d8", "PARSED_DEV=Local/7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:16] GotoIf("PJSIP/3000019-000000d8", "0?:concatenate") in new stack
    -- Goto (parse-dial-string,s,19)
    -- Executing [s@parse-dial-string:19] GotoIf("PJSIP/3000019-000000d8", "1?:next") in new stack
    -- Executing [s@parse-dial-string:20] Set("PJSIP/3000019-000000d8", "NEW_DIAL_STRING=PJSIP/333_1/sip:72.39.80.82:64675;transport=ws&PJSIP/333&Local/7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:21] Set("PJSIP/3000019-000000d8", "COUNTER=4") in new stack
    -- Executing [s@parse-dial-string:22] Set("PJSIP/3000019-000000d8", "CURRENT_DEVICE=") in new stack
    -- Executing [s@parse-dial-string:23] EndWhile("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s@parse-dial-string:5] While("PJSIP/3000019-000000d8", "0") in new stack
    -- Executing [s@parse-dial-string:24] NoOp("PJSIP/3000019-000000d8", "New dialstring: PJSIP/333_1/sip:72.39.80.82:64675;transport=ws&PJSIP/333&Local/7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:25] Set("PJSIP/3000019-000000d8", "DIAL_STRING=PJSIP/333_1/sip:72.39.80.82:64675;transport=ws&PJSIP/333&Local/7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:26] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [333@sub-local-dialing:16] NoOp("PJSIP/3000019-000000d8", "Configuring Dial Settings") in new stack
    -- Executing [333@sub-local-dialing:17] Set("PJSIP/3000019-000000d8", "RING_TIME=30") in new stack
    -- Executing [333@sub-local-dialing:18] Set("PJSIP/3000019-000000d8", "RING_TIME=30") in new stack
    -- Executing [333@sub-local-dialing:19] Set("PJSIP/3000019-000000d8", "RING_TIME=30") in new stack
    -- Executing [333@sub-local-dialing:20] Set("PJSIP/3000019-000000d8", "DIAL_OPTIONS=kKtrU(GLPI-notify-OPS)") in new stack
    -- Executing [333@sub-local-dialing:21] Set("PJSIP/3000019-000000d8", "DIAL_OPTIONS=kKtrU(GLPI-notify-OPS)") in new stack
    -- Executing [333@sub-local-dialing:22] GotoIf("PJSIP/3000019-000000d8", "0?:answermode") in new stack
    -- Goto (sub-local-dialing,333,26)
    -- Executing [333@sub-local-dialing:26] Set("PJSIP/3000019-000000d8", "ANSWER_MODE=disable") in new stack
    -- Executing [333@sub-local-dialing:27] Set("PJSIP/3000019-000000d8", "ANSWER_MODE=disable") in new stack
    -- Executing [333@sub-local-dialing:28] GotoIf("PJSIP/3000019-000000d8", "0?check-hd") in new stack
    -- Executing [333@sub-local-dialing:29] ExecIf("PJSIP/3000019-000000d8", "0?Set(EXEC_AA=yes)") in new stack
    -- Executing [333@sub-local-dialing:30] ExecIf("PJSIP/3000019-000000d8", "0?Set(EXEC_AA=yes)") in new stack
    -- Executing [333@sub-local-dialing:31] Set("PJSIP/3000019-000000d8", "IS_HOT_DESK=no") in new stack
    -- Executing [333@sub-local-dialing:32] Set("PJSIP/3000019-000000d8", "MOH_CLASS=default") in new stack
    -- Executing [333@sub-local-dialing:33] GosubIf("PJSIP/3000019-000000d8", "0?sub-set-moh,s,1(default)") in new stack
    -- Executing [333@sub-local-dialing:34] GotoIf("PJSIP/3000019-000000d8", "0?busy-here") in new stack
    -- Executing [333@sub-local-dialing:35] Set("PJSIP/3000019-000000d8", "FORCE_RECORDING=no") in new stack
    -- Executing [333@sub-local-dialing:36] Set("PJSIP/3000019-000000d8", "DIAL_OPTIONS=kKtrU(GLPI-notify-OPS)b(sub-before-connecting-call^s^1(6787bde866811108^3000019^333^^))") in new stack
    -- Executing [333@sub-local-dialing:37] Set("PJSIP/3000019-000000d8", "DIAL_OPTIONS=kKtrU(GLPI-notify-OPS)b(sub-before-connecting-call^s^1(6787bde866811108^3000019^333^^))U(sub-before-bridging-call^6787bde866811108^3000019^333^no)") in new stack
    -- Executing [333@sub-local-dialing:38] Set("PJSIP/3000019-000000d8", "__TRANSFERED_CALL=TRUE") in new stack
    -- Executing [333@sub-local-dialing:39] NoOp("PJSIP/3000019-000000d8", "Enable Follow-Me Ring Time If needed") in new stack
    -- Executing [333@sub-local-dialing:40] GotoIf("PJSIP/3000019-000000d8", "0?:check-rt") in new stack
    -- Goto (sub-local-dialing,333,47)
    -- Executing [333@sub-local-dialing:47] GotoIf("PJSIP/3000019-000000d8", "0?post-dial") in new stack
    -- Executing [333@sub-local-dialing:48] GotoIf("PJSIP/3000019-000000d8", "0?end_call") in new stack
    -- Executing [333@sub-local-dialing:49] Gosub("PJSIP/3000019-000000d8", "sub-udpate-virtual-dev-state,s,1(333,BUSY)") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:1] NoOp("PJSIP/3000019-000000d8", "Update Virtual Devices State") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:2] Set("PJSIP/3000019-000000d8", "EXT_NUM=333") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:3] Set("PJSIP/3000019-000000d8", "NEW_STATUS=BUSY") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:4] Set("PJSIP/3000019-000000d8", "EXTENSION_ID=7") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:5] Set("PJSIP/3000019-000000d8", "ODBC_ID=339") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:6] GotoIf("PJSIP/3000019-000000d8", "0?no_rows") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:7] Set("PJSIP/3000019-000000d8", "COUNTER=1") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:8] While("PJSIP/3000019-000000d8", "1") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:9] Set("PJSIP/3000019-000000d8", "VDevice=33") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:10] Set("PJSIP/3000019-000000d8", "DEVICE_STATE(Custom:VirtualDev33)=BUSY") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:11] Set("PJSIP/3000019-000000d8", "COUNTER=2") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:12] EndWhile("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:8] While("PJSIP/3000019-000000d8", "0") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:13] ODBCFinish("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:14] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [333@sub-local-dialing:50] Dial("PJSIP/3000019-000000d8", "PJSIP/333_1/sip:72.39.80.82:64675;transport=ws&PJSIP/333&Local/7010@cos-all,30,kKtrU(GLPI-notify-OPS)b(sub-before-connecting-call^s^1(6787bde866811108^3000019^333^^))U(sub-before-bridging-call^6787bde866811108^3000019^333^no)") in new stack
[2022-08-31 16:13:25] ERROR[16522]: res_pjsip.c:4096 ast_sip_create_dialog_uac: Endpoint '333': Could not create dialog to invalid URI '333'.  Is endpoint registered and reachable?
[2022-08-31 16:13:25] ERROR[16522]: chan_pjsip.c:2657 request: Failed to create outgoing session to endpoint '333'
[2022-08-31 16:13:25] WARNING[10455][C-000002aa]: app_dial.c:2663 dial_exec_full: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)
    -- PJSIP/333_1-000000d9 Internal Gosub(sub-before-connecting-call,s,1(6787bde866811108,3000019,333,,)) start
    -- Executing [s@sub-before-connecting-call:1] NoOp("PJSIP/333_1-000000d9", "Executing routines in the newly created channel before initiaing the call") in new stack
    -- Executing [s@sub-before-connecting-call:2] Set("PJSIP/333_1-000000d9", "TENANT=6787bde866811108") in new stack
    -- Executing [s@sub-before-connecting-call:3] Set("PJSIP/333_1-000000d9", "CALLER=3000019") in new stack
    -- Executing [s@sub-before-connecting-call:4] Set("PJSIP/333_1-000000d9", "CALLEE=333") in new stack
    -- Executing [s@sub-before-connecting-call:5] Set("PJSIP/333_1-000000d9", "EXEC_AA=") in new stack
    -- Executing [s@sub-before-connecting-call:6] Set("PJSIP/333_1-000000d9", "CUSTOM_ALERT_INFO=") in new stack
    -- Executing [s@sub-before-connecting-call:7] Set("PJSIP/333_1-000000d9", "APP_TYPE=NONE") in new stack
    -- Executing [s@sub-before-connecting-call:8] GosubIf("PJSIP/333_1-000000d9", "0?sub-auto-answer,s,1") in new stack
    -- Executing [s@sub-before-connecting-call:9] GosubIf("PJSIP/333_1-000000d9", "0?sub-set-custom-header,s,1(Alert-Info,)") in new stack
    -- Executing [s@sub-before-connecting-call:10] GosubIf("PJSIP/333_1-000000d9", "0?sub-set-custom-header,s,1(Call-Info,)") in new stack
    -- Executing [s@sub-before-connecting-call:11] Gosub("PJSIP/333_1-000000d9", "sub-set-custom-header,s,1(CALL-TYPE,LOCAL)") in new stack
    -- Executing [s@sub-set-custom-header:1] NoOp("PJSIP/333_1-000000d9", "Setting up custom header") in new stack
    -- Executing [s@sub-set-custom-header:2] GotoIf("PJSIP/333_1-000000d9", "0?set-sip") in new stack
    -- Executing [s@sub-set-custom-header:3] NoOp("PJSIP/333_1-000000d9", "Add PJSIP Headers") in new stack
    -- Executing [s@sub-set-custom-header:4] Set("PJSIP/333_1-000000d9", "PJSIP_HEADER(add,CALL-TYPE)=LOCAL") in new stack
    -- Executing [s@sub-set-custom-header:5] Goto("PJSIP/333_1-000000d9", "end") in new stack
    -- Goto (sub-set-custom-header,s,8)
    -- Executing [s@sub-set-custom-header:8] Return("PJSIP/333_1-000000d9", "") in new stack
    -- Executing [s@sub-before-connecting-call:12] Gosub("PJSIP/333_1-000000d9", "sub-set-custom-header,s,1(APPLICATION,NONE)") in new stack
    -- Executing [s@sub-set-custom-header:1] NoOp("PJSIP/333_1-000000d9", "Setting up custom header") in new stack
    -- Executing [s@sub-set-custom-header:2] GotoIf("PJSIP/333_1-000000d9", "0?set-sip") in new stack
    -- Executing [s@sub-set-custom-header:3] NoOp("PJSIP/333_1-000000d9", "Add PJSIP Headers") in new stack
    -- Executing [s@sub-set-custom-header:4] Set("PJSIP/333_1-000000d9", "PJSIP_HEADER(add,APPLICATION)=NONE") in new stack
    -- Executing [s@sub-set-custom-header:5] Goto("PJSIP/333_1-000000d9", "end") in new stack
    -- Goto (sub-set-custom-header,s,8)
    -- Executing [s@sub-set-custom-header:8] Return("PJSIP/333_1-000000d9", "") in new stack
    -- Executing [s@sub-before-connecting-call:13] GosubIf("PJSIP/333_1-000000d9", "0?sub-set-custom-header,s,1(QUEUE-NAME,)") in new stack
    -- Executing [s@sub-before-connecting-call:14] GosubIf("PJSIP/333_1-000000d9", "0?before-connecting-call-hook,s,1") in new stack
    -- Executing [s@sub-before-connecting-call:15] Return("PJSIP/333_1-000000d9", "") in new stack
  == Spawn extension (cos-all, 333, 1) exited non-zero on 'PJSIP/333_1-000000d9'
    -- PJSIP/333_1-000000d9 Internal Gosub(sub-before-connecting-call,s,1(6787bde866811108,3000019,333,,)) complete GOSUB_RETVAL=
    -- Local/7010@cos-all-000000a9;1 Internal Gosub(sub-before-connecting-call,s,1(6787bde866811108,3000019,333,,)) start
    -- Executing [s@sub-before-connecting-call:1] NoOp("Local/7010@cos-all-000000a9;1", "Executing routines in the newly created channel before initiaing the call") in new stack
    -- Executing [s@sub-before-connecting-call:2] Set("Local/7010@cos-all-000000a9;1", "TENANT=6787bde866811108") in new stack
    -- Executing [s@sub-before-connecting-call:3] Set("Local/7010@cos-all-000000a9;1", "CALLER=3000019") in new stack
    -- Executing [s@sub-before-connecting-call:4] Set("Local/7010@cos-all-000000a9;1", "CALLEE=333") in new stack
    -- Executing [s@sub-before-connecting-call:5] Set("Local/7010@cos-all-000000a9;1", "EXEC_AA=") in new stack
    -- Executing [s@sub-before-connecting-call:6] Set("Local/7010@cos-all-000000a9;1", "CUSTOM_ALERT_INFO=") in new stack
    -- Executing [s@sub-before-connecting-call:7] Set("Local/7010@cos-all-000000a9;1", "APP_TYPE=NONE") in new stack
    -- Executing [s@sub-before-connecting-call:8] GosubIf("Local/7010@cos-all-000000a9;1", "0?sub-auto-answer,s,1") in new stack
    -- Executing [s@sub-before-connecting-call:9] GosubIf("Local/7010@cos-all-000000a9;1", "0?sub-set-custom-header,s,1(Alert-Info,)") in new stack
    -- Executing [s@sub-before-connecting-call:10] GosubIf("Local/7010@cos-all-000000a9;1", "0?sub-set-custom-header,s,1(Call-Info,)") in new stack
    -- Executing [s@sub-before-connecting-call:11] Gosub("Local/7010@cos-all-000000a9;1", "sub-set-custom-header,s,1(CALL-TYPE,LOCAL)") in new stack
    -- Executing [s@sub-set-custom-header:1] NoOp("Local/7010@cos-all-000000a9;1", "Setting up custom header") in new stack
    -- Executing [s@sub-set-custom-header:2] GotoIf("Local/7010@cos-all-000000a9;1", "0?set-sip") in new stack
    -- Executing [s@sub-set-custom-header:3] NoOp("Local/7010@cos-all-000000a9;1", "Add PJSIP Headers") in new stack
    -- Executing [s@sub-set-custom-header:4] Set("Local/7010@cos-all-000000a9;1", "PJSIP_HEADER(add,CALL-TYPE)=LOCAL") in new stack
[2022-08-31 16:13:25] ERROR[10455][C-000002aa]: res_pjsip_header_funcs.c:680 func_write_header: This function requires a PJSIP channel.
    -- Executing [s@sub-set-custom-header:5] Goto("Local/7010@cos-all-000000a9;1", "end") in new stack
    -- Goto (sub-set-custom-header,s,8)
    -- Executing [s@sub-set-custom-header:8] Return("Local/7010@cos-all-000000a9;1", "") in new stack
    -- Executing [s@sub-before-connecting-call:12] Gosub("Local/7010@cos-all-000000a9;1", "sub-set-custom-header,s,1(APPLICATION,NONE)") in new stack
    -- Executing [s@sub-set-custom-header:1] NoOp("Local/7010@cos-all-000000a9;1", "Setting up custom header") in new stack
    -- Executing [s@sub-set-custom-header:2] GotoIf("Local/7010@cos-all-000000a9;1", "0?set-sip") in new stack
    -- Executing [s@sub-set-custom-header:3] NoOp("Local/7010@cos-all-000000a9;1", "Add PJSIP Headers") in new stack
    -- Executing [s@sub-set-custom-header:4] Set("Local/7010@cos-all-000000a9;1", "PJSIP_HEADER(add,APPLICATION)=NONE") in new stack
[2022-08-31 16:13:25] ERROR[10455][C-000002aa]: res_pjsip_header_funcs.c:680 func_write_header: This function requires a PJSIP channel.
    -- Executing [s@sub-set-custom-header:5] Goto("Local/7010@cos-all-000000a9;1", "end") in new stack
    -- Goto (sub-set-custom-header,s,8)
    -- Executing [s@sub-set-custom-header:8] Return("Local/7010@cos-all-000000a9;1", "") in new stack
    -- Executing [s@sub-before-connecting-call:13] GosubIf("Local/7010@cos-all-000000a9;1", "0?sub-set-custom-header,s,1(QUEUE-NAME,)") in new stack
    -- Executing [s@sub-before-connecting-call:14] GosubIf("Local/7010@cos-all-000000a9;1", "0?before-connecting-call-hook,s,1") in new stack
    -- Executing [s@sub-before-connecting-call:15] Return("Local/7010@cos-all-000000a9;1", "") in new stack
  == Spawn extension (cos-all, 333, 1) exited non-zero on 'Local/7010@cos-all-000000a9;1'
    -- Local/7010@cos-all-000000a9;1 Internal Gosub(sub-before-connecting-call,s,1(6787bde866811108,3000019,333,,)) complete GOSUB_RETVAL=
    -- Called PJSIP/333_1/sip:72.39.80.82:64675;transport=ws
    -- Called Local/7010@cos-all
    -- Executing [7010@cos-all:1] NoOp("Local/7010@cos-all-000000a9;2", "More than on digit pattern") in new stack
    -- Executing [7010@cos-all:2] Gosub("Local/7010@cos-all-000000a9;2", "s,1(7010)") in new stack
    -- Executing [s@cos-all:1] Set("Local/7010@cos-all-000000a9;2", "EXTENSION=7010") in new stack
    -- Executing [s@cos-all:2] NoOp("Local/7010@cos-all-000000a9;2", "Dialing 7010 from 3000019") in new stack
    -- Executing [s@cos-all:3] Gosub("Local/7010@cos-all-000000a9;2", "sub-set-global-vars,s,1(6787bde866811108,7010,parking-1)") in new stack
    -- Executing [s@sub-set-global-vars:1] NoOp("Local/7010@cos-all-000000a9;2", "Setting Global Vars") in new stack
    -- Executing [s@sub-set-global-vars:2] Set("Local/7010@cos-all-000000a9;2", "TENANT_PATH=6787bde866811108") in new stack
    -- Executing [s@sub-set-global-vars:3] Set("Local/7010@cos-all-000000a9;2", "PREFIX=") in new stack
    -- Executing [s@sub-set-global-vars:4] Set("Local/7010@cos-all-000000a9;2", "__PICKUPMARK=7010") in new stack
    -- Executing [s@sub-set-global-vars:5] Set("Local/7010@cos-all-000000a9;2", "__PARKINGLOT=parking-1") in new stack
    -- Executing [s@sub-set-global-vars:6] Set("Local/7010@cos-all-000000a9;2", "__DYNAMIC_FEATURES=custom-features") in new stack
    -- Executing [s@sub-set-global-vars:7] Set("Local/7010@cos-all-000000a9;2", "ICALL=no") in new stack
    -- Executing [s@sub-set-global-vars:8] Return("Local/7010@cos-all-000000a9;2", "") in new stack
    -- Executing [s@cos-all:4] Gosub("Local/7010@cos-all-000000a9;2", "sub-set-call-vars,s,1(6787bde866811108,7010,1,cos-all,ARS-all)") in new stack
    -- Executing [s@sub-set-call-vars:1] NoOp("Local/7010@cos-all-000000a9;2", "Setting Call Vars") in new stack
    -- Executing [s@sub-set-call-vars:2] Set("Local/7010@cos-all-000000a9;2", "_TENANT=6787bde866811108") in new stack
    -- Executing [s@sub-set-call-vars:3] Set("Local/7010@cos-all-000000a9;2", "_CALL_DESTINATION=7010") in new stack
    -- Executing [s@sub-set-call-vars:4] Set("Local/7010@cos-all-000000a9;2", "_COS_ID=1") in new stack
    -- Executing [s@sub-set-call-vars:5] Set("Local/7010@cos-all-000000a9;2", "_COS_NAME=cos-all") in new stack
    -- Executing [s@sub-set-call-vars:6] Set("Local/7010@cos-all-000000a9;2", "__TRANSFER_CONTEXT=cos-all") in new stack
    -- Executing [s@sub-set-call-vars:7] Set("Local/7010@cos-all-000000a9;2", "_ARS=ARS-all") in new stack
    -- Executing [s@sub-set-call-vars:8] Set("Local/7010@cos-all-000000a9;2", "CDR(tenant)=vitalpbx") in new stack
    -- Executing [s@sub-set-call-vars:9] Set("Local/7010@cos-all-000000a9;2", "CDR(destination)=7010") in new stack
    -- Executing [s@sub-set-call-vars:10] Set("Local/7010@cos-all-000000a9;2", "CDR(trunk)=") in new stack
    -- Executing [s@sub-set-call-vars:11] Set("Local/7010@cos-all-000000a9;2", "CDR(did)=") in new stack
    -- Executing [s@sub-set-call-vars:12] Set("Local/7010@cos-all-000000a9;2", "__CALLID=1661955205.963") in new stack
    -- Executing [s@sub-set-call-vars:13] ExecIf("Local/7010@cos-all-000000a9;2", "0?Set(CHANNEL(language)=)") in new stack
    -- Executing [s@sub-set-call-vars:14] ExecIf("Local/7010@cos-all-000000a9;2", "1?Set(CHANNEL(language)=en)") in new stack
    -- Executing [s@sub-set-call-vars:15] Return("Local/7010@cos-all-000000a9;2", "") in new stack
    -- Executing [s@cos-all:5] Gosub("Local/7010@cos-all-000000a9;2", "sub-construct-cid,s,1") in new stack
    -- Executing [s@sub-construct-cid:1] NoOp("Local/7010@cos-all-000000a9;2", "Building CID") in new stack
    -- Executing [s@sub-construct-cid:2] Set("Local/7010@cos-all-000000a9;2", "_CALL_SOURCE=3000019") in new stack
    -- Executing [s@sub-construct-cid:3] Set("Local/7010@cos-all-000000a9;2", "_CS=3000019") in new stack
    -- Executing [s@sub-construct-cid:4] GotoIf("Local/7010@cos-all-000000a9;2", "1?return") in new stack
    -- Goto (sub-construct-cid,s,11)
    -- Executing [s@sub-construct-cid:11] NoOp("Local/7010@cos-all-000000a9;2", "") in new stack
    -- Executing [s@sub-construct-cid:12] Set("Local/7010@cos-all-000000a9;2", "CDR(source)=3000019") in new stack
    -- Executing [s@sub-construct-cid:13] Return("Local/7010@cos-all-000000a9;2", "") in new stack
    -- Executing [s@cos-all:6] Gosub("Local/7010@cos-all-000000a9;2", "set-global-tenant-vars,s,1") in new stack
    -- Executing [s@set-global-tenant-vars:1] NoOp("Local/7010@cos-all-000000a9;2", "Setting Global Vars for vitalpbx Tenant") in new stack
    -- Executing [s@set-global-tenant-vars:2] Set("Local/7010@cos-all-000000a9;2", "__TENANT_PATH=6787bde866811108") in new stack
    -- Executing [s@set-global-tenant-vars:3] Set("Local/7010@cos-all-000000a9;2", "__TENANT_PREFIX=") in new stack
    -- Executing [s@set-global-tenant-vars:4] Set("Local/7010@cos-all-000000a9;2", "__QUEUE_AGENTS_CONTEXT=queue-call-to-agents") in new stack
    -- Executing [s@set-global-tenant-vars:5] Set("Local/7010@cos-all-000000a9;2", "__FOLLOWME_CONTEXT=ext-followme") in new stack
    -- Executing [s@set-global-tenant-vars:6] Set("Local/7010@cos-all-000000a9;2", "__HINTS_CONTEXT=extension-hints") in new stack
    -- Executing [s@set-global-tenant-vars:7] Set("Local/7010@cos-all-000000a9;2", "__DEFAULT_COS=cos-all") in new stack
    -- Executing [s@set-global-tenant-vars:8] Return("Local/7010@cos-all-000000a9;2", "") in new stack
    -- Executing [s@cos-all:7] GotoIf("Local/7010@cos-all-000000a9;2", "0?local-dialing") in new stack
    -- Executing [s@cos-all:8] NoOp("Local/7010@cos-all-000000a9;2", "Check if is an Emergency Call") in new stack
    -- Executing [s@cos-all:9] GotoIf("Local/7010@cos-all-000000a9;2", "0?emergency-calls,7010,1") in new stack
    -- Executing [s@cos-all:10] Gosub("Local/7010@cos-all-000000a9;2", "sub-lockphone-check,s,1") in new stack
    -- Executing [s@sub-lockphone-check:1] NoOp("Local/7010@cos-all-000000a9;2", "SUB: LOCK PHONE CHECK") in new stack
    -- Executing [s@sub-lockphone-check:2] GotoIf("Local/7010@cos-all-000000a9;2", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:3] GotoIf("Local/7010@cos-all-000000a9;2", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:4] GotoIf("Local/7010@cos-all-000000a9;2", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:5] GotoIf("Local/7010@cos-all-000000a9;2", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:6] GotoIf("Local/7010@cos-all-000000a9;2", "0?:unlock") in new stack
    -- Goto (sub-lockphone-check,s,12)
    -- Executing [s@sub-lockphone-check:12] Return("Local/7010@cos-all-000000a9;2", "") in new stack
    -- Executing [s@cos-all:11] Gosub("Local/7010@cos-all-000000a9;2", "sub-local-dialing,s,1") in new stack
    -- Executing [s@sub-local-dialing:1] NoOp("Local/7010@cos-all-000000a9;2", "Trying to determine if is a local extension") in new stack
    -- Executing [s@sub-local-dialing:2] GotoIf("Local/7010@cos-all-000000a9;2", "0?:return") in new stack
    -- Goto (sub-local-dialing,s,5)
    -- Executing [s@sub-local-dialing:5] Return("Local/7010@cos-all-000000a9;2", "") in new stack
    -- Executing [s@cos-all:12] GotoIf("Local/7010@cos-all-000000a9;2", "0?end-call") in new stack
    -- Executing [s@cos-all:13] Goto("Local/7010@cos-all-000000a9;2", "cos-all-post,7010,1") in new stack
    -- Goto (cos-all-post,7010,1)
    -- Executing [7010@cos-all-post:1] Gosub("Local/7010@cos-all-000000a9;2", "sub-set-call-vars,app-incoming,1") in new stack
    -- Executing [app-incoming@sub-set-call-vars:1] NoOp("Local/7010@cos-all-000000a9;2", "Incoming Call App CDR") in new stack
    -- Executing [app-incoming@sub-set-call-vars:2] GotoIf("Local/7010@cos-all-000000a9;2", "0?:return") in new stack
    -- Goto (sub-set-call-vars,app-incoming,6)
    -- Executing [app-incoming@sub-set-call-vars:6] Return("Local/7010@cos-all-000000a9;2", "") in new stack
    -- Executing [7010@cos-all-post:2] NoOp("Local/7010@cos-all-000000a9;2", "Custom Application: GLPI-notify-OPS") in new stack
    -- Executing [7010@cos-all-post:3] Goto("Local/7010@cos-all-000000a9;2", "custom-contexts,cc-6,1") in new stack
    -- Goto (custom-contexts,cc-6,1)
    -- Executing [cc-6@custom-contexts:1] NoOp("Local/7010@cos-all-000000a9;2", "GLPI-notify-OPS") in new stack
    -- Executing [cc-6@custom-contexts:2] Gosub("Local/7010@cos-all-000000a9;2", "GLPI-notify-OPS,GLPI-Support,1(app-termination,hangup,1)") in new stack
[2022-08-31 16:13:25] ERROR[10456][C-000002aa]: app_stack.c:593 gosub_exec: Gosub attempted to reach non-existent destination 'GLPI-notify-OPS,GLPI-Support,1' from 'custom-contexts,cc-6,2'
  == Spawn extension (custom-contexts, cc-6, 2) exited non-zero on 'Local/7010@cos-all-000000a9;2'
  == DTLS ECDH initialized (automatic), faster PFS enabled
    -- PJSIP/333_1-000000d9 connected line has changed. Saving it until answer for PJSIP/3000019-000000d8
    -- PJSIP/333_1-000000d9 is ringing
       > 0x7f9f3c028ce0 -- Strict RTP learning after remote address set to: 72.39.80.82:58382
    -- PJSIP/333_1-000000d9 answered PJSIP/3000019-000000d8
    -- PJSIP/333_1-000000d9 Internal Gosub(sub-before-bridging-call,s,1(6787bde866811108,3000019,333,no)) start
    -- Executing [s@sub-before-bridging-call:1] NoOp("PJSIP/333_1-000000d9", "Executing sub-routine before connecting to the calling channel") in new stack
    -- Executing [s@sub-before-bridging-call:2] Set("PJSIP/333_1-000000d9", "TENANT=6787bde866811108") in new stack
    -- Executing [s@sub-before-bridging-call:3] Set("PJSIP/333_1-000000d9", "CALLER=3000019") in new stack
    -- Executing [s@sub-before-bridging-call:4] Set("PJSIP/333_1-000000d9", "CALLEE=333") in new stack
    -- Executing [s@sub-before-bridging-call:5] Set("PJSIP/333_1-000000d9", "FORCE_CALL_RECORDING=no") in new stack
    -- Executing [s@sub-before-bridging-call:6] NoOp("PJSIP/333_1-000000d9", "Check if the follow-me confirmation sub-routine needs to be executed") in new stack
    -- Executing [s@sub-before-bridging-call:7] GotoIf("PJSIP/333_1-000000d9", "1?call-recording") in new stack
    -- Goto (sub-before-bridging-call,s,9)
    -- Executing [s@sub-before-bridging-call:9] NoOp("PJSIP/333_1-000000d9", "Executing the call-recording sub-routine") in new stack
    -- Executing [s@sub-before-bridging-call:10] Gosub("PJSIP/333_1-000000d9", "sub-call-recording,s,1(6787bde866811108,3000019,333,no)") in new stack
    -- Executing [s@sub-call-recording:1] NoOp("PJSIP/333_1-000000d9", "Check if call will be recorded on tenant 6787bde866811108") in new stack
    -- Executing [s@sub-call-recording:2] NoOp("PJSIP/333_1-000000d9", "Call Type: 1 ") in new stack
    -- Executing [s@sub-call-recording:3] Set("PJSIP/333_1-000000d9", "TENANT=6787bde866811108") in new stack
    -- Executing [s@sub-call-recording:4] Set("PJSIP/333_1-000000d9", "CALLER=3000019") in new stack
    -- Executing [s@sub-call-recording:5] Set("PJSIP/333_1-000000d9", "CALLEE=333") in new stack
    -- Executing [s@sub-call-recording:6] Set("PJSIP/333_1-000000d9", "APP_FORCE=no") in new stack
    -- Executing [s@sub-call-recording:7] GotoIf("PJSIP/333_1-000000d9", "1?:rec_no_available") in new stack
    -- Executing [s@sub-call-recording:8] GotoIf("PJSIP/333_1-000000d9", "0?perform-recording") in new stack
    -- Executing [s@sub-call-recording:9] GotoIf("PJSIP/333_1-000000d9", "1?perform-recording") in new stack
    -- Goto (sub-call-recording,s,14)
    -- Executing [s@sub-call-recording:14] Gosub("PJSIP/333_1-000000d9", "sub-perform-recording,s,1") in new stack
    -- Executing [s@sub-perform-recording:1] NoOp("PJSIP/333_1-000000d9", "Perform Call Recording") in new stack
    -- Executing [s@sub-perform-recording:2] Set("PJSIP/333_1-000000d9", "RECORDING_ID=1661955205.961") in new stack
    -- Executing [s@sub-perform-recording:3] Set("PJSIP/333_1-000000d9", "APP_TYPE=NONE") in new stack
    -- Executing [s@sub-perform-recording:4] Set("PJSIP/333_1-000000d9", "AUDIO_FILE=161327-LOCAL-NONE-3000019-333-1661955205.961") in new stack
    -- Executing [s@sub-perform-recording:5] Set("PJSIP/333_1-000000d9", "RECORDING_FORMAT=wav") in new stack
    -- Executing [s@sub-perform-recording:6] Set("PJSIP/333_1-000000d9", "__REC_FILENAME=/var/spool/asterisk/monitor/2022/08/31/161327-LOCAL-NONE-3000019-333-1661955205.961.wav") in new stack
    -- Executing [s@sub-perform-recording:7] GotoIf("PJSIP/333_1-000000d9", "0?:set_rec_file") in new stack
    -- Goto (sub-perform-recording,s,10)
    -- Executing [s@sub-perform-recording:10] Set("PJSIP/333_1-000000d9", "CDR(recfile)=/var/spool/asterisk/monitor/2022/08/31/161327-LOCAL-NONE-3000019-333-1661955205.961.wav") in new stack
    -- Executing [s@sub-perform-recording:11] MixMonitor("PJSIP/333_1-000000d9", "/var/spool/asterisk/monitor/2022/08/31/161327-LOCAL-NONE-3000019-333-1661955205.961.wav,b,") in new stack
    -- Executing [s@sub-perform-recording:12] Return("PJSIP/333_1-000000d9", "") in new stack
    -- Executing [s@sub-call-recording:15] Goto("PJSIP/333_1-000000d9", "return") in new stack
  == Begin MixMonitor Recording PJSIP/333_1-000000d9
    -- Goto (sub-call-recording,s,17)
    -- Executing [s@sub-call-recording:17] Return("PJSIP/333_1-000000d9", "") in new stack
    -- Executing [s@sub-before-bridging-call:11] NoOp("PJSIP/333_1-000000d9", "Check if there's a custom sub-routine defined for executing it") in new stack
    -- Executing [s@sub-before-bridging-call:12] GosubIf("PJSIP/333_1-000000d9", "0?before-bridging-call-hook,s,1") in new stack
    -- Executing [s@sub-before-bridging-call:13] Return("PJSIP/333_1-000000d9", "") in new stack
  == Spawn extension (cos-all, , 1) exited non-zero on 'PJSIP/333_1-000000d9'
    -- PJSIP/333_1-000000d9 Internal Gosub(sub-before-bridging-call,s,1(6787bde866811108,3000019,333,no)) complete GOSUB_RETVAL=
       > 0x7f9fd0033ed0 -- Strict RTP learning after remote address set to: 192.168.1.18:5032
    -- Channel PJSIP/333_1-000000d9 joined 'simple_bridge' basic-bridge <367d45ff-727a-493f-b015-83212337a300>
    -- Channel PJSIP/3000019-000000d8 joined 'simple_bridge' basic-bridge <367d45ff-727a-493f-b015-83212337a300>
       > 0x7f9f3c028ce0 -- Strict RTP learning after ICE completion
       > 0x7f9f3c028ce0 -- Strict RTP learning after remote address set to: 72.39.80.82:58382
       > 0x7f9fd0033ed0 -- Strict RTP qualifying stream type: audio
       > 0x7f9fd0033ed0 -- Strict RTP switching source address to 72.39.80.82:5032
       > 0x7f9f3c028ce0 -- Strict RTP switching to RTP target address 72.39.80.82:58382 as source
    -- Channel PJSIP/3000019-000000d8 left 'simple_bridge' basic-bridge <367d45ff-727a-493f-b015-83212337a300>
  == Spawn extension (sub-local-dialing, 333, 50) exited non-zero on 'PJSIP/3000019-000000d8'
    -- Executing [h@sub-local-dialing:1] NoOp("PJSIP/3000019-000000d8", "Finishing the call") in new stack
    -- Channel PJSIP/333_1-000000d9 left 'simple_bridge' basic-bridge <367d45ff-727a-493f-b015-83212337a300>
    -- Executing [h@sub-local-dialing:2] Gosub("PJSIP/3000019-000000d8", "sub-udpate-virtual-dev-state,s,1(333,NOT_INUSE)") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:1] NoOp("PJSIP/3000019-000000d8", "Update Virtual Devices State") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:2] Set("PJSIP/3000019-000000d8", "EXT_NUM=333") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:3] Set("PJSIP/3000019-000000d8", "NEW_STATUS=NOT_INUSE") in new stack
  == MixMonitor close filestream (mixed)
  == End MixMonitor Recording PJSIP/333_1-000000d9
    -- Executing [s@sub-udpate-virtual-dev-state:4] Set("PJSIP/3000019-000000d8", "EXTENSION_ID=7") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:5] Set("PJSIP/3000019-000000d8", "ODBC_ID=340") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:6] GotoIf("PJSIP/3000019-000000d8", "0?no_rows") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:7] Set("PJSIP/3000019-000000d8", "COUNTER=1") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:8] While("PJSIP/3000019-000000d8", "1") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:9] Set("PJSIP/3000019-000000d8", "VDevice=33") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:10] Set("PJSIP/3000019-000000d8", "DEVICE_STATE(Custom:VirtualDev33)=NOT_INUSE") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:11] Set("PJSIP/3000019-000000d8", "COUNTER=2") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:12] EndWhile("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:8] While("PJSIP/3000019-000000d8", "0") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:13] ODBCFinish("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:14] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [h@sub-local-dialing:3] GosubIf("PJSIP/3000019-000000d8", "0?dynamic-routing-connected,s,1(ANSWER,3000019)") in new stack
    -- Executing [h@sub-local-dialing:4] GotoIf("PJSIP/3000019-000000d8", "0?call_ended") in new stack
    -- Executing [h@sub-local-dialing:5] GosubIf("PJSIP/3000019-000000d8", "0?wake-up-no-answered,s,1") in new stack
    -- Executing [h@sub-local-dialing:6] Gosub("PJSIP/3000019-000000d8", "sub-call-completion-check,s,1") in new stack
    -- Executing [s@sub-call-completion-check:1] NoOp("PJSIP/3000019-000000d8", "FEATURE: CALL COMPLETION CHECK") in new stack
    -- Executing [s@sub-call-completion-check:2] Set("PJSIP/3000019-000000d8", "CC_MODE=none") in new stack
    -- Executing [s@sub-call-completion-check:3] Set("PJSIP/3000019-000000d8", "CC_MODE=none") in new stack
    -- Executing [s@sub-call-completion-check:4] Set("PJSIP/3000019-000000d8", "CC_MODE=none") in new stack
    -- Executing [s@sub-call-completion-check:5] GotoIf("PJSIP/3000019-000000d8", "1?end") in new stack
    -- Goto (sub-call-completion-check,s,17)
    -- Executing [s@sub-call-completion-check:17] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [h@sub-local-dialing:7] NoOp("PJSIP/3000019-000000d8", "Call ended") in new stack
    -- Executing [h@sub-local-dialing:8] Gosub("PJSIP/3000019-000000d8", "notify-call-hangup,s,1") in new stack
    -- Executing [s@notify-call-hangup:1] Verbose("PJSIP/3000019-000000d8", "0, Extension Hangup") in new stack
 Extension Hangup
    -- Executing [s@notify-call-hangup:2] GotoIf("PJSIP/3000019-000000d8", "1?:incoming") in new stack
    -- Executing [s@notify-call-hangup:3] UserEvent("PJSIP/3000019-000000d8", ""EXTENSIONS_SUMMARY","Data: EXT_TO_EXT,PJSIP/3000019-0000001v,PJSIP/333_1-000000d9,LOCAL"") in new stack
    -- Executing [s@notify-call-hangup:4] Goto("PJSIP/3000019-000000d8", "end") in new stack
    -- Goto (notify-call-hangup,s,7)
    -- Executing [s@notify-call-hangup:7] Return("PJSIP/3000019-000000d8", "") in new stack
    -- Executing [h@sub-local-dialing:9] Hangup("PJSIP/3000019-000000d8", "") in new stack
  == Spawn extension (sub-local-dialing, h, 9) exited non-zero on 'PJSIP/3000019-000000d8'
[2022-08-31 16:13:38] ERROR[25237]: res_pjsip_outbound_authenticator_digest.c:450 digest_create_request_with_auth: Host: '145.239.255.24:5061': There were no auth ids available

Do you know what that is?

Anyway. it looks like only the second U option gets applied.

VitalPBX will have the follow the same route as they used for Custom Dynamic Applications, to check if the end user also wants to append something.

Something like:

include sub-before-bridging-call-custom

Hi,

sorry, I am not sure about " pastebin"

do you have any examples ? do I need to modify the custom context to invlude this “include sub-before-bridging-call-custom”

You can use before-bridging-call-hook extension s

1 Like

Hi,

Thanks for all your help.

do you know how to set it and where ? before-bridging-call-hook extension s

Just add the before-bridging-call-hook context in whatever file you use for your custom dialplans (i.e. /etc/asterisk/vitalpbx/extensions__90-custom.conf)

Sample dialplan below

[before-bridging-call-hook]
exten => s,1,Noop(Entering custom context before bridging the call)
 same => n,GosubIf($["X${GOSUB_RESULT}X"="XX"]?GLPI-notify-OPS,GLPI-Support,1) ; Only if call was actually answered
 same => n,Return()

Thank you so much, it is working now, I really appreciate your help in this…Thanks again…

1 Like