Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Parsing incoming extension till first @


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
alijawad1 at gmail.com
Guest





PostPosted: Tue Apr 22, 2008 5:01 am    Post subject: [asterisk-users] Parsing incoming extension till first @ Reply with quote

Hi All

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)

thx
Back to top
philipp.kempgen at amo...
Guest





PostPosted: Tue Apr 22, 2008 5:33 am    Post subject: [asterisk-users] Parsing incoming extension till first @ Reply with quote

Ali Jawad schrieb:

Quote:
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
Back to top
alijawad1 at gmail.com
Guest





PostPosted: Tue Apr 22, 2008 5:49 am    Post subject: [asterisk-users] Parsing incoming extension till first @ Reply with quote

Thanks Patrick this resulted in

-- Executing [009613041705 at asterisk.myJab.net@google-in:1]
Set("Gtalk/jabber1-c06e", "dst=009613041705") in new stack
-- Auto fallthrough, channel 'Gtalk/jabber1-c06e' status is 'UNKNOWN'

It seems to have cut the correct part but I am not sure about the rest
of it, it is causing auto fallthrough with status UNKNOWN

On Tue, Apr 22, 2008 at 1:33 PM, Philipp Kempgen
<philipp.kempgen at amooma.de> wrote:
Quote:
Ali Jawad schrieb:



Quote:
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

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users


--
--
With Regards
Ali Jawad System Administrator
http://www.alijawad.org
Phone : +961-01-559031
Mobile : +961-03-041705


----------------------------------------------------


Confidentiality Notice: The contents of this E-mail are intended for the
named recipient only. It may contain confidential and privileged
information. If you received it in error, please notify us immediately and
then destroy it. Internet communications are not secure and therefore
I do we do not accept legal responsibility
for the contents of this message. Also, and though we provide every effort
to keep our network free from viruses, you would need to check this E-mail
and any attachments for viruses as we can take no responsibility for any
computer virus which might be transferred by way of this E-mail.
Back to top
alijawad1 at gmail.com
Guest





PostPosted: Tue Apr 22, 2008 5:51 am    Post subject: [asterisk-users] Parsing incoming extension till first @ Reply with quote

Thx again patrick it worked, I used

[google-in]
exten => _.,1,Set(dst=${CUT(EXTEN,@,1)})
exten => _.,1,Dial(SIP/${dst}@pstn.gw)

while it should have been

[google-in]
exten => _.,1,Set(dst=${CUT(EXTEN,@,1)})
exten => _.,2,Dial(SIP/${dst}@pstn.gw)
Back to top
rob at hillis.dyndns.org
Guest





PostPosted: Tue Apr 22, 2008 7:02 am    Post subject: [asterisk-users] Parsing incoming extension till first @ Reply with quote

Using _. is going to result in warnings. A much better practice is to
use _X.

Ali Jawad wrote:
Quote:
Thx again patrick it worked, I used

[google-in]
exten => _.,1,Set(dst=${CUT(EXTEN,@,1)})
exten => _.,1,Dial(SIP/${dst}@pstn.gw)

while it should have been

[google-in]
exten => _.,1,Set(dst=${CUT(EXTEN,@,1)})
exten => _.,2,Dial(SIP/${dst}@pstn.gw)

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

!DSPAM:480e5326213018190740810!


Back to top
alijawad1 at gmail.com
Guest





PostPosted: Wed Apr 23, 2008 1:31 am    Post subject: [asterisk-users] Parsing incoming extension till first @ Reply with quote

Thanks for the hint Patrick I appreciate it.

On Tue, Apr 22, 2008 at 3:02 PM, Rob Hillis <rob at hillis.dyndns.org> wrote:
Quote:
Using _. is going to result in warnings. A much better practice is to
use _X.



Ali Jawad wrote:
Quote:
Thx again patrick it worked, I used

[google-in]
exten => _.,1,Set(dst=${CUT(EXTEN,@,1)})
exten => _.,1,Dial(SIP/${dst}@pstn.gw)

while it should have been

[google-in]
exten => _.,1,Set(dst=${CUT(EXTEN,@,1)})
exten => _.,2,Dial(SIP/${dst}@pstn.gw)


Quote:
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

!DSPAM:480e5326213018190740810!



_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users


--
--
With Regards
Ali Jawad System Administrator
http://www.alijawad.org
Phone : +961-01-559031
Mobile : +961-03-041705


----------------------------------------------------


Confidentiality Notice: The contents of this E-mail are intended for the
named recipient only. It may contain confidential and privileged
information. If you received it in error, please notify us immediately and
then destroy it. Internet communications are not secure and therefore
I do we do not accept legal responsibility
for the contents of this message. Also, and though we provide every effort
to keep our network free from viruses, you would need to check this E-mail
and any attachments for viruses as we can take no responsibility for any
computer virus which might be transferred by way of this E-mail.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services