Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

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

[asterisk-users] Manipulating of a dialed sequence


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





PostPosted: Sat Dec 05, 2015 11:21 am    Post subject: [asterisk-users] Manipulating of a dialed sequence Reply with quote

Hi Asterisk List

Given, as an example, the following sequence

012345*543210

I would like to store into a variable all digits before "*" (012345) and
in a different variable all digits after the "*" (543210) for further
processing in the dial plan.

The length of the dialed sequence may be variable and "*" is the
separator between the two values to store.

Any idea?

Thanks

Francesco



--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
asterisk.org at sedwar...
Guest





PostPosted: Sat Dec 05, 2015 12:08 pm    Post subject: [asterisk-users] Manipulating of a dialed sequence Reply with quote

On Sat, 5 Dec 2015, Frank wrote:

Quote:
Given, as an example, the following sequence

012345*543210

I would like to store into a variable all digits before "*" (012345) and
in a different variable all digits after the "*" (543210) for further
processing in the dial plan.

Have you tried the 'cut' function?

--
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards sedwards@sedwards.com Voice: +1-760-468-3867 PST

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
rafaelsnsa at gmail.com
Guest





PostPosted: Sat Dec 05, 2015 1:03 pm    Post subject: [asterisk-users] Manipulating of a dialed sequence Reply with quote

Hi

Try this:


[pbx]
exten => _1X.,1,Answer()
same  => n,Set(VAR=012345*543210)
same  => n,Set(VAR1=${CUT(VAR,*,1)})    ;012345
same  => n,Set(VAR1=${CUT(VAR,*,2)})    ;543210




(rafaelsnsa@gmail.com)Rafael S. SaraivaPorto Alegre - RS | Mobile:  (51) 8174-7956[/url] [url=https://plus.google.com/u/0/+RafaelSaraivaRS]




2015-12-05 14:21 GMT-02:00 Frank <mailinglist@linuxista.com (mailinglist@linuxista.com)>:
Quote:
Hi Asterisk List

Given, as an example, the following sequence

012345*543210

I would like to store into a variable all digits before "*" (012345) and
in a different variable all digits after the "*" (543210) for further
processing in the dial plan.

The length of the dialed sequence may be variable and "*" is the
separator between the two values to store.

Any idea?

Thanks

Francesco



--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
mailinglist at linuxis...
Guest





PostPosted: Sat Dec 05, 2015 5:12 pm    Post subject: [asterisk-users] Manipulating of a dialed sequence Reply with quote

Steve and Rafael, that is exactly what I was looking for!
Many thanks for your help!

Smile


--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
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