<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>Hi all,<br><br></div>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.<br>
<br></div>Unfortunatelly when I try to print the variable content from inside the module it prints the variable name.<br><br></div>This is the call from opensips.cfg:<br></div><span style="font-family:courier new,monospace">myFunction("anyString", "anyOtherString", "$var(server_name)");</span><br>
<br></div>This is myFunction signature and export (I believe I don't need a fixup):<br></div><span style="font-family:courier new,monospace">static int myFunction(struct sip_msg *msg, char *str1, char *str2, char *component);<br>
</span></div><span style="font-family:courier new,monospace">...<br>{"myFunction", (cmd_function)myFunction, 3, 0, 0,<br>REQUEST_ROUTE|ONREPLY_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|LOCAL_ROUTE|STARTUP_ROUTE|TIMER_ROUTE},<br>
...</span><br><br></div>That is the function:<br><br></div><span style="font-family:courier new,monospace">static int<br>dns_resolvemyFunctiondomain(struct sip_msg *msg, char *str1, char *str2, char *component)<br>{<br>...<br>
LM_ERR("D5S1 %s", component);<br>...<br>}</span><br><br></div>And the output:<br><br></div>D5S1 $var(server_name)<br><br></div>I've tried to remove the double quote but opensips won't start.<br><br></div>
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.<br><br></div><div>Thanks in advance.<br></div><div><br></div>Regards,<br></div>
Douglas<br></div>