[SR-Users] uri_param function

Andrew Chen achen at fuze.com
Mon Jan 21 23:06:33 CET 2019


Thanks Brandon for your responses.  For some reason I misunderstood the use
of uri_param and thought that would just check if the param "ak" would
exist.

Yeah I did something like what you just mentioned except I'm not checking
for blank value, but checking to make sure the param exists.

if(uri =~ "(AK|ak)") {
...
}



On Mon, Jan 21, 2019 at 4:38 PM Brandon Armstead <brandon at cryy.com> wrote:

> Andrew,
>
>    Perhaps try something like this:
>
> if(!($(ru{uri.param,ak}) == "")){
>   // ak has a value
> } else {
>  // ak has no value
> }
>
> On Mon, Jan 21, 2019 at 1:28 PM Brandon Armstead <brandon at cryy.com> wrote:
>
>> Andrew,
>>
>>    I believe per docs it finds a param with no value, so it may not match
>> if there is a value on that attribute.
>>
>> On Mon, Jan 21, 2019 at 1:24 PM Andrew Chen <achen at fuze.com> wrote:
>>
>>> Hi all,
>>>
>>> Question.  I'm executing uri_param() function to look for our customized
>>> Request-URI parameters generated by our client.  However, it keeps saying
>>> the param is not there even though my client logs shows the param was
>>> generated.  Below is an example Request-URI from a test call I made:
>>>
>>> sips:<some long string>@sjomainkamavip50.fuzemeeting.com:443;FN=
>>> sjomainfn92.a.fuzemeeting.com;BR=sjomainfn91.a.fuzemeeting.com;AK=<some
>>> key>;transport=wss"
>>>
>>> And here is my line of code to check it:
>>>
>>>                         if(uri_param("AK") ||uri_param("ak")) {
>>>                                 xlog("L_INFO", "[CSeq $cs] AK value
>>> detected");
>>>                         } else {
>>>                                 xlog("L_INFO", "[CSeq $cs] AK value not
>>> detected.  Aborting call");
>>>                                 drop();
>>>                         }
>>> Am I misusing this function somehow?
>>>
>>> I'm running 5.1.2.
>>>
>>> Thanks
>>>
>>> Regards,
>>>
>>> --
>>> Andy Chen
>>>
>>>
>>> *Confidentiality Notice: The information contained in this e-mail and any
>>> attachments may be confidential. If you are not an intended recipient,
>>> you
>>> are hereby notified that any dissemination, distribution or copying of
>>> this
>>> e-mail is strictly prohibited. If you have received this e-mail in error,
>>> please notify the sender and permanently delete the e-mail and any
>>> attachments immediately. You should not retain, copy or use this e-mail
>>> or
>>> any attachment for any purpose, nor disclose all or any part of the
>>> contents to any other person. Thank you.*
>>> _______________________________________________
>>> Kamailio (SER) - Users Mailing List
>>> sr-users at lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>


-- 
Andy Chen
Sr. Telephony Lead Engineer
415 516 5535 (M)
achen@ <achen at thinkingphones.com>fuze.com

-- 
*Confidentiality Notice: The information contained in this e-mail and any

attachments may be confidential. If you are not an intended recipient, you

are hereby notified that any dissemination, distribution or copying of this

e-mail is strictly prohibited. If you have received this e-mail in error,

please notify the sender and permanently delete the e-mail and any

attachments immediately. You should not retain, copy or use this e-mail or

any attachment for any purpose, nor disclose all or any part of the

contents to any other person. Thank you.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20190121/86dfeeb8/attachment.html>


More information about the sr-users mailing list