I am using asterisk 11.I am using Zoiper on my phone,but our contacts are stored as
(XXX)XXXXXXX
I would like to strip the “(” and the “)” but I read the following error on the Asterisk CLi.
ERROR[1296][C-0000001e]: pbx.c:4345 ast_func_read2: Function not registered
My dialplan test looks like this
exten => _(0NX)XXXXXXX,1,NoOp()
same => n,Set(test=${EXTEN})
same => n,Verbose(1, string 1: ${test})
same => n,Set(test2=${REPLACE(${test},7,6)})
; same => n,Set(test2=${test})
same => n,Verbose(1, string 2: ${test2})
same => n,Hangup()
I also tried STRREPLACE() as well and get the same error.
You can’t find it because you are the only one having it. I would check carefully for bogus characters. Also do “core show function REPLACE”, to see if the help system thinks the function exists.
You may be able to use FILTER instead, but I’d expect both to fail at the same time.
localhost*CLI> core show function REPLACE
-= Info about function 'REPLACE' =-
[Synopsis]
Replace a set of characters in a given string with another character.
[Description]
Iterates through a string replacing all the <find-chars> with <replace-ch
ar>. <replace-char> may be either empty or contain one character. If empty,
all <find-chars> will be deleted from the output.
NOTE: The replacement only occurs in the output. The original variable is
not altered.
[Syntax]
REPLACE(varname,find-chars[,replace-char])
[Arguments]
Not available
[See Also]
Not available