<div dir="ltr"><div><div>Worked as a charm.<br><br></div>Thank you Liviu.<br><br>Have a nice week!<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 21, 2013 at 11:41 AM, Liviu Chircu <span dir="ltr"><<a href="mailto:liviu@opensips.org" target="_blank">liviu@opensips.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Hello Douglas,<br>
<br>
If you want the parameter to be a pseudo-variable only, you
should:<br>
- parse the '$...' string in the fixup phase with
pv_parse_spec(...)<br>
- get the spec value at runtime with pv_get_spec_value(...)<br>
<br>
If you want the parameter to be either string or pv, you should:<br>
- parse the string at fixup with the generic fixup_sgp(...)
function<br>
- get the generic parameter value at runtime with
fixup_get_svalue(...) function<br>
<br>
Regards,<br>
<pre cols="72">Liviu Chircu
OpenSIPS dev
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre><div><div class="h5">
On 01/21/2013 03:30 PM, Douglas Lopes Pereira wrote:<br>
</div></div></div>
<blockquote type="cite"><div><div class="h5">
<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>
<br>
<fieldset></fieldset>
<br>
</div></div><pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>