REPLACE() function returns error

Hello Guys

I am using asterisk 11.I am using Zoiper on my phone,but our contacts are stored as

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.

Please assist


You haven’t loaded the module that contains it (either you have autoload off or you don’t have the module to load). It should be in

Thanks for the reply,but it is loaded

localhost*CLI> module show like
Module                         Description                              Use Count                String handling dialplan functions       0         
1 modules loaded

I also followed the instructions and don’t get any error.

Please let me know where else I can look,I cannot seem to find this error on google or on the forums.


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.

I have also tried CUT() as well,I get the same error.

localhost*CLI> core show function REPLACE

  -= Info about function 'REPLACE' =- 

Replace a set of characters in a given string with another character. 

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.


Not available

[See Also]
Not available

I had the incorrect syntax.

same => n,Set(test2=${REPLACE(${test},7,6)})

should be

same => n,Set(test2=${REPLACE(test,7,6)})

Also got some assistance here

Thanks for leading me to it.