[asterisk-users] Variable stripping/removing part of string

magnus.b at inputinterior.se magnus.b at inputinterior.se
Mon Apr 11 23:44:40 CDT 2011


Weired result:

exten => 0424449631,n,NoOp(${CALLERID(name)})
exten => 0424449631,n,NoOp(${${CUT(CALLERID(name),\(,1)}:0:-1})
-- Executing [0424449631 at fax.inputinterior.se:4] NoOp("OOH323/Avaya2-248", 
"Martela (fax)") in new stack
-- Executing [0424449631 at fax.inputinterior.se:5] NoOp("OOH323/Avaya2-248", 
"") in new stack

Now I understand even less. (But it was a nice try).

-----Ursprungligt meddelande----- 
From: Chad Wallace
Sent: Tuesday, April 12, 2011 3:27 AM
To: asterisk-users at lists.digium.com
Subject: Re: [asterisk-users] Variable stripping/removing part of string
On Mon, 11 Apr 2011 12:58:39 +0200
<magnus.b at inputinterior.se> wrote:

> U were right, breaking it into two lines work.
>
> exten => 0424449631,n,NoOp(${CALLERID(name)})
> exten => 0424449631,n,Set(name=${CUT(CALLERID(name),\(,1)})
> exten => 0424449631,n,NoOp(${name:0:-1})
> -- Executing [0424449631 at fax.inputinterior.se:4]
> NoOp("OOH323/Avaya2-150", "Martela (fax)") in new stack
> -- Executing [0424449631 at fax.inputinterior.se:5]
> Set("OOH323/Avaya2-150", "name=Martela ") in new stack
> -- Executing [0424449631 at fax.inputinterior.se:6]
> NoOp("OOH323/Avaya2-150", "Martela") in new stack
>
> But still, dont understand why u cant do it on one line, but u cant
> always understand everything.
> Anyway, thx for pointing me to the correct direction.

Just a guess...  try this:

exten => 0424449631,n,NoOp(${${CUT(CALLERID(name),\(,1)}:0:-1})




More information about the asterisk-users mailing list