VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
admin at tootai.net Guest
|
Posted: Tue Jul 01, 2008 9:20 am Post subject: [asterisk-users] Asterisk 1.4.21 and CUT function |
|
|
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
|
Posted: Tue Jul 01, 2008 10:48 am Post subject: [asterisk-users] Asterisk 1.4.21 and CUT function |
|
|
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
|
Posted: Tue Jul 01, 2008 11:05 am Post subject: [asterisk-users] Asterisk 1.4.21 and CUT function |
|
|
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
|
Posted: Wed Jul 02, 2008 6:15 am Post subject: [asterisk-users] Asterisk 1.4.21 and CUT function |
|
|
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 |
|
|
|
|
|
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
|