<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi,<br>
      it looks good at a first sight.<br>
      <br>
      Daniel<br>
      <br>
      <br>
      <br>
      <br>
      <br>
      On 01/19/2015 03:13 PM, Mykola Zaika wrote:<br>
    </div>
    <blockquote
cite="mid:CABT8L5yVfkSFb2eSNC=hUqrviAQRmTRuwAiOfD4522MMaxCTRw@mail.gmail.com"
      type="cite">
      <div dir="ltr">I understand You completely.  Here are some
        examples. What am I doing wrong? <br>
        <div><br>
          1) set your emergency_prefix in subscriber preferences (ex
          peerA_)<br>
          <br>
          <img style="margin-right: 0px;" alt="Вбудоване зображення 1"
            src="cid:part1.00020105.00050407@sipwise.com"><br>
          2) rewrite all the calls from that subscriber and prefix them
          with that value peerA_. You have to use the special variable
          ${caller_emergency_prefix} in the INBOUND rewrite rules for
          callee (attached to the subscriber's domain or to the
          subscriber itself).<br>
          <br>
          <img style="margin-right: 0px;" alt="Вбудоване зображення 2"
            src="cid:part2.03050306.04080702@sipwise.com"><br>
          <br>
          3) now all the calls from that subscriber has destination
          like: peerA_XXXXXX<br>
          4) put the value of "peerA_" in the peering server rules as
          callee prefix value<br>
          <br>
          <img style="margin-right: 0px;" alt="Вбудоване зображення 3"
            src="cid:part3.02070304.09050306@sipwise.com"><br>
          <br>
          5) remove the prefix using the peering's OUTBOUND rewrite
          rules for callee<br>
          <br>
          <img style="margin-right: 0px;" alt="Вбудоване зображення 4"
            src="cid:part4.02060804.06060102@sipwise.com"><br>
        </div>
      </div>
      <div class="gmail_extra"><br clear="all">
        <div>
          <div class="gmail_signature">
            <div dir="ltr">
              <div>
                <div dir="ltr">
                  <div>
                    <div dir="ltr"><span><font color="#888888">-- <br>
                          <div>
                            <div dir="ltr">
                              <div>З повагою,</div>
                              <div>Микола Заїка<br>
                              </div>
                              <div>Компанія VoIPTime,</div>
                              <div>Тел: <span
                                  style="color:rgb(0,0,255)"><a
                                    moz-do-not-send="true"
                                    href="tel:%2B380%2032%202328022"
                                    value="+380322328022"
                                    target="_blank">+380 32 2328022</a></span></div>
                              <div><span style="color:rgb(0,0,255)"><a
                                    moz-do-not-send="true"
                                    href="mailto:ydidukh@voiptime.net"
                                    target="_blank">mzaika@voiptime.net</a></span></div>
                              <div><span style="color:rgb(0,0,255)"><a
                                    moz-do-not-send="true"
                                    href="http://www.voiptime.net"
                                    target="_blank">www.voiptime.net</a></span></div>
                            </div>
                          </div>
                        </font></span></div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <br>
        <div class="gmail_quote">2015-01-19 15:23 GMT+02:00 Daniel
          Grotti <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:dgrotti@sipwise.com" target="_blank">dgrotti@sipwise.com</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <div>Hi,<br>
                so this is how it works:<br>
                <br>
                <br>
                1) set your emergency_prefix in subscriber preferences
                (ex peerA_)<br>
                2) rewrite all the calls from that subscriber and prefix
                them with that value peerA_. You have to use the special
                variable ${caller_emergency_prefix} in the INBOUND
                rewrite rules for callee (attached to the subscriber's
                domain or to the subscriber itself).<br>
                3) now all the calls from that subscriber has
                destination like: peerA_XXXXXX<br>
                4) put the value of "peerA_" in the peering server rules
                as callee prefix value<br>
                5) remove the prefix using the peering's OUTBOUND
                rewrite rules for callee<br>
                <br>
                <br>
                hope this is much clear.<span class="HOEnZb"><font
                    color="#888888"><br>
                    <br>
                    <br>
                    Daniel</font></span>
                <div>
                  <div class="h5"><br>
                    <br>
                    <br>
                    On 01/19/2015 02:13 PM, Mykola Zaika wrote:<br>
                  </div>
                </div>
              </div>
              <div>
                <div class="h5">
                  <blockquote type="cite">
                    <div dir="ltr">
                      <div>
                        <div>I checked all my settings. Maybe rewrite
                          rules have to enable in global configuration
                          files? <br>
                        </div>
                        In subscribers setting is field
                        "emergency_prefix: (A numeric string intended to
                        be used in rewrite rules for emergency
                        numbers.)" When I can use that field? Can I use
                        "emergency_prefix" and  "rewrite_rule_set:"
                        together?<br>
                        <br>
                      </div>
                      Thanks.<br>
                    </div>
                    <div class="gmail_extra"><br clear="all">
                      <div>
                        <div>
                          <div dir="ltr">
                            <div>
                              <div dir="ltr">
                                <div>
                                  <div dir="ltr"><span><font
                                        color="#888888">-- <br>
                                        <div>
                                          <div dir="ltr">
                                            <div>З повагою,</div>
                                            <div>Микола Заїка<br>
                                            </div>
                                            <div>Компанія VoIPTime,</div>
                                            <div>Тел: <span
                                                style="color:rgb(0,0,255)"><a
                                                  moz-do-not-send="true"
