Custom Context Condition

This only issue is now that when I call from Ext 3000019 → Ext 333, the ${CALLERID(num)} is not returning anything, I use this aestrix variable for conditions in my script, any idea ?

If I remove the [before-bridging-call-hook] then ${CALLERID(num)} returns 3000019

Connected to Asterisk 18.10.0 currently running on phone (pid = 1376)
    -- Executing [333@cos-all:1] NoOp("PJSIP/3000019-000001a0", "More than on digit pattern") in new stack
    -- Executing [333@cos-all:2] Gosub("PJSIP/3000019-000001a0", "s,1(333)") in new stack
    -- Executing [s@cos-all:1] Set("PJSIP/3000019-000001a0", "EXTENSION=333") in new stack
    -- Executing [s@cos-all:2] NoOp("PJSIP/3000019-000001a0", "Dialing 333 from 3000019") in new stack
    -- Executing [s@cos-all:3] Gosub("PJSIP/3000019-000001a0", "sub-set-global-vars,s,1(6787bde866811108,333,parking-1)") in new stack
    -- Executing [s@sub-set-global-vars:1] NoOp("PJSIP/3000019-000001a0", "Setting Global Vars") in new stack
    -- Executing [s@sub-set-global-vars:2] Set("PJSIP/3000019-000001a0", "TENANT_PATH=6787bde866811108") in new stack
    -- Executing [s@sub-set-global-vars:3] Set("PJSIP/3000019-000001a0", "PREFIX=") in new stack
    -- Executing [s@sub-set-global-vars:4] Set("PJSIP/3000019-000001a0", "__PICKUPMARK=333") in new stack
    -- Executing [s@sub-set-global-vars:5] Set("PJSIP/3000019-000001a0", "__PARKINGLOT=parking-1") in new stack
    -- Executing [s@sub-set-global-vars:6] Set("PJSIP/3000019-000001a0", "__DYNAMIC_FEATURES=custom-features") in new stack
    -- Executing [s@sub-set-global-vars:7] Set("PJSIP/3000019-000001a0", "ICALL=no") in new stack
    -- Executing [s@sub-set-global-vars:8] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s@cos-all:4] Gosub("PJSIP/3000019-000001a0", "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-000001a0", "Setting Call Vars") in new stack
    -- Executing [s@sub-set-call-vars:2] Set("PJSIP/3000019-000001a0", "_TENANT=6787bde866811108") in new stack
    -- Executing [s@sub-set-call-vars:3] Set("PJSIP/3000019-000001a0", "_CALL_DESTINATION=333") in new stack
    -- Executing [s@sub-set-call-vars:4] Set("PJSIP/3000019-000001a0", "_COS_ID=1") in new stack
    -- Executing [s@sub-set-call-vars:5] Set("PJSIP/3000019-000001a0", "_COS_NAME=cos-all") in new stack
    -- Executing [s@sub-set-call-vars:6] Set("PJSIP/3000019-000001a0", "__TRANSFER_CONTEXT=cos-all") in new stack
    -- Executing [s@sub-set-call-vars:7] Set("PJSIP/3000019-000001a0", "_ARS=ARS-all") in new stack
    -- Executing [s@sub-set-call-vars:8] Set("PJSIP/3000019-000001a0", "CDR(tenant)=vitalpbx") in new stack
    -- Executing [s@sub-set-call-vars:9] Set("PJSIP/3000019-000001a0", "CDR(destination)=333") in new stack
    -- Executing [s@sub-set-call-vars:10] Set("PJSIP/3000019-000001a0", "CDR(trunk)=") in new stack
    -- Executing [s@sub-set-call-vars:11] Set("PJSIP/3000019-000001a0", "CDR(did)=") in new stack
    -- Executing [s@sub-set-call-vars:12] Set("PJSIP/3000019-000001a0", "__CALLID=1662005851.1820") in new stack
    -- Executing [s@sub-set-call-vars:13] ExecIf("PJSIP/3000019-000001a0", "0?Set(CHANNEL(language)=)") in new stack
    -- Executing [s@sub-set-call-vars:14] ExecIf("PJSIP/3000019-000001a0", "0?Set(CHANNEL(language)=)") in new stack
    -- Executing [s@sub-set-call-vars:15] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s@cos-all:5] Gosub("PJSIP/3000019-000001a0", "sub-construct-cid,s,1") in new stack
    -- Executing [s@sub-construct-cid:1] NoOp("PJSIP/3000019-000001a0", "Building CID") in new stack
    -- Executing [s@sub-construct-cid:2] Set("PJSIP/3000019-000001a0", "_CALL_SOURCE=3000019") in new stack
    -- Executing [s@sub-construct-cid:3] Set("PJSIP/3000019-000001a0", "_CS=3000019") in new stack
    -- Executing [s@sub-construct-cid:4] GotoIf("PJSIP/3000019-000001a0", "0?return") in new stack
    -- Executing [s@sub-construct-cid:5] Gosub("PJSIP/3000019-000001a0", "sub-get-device-tree,s,1") in new stack
    -- Executing [s@sub-get-device-tree:1] NoOp("PJSIP/3000019-000001a0", "Configuring Device Tree") in new stack
    -- Executing [s@sub-get-device-tree:2] Set("PJSIP/3000019-000001a0", "DEV_TECHNOLOGY=PJSIP") in new stack
    -- Executing [s@sub-get-device-tree:3] GosubIf("PJSIP/3000019-000001a0", "0?s-local,1") in new stack
    -- Executing [s@sub-get-device-tree:4] GotoIf("PJSIP/3000019-000001a0", "0?return") in new stack
    -- Executing [s@sub-get-device-tree:5] GotoIf("PJSIP/3000019-000001a0", "1?pjsip") in new stack
    -- Goto (sub-get-device-tree,s,9)
    -- Executing [s@sub-get-device-tree:9] NoOp("PJSIP/3000019-000001a0", "A PJSIP") in new stack
    -- Executing [s@sub-get-device-tree:10] Set("PJSIP/3000019-000001a0", "DEV_USER=3000019") in new stack
    -- Executing [s@sub-get-device-tree:11] Goto("PJSIP/3000019-000001a0", "build_interface") in new stack
    -- Goto (sub-get-device-tree,s,13)
    -- Executing [s@sub-get-device-tree:13] Set("PJSIP/3000019-000001a0", "_INTERFACE=PJSIP/3000019") in new stack
    -- Executing [s@sub-get-device-tree:14] Set("PJSIP/3000019-000001a0", "DEV_TREE=devices/PJSIP/3000019") in new stack
    -- Executing [s@sub-get-device-tree:15] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s@sub-construct-cid:6] GotoIf("PJSIP/3000019-000001a0", "0?return") in new stack
    -- Executing [s@sub-construct-cid:7] Set("PJSIP/3000019-000001a0", "_CALL_SOURCE=3000019") in new stack
    -- Executing [s@sub-construct-cid:8] Set("PJSIP/3000019-000001a0", "_CS=3000019") in new stack
    -- Executing [s@sub-construct-cid:9] ExecIf("PJSIP/3000019-000001a0", "1?Set(CALLERID(all)="3000019" <3000019>)") in new stack
    -- Executing [s@sub-construct-cid:10] Set("PJSIP/3000019-000001a0", "_CID_CONSTRUCTED=yes") in new stack
    -- Executing [s@sub-construct-cid:11] NoOp("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s@sub-construct-cid:12] Set("PJSIP/3000019-000001a0", "CDR(source)=3000019") in new stack
    -- Executing [s@sub-construct-cid:13] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s@cos-all:6] Gosub("PJSIP/3000019-000001a0", "set-global-tenant-vars,s,1") in new stack
    -- Executing [s@set-global-tenant-vars:1] NoOp("PJSIP/3000019-000001a0", "Setting Global Vars for vitalpbx Tenant") in new stack
    -- Executing [s@set-global-tenant-vars:2] Set("PJSIP/3000019-000001a0", "__TENANT_PATH=6787bde866811108") in new stack
    -- Executing [s@set-global-tenant-vars:3] Set("PJSIP/3000019-000001a0", "__TENANT_PREFIX=") in new stack
    -- Executing [s@set-global-tenant-vars:4] Set("PJSIP/3000019-000001a0", "__QUEUE_AGENTS_CONTEXT=queue-call-to-agents") in new stack
    -- Executing [s@set-global-tenant-vars:5] Set("PJSIP/3000019-000001a0", "__FOLLOWME_CONTEXT=ext-followme") in new stack
    -- Executing [s@set-global-tenant-vars:6] Set("PJSIP/3000019-000001a0", "__HINTS_CONTEXT=extension-hints") in new stack
    -- Executing [s@set-global-tenant-vars:7] Set("PJSIP/3000019-000001a0", "__DEFAULT_COS=cos-all") in new stack
    -- Executing [s@set-global-tenant-vars:8] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s@cos-all:7] GotoIf("PJSIP/3000019-000001a0", "0?local-dialing") in new stack
    -- Executing [s@cos-all:8] NoOp("PJSIP/3000019-000001a0", "Check if is an Emergency Call") in new stack
    -- Executing [s@cos-all:9] GotoIf("PJSIP/3000019-000001a0", "0?emergency-calls,333,1") in new stack
    -- Executing [s@cos-all:10] Gosub("PJSIP/3000019-000001a0", "sub-lockphone-check,s,1") in new stack
    -- Executing [s@sub-lockphone-check:1] NoOp("PJSIP/3000019-000001a0", "SUB: LOCK PHONE CHECK") in new stack
    -- Executing [s@sub-lockphone-check:2] GotoIf("PJSIP/3000019-000001a0", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:3] GotoIf("PJSIP/3000019-000001a0", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:4] GotoIf("PJSIP/3000019-000001a0", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:5] GotoIf("PJSIP/3000019-000001a0", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:6] GotoIf("PJSIP/3000019-000001a0", "0?:unlock") in new stack
    -- Goto (sub-lockphone-check,s,12)
    -- Executing [s@sub-lockphone-check:12] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s@cos-all:11] Gosub("PJSIP/3000019-000001a0", "sub-local-dialing,s,1") in new stack
    -- Executing [s@sub-local-dialing:1] NoOp("PJSIP/3000019-000001a0", "Trying to determine if is a local extension") in new stack
    -- Executing [s@sub-local-dialing:2] GotoIf("PJSIP/3000019-000001a0", "1?:return") in new stack
    -- Executing [s@sub-local-dialing:3] Set("PJSIP/3000019-000001a0", "EXTENSION_TO_DIAL=333") in new stack
    -- Executing [s@sub-local-dialing:4] Goto("PJSIP/3000019-000001a0", "333,1") in new stack
    -- Goto (sub-local-dialing,333,1)
    -- Executing [333@sub-local-dialing:1] NoOp("PJSIP/3000019-000001a0", "Dialing Local Extension") in new stack
    -- Executing [333@sub-local-dialing:2] ExecIf("PJSIP/3000019-000001a0", "0?NoCDR()") in new stack
    -- Executing [333@sub-local-dialing:3] Gosub("PJSIP/3000019-000001a0", "sub-setup-call-type,s,1(internal)") in new stack
    -- Executing [s@sub-setup-call-type:1] NoOp("PJSIP/3000019-000001a0", "Determinating Call Type") in new stack
    -- Executing [s@sub-setup-call-type:2] GotoIf("PJSIP/3000019-000001a0", "0?return") in new stack
    -- Executing [s@sub-setup-call-type:3] Gosub("PJSIP/3000019-000001a0", "s-internal,1()") in new stack
    -- Executing [s-internal@sub-setup-call-type:1] NoOp("PJSIP/3000019-000001a0", "Internal Call") in new stack
    -- Executing [s-internal@sub-setup-call-type:2] Set("PJSIP/3000019-000001a0", "__CALL_TYPE=1") in new stack
    -- Executing [s-internal@sub-setup-call-type:3] Set("PJSIP/3000019-000001a0", "__CALL_TYPE_LABEL=LOCAL") in new stack
    -- Executing [s-internal@sub-setup-call-type:4] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s@sub-setup-call-type:4] Set("PJSIP/3000019-000001a0", "__CALL_TYPE_CONFIGURED=yes") in new stack
    -- Executing [s@sub-setup-call-type:5] Set("PJSIP/3000019-000001a0", "CDR(calltype)=1") in new stack
    -- Executing [s@sub-setup-call-type:6] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [333@sub-local-dialing:4] Set("PJSIP/3000019-000001a0", "_DESTINATION_STATE=NOT_INUSE") in new stack
    -- Executing [333@sub-local-dialing:5] Set("PJSIP/3000019-000001a0", "_DESTINATION_NUMBER=333") in new stack
    -- Executing [333@sub-local-dialing:6] Set("PJSIP/3000019-000001a0", "_DESTINATION_COS_NAME=cos-all") in new stack
    -- Executing [333@sub-local-dialing:7] Gosub("PJSIP/3000019-000001a0", "sub-check-cos-privacy,s,1(cos-all,1,cos-all)") in new stack
    -- Executing [s@sub-check-cos-privacy:1] NoOp("PJSIP/3000019-000001a0", "Checking Privacy of CoS: cos-all") in new stack
    -- Executing [s@sub-check-cos-privacy:2] GotoIf("PJSIP/3000019-000001a0", "1?:no_local") in new stack
    -- Executing [s@sub-check-cos-privacy:3] Set("PJSIP/3000019-000001a0", "CALLER_COS_ID=1") in new stack
    -- Executing [s@sub-check-cos-privacy:4] Set("PJSIP/3000019-000001a0", "CALLER_COS_NAME=cos-all") in new stack
    -- Executing [s@sub-check-cos-privacy:5] Set("PJSIP/3000019-000001a0", "CALLED_COS_ID=1") in new stack
    -- Executing [s@sub-check-cos-privacy:6] GotoIf("PJSIP/3000019-000001a0", "1?same_cos") in new stack
    -- Goto (sub-check-cos-privacy,s,17)
    -- Executing [s@sub-check-cos-privacy:17] NoOp("PJSIP/3000019-000001a0", "The caller CoS and Callee CoS are the same") in new stack
    -- Executing [s@sub-check-cos-privacy:18] Goto("PJSIP/3000019-000001a0", "return") in new stack
    -- Goto (sub-check-cos-privacy,s,22)
    -- Executing [s@sub-check-cos-privacy:22] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [333@sub-local-dialing:8] Set("PJSIP/3000019-000001a0", "DIAL_STRING=PJSIP/333_1&PJSIP/333&Local/7010@cos-all") in new stack
    -- Executing [333@sub-local-dialing:9] Set("PJSIP/3000019-000001a0", "DB(6787bde866811108/LASTCALLER/333)=3000019") in new stack
    -- Executing [333@sub-local-dialing:10] Set("PJSIP/3000019-000001a0", "IGNORE_DIVERSIONS=") in new stack
    -- Executing [333@sub-local-dialing:11] Set("PJSIP/3000019-000001a0", "QUEUE_CALL=") in new stack
    -- Executing [333@sub-local-dialing:12] GosubIf("PJSIP/3000019-000001a0", "0?sub-queue-members,s,1") in new stack
    -- Executing [333@sub-local-dialing:13] GosubIf("PJSIP/3000019-000001a0", "0?:sub-check-diversions,s,1(predialing)") in new stack
    -- Executing [s@sub-check-diversions:1] NoOp("PJSIP/3000019-000001a0", "Checking diversions for extension 333") in new stack
    -- Executing [s@sub-check-diversions:2] Set("PJSIP/3000019-000001a0", "OLD_CALLER_ID="3000019" <3000019>") in new stack
    -- Executing [s@sub-check-diversions:3] GosubIf("PJSIP/3000019-000001a0", "0?:return") in new stack
    -- Executing [s@sub-check-diversions:9] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s@sub-check-diversions:4] ExecIf("PJSIP/3000019-000001a0", "0?Set(CALLERID(all)="Asmar Kahn" <333>)") in new stack
    -- Executing [s@sub-check-diversions:5] Set("PJSIP/3000019-000001a0", "__CALL_ORIGIN=diversions") in new stack
    -- Executing [s@sub-check-diversions:6] Set("PJSIP/3000019-000001a0", "__DIVERSION_ORIGIN=333") in new stack
    -- Executing [s@sub-check-diversions:7] Gosub("PJSIP/3000019-000001a0", "s-predialing,1") in new stack
    -- Executing [s-predialing@sub-check-diversions:1] NoOp("PJSIP/3000019-000001a0", "Diversions on pre-dialing") in new stack
    -- Executing [s-predialing@sub-check-diversions:2] GosubIf("PJSIP/3000019-000001a0", "0?:diversion-testing,1(Do not Disturb,DND,,,dnd)") in new stack
    -- Executing [diversion-testing@sub-check-diversions:1] NoOp("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [diversion-testing@sub-check-diversions:2] Set("PJSIP/3000019-000001a0", "FROM_NUMBER=333") in new stack
    -- Executing [diversion-testing@sub-check-diversions:3] GotoIf("PJSIP/3000019-000001a0", "0?:next-diversion") in new stack
    -- Goto (sub-check-diversions,diversion-testing,36)
    -- Executing [diversion-testing@sub-check-diversions:36] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s-predialing@sub-check-diversions:3] Gosub("PJSIP/3000019-000001a0", "diversion-testing,1(Call Forward Immeditely,CFI,,,toggle_cfi)") in new stack
    -- Executing [diversion-testing@sub-check-diversions:1] NoOp("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [diversion-testing@sub-check-diversions:2] Set("PJSIP/3000019-000001a0", "FROM_NUMBER=333") in new stack
    -- Executing [diversion-testing@sub-check-diversions:3] GotoIf("PJSIP/3000019-000001a0", "0?:next-diversion") in new stack
    -- Goto (sub-check-diversions,diversion-testing,36)
    -- Executing [diversion-testing@sub-check-diversions:36] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s-predialing@sub-check-diversions:4] GosubIf("PJSIP/3000019-000001a0", "0?:diversion-testing,1(Boss Secretray,BOSS,,,boss_secretary)") in new stack
    -- Executing [diversion-testing@sub-check-diversions:1] NoOp("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [diversion-testing@sub-check-diversions:2] Set("PJSIP/3000019-000001a0", "FROM_NUMBER=333") in new stack
    -- Executing [diversion-testing@sub-check-diversions:3] GotoIf("PJSIP/3000019-000001a0", "0?:next-diversion") in new stack
    -- Goto (sub-check-diversions,diversion-testing,36)
    -- Executing [diversion-testing@sub-check-diversions:36] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s-predialing@sub-check-diversions:5] GosubIf("PJSIP/3000019-000001a0", "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-000001a0", "") in new stack
    -- Executing [diversion-testing@sub-check-diversions:2] Set("PJSIP/3000019-000001a0", "FROM_NUMBER=333") in new stack
    -- Executing [diversion-testing@sub-check-diversions:3] GotoIf("PJSIP/3000019-000001a0", "0?:next-diversion") in new stack
    -- Goto (sub-check-diversions,diversion-testing,36)
    -- Executing [diversion-testing@sub-check-diversions:36] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s-predialing@sub-check-diversions:6] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s@sub-check-diversions:8] Set("PJSIP/3000019-000001a0", "CALLERID(all)="3000019" <3000019>") in new stack
    -- Executing [s@sub-check-diversions:9] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [333@sub-local-dialing:14] GotoIf("PJSIP/3000019-000001a0", "0?post-dial") in new stack
    -- Executing [333@sub-local-dialing:15] Gosub("PJSIP/3000019-000001a0", "parse-dial-string,s,1") in new stack
    -- Executing [s@parse-dial-string:1] NoOp("PJSIP/3000019-000001a0", "Parsing dial string: PJSIP/333_1&PJSIP/333&Local/7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:2] Set("PJSIP/3000019-000001a0", "NEW_DIAL_STRING=") in new stack
    -- Executing [s@parse-dial-string:3] Set("PJSIP/3000019-000001a0", "COUNTER=1") in new stack
    -- Executing [s@parse-dial-string:4] Set("PJSIP/3000019-000001a0", "CURRENT_DEVICE=PJSIP/333_1") in new stack
    -- Executing [s@parse-dial-string:5] While("PJSIP/3000019-000001a0", "1") in new stack
    -- Executing [s@parse-dial-string:6] Set("PJSIP/3000019-000001a0", "TECHNOLOGY=PJSIP") in new stack
    -- Executing [s@parse-dial-string:7] Set("PJSIP/3000019-000001a0", "USER=333_1") in new stack
    -- Executing [s@parse-dial-string:8] GotoIf("PJSIP/3000019-000001a0", "1?:regular") in new stack
    -- Executing [s@parse-dial-string:9] Goto("PJSIP/3000019-000001a0", "regular-pjsip") in new stack
    -- Goto (parse-dial-string,s,12)
    -- Executing [s@parse-dial-string:12] Set("PJSIP/3000019-000001a0", "PARSED_DEV=PJSIP/333_1/sip:72.39.80.82:50173;transport=ws") in new stack
    -- Executing [s@parse-dial-string:13] ExecIf("PJSIP/3000019-000001a0", "0?Set(PARSED_DEV=PJSIP/333_1)") in new stack
    -- Executing [s@parse-dial-string:14] Goto("PJSIP/3000019-000001a0", "append") in new stack
    -- Goto (parse-dial-string,s,16)
    -- Executing [s@parse-dial-string:16] GotoIf("PJSIP/3000019-000001a0", "1?:concatenate") in new stack
    -- Executing [s@parse-dial-string:17] Set("PJSIP/3000019-000001a0", "NEW_DIAL_STRING=PJSIP/333_1/sip:72.39.80.82:50173;transport=ws") in new stack
    -- Executing [s@parse-dial-string:18] Goto("PJSIP/3000019-000001a0", "next") in new stack
    -- Goto (parse-dial-string,s,21)
    -- Executing [s@parse-dial-string:21] Set("PJSIP/3000019-000001a0", "COUNTER=2") in new stack
    -- Executing [s@parse-dial-string:22] Set("PJSIP/3000019-000001a0", "CURRENT_DEVICE=PJSIP/333") in new stack
    -- Executing [s@parse-dial-string:23] EndWhile("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s@parse-dial-string:5] While("PJSIP/3000019-000001a0", "1") in new stack
    -- Executing [s@parse-dial-string:6] Set("PJSIP/3000019-000001a0", "TECHNOLOGY=PJSIP") in new stack
    -- Executing [s@parse-dial-string:7] Set("PJSIP/3000019-000001a0", "USER=333") in new stack
    -- Executing [s@parse-dial-string:8] GotoIf("PJSIP/3000019-000001a0", "1?:regular") in new stack
    -- Executing [s@parse-dial-string:9] Goto("PJSIP/3000019-000001a0", "regular-pjsip") in new stack
    -- Goto (parse-dial-string,s,12)
    -- Executing [s@parse-dial-string:12] Set("PJSIP/3000019-000001a0", "PARSED_DEV=") in new stack
    -- Executing [s@parse-dial-string:13] ExecIf("PJSIP/3000019-000001a0", "1?Set(PARSED_DEV=PJSIP/333)") in new stack
    -- Executing [s@parse-dial-string:14] Goto("PJSIP/3000019-000001a0", "append") in new stack
    -- Goto (parse-dial-string,s,16)
    -- Executing [s@parse-dial-string:16] GotoIf("PJSIP/3000019-000001a0", "0?:concatenate") in new stack
    -- Goto (parse-dial-string,s,19)
    -- Executing [s@parse-dial-string:19] GotoIf("PJSIP/3000019-000001a0", "1?:next") in new stack
    -- Executing [s@parse-dial-string:20] Set("PJSIP/3000019-000001a0", "NEW_DIAL_STRING=PJSIP/333_1/sip:72.39.80.82:50173;transport=ws&PJSIP/333") in new stack
    -- Executing [s@parse-dial-string:21] Set("PJSIP/3000019-000001a0", "COUNTER=3") in new stack
    -- Executing [s@parse-dial-string:22] Set("PJSIP/3000019-000001a0", "CURRENT_DEVICE=Local/7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:23] EndWhile("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s@parse-dial-string:5] While("PJSIP/3000019-000001a0", "1") in new stack
    -- Executing [s@parse-dial-string:6] Set("PJSIP/3000019-000001a0", "TECHNOLOGY=Local") in new stack
    -- Executing [s@parse-dial-string:7] Set("PJSIP/3000019-000001a0", "USER=7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:8] GotoIf("PJSIP/3000019-000001a0", "0?:regular") in new stack
    -- Goto (parse-dial-string,s,15)
    -- Executing [s@parse-dial-string:15] Set("PJSIP/3000019-000001a0", "PARSED_DEV=Local/7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:16] GotoIf("PJSIP/3000019-000001a0", "0?:concatenate") in new stack
    -- Goto (parse-dial-string,s,19)
    -- Executing [s@parse-dial-string:19] GotoIf("PJSIP/3000019-000001a0", "1?:next") in new stack
    -- Executing [s@parse-dial-string:20] Set("PJSIP/3000019-000001a0", "NEW_DIAL_STRING=PJSIP/333_1/sip:72.39.80.82:50173;transport=ws&PJSIP/333&Local/7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:21] Set("PJSIP/3000019-000001a0", "COUNTER=4") in new stack
    -- Executing [s@parse-dial-string:22] Set("PJSIP/3000019-000001a0", "CURRENT_DEVICE=") in new stack
    -- Executing [s@parse-dial-string:23] EndWhile("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s@parse-dial-string:5] While("PJSIP/3000019-000001a0", "0") in new stack
    -- Executing [s@parse-dial-string:24] NoOp("PJSIP/3000019-000001a0", "New dialstring: PJSIP/333_1/sip:72.39.80.82:50173;transport=ws&PJSIP/333&Local/7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:25] Set("PJSIP/3000019-000001a0", "DIAL_STRING=PJSIP/333_1/sip:72.39.80.82:50173;transport=ws&PJSIP/333&Local/7010@cos-all") in new stack
    -- Executing [s@parse-dial-string:26] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [333@sub-local-dialing:16] NoOp("PJSIP/3000019-000001a0", "Configuring Dial Settings") in new stack
    -- Executing [333@sub-local-dialing:17] Set("PJSIP/3000019-000001a0", "RING_TIME=30") in new stack
    -- Executing [333@sub-local-dialing:18] Set("PJSIP/3000019-000001a0", "RING_TIME=30") in new stack
    -- Executing [333@sub-local-dialing:19] Set("PJSIP/3000019-000001a0", "RING_TIME=30") in new stack
    -- Executing [333@sub-local-dialing:20] Set("PJSIP/3000019-000001a0", "DIAL_OPTIONS=kKtrU(GLPI-notify-OPS)") in new stack
    -- Executing [333@sub-local-dialing:21] Set("PJSIP/3000019-000001a0", "DIAL_OPTIONS=kKtrU(GLPI-notify-OPS)") in new stack
    -- Executing [333@sub-local-dialing:22] GotoIf("PJSIP/3000019-000001a0", "0?:answermode") in new stack
    -- Goto (sub-local-dialing,333,26)
    -- Executing [333@sub-local-dialing:26] Set("PJSIP/3000019-000001a0", "ANSWER_MODE=disable") in new stack
    -- Executing [333@sub-local-dialing:27] Set("PJSIP/3000019-000001a0", "ANSWER_MODE=disable") in new stack
    -- Executing [333@sub-local-dialing:28] GotoIf("PJSIP/3000019-000001a0", "0?check-hd") in new stack
    -- Executing [333@sub-local-dialing:29] ExecIf("PJSIP/3000019-000001a0", "0?Set(EXEC_AA=yes)") in new stack
    -- Executing [333@sub-local-dialing:30] ExecIf("PJSIP/3000019-000001a0", "0?Set(EXEC_AA=yes)") in new stack
    -- Executing [333@sub-local-dialing:31] Set("PJSIP/3000019-000001a0", "IS_HOT_DESK=no") in new stack
    -- Executing [333@sub-local-dialing:32] Set("PJSIP/3000019-000001a0", "MOH_CLASS=default") in new stack
    -- Executing [333@sub-local-dialing:33] GosubIf("PJSIP/3000019-000001a0", "0?sub-set-moh,s,1(default)") in new stack
    -- Executing [333@sub-local-dialing:34] GotoIf("PJSIP/3000019-000001a0", "0?busy-here") in new stack
    -- Executing [333@sub-local-dialing:35] Set("PJSIP/3000019-000001a0", "FORCE_RECORDING=no") in new stack
    -- Executing [333@sub-local-dialing:36] Set("PJSIP/3000019-000001a0", "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-000001a0", "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-000001a0", "__TRANSFERED_CALL=TRUE") in new stack
    -- Executing [333@sub-local-dialing:39] NoOp("PJSIP/3000019-000001a0", "Enable Follow-Me Ring Time If needed") in new stack
    -- Executing [333@sub-local-dialing:40] GotoIf("PJSIP/3000019-000001a0", "0?:check-rt") in new stack
    -- Goto (sub-local-dialing,333,47)
    -- Executing [333@sub-local-dialing:47] GotoIf("PJSIP/3000019-000001a0", "0?post-dial") in new stack
    -- Executing [333@sub-local-dialing:48] GotoIf("PJSIP/3000019-000001a0", "0?end_call") in new stack
    -- Executing [333@sub-local-dialing:49] Gosub("PJSIP/3000019-000001a0", "sub-udpate-virtual-dev-state,s,1(333,BUSY)") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:1] NoOp("PJSIP/3000019-000001a0", "Update Virtual Devices State") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:2] Set("PJSIP/3000019-000001a0", "EXT_NUM=333") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:3] Set("PJSIP/3000019-000001a0", "NEW_STATUS=BUSY") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:4] Set("PJSIP/3000019-000001a0", "EXTENSION_ID=7") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:5] Set("PJSIP/3000019-000001a0", "ODBC_ID=635") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:6] GotoIf("PJSIP/3000019-000001a0", "0?no_rows") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:7] Set("PJSIP/3000019-000001a0", "COUNTER=1") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:8] While("PJSIP/3000019-000001a0", "1") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:9] Set("PJSIP/3000019-000001a0", "VDevice=33") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:10] Set("PJSIP/3000019-000001a0", "DEVICE_STATE(Custom:VirtualDev33)=BUSY") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:11] Set("PJSIP/3000019-000001a0", "COUNTER=2") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:12] EndWhile("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:8] While("PJSIP/3000019-000001a0", "0") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:13] ODBCFinish("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:14] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [333@sub-local-dialing:50] Dial("PJSIP/3000019-000001a0", "PJSIP/333_1/sip:72.39.80.82:50173;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-09-01 06:17:31] ERROR[27962]: 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-09-01 06:17:31] ERROR[27962]: chan_pjsip.c:2657 request: Failed to create outgoing session to endpoint '333'
[2022-09-01 06:17:31] WARNING[18606][C-00000341]: app_dial.c:2663 dial_exec_full: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)
    -- PJSIP/333_1-000001a1 Internal Gosub(sub-before-connecting-call,s,1(6787bde866811108,3000019,333,,)) start
    -- Executing [s@sub-before-connecting-call:1] NoOp("PJSIP/333_1-000001a1", "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-000001a1", "TENANT=6787bde866811108") in new stack
    -- Executing [s@sub-before-connecting-call:3] Set("PJSIP/333_1-000001a1", "CALLER=3000019") in new stack
    -- Executing [s@sub-before-connecting-call:4] Set("PJSIP/333_1-000001a1", "CALLEE=333") in new stack
    -- Executing [s@sub-before-connecting-call:5] Set("PJSIP/333_1-000001a1", "EXEC_AA=") in new stack
    -- Executing [s@sub-before-connecting-call:6] Set("PJSIP/333_1-000001a1", "CUSTOM_ALERT_INFO=") in new stack
    -- Executing [s@sub-before-connecting-call:7] Set("PJSIP/333_1-000001a1", "APP_TYPE=NONE") in new stack
    -- Executing [s@sub-before-connecting-call:8] GosubIf("PJSIP/333_1-000001a1", "0?sub-auto-answer,s,1") in new stack
    -- Executing [s@sub-before-connecting-call:9] GosubIf("PJSIP/333_1-000001a1", "0?sub-set-custom-header,s,1(Alert-Info,)") in new stack
    -- Executing [s@sub-before-connecting-call:10] GosubIf("PJSIP/333_1-000001a1", "0?sub-set-custom-header,s,1(Call-Info,)") in new stack
    -- Executing [s@sub-before-connecting-call:11] Gosub("PJSIP/333_1-000001a1", "sub-set-custom-header,s,1(CALL-TYPE,LOCAL)") in new stack
    -- Executing [s@sub-set-custom-header:1] NoOp("PJSIP/333_1-000001a1", "Setting up custom header") in new stack
    -- Executing [s@sub-set-custom-header:2] GotoIf("PJSIP/333_1-000001a1", "0?set-sip") in new stack
    -- Executing [s@sub-set-custom-header:3] NoOp("PJSIP/333_1-000001a1", "Add PJSIP Headers") in new stack
    -- Executing [s@sub-set-custom-header:4] Set("PJSIP/333_1-000001a1", "PJSIP_HEADER(add,CALL-TYPE)=LOCAL") in new stack
    -- Executing [s@sub-set-custom-header:5] Goto("PJSIP/333_1-000001a1", "end") in new stack
    -- Goto (sub-set-custom-header,s,8)
    -- Executing [s@sub-set-custom-header:8] Return("PJSIP/333_1-000001a1", "") in new stack
    -- Executing [s@sub-before-connecting-call:12] Gosub("PJSIP/333_1-000001a1", "sub-set-custom-header,s,1(APPLICATION,NONE)") in new stack
    -- Executing [s@sub-set-custom-header:1] NoOp("PJSIP/333_1-000001a1", "Setting up custom header") in new stack
    -- Executing [s@sub-set-custom-header:2] GotoIf("PJSIP/333_1-000001a1", "0?set-sip") in new stack
    -- Executing [s@sub-set-custom-header:3] NoOp("PJSIP/333_1-000001a1", "Add PJSIP Headers") in new stack
    -- Executing [s@sub-set-custom-header:4] Set("PJSIP/333_1-000001a1", "PJSIP_HEADER(add,APPLICATION)=NONE") in new stack
    -- Executing [s@sub-set-custom-header:5] Goto("PJSIP/333_1-000001a1", "end") in new stack
    -- Goto (sub-set-custom-header,s,8)
    -- Executing [s@sub-set-custom-header:8] Return("PJSIP/333_1-000001a1", "") in new stack
    -- Executing [s@sub-before-connecting-call:13] GosubIf("PJSIP/333_1-000001a1", "0?sub-set-custom-header,s,1(QUEUE-NAME,)") in new stack
    -- Executing [s@sub-before-connecting-call:14] GosubIf("PJSIP/333_1-000001a1", "0?before-connecting-call-hook,s,1") in new stack
    -- Executing [s@sub-before-connecting-call:15] Return("PJSIP/333_1-000001a1", "") in new stack
  == Spawn extension (cos-all, 333, 1) exited non-zero on 'PJSIP/333_1-000001a1'
    -- PJSIP/333_1-000001a1 Internal Gosub(sub-before-connecting-call,s,1(6787bde866811108,3000019,333,,)) complete GOSUB_RETVAL=
    -- Local/7010@cos-all-0000013b;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-0000013b;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-0000013b;1", "TENANT=6787bde866811108") in new stack
    -- Executing [s@sub-before-connecting-call:3] Set("Local/7010@cos-all-0000013b;1", "CALLER=3000019") in new stack
    -- Executing [s@sub-before-connecting-call:4] Set("Local/7010@cos-all-0000013b;1", "CALLEE=333") in new stack
    -- Executing [s@sub-before-connecting-call:5] Set("Local/7010@cos-all-0000013b;1", "EXEC_AA=") in new stack
    -- Executing [s@sub-before-connecting-call:6] Set("Local/7010@cos-all-0000013b;1", "CUSTOM_ALERT_INFO=") in new stack
    -- Executing [s@sub-before-connecting-call:7] Set("Local/7010@cos-all-0000013b;1", "APP_TYPE=NONE") in new stack
    -- Executing [s@sub-before-connecting-call:8] GosubIf("Local/7010@cos-all-0000013b;1", "0?sub-auto-answer,s,1") in new stack
    -- Executing [s@sub-before-connecting-call:9] GosubIf("Local/7010@cos-all-0000013b;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-0000013b;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-0000013b;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-0000013b;1", "Setting up custom header") in new stack
    -- Executing [s@sub-set-custom-header:2] GotoIf("Local/7010@cos-all-0000013b;1", "0?set-sip") in new stack
    -- Executing [s@sub-set-custom-header:3] NoOp("Local/7010@cos-all-0000013b;1", "Add PJSIP Headers") in new stack
    -- Executing [s@sub-set-custom-header:4] Set("Local/7010@cos-all-0000013b;1", "PJSIP_HEADER(add,CALL-TYPE)=LOCAL") in new stack
