[SR-Users] save a Q850 cause reason from a reply

Daniel-Constantin Mierla miconda at gmail.com
Wed Feb 1 12:09:32 CET 2012


Hello,

in failure route you have access to the request, not the reply -- I 
understand the Reason header is in reply from the content of the discussion.

Either set an onreply_route and get the Reason header there, like 
storing it in the avp, or use $T_rpl($hdr(Reason)) in failure route -- 
first option is faster if meets your needs of what to do with the avp.

Cheers,
Daniel

On 1/31/12 6:24 PM, Uri Shacked wrote:
> Hi guys.....
> the header searching and saving the Q850 code didn't work.
> here is what i wrote in the cfg, in the failure route:
> /# manage failure routing cases
> failure_route[MANAGE_FAILURE] {
>   xlog("L_CRIT", "failure \n");
>  if($avp(CAR)=="CALLOUT"){
>  xlog("L_CRIT", "failure in callout \n");
>   ##if(is_present_hf("Reason")) {
>   xlog("L_CRIT", "failure in reason\n");
>    $avp(Q850)=$(hdr(Reason){param.value,cause}{s.int <http://s.int>});
>    xlog("L_CRIT", "failure in reason $avp(Q850)\n");
>   ##}/
> here is the log print......
> / 3(3433) CRITICAL: <script>: failure
>  3(3433) CRITICAL: <script>: failure in callout
>  3(3433) CRITICAL: <script>: failure in reason
>  3(3433) ERROR: <core> [lvalue.c:347]: non existing right pvar
>  3(3433) ERROR: <core> [lvalue.c:407]: assignment failed at pos: 
> (524,15-524,54)
>  3(3433) CRITICAL: <script>: failure in reason <null>/
> the command /is_present_hf("Reason")) / is under ## because of 
> tests... when it was in use, the script didn't even went in the "if", 
> the command didn't recognize the header.
> //
> here is the sip trace for the 486, the header is there...
> /    Message Header
>         Call-ID: 6994099017399497785-1328029200-13379
>         From: <sip:36264529;ss7-cpc=10;cpc=ordinary at 172.16.10.3 
> <mailto:ordinary at 172.16.10.3>;user=phone>;tag=6994099017399497785
>         To: <sip:39955011 at 172.16.60.161 
> <mailto:sip%3A39955011 at 172.16.60.161>;user=phone>;tag=9299942026613191738
>         CSeq: 1 INVITE
>         Via: SIP/2.0/UDP 
> 172.16.60.161;received=172.16.60.161;branch=z9hG4bK08d6.c653f346.2,SIP/2.0/UDP 
> 172.16.10.3:5060;branch=z9hG4bK-6110080000017439-ac100a03-1
>         Supported: timer,100rel
>         Reason: Q.850;cause=17;text="UserBusy"
>             Reason Protocols: Q.850
>             Cause: 17(0x11)[User busy]
>         Content-Length: 0/
>
>
>
> _______________________________________________
> 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://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20120201/b1d147f3/attachment.htm>


More information about the sr-users mailing list