<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hello, Andrew!<br>
      <br>
      You should see the enum response stored in the $ru variable just
      after the enum_pv_query function.<br>
      <br>
      Regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">--
R&#259;zvan Crainea
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <br>
    On 04/10/2012 09:25 AM, Andrew Melton wrote:
    <blockquote
cite="mid:CAB_4pdMHPC-ACGwKjd2Mre8Sh1rrt69gNbDah4f3TM109iN81Q@mail.gmail.com"
      type="cite">Ok, thanks Razvan.<br>
      <br>
      Can you help me narrow down the response?&nbsp; I am using the
      enum_pv_query along with t_reply to return the enum results to the
      caller:<br>
      <br>
      route[1] {<br>
      ...<br>
      enum_pv_query("$ru", "enum.local");<br>
      &nbsp;t_reply("302", "ENUM");<br>
      ...<br>
      <br>
      <br>
      This results in something like (from sip_trace):<br>
      <br>
      | 1089 | 2012-04-09 20:33:23 | <a moz-do-not-send="true"
        href="mailto:7f995e292bec90f904dd33f9764af0bb@10.10.81.28">7f995e292bec90f904dd33f9764af0bb@10.10.81.28</a>&nbsp;
      |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | SIP/2.0 302 ENUM<br>
      Via: SIP/2.0/UDP
      10.10.81.28:5060;received=10.10.81.28;branch=z9hG4bK2bfcb565;rport=5060<br>
      From: &lt;<a moz-do-not-send="true"
        href="mailto:sip%3A12105856325@10.10.81.28">sip:12105856325@10.10.81.28</a>&gt;;tag=as6c204346<br>
      To: &lt;<a moz-do-not-send="true"
        href="mailto:sip%3A%2B13104849395@10.10.141.97">sip:+13104849395@10.10.141.97</a>&gt;;tag=3e30cad664f79af6351b92d4153bfe13.b8f4<br>
      Call-ID: <a moz-do-not-send="true"
        href="mailto:7f995e292bec90f904dd33f9764af0bb@10.10.81.28">7f995e292bec90f904dd33f9764af0bb@10.10.81.28</a><br>
      CSeq: 102 INVITE<br>
      Contact:
      &lt;tel:+13104849395;npdi;rn=3105654000;spid=132D&gt;;q=0.99<br>
      Server: OpenSIPS (1.8.0-beta-notls (x86_64/linux))<br>
      Content-Length: 0<br>
      <br>
      It would seem that either $(ct.fields(uri) or $ru would grab the
      Contact header string:<br>
      <br>
      Contact:
      &lt;tel:+13104849395;npdi;rn=3105654000;spid=132D&gt;;q=0.99<br>
      <br>
      but xlog copies the received URI instead of the enum_pv_query
      results.&nbsp; <br>
      <br>
      Is there something in addition to $ru that I need to look for to
      capture the URI response?<br>
      <br>
      Thank you.<br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <div class="gmail_quote">On Mon, Apr 9, 2012 at 1:17 AM, Razvan
        Crainea <span dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:razvan@opensips.org">razvan@opensips.org</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div bgcolor="#FFFFFF" text="#000000"> <tt>Hello, Andrew!<br>
              <br>
              You cannot access the raw NAPTR response from the script,
              you can only see the R-URI modified according to the ENUM
              regexp response. Therefore, you can search for the rn
              param in the R-URI ($ru pseudovariable).<br>
              <br>
              Regards,<br>
            </tt>
            <pre cols="72">--
R&#259;zvan Crainea
OpenSIPS Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
            <div>
              <div class="h5"> <br>
                On 04/06/2012 11:58 PM, Andrew Melton wrote: </div>
            </div>
            <blockquote type="cite">
              <div>
                <div class="h5">I am attempting to use the NAPTR
                  response from an enum_pv_query, but I can't find the
                  variable being used to store it. &nbsp;Debug shows a
                  response value:
                  <div><br>
                  </div>
                  <div>DBG:enum:enum_pv_query_3: ENUM query on
                    5.2.1.5.7.2.8.2.1.5.1.enum.local: order 100, pref
                    50, flen 1, flags 'u', slen 12, services
                    'E2U+pstn:tel', rlen 44, regexp
                    '!^(.*)$!tel:\1;npdi;rn=<a moz-do-not-send="true"
                      href="tel:5125599976" value="+15125599976"
                      target="_blank">5125599976</a>;spid=1086!'</div>
                  <div><br>
                  </div>
                  <div>Based on that, I was expecting to redirect the
                    call by parsing the rn=<a moz-do-not-send="true"
                      href="tel:5125599976" value="+15125599976"
                      target="_blank">5125599976</a> from the enum
                    response, and using it to either rewrite the uri or
                    construct a simple 302 from scratch. &nbsp;Can I store
                    the response or use it in a script?</div>
                  <div><br>
                  </div>
                  <div>Thanks.</div>
                  <div><br>
                  </div>
                  <div><br>
                  </div>
                  <br>
                  <fieldset></fieldset>
                  <br>
                </div>
              </div>
              <pre>_______________________________________________
Users mailing list
<a moz-do-not-send="true" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
            </blockquote>
          </div>
          <br>
          _______________________________________________<br>
          Users mailing list<br>
          <a moz-do-not-send="true"
            href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
          <a moz-do-not-send="true"
            href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
            target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
          <br>
        </blockquote>
      </div>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
  </body>
</html>