Skip to content

Instantly share code, notes, and snippets.

@ambiorixg12
Created December 19, 2018 04:33
Show Gist options
  • Select an option

  • Save ambiorixg12/e376c5e814a09a67ff507b55c48f43f0 to your computer and use it in GitHub Desktop.

Select an option

Save ambiorixg12/e376c5e814a09a67ff507b55c48f43f0 to your computer and use it in GitHub Desktop.
redirecting both call legs to different destination using in a live call
exten=>_6XXX,1,NoCDR()
same=>n,Noop(${EXTEN} ${CHANNEL} ${CDR(dstchannel)})
same=>n,Set(__DYNAMIC_FEATURES=transf)
exten=>_6XXX,n,Dial(PJSIP/${EXTEN})
;;;;custom transfer
[customtransfer]
exten=>s,1,Noop(${EXTEN} ${CHANNEL})
same=>n,Set(__a=${SHELL(asterisk -x " core show channels " | grep 'PJSIP/6005-' | awk '{print $1}')})
same=>n,Set(__b=${SHELL(asterisk -x " core show channels " | grep 'PJSIP/6001-' | awk '{print $1}')})
same=>n(vmcaller),System(/usr/sbin/asterisk -x "Channel Redirect ${a:0:-1} internal,8095445555,1")
same=>n(vmcaller),System(/usr/sbin/asterisk -x "Channel Redirect ${b:0:-1} park,s,1")
[park]
exten=>s,1,Answer()
same=>n,MusicOnHold(default)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
/etc/asterisk/features.conf
transf =>*1,peer,Dial(Local/s@customtransfer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment