<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">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 class="moz-signature" cols="72">Liviu Chircu
OpenSIPS dev
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
On 01/21/2013 03:30 PM, Douglas Lopes Pereira wrote:<br>
</div>
<blockquote
cite="mid:CAMWRJkTbjhiXdJVCizyHSX9XA3wYMJfycFaJj5MshMT4vcsJ6g@mail.gmail.com"
type="cite">
<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 class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>