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><meta http-equiv="content-type" content="text/html; charset=utf-8">avp_copy("sip:123@123.123.123:5060", "$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 class="Apple-tab-span" style="white-space:pre">                </span>struct usr_avp* destavp <span class="Apple-tab-span" style="white-space:pre">        </span>= NULL;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>int_str destval;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>const str selected_route <span class="Apple-tab-span" style="white-space:pre">        </span>= { "selectedroute", 13 };</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>int attempts = 1, max_attempts = 3;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span><span class="Apple-style-span" style="white-space: pre; ">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? </div>
<div><br></div><div>Any help will be appreciated.</div><div><br></div><div>Thanks in advance!</div><div><br></div><div>Carlos.</div>