[2022-09-01 06:17:31] ERROR[18606][C-00000341]: 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-0000013b;1", "end") in new stack
    -- Goto (sub-set-custom-header,s,8)
    -- Executing [s@sub-set-custom-header:8] Return("Local/7010@cos-all-0000013b;1", "") in new stack
    -- Executing [s@sub-before-connecting-call:12] Gosub("Local/7010@cos-all-0000013b;1", "sub-set-custom-header,s,1(APPLICATION,NONE)") in new stack
    -- Executing [s@sub-set-custom-header:1] NoOp("Local/7010@cos-all-0000013b;1", "Setting up custom header") in new stack
    -- Executing [s@sub-set-custom-header:2] GotoIf("Local/7010@cos-all-0000013b;1", "0?set-sip") in new stack
    -- Executing [s@sub-set-custom-header:3] NoOp("Local/7010@cos-all-0000013b;1", "Add PJSIP Headers") in new stack
    -- Executing [s@sub-set-custom-header:4] Set("Local/7010@cos-all-0000013b;1", "PJSIP_HEADER(add,APPLICATION)=NONE") in new stack
[2022-09-01 06:17:31] ERROR[18606][C-00000341]: 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-0000013b;1", "end") in new stack
    -- Goto (sub-set-custom-header,s,8)
    -- Executing [s@sub-set-custom-header:8] Return("Local/7010@cos-all-0000013b;1", "") in new stack
    -- Executing [s@sub-before-connecting-call:13] GosubIf("Local/7010@cos-all-0000013b;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-0000013b;1", "0?before-connecting-call-hook,s,1") in new stack
    -- Executing [s@sub-before-connecting-call:15] Return("Local/7010@cos-all-0000013b;1", "") in new stack
  == Spawn extension (cos-all, 333, 1) exited non-zero on 'Local/7010@cos-all-0000013b;1'
    -- Local/7010@cos-all-0000013b;1 Internal Gosub(sub-before-connecting-call,s,1(6787bde866811108,3000019,333,,)) complete GOSUB_RETVAL=
    -- Called PJSIP/333_1/sip:72.39.80.82:50173;transport=ws
    -- Called Local/7010@cos-all
    -- Executing [7010@cos-all:1] NoOp("Local/7010@cos-all-0000013b;2", "More than on digit pattern") in new stack
    -- Executing [7010@cos-all:2] Gosub("Local/7010@cos-all-0000013b;2", "s,1(7010)") in new stack
    -- Executing [s@cos-all:1] Set("Local/7010@cos-all-0000013b;2", "EXTENSION=7010") in new stack
    -- Executing [s@cos-all:2] NoOp("Local/7010@cos-all-0000013b;2", "Dialing 7010 from 3000019") in new stack
    -- Executing [s@cos-all:3] Gosub("Local/7010@cos-all-0000013b;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-0000013b;2", "Setting Global Vars") in new stack
    -- Executing [s@sub-set-global-vars:2] Set("Local/7010@cos-all-0000013b;2", "TENANT_PATH=6787bde866811108") in new stack
    -- Executing [s@sub-set-global-vars:3] Set("Local/7010@cos-all-0000013b;2", "PREFIX=") in new stack
    -- Executing [s@sub-set-global-vars:4] Set("Local/7010@cos-all-0000013b;2", "__PICKUPMARK=7010") in new stack
    -- Executing [s@sub-set-global-vars:5] Set("Local/7010@cos-all-0000013b;2", "__PARKINGLOT=parking-1") in new stack
    -- Executing [s@sub-set-global-vars:6] Set("Local/7010@cos-all-0000013b;2", "__DYNAMIC_FEATURES=custom-features") in new stack
    -- Executing [s@sub-set-global-vars:7] Set("Local/7010@cos-all-0000013b;2", "ICALL=no") in new stack
    -- Executing [s@sub-set-global-vars:8] Return("Local/7010@cos-all-0000013b;2", "") in new stack
    -- Executing [s@cos-all:4] Gosub("Local/7010@cos-all-0000013b;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-0000013b;2", "Setting Call Vars") in new stack
    -- Executing [s@sub-set-call-vars:2] Set("Local/7010@cos-all-0000013b;2", "_TENANT=6787bde866811108") in new stack
    -- Executing [s@sub-set-call-vars:3] Set("Local/7010@cos-all-0000013b;2", "_CALL_DESTINATION=7010") in new stack
    -- Executing [s@sub-set-call-vars:4] Set("Local/7010@cos-all-0000013b;2", "_COS_ID=1") in new stack
    -- Executing [s@sub-set-call-vars:5] Set("Local/7010@cos-all-0000013b;2", "_COS_NAME=cos-all") in new stack
    -- Executing [s@sub-set-call-vars:6] Set("Local/7010@cos-all-0000013b;2", "__TRANSFER_CONTEXT=cos-all") in new stack
    -- Executing [s@sub-set-call-vars:7] Set("Local/7010@cos-all-0000013b;2", "_ARS=ARS-all") in new stack
    -- Executing [s@sub-set-call-vars:8] Set("Local/7010@cos-all-0000013b;2", "CDR(tenant)=vitalpbx") in new stack
    -- Executing [s@sub-set-call-vars:9] Set("Local/7010@cos-all-0000013b;2", "CDR(destination)=7010") in new stack
    -- Executing [s@sub-set-call-vars:10] Set("Local/7010@cos-all-0000013b;2", "CDR(trunk)=") in new stack
    -- Executing [s@sub-set-call-vars:11] Set("Local/7010@cos-all-0000013b;2", "CDR(did)=") in new stack
    -- Executing [s@sub-set-call-vars:12] Set("Local/7010@cos-all-0000013b;2", "__CALLID=1662005851.1823") in new stack
    -- Executing [s@sub-set-call-vars:13] ExecIf("Local/7010@cos-all-0000013b;2", "0?Set(CHANNEL(language)=)") in new stack
    -- Executing [s@sub-set-call-vars:14] ExecIf("Local/7010@cos-all-0000013b;2", "1?Set(CHANNEL(language)=en)") in new stack
    -- Executing [s@sub-set-call-vars:15] Return("Local/7010@cos-all-0000013b;2", "") in new stack
    -- Executing [s@cos-all:5] Gosub("Local/7010@cos-all-0000013b;2", "sub-construct-cid,s,1") in new stack
    -- Executing [s@sub-construct-cid:1] NoOp("Local/7010@cos-all-0000013b;2", "Building CID") in new stack
    -- Executing [s@sub-construct-cid:2] Set("Local/7010@cos-all-0000013b;2", "_CALL_SOURCE=3000019") in new stack
    -- Executing [s@sub-construct-cid:3] Set("Local/7010@cos-all-0000013b;2", "_CS=3000019") in new stack
    -- Executing [s@sub-construct-cid:4] GotoIf("Local/7010@cos-all-0000013b;2", "1?return") in new stack
    -- Goto (sub-construct-cid,s,11)
    -- Executing [s@sub-construct-cid:11] NoOp("Local/7010@cos-all-0000013b;2", "") in new stack
    -- Executing [s@sub-construct-cid:12] Set("Local/7010@cos-all-0000013b;2", "CDR(source)=3000019") in new stack
    -- Executing [s@sub-construct-cid:13] Return("Local/7010@cos-all-0000013b;2", "") in new stack
    -- Executing [s@cos-all:6] Gosub("Local/7010@cos-all-0000013b;2", "set-global-tenant-vars,s,1") in new stack
    -- Executing [s@set-global-tenant-vars:1] NoOp("Local/7010@cos-all-0000013b;2", "Setting Global Vars for vitalpbx Tenant") in new stack
    -- Executing [s@set-global-tenant-vars:2] Set("Local/7010@cos-all-0000013b;2", "__TENANT_PATH=6787bde866811108") in new stack
    -- Executing [s@set-global-tenant-vars:3] Set("Local/7010@cos-all-0000013b;2", "__TENANT_PREFIX=") in new stack
    -- Executing [s@set-global-tenant-vars:4] Set("Local/7010@cos-all-0000013b;2", "__QUEUE_AGENTS_CONTEXT=queue-call-to-agents") in new stack
    -- Executing [s@set-global-tenant-vars:5] Set("Local/7010@cos-all-0000013b;2", "__FOLLOWME_CONTEXT=ext-followme") in new stack
    -- Executing [s@set-global-tenant-vars:6] Set("Local/7010@cos-all-0000013b;2", "__HINTS_CONTEXT=extension-hints") in new stack
    -- Executing [s@set-global-tenant-vars:7] Set("Local/7010@cos-all-0000013b;2", "__DEFAULT_COS=cos-all") in new stack
    -- Executing [s@set-global-tenant-vars:8] Return("Local/7010@cos-all-0000013b;2", "") in new stack
    -- Executing [s@cos-all:7] GotoIf("Local/7010@cos-all-0000013b;2", "0?local-dialing") in new stack
    -- Executing [s@cos-all:8] NoOp("Local/7010@cos-all-0000013b;2", "Check if is an Emergency Call") in new stack
    -- Executing [s@cos-all:9] GotoIf("Local/7010@cos-all-0000013b;2", "0?emergency-calls,7010,1") in new stack
    -- Executing [s@cos-all:10] Gosub("Local/7010@cos-all-0000013b;2", "sub-lockphone-check,s,1") in new stack
    -- Executing [s@sub-lockphone-check:1] NoOp("Local/7010@cos-all-0000013b;2", "SUB: LOCK PHONE CHECK") in new stack
    -- Executing [s@sub-lockphone-check:2] GotoIf("Local/7010@cos-all-0000013b;2", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:3] GotoIf("Local/7010@cos-all-0000013b;2", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:4] GotoIf("Local/7010@cos-all-0000013b;2", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:5] GotoIf("Local/7010@cos-all-0000013b;2", "0?unlock") in new stack
    -- Executing [s@sub-lockphone-check:6] GotoIf("Local/7010@cos-all-0000013b;2", "0?:unlock") in new stack
    -- Goto (sub-lockphone-check,s,12)
    -- Executing [s@sub-lockphone-check:12] Return("Local/7010@cos-all-0000013b;2", "") in new stack
    -- Executing [s@cos-all:11] Gosub("Local/7010@cos-all-0000013b;2", "sub-local-dialing,s,1") in new stack
    -- Executing [s@sub-local-dialing:1] NoOp("Local/7010@cos-all-0000013b;2", "Trying to determine if is a local extension") in new stack
    -- Executing [s@sub-local-dialing:2] GotoIf("Local/7010@cos-all-0000013b;2", "0?:return") in new stack
    -- Goto (sub-local-dialing,s,5)
    -- Executing [s@sub-local-dialing:5] Return("Local/7010@cos-all-0000013b;2", "") in new stack
    -- Executing [s@cos-all:12] GotoIf("Local/7010@cos-all-0000013b;2", "0?end-call") in new stack
    -- Executing [s@cos-all:13] Goto("Local/7010@cos-all-0000013b;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-0000013b;2", "sub-set-call-vars,app-incoming,1") in new stack
    -- Executing [app-incoming@sub-set-call-vars:1] NoOp("Local/7010@cos-all-0000013b;2", "Incoming Call App CDR") in new stack
    -- Executing [app-incoming@sub-set-call-vars:2] GotoIf("Local/7010@cos-all-0000013b;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-0000013b;2", "") in new stack
    -- Executing [7010@cos-all-post:2] NoOp("Local/7010@cos-all-0000013b;2", "Custom Application: GLPI-notify-OPS") in new stack
    -- Executing [7010@cos-all-post:3] Goto("Local/7010@cos-all-0000013b;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-0000013b;2", "GLPI-notify-OPS") in new stack
    -- Executing [cc-6@custom-contexts:2] Gosub("Local/7010@cos-all-0000013b;2", "before-bridging-call-hook,GLPI-Support,1(app-termination,hangup,1)") in new stack
