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

magnus.b at inputinterior.se magnus.b at inputinterior.se
Mon Apr 11 05:58:39 CDT 2011


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.

-----Ursprungligt meddelande----- 
From: Jeroen Eeuwes
Sent: Monday, April 11, 2011 12:09 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Variable stripping/removing part of string

Hi Magnus,

> exten => 0424449631,n,NoOp(${CUT(CALLERID(name),\(,1):0:-1})
>
> But that gave me “Martela “ so my way of doing it is wrong.
> Any that can tell me what I am doing wrong or have any better suggestion
> howto do it?

I think you are not able to do it in one step. Can you try something like 
this:

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

Best regards,
Jeroen Eeuwes

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




More information about the asterisk-users mailing list