On Mon, 2008-10-20 at 16:17 -0700, Edwin Lam wrote:
> sean darcy wrote:
>
> > OK. So I changed the * to .. , like so:
> >
> > exten =>s,n,Set(CALLERID(name)=${IF($[0${CALLERID(num)} =
> > 0${REGEX("21245711..")} ] ? "Office":${CALLERID(name)} )})
> >
> > which I would expect to mean 021245711 followed by two other characters.
> >
> > It still matches a blank callerid(num).
>
> try:
>
> exten =>s,n,Set(CALLERID(name)=${IF($[ ${REGEX("021245711.."
> 0${CALLERID(num)})} = 1] ? "Office":${CALLERID(name)})})
>
>
and just to round out the discussion, you could also:
(using the =~ and ? :: notation in $[] expressions...)
exten => s,n,Set(CALLERID(name)=$[ 0${CALLERID(num)} =~ 021245711.. ?
"Office" :: ${CALLERID(name)}])
I haven't tried to debug it, but it hopefully will do the job. See
doc/tex/channelvariables or just doc/channelvariables (iirc), depending
on the version of Asterisk...
using the =~ and ? :: notation in $[] expressions...
murf
--
Steve Murphy
Software Developer
Digium
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
