[SR-Users] is_present_hf error on select

Daniel-Constantin Mierla miconda at gmail.com
Mon Mar 30 22:42:25 CEST 2015


Just an extra note for the records -- if you want to presenrve th
request uri (which is $ru) in the forwarded message, you can set $du to
the sip address of the hop where you want to relay the message.

Cheers,
Daniel

On 30/03/15 21:28, Kyle Kurz wrote:
> Perfect, thank you so much Javi.
>
> On Mon, Mar 30, 2015 at 12:40 AM, Javi Gallart
> <jgallart at systemonenoc.com <mailto:jgallart at systemonenoc.com>> wrote:
>
>     Hi
>     On 27/03/15 16:37, Kyle Kurz wrote:
>>     Thanks guys, that worked. Follow-up question, I want to reroute
>>     the incoming packet to the sip URI in that header, but Kamailio
>>     is complaining about the use of a variable in t_relay_to_udp.
>>     Putting $var(b) in quotes just makes it try to use that literal
>>     string as the target host. Is there another way to accomplish this?
>     you could set $ru to the desired value, and the call t_relay().
>
>     Regards
>
>     Javi
>
>>
>>     $var(a) =$hdr(X-Digium-AppServer-Response-URI);
>>     $var(b) =$(var(a){s.strip,4});
>>     if (!t_relay_to_udp($var(b), "5060")) {
>>          sl_reply_error();
>>     }
>>
>>     Thanks,
>>     Kyle
>>
>>
>>     On Fri, Mar 27, 2015 at 8:21 AM, Javi Gallart
>>     <jgallart at systemonenoc.com <mailto:jgallart at systemonenoc.com>> wrote:
>>
>>         Hi
>>         On 27/03/15 16:09, Kyle Kurz wrote:
>>>         I'm trying to use the is_present_hf function to detect the
>>>         presence of a user-defined header and getting the following
>>>         errors in my Kamailio logs:
>>>
>>>         2(12149) BUG: <core> [select.c:426]: run_select(): Select
>>>         structure has not been resolved
>>>         2(12149) ERROR: <core> [lvalue.c:416]: lval_assign():
>>>         assignment failed at pos: (99,58-99,58)
>>>         2(12149) ERROR: <script>: 
>>>
>>>         A quick Google search yielded no results for why this could
>>>         be happening. Originally, I had my code in route[REPLY], but
>>>         noticed that was not one of the paths it was listed as
>>>         available in the textops document, so I moved it to
>>>         request_route, but got the same errors. Does anyone have any
>>>         feedback on how to move forward? My code snippet is below:
>>>
>>>         if (is_present_hf("X-Digium-AppServer-Response-URI")) {
>>>              $var(a) = @hf_value.X_Digium_AppServer_Response_URI[1];
>>>              xlog ("\n\nHERE RESPONSE URI $var(a)\n\n");
>>>         }
>>>
>>         Apparently the syntax for accessing the header is not
>>         correct. @hf_value will look for a global variable with that
>>         name. Try with $hdr().
>>
>>         http://www.kamailio.org/wiki/cookbooks/4.2.x/pseudovariables#hdr_name_-_headers
>>
>>         Regards
>>
>>         Javi
>>>
>>>         Thanks,
>>>         Kyle
>>>
>>>         -- 
>>>
>>>         *Kyle Kurz*
>>>         Digium, Inc. · Senior Software Engineer
>>>         9115 Brown Deer Rd · San Diego, CA 92121 · US
>>>         direct +1 858.537.1166
>>>         Check us out at: http://digium.com
>>>         <http://digium.com/> · http://asterisk.org
>>>         <http://www.asterisk.org/> 
>>>
>>>
>>>         _______________________________________________
>>>         SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>>         sr-users at lists.sip-router.org <mailto:sr-users at lists.sip-router.org>
>>>         http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>>         _______________________________________________
>>         SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
>>         mailing list
>>         sr-users at lists.sip-router.org
>>         <mailto:sr-users at lists.sip-router.org>
>>         http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>>
>>
>>     -- 
>>
>>     *Kyle Kurz*
>>     Digium, Inc. · Senior Software Engineer
>>     9115 Brown Deer Rd · San Diego, CA 92121 · US
>>     direct +1 858.537.1166
>>     Check us out at: http://digium.com
>>     <http://digium.com/> · http://asterisk.org
>>     <http://www.asterisk.org/> 
>>
>>
>>     _______________________________________________
>>     SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>     sr-users at lists.sip-router.org <mailto:sr-users at lists.sip-router.org>
>>     http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
>     _______________________________________________
>     SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
>     list
>     sr-users at lists.sip-router.org <mailto:sr-users at lists.sip-router.org>
>     http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
>
>
> -- 
>
> *Kyle Kurz*
> Digium, Inc. · Senior Software Engineer
> 9115 Brown Deer Rd · San Diego, CA 92121 · US
> direct +1 858.537.1166
> Check us out at: http://digium.com
> <http://digium.com/> · http://asterisk.org <http://www.asterisk.org/> 
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, May 27-29, 2015
Berlin, Germany - http://www.kamailioworld.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150330/afa63d70/attachment.html>


More information about the sr-users mailing list