Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

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

[asterisk-users] Asterisk 1.4.21 and CUT function


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





PostPosted: Tue Jul 01, 2008 9:20 am    Post subject: [asterisk-users] Asterisk 1.4.21 and CUT function Reply with quote

Hi all,

does anybody know how to cut a chain using the pipe delimiter? I tried
to escape it or to use $'x7c' as delimiter, no luck.

Thanks for any help.

--
Daniel
Back to top
tilghman at mail.jeffa...
Guest





PostPosted: Tue Jul 01, 2008 10:48 am    Post subject: [asterisk-users] Asterisk 1.4.21 and CUT function Reply with quote

On Tuesday 01 July 2008 09:20:52 Administrator TOOTAI wrote:
Quote:
does anybody know how to cut a chain using the pipe delimiter? I tried
to escape it or to use $'x7c' as delimiter, no luck.

1.2 does not support escaping at all. 1.4 accepts only escapes relating to
space characters (\t, \r, \n). 1.6 supports the space characters, plus
hexadecimal (\xNN) and octal (\0NNN) escapes.

--
Tilghman
Back to top
tilghman at mail.jeffa...
Guest





PostPosted: Tue Jul 01, 2008 11:05 am    Post subject: [asterisk-users] Asterisk 1.4.21 and CUT function Reply with quote

On Tuesday 01 July 2008 10:48:55 Tilghman Lesher wrote:
Quote:
On Tuesday 01 July 2008 09:20:52 Administrator TOOTAI wrote:
Quote:
does anybody know how to cut a chain using the pipe delimiter? I tried
to escape it or to use $'x7c' as delimiter, no luck.

1.2 does not support escaping at all. 1.4 accepts only escapes relating to
space characters (\t, \r, \n). 1.6 supports the space characters, plus
hexadecimal (\xNN) and octal (\0NNN) escapes.

Oh, there is a way to do what you want in 1.4, although it is non-obvious, due
to the insane amount of escaping that needs to be done:

exten => 8122,1,NoOp(${SET(string=one|two|three|four)})
exten => 8122,n,NoOp(${CUT(string,\\|,2)})

-- Executing [8122 at digium:1] NoOp("SIP/vidphone-0824ba08", "one|two|three|
four") in new stack
-- Executing [8122 at digium:2] NoOp("SIP/vidphone-0824ba08", "two") in new
stack

Note that this insane escaping has been corrected in 1.6.0.

--
Tilghman
Back to top
admin at tootai.net
Guest





PostPosted: Wed Jul 02, 2008 6:15 am    Post subject: [asterisk-users] Asterisk 1.4.21 and CUT function Reply with quote

Tilghman Lesher a ?crit :
Quote:
On Tuesday 01 July 2008 10:48:55 Tilghman Lesher wrote:

Quote:
On Tuesday 01 July 2008 09:20:52 Administrator TOOTAI wrote:

Quote:
does anybody know how to cut a chain using the pipe delimiter? I tried
to escape it or to use $'x7c' as delimiter, no luck.

1.2 does not support escaping at all. 1.4 accepts only escapes relating to
space characters (\t, \r, \n). 1.6 supports the space characters, plus
hexadecimal (\xNN) and octal (\0NNN) escapes.


Oh, there is a way to do what you want in 1.4, although it is non-obvious, due
to the insane amount of escaping that needs to be done:

exten => 8122,1,NoOp(${SET(string=one|two|three|four)})
exten => 8122,n,NoOp(${CUT(string,\\|,2)})

-- Executing [8122 at digium:1] NoOp("SIP/vidphone-0824ba08", "one|two|three|
four") in new stack
-- Executing [8122 at digium:2] NoOp("SIP/vidphone-0824ba08", "two") in new
stack

Note that this insane escaping has been corrected in 1.6.0.

Tilghman,

many thanks, it works this way. Other solution would be to launch an AGI
script to do this.

--
Daniel
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