[asterisk-dev] ast_config and character escaping

Tilghman Lesher tlesher at digium.com
Tue Sep 7 10:30:49 CDT 2010


On Tuesday 07 September 2010 01:30:02 st41ker wrote:
> I'm using ast_variable_browse to retrieve variables from some text
> config file.
> I need to load variables containing regexp values, but it seems like
> something is breaking them.
>
> Sample variable from config file:
>
> ^1(.*)=(.*)/09\&
>
> In the output ast_variable I'm getting escaped ('\\&') value.
>
> When I use:
>
> ^1(.*)=(.*)/09\1
>
> everything is fine.
>
> I've looked almost everywhere in the related code and found nothing that
> can help in resolving the issue.
> Please, could someone direct me in the right way?

Much of this behavior is going to change, depending upon what version of
Asterisk you're using.  Especially in 1.4 and earlier versions, escaping was
removed at the point of load.  What version of the API are you using?

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list