Thank you Daniel. I'll try that.<div><br></div><div>Regards</div><div><br></div><div>Carlos. <br><br><div class="gmail_quote">On Fri, Sep 9, 2011 at 8:42 AM, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com">miconda@gmail.com</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">
Hello,<div><div></div><div class="h5"><br>
<br>
On 9/8/11 6:30 PM, Carlos Ruiz Diaz wrote:
<blockquote type="cite">
<span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px">Hello.
<div><br>
</div>
<div>I'm currently developing an OpenSER module which does some
business logic for the company I work for. For compatibility
reasons we are working with openser-1.2.2-tls and we haven't
been able to upgrade to newer version yet.</div>
<div><br>
</div>
<div>In one block of the code I have to read an avp which is
written inside the openser.cfg script using:</div>
<div><br>
</div>
<div>OPENSER:</div>
<div>avp_copy(<a>"sip:123@123.123.123:5060"</a>,
"$avp(s:selectedroute)/g"); </div>
<div><br>
</div>
<div>C CODE:</div>
<div>
<div>if (is_response && is_invite_seq)</div>
<div>{</div>
<div><span style="white-space:pre-wrap"> </span>struct
usr_avp* destavp <span style="white-space:pre-wrap"> </span>=
NULL;</div>
<div><span style="white-space:pre-wrap"> </span>int_str
destval;</div>
<div><span style="white-space:pre-wrap"> </span>const str
selected_route <span style="white-space:pre-wrap"> </span>=
{ "selectedroute", 13 };</div>
<div><span style="white-space:pre-wrap"> </span>int
attempts = 1, max_attempts = 3;</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"> </span><span style="white-space:pre-wrap">for ( destavp =
search_first_avp(AVP_NAME_STR | AVP_VAL_STR, (int_str)
selected_route, NULL, 0); destavp != NULL; destavp =
search_next_avp(destavp, NULL) ) { get_avp_val(destavp,
&destval); }</span></div>
</div>
<div>}</div>
<div><br>
</div>
<div>The problem is that "selectedroute" avp cannot be found so
I can't read its value. This happens sporadically and most of
the time the code works just fine. </div>
<div><br>
</div>
<div>I also checked for the list of available AVPs using
get_avp_list() but it reports an empty list. </div>
<div><br>
</div>
<div>Is there another way to read AVPs or is there something I'm
missing which is causing this problem? <br>
</div>
</span></blockquote></div></div>
If the avp list is null inside C code, then the avp was not added.
Do you see any error message in syslog related to avp_copy()?<br>
<br>
After avp copy, do a xlog(..) line printing the avp, if it is
printed in syslog and you don't get it in C, then would be very
strange...<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<blockquote type="cite"><div class="im"><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">
<div><br>
</div>
<div>Any help will be appreciated.</div>
<div><br>
</div>
<div>Thanks in advance!</div>
<div><br>
</div>
<font color="#888888">
<div>Carlos.</div>
</font></span>
<br>
<fieldset></fieldset>
<br>
</div><pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote><font color="#888888">
<br>
<pre cols="72">--
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
Kamailio Advanced Training, Oct 10-13, Berlin: <a href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a>
<a href="http://linkedin.com/in/miconda" target="_blank">http://linkedin.com/in/miconda</a> -- <a href="http://twitter.com/miconda" target="_blank">http://twitter.com/miconda</a></pre>
</font></div>
</blockquote></div><br></div>