[2022-09-01 06:17:31] ERROR[18607][C-00000341]: app_stack.c:593 gosub_exec: Gosub attempted to reach non-existent destination 'before-bridging-call-hook,GLPI-Support,1' from 'custom-contexts,cc-6,2'
  == Spawn extension (custom-contexts, cc-6, 2) exited non-zero on 'Local/7010@cos-all-0000013b;2'
  == DTLS ECDH initialized (automatic), faster PFS enabled
    -- PJSIP/333_1-000001a1 connected line has changed. Saving it until answer for PJSIP/3000019-000001a0
    -- PJSIP/333_1-000001a1 is ringing
       > 0x7f9f7425e370 -- Strict RTP learning after remote address set to: 72.39.80.82:54314
    -- PJSIP/333_1-000001a1 answered PJSIP/3000019-000001a0
    -- PJSIP/333_1-000001a1 Internal Gosub(sub-before-bridging-call,s,1(6787bde866811108,3000019,333,no)) start
    -- Executing [s@sub-before-bridging-call:1] NoOp("PJSIP/333_1-000001a1", "Executing sub-routine before connecting to the calling channel") in new stack
    -- Executing [s@sub-before-bridging-call:2] Set("PJSIP/333_1-000001a1", "TENANT=6787bde866811108") in new stack
    -- Executing [s@sub-before-bridging-call:3] Set("PJSIP/333_1-000001a1", "CALLER=3000019") in new stack
    -- Executing [s@sub-before-bridging-call:4] Set("PJSIP/333_1-000001a1", "CALLEE=333") in new stack
    -- Executing [s@sub-before-bridging-call:5] Set("PJSIP/333_1-000001a1", "FORCE_CALL_RECORDING=no") in new stack
    -- Executing [s@sub-before-bridging-call:6] NoOp("PJSIP/333_1-000001a1", "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-000001a1", "1?call-recording") in new stack
    -- Goto (sub-before-bridging-call,s,9)
    -- Executing [s@sub-before-bridging-call:9] NoOp("PJSIP/333_1-000001a1", "Executing the call-recording sub-routine") in new stack
    -- Executing [s@sub-before-bridging-call:10] Gosub("PJSIP/333_1-000001a1", "sub-call-recording,s,1(6787bde866811108,3000019,333,no)") in new stack
    -- Executing [s@sub-call-recording:1] NoOp("PJSIP/333_1-000001a1", "Check if call will be recorded on tenant 6787bde866811108") in new stack
    -- Executing [s@sub-call-recording:2] NoOp("PJSIP/333_1-000001a1", "Call Type: 1 ") in new stack
    -- Executing [s@sub-call-recording:3] Set("PJSIP/333_1-000001a1", "TENANT=6787bde866811108") in new stack
    -- Executing [s@sub-call-recording:4] Set("PJSIP/333_1-000001a1", "CALLER=3000019") in new stack
    -- Executing [s@sub-call-recording:5] Set("PJSIP/333_1-000001a1", "CALLEE=333") in new stack
    -- Executing [s@sub-call-recording:6] Set("PJSIP/333_1-000001a1", "APP_FORCE=no") in new stack
    -- Executing [s@sub-call-recording:7] GotoIf("PJSIP/333_1-000001a1", "1?:rec_no_available") in new stack
    -- Executing [s@sub-call-recording:8] GotoIf("PJSIP/333_1-000001a1", "0?perform-recording") in new stack
    -- Executing [s@sub-call-recording:9] GotoIf("PJSIP/333_1-000001a1", "1?perform-recording") in new stack
    -- Goto (sub-call-recording,s,14)
    -- Executing [s@sub-call-recording:14] Gosub("PJSIP/333_1-000001a1", "sub-perform-recording,s,1") in new stack
    -- Executing [s@sub-perform-recording:1] NoOp("PJSIP/333_1-000001a1", "Perform Call Recording") in new stack
    -- Executing [s@sub-perform-recording:2] Set("PJSIP/333_1-000001a1", "RECORDING_ID=1662005851.1821") in new stack
    -- Executing [s@sub-perform-recording:3] Set("PJSIP/333_1-000001a1", "APP_TYPE=NONE") in new stack
    -- Executing [s@sub-perform-recording:4] Set("PJSIP/333_1-000001a1", "AUDIO_FILE=061733-LOCAL-NONE-3000019-333-1662005851.1821") in new stack
    -- Executing [s@sub-perform-recording:5] Set("PJSIP/333_1-000001a1", "RECORDING_FORMAT=wav") in new stack
    -- Executing [s@sub-perform-recording:6] Set("PJSIP/333_1-000001a1", "__REC_FILENAME=/var/spool/asterisk/monitor/2022/09/01/061733-LOCAL-NONE-3000019-333-1662005851.1821.wav") in new stack
    -- Executing [s@sub-perform-recording:7] GotoIf("PJSIP/333_1-000001a1", "0?:set_rec_file") in new stack
    -- Goto (sub-perform-recording,s,10)
    -- Executing [s@sub-perform-recording:10] Set("PJSIP/333_1-000001a1", "CDR(recfile)=/var/spool/asterisk/monitor/2022/09/01/061733-LOCAL-NONE-3000019-333-1662005851.1821.wav") in new stack
    -- Executing [s@sub-perform-recording:11] MixMonitor("PJSIP/333_1-000001a1", "/var/spool/asterisk/monitor/2022/09/01/061733-LOCAL-NONE-3000019-333-1662005851.1821.wav,b,") in new stack
    -- Executing [s@sub-perform-recording:12] Return("PJSIP/333_1-000001a1", "") in new stack
    -- Executing [s@sub-call-recording:15] Goto("PJSIP/333_1-000001a1", "return") in new stack
    -- Goto (sub-call-recording,s,17)
    -- Executing [s@sub-call-recording:17] Return("PJSIP/333_1-000001a1", "") in new stack
    -- Executing [s@sub-before-bridging-call:11] NoOp("PJSIP/333_1-000001a1", "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-000001a1", "1?before-bridging-call-hook,s,1") in new stack
    -- Executing [s@before-bridging-call-hook:1] NoOp("PJSIP/333_1-000001a1", "Entering custom context before bridging the call") in new stack
    -- Executing [s@before-bridging-call-hook:2] GosubIf("PJSIP/333_1-000001a1", "1?GLPI-notify-OPS,GLPI-Support,1") in new stack
    -- Executing [GLPI-Support@GLPI-notify-OPS:1] Set("PJSIP/333_1-000001a1", "user=zammad") in new stack
    -- Executing [GLPI-Support@GLPI-notify-OPS:2] Set("PJSIP/333_1-000001a1", "pass=zammad") in new stack
    -- Executing [GLPI-Support@GLPI-notify-OPS:3] Set("PJSIP/333_1-000001a1", "schema=zammad_production") in new stack
    -- Executing [GLPI-Support@GLPI-notify-OPS:4] Set("PJSIP/333_1-000001a1", "server=75.119.134.12") in new stack
  == Begin MixMonitor Recording PJSIP/333_1-000001a1
    -- Executing [GLPI-Support@GLPI-notify-OPS:5] Set("PJSIP/333_1-000001a1", "ARRAY(fname,lname,getemail,phone)=") in new stack
    -- Executing [GLPI-Support@GLPI-notify-OPS:6] Set("PJSIP/333_1-000001a1", "sendemail=") in new stack
    -- Executing [GLPI-Support@GLPI-notify-OPS:7] ExecIf("PJSIP/333_1-000001a1", "1?Set(sendemail=Do-not-reply@pbx.noreply)") in new stack
       > 0x7f9f7425e370 -- Strict RTP learning after ICE completion
       > 0x7f9f7425e370 -- Strict RTP learning after remote address set to: 72.39.80.82:54314
       > 0x7f9f7425e370 -- Strict RTP switching to RTP target address 72.39.80.82:54314 as source
    -- Executing [GLPI-Support@GLPI-notify-OPS:8] Set("PJSIP/333_1-000001a1", "Answer=error: The login is not valid. Unable to add user. User: AgentBadge: 12 .... New user added successfully") in new stack
