[OpenSIPS-Users] s.index madness and my waning grip on sanity

Liviu Chircu liviu at opensips.org
Fri Jan 27 13:10:27 EST 2017


Hi, Jock!

The answer is simple: you must be using a pre-2.2 OpenSIPS, which does 
not include this transformation, just like the error message says:

"ERROR:core:tr_parse_string: unknown transformation: index"

Future advice: before reading documentation, make sure you properly 
select your OpenSIPS version using the top-level switches [1]

[1]: http://www.opensips.org/Documentation/Script-Tran-2-1

Regards,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 27.01.2017 19:26, Jock McKechnie wrote:
> Good morning all;
>
> I'm having a battle with s.index that I'd really like to believe no
> one should be waging, and I've come to the conclusion either 1.11 is
> seriously broken, or I'm utterly deranged, but at the risk of
> verifying the second, I wanted to reach out and figure out what I'm
> doing wrong here.
>
> I seem utterly incapable of getting s.index working at all, consider
> the following:
>
> $var(source) = "onetwothree";
> $var(search) = "one";
> $var(index) = $(var(source){s.index, $var(search), 0});
>
> Which should look famaliar as it's based entirely on the example in
> the 1.11 documentation. This produces the following:
> ERROR:core:tr_parse_string: unknown transformation: index,
> $var(search), 0}/index/5! ERROR:core:parse_transformation: error
> parsing [{s.index, $var(search), 0}] ERROR:core:pv_parse_spec:
> ERROR:bad tr in pvar name "var" ERROR:core:pv_parse_spec: invalid
> parsing in [$(var(source){s.index, $var(search), 0})] at (4)
> CRITICAL:core:yyerror: parse error in config file
> /etc/opensips/opensips.cfg, line 92, column 166-206: unknown script
> variable
>
> Using a static search string:
> $var(index) = $(var(source){s.index, "one", 0});
>
> Garners me the same with:
> ERROR:core:tr_parse_string: unknown transformation: index, "one", 0}/index/5!
>
> And not providing a starting offset is similar:
> $var(index) = $(var(source){s.index, $var(search)});
>
> ERROR:core:tr_parse_string: unknown transformation: index,
> $var(search)}/index/5!
>
> Given these are core transformations and I'm using several others in
> my configs I'm running under the belief I'm not missing a module. I've
> tried copying the doc example verbatim with identical results. What am
> I missing here, people? Is it just staring me straight in the face?
>
> My thanks;
>   - Jock
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users




More information about the Users mailing list