Here is a simple way to strip the '-' 

Here is a concept solution.
I have not tested the code so there may be some syntax errors. 
It can work as I am doing stuff like this all the time. This example is 
using a check to only do the cut if there is more than one field. You may 
be able to just use step 3 from ctx and have what you want, but I am not 
sure if it will fall back gracefully if there is only 1 field. 

No AGI required.

exten => mycode,n,Gosub(ctx,1)

exten => ctx,1,Set(l_filedCNT=${FIELDQTY(CALLERID(num),-)})
exten => ctx,n,GotoIf($[${MATH(${l_filedCNT}>1)}=TRUE]?DoStrip:SkipStrip)
exten => ctx,n(doStrip),Set CALLERID(num)=${CUST(CALLERID(num), -, 1-)
exten => ctx,n(doSkip),NoOp(${CALLERID(num)})

Thanks
zktech


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

Reply via email to