Last active
December 18, 2020 21:00
-
-
Save backslash7/50efc532ba5a664b14a4 to your computer and use it in GitHub Desktop.
How to strip destination number from SIP To: header and use it as DID
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
; Assign this context to your incoming SIP trunk settings | |
[custom-get-did-from-sip] | |
exten => _X.,1,Noop(Fixing DID using information from SIP TO header) | |
exten => _X.,n,NOOP(Header is: ${SIP_HEADER(TO)}) | |
exten => _X.,n,Set(pseudodid=${SIP_HEADER(TO)}) | |
exten => _X.,n,Set(pseudodid=${CUT(pseudodid,@,1)}) | |
exten => _X.,n,Set(pseudodid=${CUT(pseudodid,:,2)}) | |
exten => _X.,n,Noop(Pseudo DID is: ${pseudodid}) | |
exten => _X.,n,Goto(from-trunk,${pseudodid},1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment