Last active
November 14, 2016 18:05
-
-
Save ctaloi/5861727 to your computer and use it in GitHub Desktop.
Asterisk - Pass SIP Diversion if exists on the way in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exten => s,1,Set(TG_FULLNAME=${ARG2}) | |
exten => s,n,Set(TRUNK=${CUT(TG_FULLNAME,/,2)}) | |
exten => s,n,Set(ORIG_ANI=${CALLERID(rdnis)}) | |
exten => s,n,Set(SIP_DOMAIN=${SIPDOMAIN}) | |
exten => s,n,Set(ROUTE_STRIP=${ARG1}) | |
exten => s,n,Set(DIALED=${DIALED_NUMBER:${ROUTE_STRIP}} | |
exten => s,n,GotoIf($[${LEN(${ORIG_ANI})} > 0]?100:101) | |
exten => s,100,SIPAddHeader(Diversion: <sip:${CALLERID(rdnis)}@${SIP_DOMAIN}>\;Reason=unconditional) | |
exten => s,101,Dial(SIP/${DIALED}@${TRUNK},,tT) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment