Thank you for your reply.
The Callback module is free, and I didn’t find a commercial version!
Are you sure about the commercial version?
Here are some of the dialplans I have tried.
[custom-callback]
exten => s,1,Answer()
exten => s,2,NoOp(Callback received for ${CALLERID(num)} to extension ${EXTEN})
exten => s,3,GotoIf($[${EXTEN} = 1234]?5:10)
exten => s,4,Playback(not-authorized)
exten => s,5,Dial(SIP/${EXTEN},20)
exten => s,6,VoiceMail(${EXTEN}@default,u)
exten => s,10,Hangup()
[default]
exten => _X.,1,Answer()
exten => _X.,2,NoOp(Processing callback for ${CALLERID(num)} to extension ${EXTEN})
exten => _X.,3,GotoIf($[${EXTEN} = 1234]?5:10)
exten => _X.,4,Dial(SIP/${EXTEN},20)
exten => _X.,5,NoOp(Prioritizing callback for extension 1234)
exten => _X.,6,Dial(SIP/${EXTEN},20)
exten => _X.,7,VoiceMail(${EXTEN}@default,u)
exten => _X.,10,Hangup()
[callback]
include => callback-custom
exten => 1,1,Set(CALL=${CALLERID(number)})
exten => 1,n,Set(DESTINATION=from-did-direct.911.1)
exten => 1,n,Set(SLEEP=2)
exten => 1,n,Set(TIMEOUT=15000)
exten => 1,n,GotoIf($[${CALL} = 1234]?5:10)
exten => 1,n,Set(CALLERID=Callback)
exten => 1,n,System(/var/lib/asterisk/bin/callback ${CALL} ${DESTINATION} ${SLEEP} ${TIMEOUT} ${BASE64_ENCODE(${CALLERID})} &)
exten => 1,n,Hangup()
exten => 1,5,NoOp(Prioritizing callback for extension 1234)
exten => 1,6,Dial(SIP/1234,20)
exten => 1,7,VoiceMail(1234@default,u)
exten => 1,10,Hangup()
[callback]
include => callback-custom
exten => 1,1,Set(CALL=${CALLERID(number)})
exten => 1,n,Set(DESTINATION=from-did-direct.911.1)
exten => 1,n,Set(SLEEP=2)
exten => 1,n,Set(TIMEOUT=15000)
exten => 1,n,GotoIf($[${CALL} = 1234]?priority_1234:priority_other)
; Priority for extension 1234
exten => priority_1234,1,NoOp(Prioritizing callback for extension 1234)
exten => priority_1234,n,Dial(SIP/1234,20)
exten => priority_1234,n,VoiceMail(1234@default,u)
exten => priority_1234,n,Hangup()
; Priority for other extensions
exten => priority_other,1,NoOp(Processing callback for other extensions)
exten => priority_other,n,System(/var/lib/asterisk/bin/callback ${CALL} ${DESTINATION} ${SLEEP} ${TIMEOUT} ${BASE64_ENCODE(${CALLERID})} &)
exten => priority_other,n,Hangup()