[OpenSIPS-Users] Passing AVP to prefix core function

Alex A alex.a at gtanetworkconsulting.com
Wed Aug 1 11:26:13 EDT 2018

Dear All, I am working what appears to be a simple function for opensips 2.2.3, however cannot seem to get it working.. Essentially, extract the groupID from permissions module and add a prefix to R-URI on the egress side. https://www.opensips.org/Documentation/Script-CoreFunctions-2-2#toc26 http://www.opensips.org/html/docs/modules/2.2.x/permissions.html#idp5689232 Config route looks like this:     route[relay] {     if ( get_source_group("$avp(group)") ) {             # do something with $avp(group)             xlog("group is $avp(group)\n");                          #prefix("$avp(group)");     };     #Add the string parameter in front of username in R-URI.     #prefix("$avp(group)");     #prefix("$avp(group){s.substr,0,0}");     $avp(22) = "3333#";     prefix("$avp(22)"); Prefix core function prefixes R-URI with variable name ($avp(22)) instead of value of "3333#". I have tried various syntax versions that are commented out, however to no avail.. If I remove the quotes around the variable name: prefix($avp(22)); Opensips does not startup at all, complaining about: syntax error and bad argument, string expected Am I missing something simple? or prefix function is simply not designed to work with variables? Thank you in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20180801/91dbed44/attachment-0001.html>

More information about the Users mailing list