<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <tt>Hi,<br>
      <br>
      So what you want to do is basically to convert from 1234ABC@.....
      into <a class="moz-txt-link-abbreviated" href="mailto:ABC@domain1.com">ABC@domain1.com</a> ?<br>
      <br>
      You can do simple scripting like:<br>
          if ($rU=~"^1234") { <br>
              strip(4);<br>
              $rd = "domain1.com";<br>
          }<br>
      <br>
      or you can use the dialplan module to do in a scalable way, via DB.<br>
      <br>
          dp_translate("1","$rU/$ru")<br>
      <br>
      and in dialplan use:<br>
          match_regexp : "^1234[0-9]+"<br>
          subst_exp: "</tt><tt><tt>^1234([0-9]+)</tt>"<br>
          repl_exp: <a class="moz-txt-link-rfc2396E" href="mailto:sip:\1@domain1.com">"sip:\1@domain1.com"</a><br>
      <br>
      See more
      <a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/1.11.x/dialplan.html#id249304">http://www.opensips.org/html/docs/modules/1.11.x/dialplan.html#id249304</a><br>
      <br>
      <br>
      Regards,<br>
    </tt>
    <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 19.06.2015 12:01, nirali soni wrote:<br>
    </div>
    <blockquote
cite="mid:CANtjt0m_uDLE7awZZOqmJMhquZc1u+1rAZw_QQnmwjUFiOzMqw@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hello Bogdan,
        <div><br>
        </div>
        <div>I am having different accounts with unique account code in
          asterisk.In asterisk peer is defined as [account
          code+extension] like 1234 is account code and 101 is
          extension.its like <b>[1234101].</b>So we have different
          account code with same extensions. i want to use opensips to
          map account code with domain.like 1234 having domain <a
            moz-do-not-send="true" href="http://abc.com">abc.com</a> and
          3456 having <a moz-do-not-send="true"
            href="http://xyz.com.In">xyz.com.In</a> opensips subscriber
          table  I want to insert user as 101 with doman <a
            moz-do-not-send="true" href="http://abc.com">abc.com</a>.
          And its forwarded to asterisk with 1234101.How could I do
          this?<br>
          <div><br>
          </div>
          <div><br>
          </div>
          <div><br>
          </div>
        </div>
      </div>
      <div class="gmail_extra"><br clear="all">
        <div>
          <div class="gmail_signature">
            <div dir="ltr">Thanks and Regards,
              <div>    Nirali Soni</div>
            </div>
          </div>
        </div>
        <br>
        <div class="gmail_quote">On Thu, Jun 4, 2015 at 4:08 PM,
          Bogdan-Andrei Iancu <span dir="ltr">&lt;<a
              moz-do-not-send="true" href="mailto:bogdan@opensips.org"
              target="_blank">bogdan@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 text="#000000" bgcolor="#FFFFFF"> <tt>Hi Nirali,<br>
                <br>
                Use the s.select transformation with the dot as
                separator:<br>
                    <a moz-do-not-send="true"
                  href="http://www.opensips.org/Documentation/Script-Tran-2-1#toc6"
                  target="_blank">http://www.opensips.org/Documentation/Script-Tran-2-1#toc6</a><br>
                <br>
                Regards,<br>
              </tt><span class="">
                <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
              </span>
              <div>
                <div class="h5">
                  <div>On 04.06.2015 08:46, nirali soni wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">Hi,
                      <div><br>
                      </div>
                      <div>My domain is <b><a moz-do-not-send="true"
                            href="http://www.cname.com" target="_blank">www.cname.com</a></b>...I
                        want only <b>cname </b> from that..How can i
                        do this?  </div>
                    </div>
                    <div class="gmail_extra"><br clear="all">
                      <div>
                        <div>
                          <div dir="ltr">Thanks and Regards,
                            <div>    Nirali Soni</div>
                          </div>
                        </div>
                      </div>
                      <br>
                      <div class="gmail_quote">On Wed, May 27, 2015 at
                        10:34 PM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a
                            moz-do-not-send="true"
                            href="mailto:bogdan@opensips.org"
                            target="_blank">bogdan@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 text="#000000" bgcolor="#FFFFFF"> <tt>Hi,<br>
                              <br>
                              you should get the body of the header,
                              remove the header, do a subst (to change
                              the username) and insert the hdr back:<br>
                              <br>
                              $var(body) = $hdr(Authorization);<br>
                              $var(new_body) =
                              $(var(body){re.subst,reg_exp}) ; // see <a
                                moz-do-not-send="true"
                                href="http://www.opensips.org/Documentation/Script-Tran-2-1#toc75"
                                target="_blank">http://www.opensips.org/Documentation/Script-Tran-2-1#toc75</a><br>
                              remove_hf("</tt><tt><tt>Authorization</tt>");<br>
                              append_hf("</tt><tt><tt>Authorization: </tt>$</tt><tt><tt>var(new_body)\r\n</tt>");<br>
                              <br>
                              Regards,<br>
                            </tt><span>
                              <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
                            </span>
                            <div>
                              <div>
                                <div>On 27.05.2015 05:42, nirali soni
                                  wrote:<br>
                                </div>
                                <blockquote type="cite">
                                  <p dir="ltr">Thank for reply<br>
                                    But how could I do this with using
                                    regexp?</p>
                                  <br>
                                  <div class="gmail_quote">On Tue, 26
                                    May 2015 21:56 Bogdan-Andrei Iancu
                                    &lt;<a moz-do-not-send="true"
                                      href="mailto:bogdan@opensips.org"
                                      target="_blank">bogdan@opensips.org</a>&gt;

                                    wrote:<br>
                                    <blockquote class="gmail_quote"
                                      style="margin:0 0 0
                                      .8ex;border-left:1px #ccc
                                      solid;padding-left:1ex">
                                      <div text="#000000"
                                        bgcolor="#FFFFFF"> <tt>Hi N</tt><tt>irali,</tt><tt><br>
                                          <br>
                                          You could try to do it with
                                          some regexp and
                                          transformations, but your
                                          authentication will fail as
                                          the "response" will not match
                                          the username - the response is
                                          computed based in username,
                                          password, etc. <br>
                                        </tt><tt><br>
                                        </tt><tt>Regards,</tt><br>
                                        <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
                                      </div>
                                      <div text="#000000"
                                        bgcolor="#FFFFFF">
                                        <div>On 26.05.2015 14:57, nirali
                                          soni wrote:<br>
                                        </div>
                                      </div>
                                      <div text="#000000"
                                        bgcolor="#FFFFFF">
                                        <blockquote type="cite">
                                          <div dir="ltr">
                                            <div>Hi,</div>
                                            <div><br>
                                            </div>
                                            <div>I want to change Digest
                                              username in Register
                                              request.My use in opensips
                                              Subscribe table as 1001
                                              and in asterisk  sip.conf
                                              its lilke <b>1001_cname.
                                              </b>when I try to register
                                              to asterisk it sends 403
                                              Forbidden. with user name
                                              mismatch.</div>
                                            <div><br>
                                            </div>
                                            <div>
                                              <div>REGISTER
                                                sip:192.168.50.123:5060;transport=UDP
                                                SIP/2.0</div>
                                              <div>Via: SIP/2.0/UDP
                                                192.168.50.43:5060;branch=z9hG4bKfa0a.ff2f5601.0</div>
                                              <div>Via: SIP/2.0/UDP