[2022-09-01 06:17:35] NOTICE[18606][C-00000341]: app_stack.c:1079 gosub_run: PJSIP/333_1-000001a1 Abnormal 'Gosub(sub-before-bridging-call,s,1(6787bde866811108,3000019,333,no))' exit.  Popping routine return locations.
       > 0x7f9f3c0aee90 -- Strict RTP learning after remote address set to: 192.168.1.18:5042
    -- Channel PJSIP/333_1-000001a1 joined 'simple_bridge' basic-bridge <d8d6ef8c-4f0c-470f-beae-d628541ad6c7>
    -- Channel PJSIP/333_1-000001a1 left 'simple_bridge' basic-bridge <d8d6ef8c-4f0c-470f-beae-d628541ad6c7>
  == Spawn extension (sub-local-dialing, 333, 50) exited non-zero on 'PJSIP/3000019-000001a0'
    -- Executing [h@sub-local-dialing:1] NoOp("PJSIP/3000019-000001a0", "Finishing the call") in new stack
    -- Executing [h@sub-local-dialing:2] Gosub("PJSIP/3000019-000001a0", "sub-udpate-virtual-dev-state,s,1(333,NOT_INUSE)") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:1] NoOp("PJSIP/3000019-000001a0", "Update Virtual Devices State") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:2] Set("PJSIP/3000019-000001a0", "EXT_NUM=333") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:3] Set("PJSIP/3000019-000001a0", "NEW_STATUS=NOT_INUSE") in new stack
  == MixMonitor close filestream (mixed)
    -- Executing [s@sub-udpate-virtual-dev-state:4] Set("PJSIP/3000019-000001a0", "EXTENSION_ID=7") in new stack
  == End MixMonitor Recording PJSIP/333_1-000001a1
    -- Executing [s@sub-udpate-virtual-dev-state:5] Set("PJSIP/3000019-000001a0", "ODBC_ID=636") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:6] GotoIf("PJSIP/3000019-000001a0", "0?no_rows") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:7] Set("PJSIP/3000019-000001a0", "COUNTER=1") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:8] While("PJSIP/3000019-000001a0", "1") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:9] Set("PJSIP/3000019-000001a0", "VDevice=33") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:10] Set("PJSIP/3000019-000001a0", "DEVICE_STATE(Custom:VirtualDev33)=NOT_INUSE") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:11] Set("PJSIP/3000019-000001a0", "COUNTER=2") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:12] EndWhile("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:8] While("PJSIP/3000019-000001a0", "0") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:13] ODBCFinish("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [s@sub-udpate-virtual-dev-state:14] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [h@sub-local-dialing:3] GosubIf("PJSIP/3000019-000001a0", "0?dynamic-routing-connected,s,1(ANSWER,3000019)") in new stack
    -- Executing [h@sub-local-dialing:4] GotoIf("PJSIP/3000019-000001a0", "0?call_ended") in new stack
    -- Executing [h@sub-local-dialing:5] GosubIf("PJSIP/3000019-000001a0", "0?wake-up-no-answered,s,1") in new stack
    -- Executing [h@sub-local-dialing:6] Gosub("PJSIP/3000019-000001a0", "sub-call-completion-check,s,1") in new stack
    -- Executing [s@sub-call-completion-check:1] NoOp("PJSIP/3000019-000001a0", "FEATURE: CALL COMPLETION CHECK") in new stack
    -- Executing [s@sub-call-completion-check:2] Set("PJSIP/3000019-000001a0", "CC_MODE=none") in new stack
    -- Executing [s@sub-call-completion-check:3] Set("PJSIP/3000019-000001a0", "CC_MODE=none") in new stack
    -- Executing [s@sub-call-completion-check:4] Set("PJSIP/3000019-000001a0", "CC_MODE=none") in new stack
    -- Executing [s@sub-call-completion-check:5] GotoIf("PJSIP/3000019-000001a0", "1?end") in new stack
    -- Goto (sub-call-completion-check,s,17)
    -- Executing [s@sub-call-completion-check:17] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [h@sub-local-dialing:7] NoOp("PJSIP/3000019-000001a0", "Call ended") in new stack
    -- Executing [h@sub-local-dialing:8] Gosub("PJSIP/3000019-000001a0", "notify-call-hangup,s,1") in new stack
    -- Executing [s@notify-call-hangup:1] Verbose("PJSIP/3000019-000001a0", "0, Extension Hangup") in new stack
 Extension Hangup
    -- Executing [s@notify-call-hangup:2] GotoIf("PJSIP/3000019-000001a0", "1?:incoming") in new stack
    -- Executing [s@notify-call-hangup:3] UserEvent("PJSIP/3000019-000001a0", ""EXTENSIONS_SUMMARY","Data: EXT_TO_EXT,PJSIP/3000019-0000001v,PJSIP/333_1-000001a1,LOCAL"") in new stack
    -- Executing [s@notify-call-hangup:4] Goto("PJSIP/3000019-000001a0", "end") in new stack
    -- Goto (notify-call-hangup,s,7)
    -- Executing [s@notify-call-hangup:7] Return("PJSIP/3000019-000001a0", "") in new stack
    -- Executing [h@sub-local-dialing:9] Hangup("PJSIP/3000019-000001a0", "") in new stack
  == Spawn extension (sub-local-dialing, h, 9) exited non-zero on 'PJSIP/3000019-000001a0'

That’s probably because the U option is executed on the new channel,
You can use the ${CALL_SOURCE} variable to get the callers number, and either ${CALL_DESTINATION} or ${NTD} (depending if it’s an incoming or outgoing call) to get the callee’s number

thanks

is there any alternate of this variable as well ? ${EXTEN}

image

Hi,

is there a way to run two separate context from “before-bridging-call-hook” ?

I have multiple context but they all need to be executed after the call is answered…

[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,GosubIf($["X${GOSUB_RESULT}X"="XX"]?GLPI-email-OPS,Email-Support,1) ; Only if call was actually answered
 same => n,Return()


[GLPI-notify-OPS]

Script here .....


[GLPI-email-OPS]

script here.......

I see that you are already doing that. What’s the problem here?

I need to run the following context separately but only on answered calls. the following is the CC .conf file and the screen shot of my CC in GUI, they are not working as expected, always running the first one…

[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,GosubIf($["X${GOSUB_RESULT}X"="XX"]?GLPI-notify-OPS1,Support,1) ; Only if call was actually answered
same => n,Return()

[GLPI-notify-OPS]

;PHP INSERT
same=>n,Set(Answer=${CURL(https://phone.testabc.uk/testcon.php?fname=$[${fname}]&lname=$[${lname}]&phone=${CALL_SOURCE}&queue=${EXTEN}&callee=${CALLEE}&email=$[${getemail}]&callId=${CHANNEL(LINKEDID)}&token=YpQNUT99IibQ})



[GLPI-notify-OPS1]

;PHP INSERT
same=>n,Set(Answer=${CURL(https://phone.testabc.uk/testcon123.php?caller=${CALL_SOURCE}&queue=${EXTEN}&callee=${CALLEE}&callId=${CHANNEL(LINKEDID)}&token=YpQNUT9ibQ})

image
image

Is there a way to store extension and cc description into the variable ? I want to use them in the following GosubIf

image

same => n,GosubIf($["X${GOSUB_RESULT}X"="XX"]?${CCname},${EXTEN},1) ; Only if call was actually answered

Your issues could be the structure of your context.

This is the structure of a context:

[my-custom-ctxt]
exten => s,1,NoOp()
 same => n(repeat),Verbose("Do something!")
 same => n,Verbose("Do something different!")

But when I display ${EXTEN}. It is returning “s”

How can I get the full name from the extension box in cc gui?

please refer to the following long, ${EXTEN} returns ‘s’ instead of real extension name defined in CC Gui…

Context

[before-bridging-call-hook]
exten=> s,1,Noop(Entering custom context before bridging the call)
exten=> _.,n,Set(CCname=GLPI-notify-OPS1-Process)
 same=> n,GosubIf($["X${GOSUB_RESULT}X"="XX"]?${CCname},${EXTEN},1) ; Only if call was actually answered
 same=> n,Return()
**strong text**
-- Executing [s@sub-call-recording:17] Return("PJSIP/100_1-0000007a", "") in new stack
    -- Executing [s@sub-before-bridging-call:11] NoOp("PJSIP/100_1-0000007a", "Check if there's a custom sub-routine defined for executing it") in new stack
    -- Executing [s@sub-before-bridging-call:12] GosubIf("PJSIP/100_1-0000007a", "1?before-bridging-call-hook,s,1") in new stack
    -- Executing [s@before-bridging-call-hook:1] NoOp("PJSIP/100_1-0000007a", "Entering custom context before bridging the call") in new stack
    -- Executing [s@before-bridging-call-hook:2] Set("PJSIP/100_1-0000007a", "CCname=GLPI-notify-OPS1-Process") in new stack
    -- Executing [s@before-bridging-call-hook:3] GosubIf("PJSIP/100_1-0000007a", "1?GLPI-notify-OPS1-Process,s,1") in new stack

WORKING BUT RUNS EVEN CALL IS ANSWERED OR NOT

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

Logs

Executing [cc-10@custom-contexts:1] NoOp("Local/7011@cos-all-00000040;2", "GLPI-notify-OPS") in new stack
    -- Executing [cc-10@custom-contexts:2] Gosub("Local/7011@cos-all-00000040;2", "before-bridging-call-hook,GLPI-notify-OPS-Process,1(app-termination,hangup,1)") in new stack
    -- Executing [GLPI-notify-OPS-Process@before-bridging-call-hook:1] NoOp("Local/7011@cos-all-00000040;2", "Entering custom context before bridging the call") in new stack
    -- Executing [GLPI-notify-OPS-Process@before-bridging-call-hook:2] Set("Local/7011@cos-all-00000040;2", "CCext=(GLPI-notify-OPS-Process)") in new stack
    -- Executing [GLPI-notify-OPS-Process@before-bridging-call-hook:3] GosubIf("Local/7011@cos-all-00000040;2", "1?GLPI-notify-OPS-Process,Support,1") in new stack
    -- Executing [Support@GLPI-notify-OPS-Process:1] Set("Local/7011@cos-all-00000040;2", "user=zammad") in new stack


image

Use Dialstatus

I tried this but ${DIALSTATUS} doesnt return anything ?

Custom Context

[Ucon-Integration]

;Variables
exten=> _.,1,Set(user=zammad)
same=> n,Noop(${EXTEN})
same=> n,Noop(${DIALSTATUS})

LOGS


    -- Goto (sub-set-call-vars,app-incoming,6)
    -- Executing [app-incoming@sub-set-call-vars:6] Return("Local/7011@cos-all-00000064;2", "") in new stack
    -- Executing [7011@cos-all-post:2] NoOp("Local/7011@cos-all-00000064;2", "Custom Application: Ucon-Integrationss") in new stack
    -- Executing [7011@cos-all-post:3] Goto("Local/7011@cos-all-00000064;2", "custom-contexts,cc-10,1") in new stack
    -- Goto (custom-contexts,cc-10,1)
    -- Executing [cc-10@custom-contexts:1] NoOp("Local/7011@cos-all-00000064;2", "Ucon-Integration") in new stack
    -- Executing [cc-10@custom-contexts:2] Gosub("Local/7011@cos-all-00000064;2", "Ucon-Integration,Ucon-Integration,1(app-termination,hangup,1)") in new stack
    -- Executing [Ucon-Integration@Ucon-Integration:1] Set("Local/7011@cos-all-00000064;2", "user=zammad") in new stack
    -- Executing [Ucon-Integration@Ucon-Integration:2] NoOp("Local/7011@cos-all-00000064;2", "Ucon-Integration") in new stack
    -- Executing [Ucon-Integration@Ucon-Integration:3] NoOp("Local/7011@cos-all-00000064;2", "") in new stack

Dialstatus is set after dial.

Hello

Is there any channel variable? To check the queue name or number , after extension answered the call from the queue, can I store the queue name in the variable for some checks?

Agent is assigned to multiple queue

Check yourself with:

http://www.asteriskdocs.org/en/2nd_Edition/asterisk-book-html-chunk/asterisk-APP-B-59.html

It will help you a lot.

Thank you so much, I have learned a lot and will be able to so many issues with my script…

Thanks again…

1 Like