[OpenSIPS-Users] Evaluate script variable before calling module function
Douglas Lopes Pereira
douglaslopespereira at gmail.com
Mon Jan 21 14:30:01 CET 2013
Hi all,
I've been using opensips for a while now and trying to modify a module
function to receive a string contained in the script variable.
Unfortunatelly when I try to print the variable content from inside the
module it prints the variable name.
This is the call from opensips.cfg:
myFunction("anyString", "anyOtherString", "$var(server_name)");
This is myFunction signature and export (I believe I don't need a fixup):
static int myFunction(struct sip_msg *msg, char *str1, char *str2, char
*component);
...
{"myFunction", (cmd_function)myFunction, 3, 0, 0,
REQUEST_ROUTE|ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|LOCAL_ROUTE|STARTUP_ROUTE|TIMER_ROUTE},
...
That is the function:
static int
dns_resolvemyFunctiondomain(struct sip_msg *msg, char *str1, char *str2,
char *component)
{
...
LM_ERR("D5S1 %s", component);
...
}
And the output:
D5S1 $var(server_name)
I've tried to remove the double quote but opensips won't start.
Can you please help me? I've already searched the webpage and watched some
of the Devel Course Videos but wasn't able to find an answer.
Thanks in advance.
Regards,
Douglas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20130121/4b511c9d/attachment.htm>
More information about the Users
mailing list