REPLACE() function returns error

Hello Guys

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.

Please assist

Thanks
Kimmy

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 func_strings.so

Thanks for the reply,but it is loaded

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

I also followed the instructions https://wiki.asterisk.org/wiki/display/AST/Troubleshooting+Asterisk+Module+Loading 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.

Thanks
Kimmy

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' =- 

[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

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 http://stackoverflow.com/questions/1924982/replace-characters-in-asterisk-dialplan

Thanks for leading me to it.

Kimmy