<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hello,<br>
      <br>
      The approach you're taking seems good, and it should definitely
      work.<br>
      <br>
      Do you receive any errors in the OpenSIPS logs ? If you make a SIP
      trace ( ngrep / tcpdump ) on the OpenSIPS machine, do you see the
      INVITE message getting out of OpenSIPS ? <br>
      <br>
      If you don't see the package being sent out even on the OpenSIPS
      machine, then it means that somehow your script doesn't forward
      that request, but drops it ( because ngrep on the OpenSIPS machine
      excludes any firewall issues - ngrep gets in even before the local
      iptables output chain ).<br>
      <br>
      Best Regards,<br>
      <pre class="moz-signature" cols="72">Vlad Paiu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a>
</pre>
      On 25.09.2013 15:36, Mike Tesliuk wrote:<br>
    </div>
    <blockquote
cite="mid:CAKNtoCEqhQLa5q9bOMb3LT0bU6JX5XytpWDGGt_tBxroEStLPA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>Somebody have at least an idea if this is suposed to work
            ?<br>
            <br>
          </div>
          the package come to me, i check the did, change the $ru, and
          send to the location, the location find the user and the
          package dont reach the other side.<br>
          <br>
        </div>
        Thanks<br>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">2013/9/22 Mike Tesliuk <span dir="ltr">&lt;<a
              moz-do-not-send="true" href="mailto:mike@ultra.net.br"
              target="_blank">mike@ultra.net.br</a>&gt;</span><br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div>
                <div>
                  <div>
                    <div>
                      <div>
                        <div>Hello Guys, <br>
                          <br>
                          <br>
                          Im trying to implement a system to manipulate
                          DID's, the forward for external address is ok,
                          but in trying now to do the same with&nbsp; a user
                          that is registered <br>
                          <br>
                          <br>
                        </div>
                        i create a new table where i have the did, the
                        account and the destination, if the destination
                        is null so the opensips will check the account
                        on the location table.<br>
                        <br>
                      </div>
                      basically i have this<br>
                      <br>
                      if(!$avp(91)){<br>
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("Did
                      nao encontrado");<br>
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      sl_send_reply("404", "Not Found");<br>
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit;<br>
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }else{<br>
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("Did
                      encontrado, seguindo regras para utilizacao em
                      location");<br>
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ru =
                      "sip:" + $avp(91) + "@IP_ADDRESS:5060";<br>
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xlog("Novo
                      destino $ru");<br>
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
                      <br>
                      <br>
                    </div>
                    the avp(91) is the user account, the same that the
                    user use to register<br>
                    <br>
                    <br>
                  </div>
                  when in this situation, the call go trouhg the
                  location module, and the system find the correct
                  address.<br>
                  <br>
                </div>
                i have on the log the same information that i have on
                opensipsctl ul show<br>
                <br>
                Fazendo relay &lt;null&gt; -
sip:055011395010100000@IP_ADDR:5081;rinstance=0f9054bc313f0cf1;transport=UDP<br>
                <br>
                <br>
              </div>
              below the output from ul show<br>
              <br>
              &nbsp;&nbsp;&nbsp; AOR:: 055011395010100000<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Contact::
              sip:055011395010100000@IP_ADDR:5081;rinstance=0f9054bc313f0cf1;transport=UDP
              Q=<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Expires:: 525<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Callid::
              MTZhNzE1ZDYzYWU4Y2ViZDMzZTQzZWU1N2M0ZGFiZjQ.<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Cseq:: 2<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; User-agent:: Zoiper Communicator 2.04.10164
              rev.10204<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; State:: CS_SYNC<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Flags:: 0<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Cflag:: 0<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Socket:: udp:GW_IP_ADDR:5060<br>
              &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Methods:: 5951<br>
              <br>
              <div><br>
                <br>
              </div>
              <div>But when i make the call, the ngrep show me the send
                of the invite, but i dont see nothing on the other side.<br>
                <br>
                <br>
              </div>
              <div>Below you have the invite<br>
                <br>
                U GW_IP_ADDR:5060 -&gt; CUSTOMER_IP_ADDR:5081<br>
                INVITE
                sip:055011395010100000@CUSTOMER_IP_ADDR:5081;rinstance=0f9054bc313f0cf1;transport=UDP
                SIP/2.0.<br>
                Record-Route:
                &lt;sip:GW_IP_ADDR;lr;ftag=as657116d5;did=5b6.6e3954b;nat=yes&gt;.<br>
                Via: SIP/2.0/UDP
                GW_IP_ADDR:5060;branch=z9hG4bK485d.8be72863.0.<br>
                Via: SIP/2.0/UDP
CALLER_IP_ADDR:5060;received=CALLER_IP_ADDR;branch=z9hG4bK1f912c35;rport=5060.<br>
                Max-Forwards: 69.<br>
                From: "testemike"
                &lt;sip:testemike@CALLER_IP_ADDR&gt;;tag=as657116d5.<br>
                To: &lt;sip:551133992377@GW_IP_ADDR&gt;.<br>
                Contact: &lt;sip:testemike@CALLER_IP_ADDR:5060&gt;.<br>
                Call-ID:
                40d32e5b3c52c58646d996d871ad8471@CALLER_IP_ADDR:5060.<br>
                CSeq: 102 INVITE.<br>
                User-Agent: SIP.Ultranet.<br>
                Date: Mon, 23 Sep 2013 00:20:27 GMT.<br>
                Session-Expires: 600.<br>
                Min-SE: 90.<br>
                Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER,
                SUBSCRIBE, NOTIFY, INFO, PUBLISH.<br>
                Supported: replaces, timer.<br>
                Content-Type: application/sdp.<br>
                Content-Length: 446.<br>
                .<br>
                v=0.<br>
                o=root 985357135 985357135 IN IP4 CALLER_IP_ADDR.<br>
                s=SDP.Ultranet.<br>
                c=IN IP4 GW_IP_ADDRGW_IP_ADDR.<br>
                t=0 0.<br>
                m=audio 4229242292 RTP/AVP 8 0 3 111 97 18 101.<br>
                a=rtpmap:8 PCMA/8000.<br>
                a=rtpmap:0 PCMU/8000.<br>
                a=rtpmap:3 GSM/8000.<br>
                a=rtpmap:111 G726-32/8000.<br>
                a=rtpmap:97 iLBC/8000.<br>
                a=fmtp:97 mode=30.<br>
                a=rtpmap:18 G729/8000.<br>
                a=fmtp:18 annexb=no.<br>
                a=rtpmap:101 telephone-event/8000.<br>
                a=fmtp:101 0-16.<br>
                a=ptime:20.<br>
                a=sendrecv.<br>
                a=nortpproxy:yes.<br>
                a=nortpproxy:yes.<br>
                <br>
                <br>
              </div>
              <div>
                after the invite, i get a request timeout message<br>
                <br>
              </div>
              <div>i try to create some firewall rules on the customer
                side but i dont see any package, from the opensips is
                like the package is beeing sended<br>
                <br>
              </div>
              <div>i made a try using another machine that dont have nat
                and i cant see the package in this case too.<br>
                <br>
                <br>
              </div>
              <div><br>
              </div>
              <div>anyone have an idea about this ?<br>
                <br>
              </div>
              <div>Thanks.<br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <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>
    <br>
  </body>
</html>