New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uac_replace_XXX() treating input string as a literal some of the time #811
Comments
I'd like to add that running xlog() with the input of "sip:$rU@$var(someVar)" does in fact show up in the logs with the variables both being evaluated properly, such that it will show as: sip:12345@PLANETDRUIDIA instead of the behavior that we're seeing in uac_replace_xxx() . |
@mishehu , it may be an misunderstanding on how you construct strings from variables. Please confirm that the above works for you ; or if there are any other issues. Regards, |
Yes, obviously $var(newTo) = "sip:" + $rU + "@" + $var(someVar); works. Like I was explaining, I need to accommodate patterns that can't be standardized. How does one enter: "sip:" + $rU + "@" + $var(someVar); Into the dialplan database? These values are not known in advance. That's the ultimate goal here. |
@mishehu , if I get it right, you want to take this FMT string (like "sip:$rU@$var(someVar)" ) from somewhere (DB, etc) and than use it to evaluate it ; like you load that fmt string from DB and you use it for building the new TO header. Is this correct ? |
That is correct. Dialplan module seemed to be the most fitting for what we needed, since we're already making use of dialplan. I didn't see another module that would be able to do this. Any guidance would be appreciated... or perhaps this issue is not a bug but an RFE (request for enhancement) ? |
Yes, I guess this is more like a feature request than a bug. Maybe, for generic usage, we can evaluate a new string transformation to evaluate the FMT from a variable..... |
That would not be a bad idea. It would possibly be something many other folks would find useful. My time is a bit limited right now, but I will try to see if I can work up a patch for it unless somebody else here finds it equally useful and beats me to it. |
This affects 2.1.2 hash c846598 running on Centos 6.
If I have the following in my opensips.cfg file:
$var(newTo) = "sip:$rU@$var(someVar)";
uac_replace_to("$var(newTo)");
What I end up with in the actual SIP is a To header that looks like this:
To: "Foo" sip:$rU@$var(someVar)
I spoke with Bogdan briefly about this on IRC, and he confirms that the uac_replace_XXX functions should be feeding the input through pv_printf_s() and it should replace the $rU and the $var(someVar) with their respective values. He said this might be a bug, so here I am. :-)
The text was updated successfully, but these errors were encountered: