Left Trim Alpha characters off an inbound DID before routing to agi_did_script
Added by Dion Waynes over 8 years ago
Hi
I have inbound sip did coming from users02008888888@trunkinbound:1
The carrier cannot trim the text in front - "users" and I cant get the did routing to my camp because its not being picked up by 02008888888 inbound did I created.
I thought of doing something like this in [trunkinbound] but my syntax is wrong
Any ideas for go auto dial 3.3
exten => _.X.,1,Set(DID=($(DID:5))
exten => _X.,2,AGI
Replies (4)
RE: Left Trim Alpha characters off an inbound DID before routing to agi_did_script
-
Added by Dion Waynes over 8 years ago
also trying this
exten => _.X.,1,Set(DID=${CUT})
exten => _.X.,2,AGI
;exten => _X.,n,Hangup()
no joy
RE: Left Trim Alpha characters off an inbound DID before routing to agi_did_script
-
Added by striker 247 over 8 years ago
you can try this
change the context in your carrier from trunkinbound to usertrunk
then create a context in extensions.conf like below
[usertrunk] exten => _.,1,Set(EXTEN=${EXTEN:5}) exten => _.,2,GoTo(trunkinbound,${EXTEN},1,)
then make sure tunkinbound should be having default dialplan as like below
[trunkinbound] exten => _X.,1,AGI(agi-DID-route.agi)
regards
striker
www.striker24x7.blogspot.com
RE: Left Trim Alpha characters off an inbound DID before routing to agi_did_script
-
Added by Dion Waynes over 8 years ago
Thanks Striker for prompt response, that made perfect sense. The implementation still tossed an error
Its now trimming the DID nicely as below on line 1. But when it passes it through on line two its still using the orig did, as is the receiving trunkinbound in line 3. As such the _X in trunk inbound cant find it because it still has text.
Can it be put into another variable and passed through?
I created user trunk and edited my carrier to point to that and then made changes as above.
[Sep 21 05:27:50] -- Executing [users08888888888@usertrunk:1] Set("SIP/sd2-0000000d", "*EXTEN=08888888888"*) in new stack
[Sep 21 05:27:50] -- Executing [users08888888888@usertrunk:2] Goto("SIP/sd2-0000000d", "trunkinbound,users08888888888,1,") in new stack
[Sep 21 05:27:50] -- Goto (trunkinbound,users08888888888,1)
[Sep 21 05:27:50] WARNING26001: pbx.c:5363 __ast_pbx_run: Channel 'SIP/sd2-0000000d' sent into invalid extension 'users08888888888' in context 'trunkinbound', but no invalid handler
RE: Left Trim Alpha characters off an inbound DID before routing to agi_did_script
-
Added by Dion Waynes over 8 years ago
Figured it out
Still redirecting carrier to user trunk as per Striker, I just added the :5 on line 2, it seemed the set wasnt keeping so just passed it through live
[usertrunk]
exten => _.,1,Set(EXTEN=${EXTEN:5})
exten => _.,2,GoTo(trunkinbound,${EXTEN:5},1,)
[trunkinbound]
exten => _X.,1,AGI
Nice and clean and created new ib camp from scratch with wizard.
Thanks Striker for the idea