Hi All, First, Edwin thanks for the suggestion in the previous email about Regex. This unfortunately did not work... I believe it was correctly evaluation the true condition (i.e. I got the same behaviour).
Anselm, thanks! This way does do it. I believe you must be correct - the variables are not evaluated when they are the <true> or <false> part of an IF function. I wonder if anyone knows if this is a known bug, or whether it should be perhaps raised? On the CALLERID(num) vs CALLERID(number) .... well. There seems to be quite a lot of conflicting documentation. The upshot is I'm using CALLERID(number) and CALLERID(name) and they both seem to work fine.. Thanks to all who made suggestions... my nice little rule is working now :) Cheers, Dave -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anselm Martin Hoffmeister Sent: 02 December 2006 09:16 To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: RE: [asterisk-users] Caller ID Rewrite Am Freitag, den 01.12.2006, 20:41 +0000 schrieb David Bath: > Hi, > > Thanks for quick response. > > I changed it as you suggested, but it has the same effect: > > In the console I get: > > --Executing > Set("SIP/604625-b79140a8",CALLERID(number)=44${CALLERID(number)}") in > new stack > > It's running the IF code correctly, but in the "true" it's just not > evaluating the variable... Well, perhaps the IF hinders evaluation from happening....? It is by far not as elegant, but you could try exten=>123456,1,GotoIf($[${REGEX("^0......)} = 1]?2:3) exten=>123456,2,Set(CALLERID(num)=44${CALLERID(num):1}) exten=>123456,3,ContinueYourDialplanHere Btw. it should be CALLERID(num), not CALLERID(number), right? BR Anselm _______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users _______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users