[asterisk-users] Parsing incoming extension till first @

Philipp Kempgen philipp.kempgen at amooma.de
Tue Apr 22 05:33:29 CDT 2008


Ali Jawad schrieb:

> When I dial a number it reaches the asterisk switch as abc at xyz@123.com
> what I need to do is to parse the abc and send it to my pstn gateway
> as in
> 
> exten => _.,2,Dial(SIP/${EXTEN}@pstn.gw)
> 
> this does work but I do have a varying number of numbers before the @
> 
> exten => _.,1,Dial(SIP/${EXTEN:0:12}@pstn.gw)
> 
> Well can I use some kind of regular expression to take all numbers
> before the first @ and send them to the pstn
> 
> something like
> 
> exten => _.,1,Dial(SIP/${regexp(condition,Exten)}@pstn.gw)

core show function CUT

Regards,
  Philipp Kempgen

-- 
amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
    Let's use IT to solve problems and not to create new ones.
          Asterisk? -> http://www.das-asterisk-buch.de

Geschäftsführer: Stefan Wintermeyer
Handelsregister: Neuwied B 14998



More information about the asterisk-users mailing list