192.168.50.30:50413;received=192.168.50.30;branch=z9hG4bK-524287-1---8343a748155f5d1c;rport=50413</div>
                                              <div>Max-Forwards: 69</div>
                                              <div>Contact: <a
                                                  moz-do-not-send="true"
href="mailto:sip:1006@192.168.50.30:50413;rinstance=bf3ed7694430b17a;transport=UDP"
                                                  target="_blank">&lt;sip:1006@192.168.50.30:50413;rinstance=bf3ed7694430b17a;transport=UDP&gt;</a></div>
                                              <div>To: &lt;<a
                                                  moz-do-not-send="true"
href="mailto:sip%3A1006_cname@192.168.50.123" target="_blank">sip:1006_cname@192.168.50.123</a>&gt;</div>
                                              <div>From: &lt;<a
                                                  moz-do-not-send="true"
href="mailto:sip%3A1006_cname@192.168.50.123" target="_blank">sip:1006_cname@192.168.50.123</a>&gt;;tag=b223565f</div>
                                              <div>Call-ID:
                                                eODd20Lykxt_5QhbM49_hg..</div>
                                              <div>CSeq: 2 REGISTER</div>
                                              <div>Expires: 60</div>
                                              <div>Allow: INVITE, ACK,
                                                CANCEL, BYE, NOTIFY,
                                                REFER, MESSAGE, OPTIONS,
                                                INFO, SUBSCRIBE</div>
                                              <div>Supported: replaces,
                                                norefersub,
                                                extended-refer, timer,
                                                outbound, path,
                                                X-cisco-serviceuri</div>
                                              <div>User-Agent: Zoiper
                                                r30798</div>
                                              <div><b>Authorization:
                                                  Digest username="<font
                                                    color="#ff0000">1006</font>",realm="asterisk",nonce="50742ec9",uri="sip:192.168.50.123:5060;transport=UDP",response="c0409f4c7a960df17b24994aff6a9fa2",algorithm=MD5</b></div>
                                              <div>Allow-Events:
                                                presence, kpml</div>
                                              <div>Content-Length: 0</div>
                                            </div>
                                            <div>==========</div>
                                            <div>I want Digest username=
                                              1006_cname ..</div>
                                            <div>How can I do this?</div>
                                            <div><br>
                                            </div>
                                            <div><br>
                                            </div>
                                            <br clear="all">
                                            <div>
                                              <div>
                                                <div dir="ltr">Thanks
                                                  and Regards,
                                                  <div> </div>
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                          <br>
                                          <fieldset></fieldset>
                                          <br>
                                        </blockquote>
                                      </div>
                                      <div text="#000000"
                                        bgcolor="#FFFFFF">
                                        <blockquote type="cite">
                                          <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>
                                        <br>
                                      </div>
                                    </blockquote>
                                  </div>
                                </blockquote>
                                <br>
                              </div>
                            </div>
                          </div>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>