[SR-Users] How to get cause from reason header?

Luis Rojas G. luis.rojas at sixbell.com
Mon May 11 16:14:45 CEST 2020


On 5/8/20 4:21 PM, Denys Pozniak wrote:
> Try this one:
> $(hdr(Reason){param.value,cause})
>
Wonderful!!

Thanks a lot,

Luis

>
> пт, 8 мая 2020 г. в 21:57, Luis Rojas G. <luis.rojas at sixbell.com 
> <mailto:luis.rojas at sixbell.com>>:
>
>     Hello,
>
>     That is one of the parts I read, but to transform something first
>     I would need something to transform.
>
>     I don't know how to get the cause from the header. I was reading
>     this :
>
>     https://kamailio.org/docs/modules/5.3.x/modules/textopsx.html#textopsx.sel.hf_value
>     <https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fkamailio.org%2Fdocs%2Fmodules%2F5.3.x%2Fmodules%2Ftextopsx.html%23textopsx.sel.hf_value&data=02%7C01%7C%7C41a6de06d98740013e8b08d7f38d66cf%7Cab4a33c2b5614f798601bc921698ad08%7C0%7C0%7C637245660962672571&sdata=75sVlNzFQPs888UkJmMFevIpKsiadfLlM7ciOHq9Rp0%3D&reserved=0>
>
>     It gives some nice examples, like :
>
>     $b = @hf_value.p_associated_uri;
>     $rr = @hf_value.route.uri;
>     $prt = @hf_value2.authorization.integrity_protected;
>     What about @hf_value.reason.cause or @hf_value2.reason.cause ?
>     They don't even compile.
>
>      0(3848) ERROR: <core> [core/select.c:299]: resolve_select():
>     Unable to resolve select 'cause' at level 2
>      0(3848) ERROR: <core> [core/rvalue.c:2893]: fix_rval(): Unable to
>     resolve select in cfg at line: 209 col: 42
>      0(3848) ERROR: <core> [core/select.c:434]: log_select(): select(
>     0(3848) ERROR: <core> [core/select.c:439]: log_select():
>     hf_value2, 0(3848) ERROR: <core> [core/select.c:439]: log_select():
>                           , 0(3848) ERROR: <core> [core/select.c:439]:
>     log_select(): cause, 0(3848) ERROR: <core> [core/select.c:442]:
>     log_select(): )
>
>     Luis
>
>
>     On 5/8/20 2:42 PM, Denys Pozniak wrote:
>>     Hello!
>>
>>     Did you try Parameters List Transformations?
>>     https://www.kamailio.org/wiki/cookbooks/devel/transformations#parameters_list_transformations
>>     <https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.kamailio.org%2Fwiki%2Fcookbooks%2Fdevel%2Ftransformations%23parameters_list_transformations&data=02%7C01%7C%7C41a6de06d98740013e8b08d7f38d66cf%7Cab4a33c2b5614f798601bc921698ad08%7C0%7C0%7C637245660962682566&sdata=q5qkLPKpaNSKN9kfmkYV9GgUfpFV84Qv0SDkXdxqT90%3D&reserved=0>
>>
>>
>>     пт, 8 мая 2020 г. в 19:32, Luis Rojas G. <luis.rojas at sixbell.com
>>     <mailto:luis.rojas at sixbell.com>>:
>>
>>         Hello,
>>
>>         I am sure that this is very easy to do, but I have been
>>         googling and I
>>         can't find a way.
>>
>>         Having a Reason header, for instance :
>>
>>         Reason: SIP;cause=Some_Cause;text="Some_text"
>>
>>         How can I get the value of "Some_Cause"? I need to compare it
>>         to some
>>         specific numeric values...
>>
>>         Thanks in advance,
>>
>>         Luis
>>
>>         -- 
>>         Luis Rojas
>>         Software Architect
>>         Sixbell
>>         Los Leones 1200
>>         Providencia
>>         Santiago, Chile
>>         Phone: (+56-2) 22001288
>>         mailto:luis.rojas at sixbell.com <mailto:luis.rojas at sixbell.com>
>>         http://www.sixbell.com
>>         <https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.sixbell.com%2F&data=02%7C01%7C%7C41a6de06d98740013e8b08d7f38d66cf%7Cab4a33c2b5614f798601bc921698ad08%7C0%7C0%7C637245660962692559&sdata=nS0PdNyxQ2qXDLm4S7PKH62dR1sVqZrFgAoJTFMy8J4%3D&reserved=0>
>>
>>
>>         _______________________________________________
>>         Kamailio (SER) - Users Mailing List
>>         sr-users at lists.kamailio.org <mailto:sr-users at lists.kamailio.org>
>>         https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>         <https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.kamailio.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fsr-users&data=02%7C01%7C%7C41a6de06d98740013e8b08d7f38d66cf%7Cab4a33c2b5614f798601bc921698ad08%7C0%7C0%7C637245660962692559&sdata=%2F4yahCz4hPIc5KTTntOi%2FOZ0ZFAWshRdtuUDz5z70t8%3D&reserved=0>
>>
>>
>>
>>     -- 
>>
>>     BR,
>>     Denys Pozniak
>>
>>
>
>     -- 
>     Luis Rojas
>     Software Architect
>     Sixbell
>     Los Leones 1200
>     Providencia
>     Santiago, Chile
>     Phone: (+56-2) 22001288
>     mailto:luis.rojas at sixbell.com
>     http://www.sixbell.com  <https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.sixbell.com%2F&data=02%7C01%7C%7C41a6de06d98740013e8b08d7f38d66cf%7Cab4a33c2b5614f798601bc921698ad08%7C0%7C0%7C637245660962702553&sdata=O6eOmYSw5RnpQmGKUfnjEHJsSk7u3DPRnuogok1VH7I%3D&reserved=0>
>
>
>
> -- 
>
> BR,
> Denys Pozniak
>
>

-- 
Luis Rojas
Software Architect
Sixbell
Los Leones 1200
Providencia
Santiago, Chile
Phone: (+56-2) 22001288
mailto:luis.rojas at sixbell.com
http://www.sixbell.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20200511/1e47ddf7/attachment.html>


More information about the sr-users mailing list