Call to DID from CallBack module

Hi everyone
I have a problem for which I can’t find a solution using standard FreePBX modules:

from one of the trunks i get a call where
DID: XXXXXXXXXXX (there are an infinite number of such phones)
CID: XXXX (there are about 150 of these phones)

I need to make it so that after receiving a call, the asterisk first calls XXXX (CID) and after the subscriber picks up the phone, the system should call XXXXXXXXXXX (DID)
partially for this functionality, the callback module suits me

but I can’t find a solution to make a call to phone XXXXXXXXXXX (DID)

What solutions are there in asterisk for this task?

i created a Custom Destinations

[callback-test]
exten => _XXXXXXXXXXX,1,Dial(PJSIP/${EXTEN}@pro,60,tr)

It works if I set it in the Inbound Route

but it doesn’t work if i use it in callback

Connected to Asterisk 16.27.0 currently running on pbx (pid = 2418)
– Executing [[email protected]:1] Set(“PJSIP/3195-00000008”, “__DIRECTION=INBOUND”) in new stack
– Executing [[email protected]:2] Gosub(“PJSIP/3195-00000008”, “sub-record-check,s,1(in,89038513478,dontcare)”) in new stack
– Executing [[email protected]:1] GotoIf(“PJSIP/3195-00000008”, “0?initialized”) in new stack
– Executing [[email protected]:2] Set(“PJSIP/3195-00000008”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [[email protected]:3] Set(“PJSIP/3195-00000008”, “NOW=1660046298”) in new stack
– Executing [[email protected]:4] Set(“PJSIP/3195-00000008”, “__DAY=09”) in new stack
– Executing [[email protected]:5] Set(“PJSIP/3195-00000008”, “__MONTH=08”) in new stack
– Executing [[email protected]:6] Set(“PJSIP/3195-00000008”, “__YEAR=2022”) in new stack
– Executing [[email protected]:7] Set(“PJSIP/3195-00000008”, “__TIMESTR=20220809-145818”) in new stack
– Executing [[email protected]:8] Set(“PJSIP/3195-00000008”, “__FROMEXTEN=unknown”) in new stack
– Executing [[email protected]:9] Set(“PJSIP/3195-00000008”, “__MON_FMT=wav”) in new stack
– Executing [[email protected]:10] NoOp(“PJSIP/3195-00000008”, “Recordings initialized”) in new stack
– Executing [[email protected]:11] ExecIf(“PJSIP/3195-00000008”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [[email protected]:12] Set(“PJSIP/3195-00000008”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [[email protected]:13] ExecIf(“PJSIP/3195-00000008”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [[email protected]:14] GotoIf(“PJSIP/3195-00000008”, “2?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [[email protected]:17] GotoIf(“PJSIP/3195-00000008”, “1?sub-record-check,in,1”) in new stack
– Goto (sub-record-check,in,1)
– Executing [[email protected]:1] NoOp(“PJSIP/3195-00000008”, “Inbound Recording Check to 89038513478”) in new stack
– Executing [[email protected]:2] Set(“PJSIP/3195-00000008”, “FROMEXTEN=unknown”) in new stack
– Executing [[email protected]:3] ExecIf(“PJSIP/3195-00000008”, “4?Set(FROMEXTEN=3195)”) in new stack
– Executing [[email protected]:4] Gosub(“PJSIP/3195-00000008”, “recordcheck,1(dontcare,in,89038513478)”) in new stack
– Executing [[email protected]:1] NoOp(“PJSIP/3195-00000008”, “Starting recording check against dontcare”) in new stack
– Executing [[email protected]:2] Goto(“PJSIP/3195-00000008”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [[email protected]:3] Return(“PJSIP/3195-00000008”, “”) in new stack
– Executing [[email protected]:5] Return(“PJSIP/3195-00000008”, “”) in new stack
– Executing [[email protected]:3] Set(“PJSIP/3195-00000008”, “CHANNEL(tonezone)=us”) in new stack
– Executing [[email protected]:4] Set(“PJSIP/3195-00000008”, “__FROM_DID=89038513478”) in new stack
– Executing [[email protected]:5] Set(“PJSIP/3195-00000008”, “returnhere=1”) in new stack
– Executing [[email protected]:6] Gosub(“PJSIP/3195-00000008”, “app-blacklist-check,s,1()”) in new stack
– Executing [[email protected]:1] GotoIf(“PJSIP/3195-00000008”, “0?blacklisted”) in new stack
– Executing [[email protected]:2] Set(“PJSIP/3195-00000008”, “CALLED_BLACKLIST=1”) in new stack
– Executing [[email protected]:3] Return(“PJSIP/3195-00000008”, “”) in new stack
– Executing [[email protected]:7] Set(“PJSIP/3195-00000008”, “CDR(did)=89038513478”) in new stack
– Executing [[email protected]:8] GotoIf(“PJSIP/3195-00000008”, “0?”) in new stack
– Executing [[email protected]:9] ExecIf(“PJSIP/3195-00000008”, “1 ?Set(CALLERID(name)=3195)”) in new stack
– Executing [[email protected]:10] Set(“PJSIP/3195-00000008”, “__MOHCLASS=”) in new stack
– Executing [[email protected]:11] Set(“PJSIP/3195-00000008”, “__REVERSAL_REJECT=FALSE”) in new stack
– Executing [[email protected]:12] GotoIf(“PJSIP/3195-00000008”, “1?post-reverse-charge”) in new stack
– Goto (from-pstn,89038513478,14)
– Executing [[email protected]:14] NoOp(“PJSIP/3195-00000008”, “”) in new stack
– Executing [[email protected]:15] Set(“PJSIP/3195-00000008”, “__CALLINGNAMEPRES_SV=allowed_not_screened”) in new stack
– Executing [[email protected]:16] Set(“PJSIP/3195-00000008”, “__CALLINGNUMPRES_SV=allowed_not_screened”) in new stack
– Executing [[email protected]:17] Set(“PJSIP/3195-00000008”, “CALLERID(name-pres)=allowed_not_screened”) in new stack
– Executing [[email protected]:18] Set(“PJSIP/3195-00000008”, “CALLERID(num-pres)=allowed_not_screened”) in new stack
– Executing [[email protected]:19] NoOp(“PJSIP/3195-00000008”, “CallerID Entry Point”) in new stack
– Executing [[email protected]:20] Goto(“PJSIP/3195-00000008”, “callback,1,1”) in new stack
– Goto (callback,1,1)
– Executing [[email protected]:1] Set(“PJSIP/3195-00000008”, “CALL=3195”) in new stack
– Executing [[email protected]:2] Set(“PJSIP/3195-00000008”, “DESTINATION=callback-test.1.1”) in new stack
– Executing [[email protected]:3] Set(“PJSIP/3195-00000008”, “SLEEP=0”) in new stack
– Executing [[email protected]:4] Set(“PJSIP/3195-00000008”, “TIMEOUT=15000”) in new stack
– Executing [[email protected]:5] Set(“PJSIP/3195-00000008”, “CALLERID=Callback”) in new stack
– Executing [[email protected]:6] System(“PJSIP/3195-00000008”, “/var/lib/asterisk/bin/callback 3195 callback-test.1.1 0 15000 Q2FsbGJhY2s= &”) in new stack
– Executing [[email protected]:7] Hangup(“PJSIP/3195-00000008”, “”) in new stack
== Spawn extension (callback, 1, 7) exited non-zero on ‘PJSIP/3195-00000008’

[callback-test]
include => callback-custom
exten => _XXXXXXXXXXX,1,Set(CALL=${CALLERID(number)})
exten => _XXXXXXXXXXX,n,Set(DESTINATION=from-internal.${EXTEN}.1)
exten => _XXXXXXXXXXX,n,Set(SLEEP=0)
exten => _XXXXXXXXXXX,n,Set(TIMEOUT=15000)
exten => _XXXXXXXXXXX,n,Set(CALLERID=${CALLERID(number)})
exten => _XXXXXXXXXXX,n,System(/var/lib/asterisk/bin/callback ${CALL} ${DESTINATION} ${SLEEP} ${TIMEOUT} ${BASE64_ENCODE(${CALLERID})} &)
exten => _XXXXXXXXXXX,n,Hangup

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.