<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    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.<br>
    <br>
    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.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    On 1/31/12 6:24 PM, Uri Shacked wrote:
    <blockquote
cite="mid:CAMMbDhRrZPm5-=1ytMfC7iqhJ_R_mEMtARzY4dJEX-N=u6PMUQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Hi guys.....</div>
        <div>&nbsp;</div>
        <div>the header searching and saving the Q850 code didn't work.</div>
        <div>here is what i wrote in the cfg, in the failure route:</div>
        <div>&nbsp;</div>
        <div><em># manage failure routing cases<br>
            failure_route[MANAGE_FAILURE] {<br>
            &nbsp; xlog("L_CRIT", "failure \n");<br>
            &nbsp;if($avp(CAR)=="CALLOUT"){<br>
            &nbsp;xlog("L_CRIT", "failure in callout \n");<br>
            &nbsp;&nbsp;##if(is_present_hf("Reason")) {<br>
            &nbsp;&nbsp;xlog("L_CRIT", "failure in reason\n");<br>
            &nbsp;&nbsp;&nbsp;$avp(Q850)=$(hdr(Reason){param.value,cause}{<a
              moz-do-not-send="true" href="http://s.int">s.int</a>});<br>
            &nbsp;&nbsp;&nbsp;xlog("L_CRIT", "failure in reason $avp(Q850)\n");<br>
            &nbsp;&nbsp;##}</em></div>
        <div>&nbsp;</div>
        <div>here is the log print......</div>
        <div>&nbsp;</div>
        <div><em>&nbsp;3(3433) CRITICAL: &lt;script&gt;: failure<br>
            &nbsp;3(3433) CRITICAL: &lt;script&gt;: failure in callout<br>
            &nbsp;3(3433) CRITICAL: &lt;script&gt;: failure in reason<br>
            &nbsp;3(3433) ERROR: &lt;core&gt; [lvalue.c:347]: non existing
            right pvar<br>
            &nbsp;3(3433) ERROR: &lt;core&gt; [lvalue.c:407]: assignment
            failed at pos: (524,15-524,54)<br>
            &nbsp;3(3433) CRITICAL: &lt;script&gt;: failure in reason
            &lt;null&gt;</em></div>
        <div>&nbsp;</div>
        <div>&nbsp;</div>
        <div>the command <em>is_present_hf("Reason"))&nbsp;</em> 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.</div>
        <div><em></em>&nbsp;</div>
        <div>here is the sip trace for the 486, the header is there...</div>
        <div>&nbsp;</div>
        <div><em>&nbsp;&nbsp;&nbsp; Message Header<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Call-ID: 6994099017399497785-1328029200-13379<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; From: &lt;<a class="moz-txt-link-freetext" href="sip:36264529;ss7-cpc=10;cpc=">sip:36264529;ss7-cpc=10;cpc=</a><a
              moz-do-not-send="true" href="mailto:ordinary@172.16.10.3">ordinary@172.16.10.3</a>;user=phone&gt;;tag=6994099017399497785<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; To: &lt;<a moz-do-not-send="true"
              href="mailto:sip%3A39955011@172.16.60.161">sip:39955011@172.16.60.161</a>;user=phone&gt;;tag=9299942026613191738<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CSeq: 1 INVITE<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Supported: timer,100rel<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Reason: Q.850;cause=17;text="UserBusy"<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Reason Protocols: Q.850<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cause: 17(0x11)[User busy]<br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Content-Length: 0</em></div>
        <div>&nbsp;</div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a></pre>
  </body>
</html>