[asterisk-users] Extensions of sip trunk

Daniel Tryba daniel at tryba.nl
Tue Jun 6 05:26:29 CDT 2017


On Tue, Jun 06, 2017 at 12:40:21AM +0200, Hans-Peter Jansen wrote:
> > Yes, something like if they can't fix the R-URI:
> > exten => X_.,n,Set(TO=${CUT(SIP_HEADER(To),@,1)})
> > exten => X_.,n,Set(TO=${CUT(TO,:,2)})
> > exten => X_.,n,Goto(somewhereelsetopreventloops${TO},1)
> 
> Sorry for the silly question, but how do I feed the TO variable back to the 
> usual pattern matching? Assign to $EXTEN?

The goto does that (with fixed typo):
exten => X_.,n,Goto(somewhereelsetopreventloops,${TO},1)
 
The reason to send to another context  where you handle specific DIDs is
to prevent loops. _X. is kind of a wildcard, if there is no DID for the
TO this will loop in _X.




More information about the asterisk-users mailing list