href="tel:%2B380%2032%202328022" value="+380322328022" target="_blank">+380
                                                  32 2328022</a></span></div>
                                            <div><span
                                                style="color:rgb(0,0,255)"><a
                                                  moz-do-not-send="true"
href="mailto:ydidukh@voiptime.net" target="_blank">mzaika@voiptime.net</a></span></div>
                                            <div><span
                                                style="color:rgb(0,0,255)"><a
                                                  moz-do-not-send="true"
href="http://www.voiptime.net" target="_blank">www.voiptime.net</a></span></div>
                                          </div>
                                        </div>
                                      </font></span></div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                      <br>
                      <div class="gmail_quote">2015-01-19 13:54
                        GMT+02:00 Daniel Grotti <span dir="ltr"><<a
                            moz-do-not-send="true"
                            href="mailto:dgrotti@sipwise.com"
                            target="_blank">dgrotti@sipwise.com</a>></span>:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          <div bgcolor="#FFFFFF" text="#000000">
                            <div>Please double check you rewrite rules
                              for Callee cause you  got:<span><br>
                                <br>
                                <br>
                                On 01/19/2015 11:51 AM, Mykola Zaika
                                wrote:<br>
                              </span></div>
                            <span>
                              <blockquote type="cite">Jan 19 11:39:34
                                spce /usr/sbin/kamailio[16077]: INFO:
                                <script>: Applying callee-in
                                domain rewrite rules using dpid '10' -
                                R=<a moz-do-not-send="true"
                                  href="mailto:sip%3A911@10.110.10.55"
                                  target="_blank">sip:911@10.110.10.55</a>
                                ID=<a moz-do-not-send="true"
                                  href="mailto:27a860496ea813781de8a0d3731f11af@10.110.10.43"
                                  target="_blank">27a860496ea813781de8a0d3731f11af@10.110.10.43</a><br>
                                Jan 19 11:39:34 spce
                                /usr/sbin/kamailio[16077]: INFO:
                                <script>: No matching rewrite
                                rules for '911' found - R=<a
                                  moz-do-not-send="true"
                                  href="mailto:sip%3A911@10.110.10.55"
                                  target="_blank">sip:911@10.110.10.55</a>
                                ID=<a moz-do-not-send="true"
                                  href="mailto:27a860496ea813781de8a0d3731f11af@10.110.10.43"
                                  target="_blank">27a860496ea813781de8a0d3731f11af@10.110.10.43</a></blockquote>
                              <br>
                              <br>
                            </span> so the number is not rewritten into
                            "emergency_911".<span><font color="#888888"><br>
                                <br>
                                Daniel<br>
                                <br>
                              </font></span></div>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>