On my asterisk system, if an incoming call only has a number for the caller ID and no name, the system is using the channel name as in the Callerid Name field. I would like to use some sort of pattern match test to test for the presence of "Zap/" in the ${CALLERID(name)} variable and if it is present, replace it with "Unknown". I'm using the ael format for my dialplan and have been looking for a way to do this, but haven't found anything yet. Is there a way to do this inside the dialplan or do I have to pass it out to an AGI script?
On Tuesday 23 December 2008 11:47:08 Brent Davidson wrote:> On my asterisk system, if an incoming call only has a number for the > caller ID and no name, the system is using the channel name as in the > Callerid Name field. I would like to use some sort of pattern match > test to test for the presence of "Zap/" in the ${CALLERID(name)} > variable and if it is present, replace it with "Unknown". I'm using the > ael format for my dialplan and have been looking for a way to do this, > but haven't found anything yet. Is there a way to do this inside the > dialplan or do I have to pass it out to an AGI script?Set(CALLERID(name)=${IF($[${CUT(CALLERID(name),/,1)}=Zap]?Unknown: ${CALLERID(name)})}) -- Tilghman
Brent Davidson schrieb:> On my asterisk system, if an incoming call only has a number for the > caller ID and no name, the system is using the channel name as in the > Callerid Name field. I would like to use some sort of pattern match > test to test for the presence of "Zap/" in the ${CALLERID(name)} > variable and if it is present, replace it with "Unknown". I'm using the > ael format for my dialplan and have been looking for a way to do this, > but haven't found anything yet. Is there a way to do this inside the > dialplanif ("${CALLERID(name):0:4}" = "Zap/") { Set(CALLERID(name)=Unknown); } Not sure why you would want to put the channel name into the caller ID name in the first place. Philipp Kempgen -- http://www.das-asterisk-buch.de - http://www.the-asterisk-book.com Amooma GmbH - Bachstr. 126 - 56566 Neuwied -> http://www.amooma.de Gesch?ftsf?hrer: Stefan Wintermeyer, Handelsregister: Neuwied B14998 --