[asterisk-users] Caller ID Rewrite
Anselm Martin Hoffmeister
anselm at hoffmeister-online.de
Fri Dec 1 13:25:32 MST 2006
Am Freitag, den 01.12.2006, 20:03 +0000 schrieb David Bath:
> Hi Anselm,
>
> Thanks for the help...
>
> I'm slightly confused as to your response.
>
> Wouldn't that look for a /dialled/ number in the format _0<number> try
> and jump to another extension 0044<number> with priority 1?
>
> If so, that's not what I'm trying to achieve.
Sorry, my brain is in need for a weekend off work. I obviously
understood your question wrong. My fault.
> I've made a bit more progress... and my current diaplan entry looks like
> this:
>
> exten=>123456,1,Set(${IF(REGEX("^0[1-9][0-9]\{9\}$"
> {CALLERID(number)})?CALLERID(number)=44${CALLERID(number):1})})
> exten => 123456,2,Goto(sipinternal,101,1)
>
> BUT! There's a very odd problem (and I'm sure it's my fault..) the
> second callerid function is not being evaluated...
I _think_ the IF is a string evaluation, so the format should be like
SET MYVARIABLE = [IF condition? value1 : value2]
(see http://www.voip-info.org/wiki/index.php?page=Asterisk+func+if )
Try
exten=>123456,1,Set(CALLERID(number)=
${IF(REGEX("^0[1-9][0-9]\{9\}$" ${CALLERID(number)})?
44${CALLERID(number):1}:${CALLERID(number)})})
(two linebreaks to be removed)
HTH,
Anselm
More information about the asterisk-users
mailing list