Upgrade 3CX to v18 and get it hosted free!

Asterisk func strreplace

Author image

Synopsis

Replace instances of a substring within a string with another string.

Description

Searches for all instances of the <find-string> in provided variable and replaces them with <replace-string>. If <replace-string> is an empty string, this will effectively delete that substring. If <max-replacements> is specified, this function will stop after performing replacements <max-replacements> times.

NOTE: The replacement only occurs in the output. The original variable is not altered.

NOTE: varname should be not a variable value or function return value, but a variable name or function name with params:

  • same => n,NoOp(${STRREPLACE(TRUNK,"_"," ")})
  • same => n,NoOp(${STRREPLACE(CDR(disposition)," ","_")})

Syntax

STRREPLACE(varname,find-string[,replace-string[,max-replacements]])

Arguments

Not available

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.