<html>
  <head>
    <meta content="text/html; charset=KOI8-R" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix"><span id="result_box" class=""
        lang="en"><span class="hps">Thanks, Jordan!<br>
          <br>
          I tried</span> <span class="hps">the following structure</span><span>:</span>
        <br>
---8&lt;-----------------------------------------------------------------------------------------------------------------------<br>
        <br>
        if (db_is_user_in("$fu", "asterisk"))<br>
        ššš {<br>
        ššš ššš $rd=$var(asterisk_ip);<br>
        ššš }ššš ššš <br>
        <br>
        ššš if(!dp_translate("0","$rU/$rU")){ššš ššš <br>
        ššš ššš send_reply("420", "Invalid Destination");<br>
        ššš ššš exit;<br>
        ššš }<br>
        <br>
        ššš if (db_is_user_in("$fu", "asterisk"))<br>
        ššš ššš {ššš ššš <br>
        ššš ššš $avp(dest)="media";<br>
        ššš ššš }ššš ššš <br>
        ššš <br>
        ššš xlog("$avp(dest)");ššš <br>
        ššš <br>
        ššš if ($avp(dest)=="usrloc") {<br>
        ššš ššš route(m4_USRLOC);<br>
        ššš }<br>
        ššš <br>
        ššš if ($avp(dest)=="pstn") {<br>
        ššš ššš ššš route(m4_PSTN);<br>
        ššš }<br>
        <br>
        ššš # route to Asterisk<br>
        ššš if ($avp(dest)=="media") { <br>
        ššš ššš route(m4_MEDIA);<br>
        ššš }<br>
        <br>
---8&lt;-----------------------------------------------------------------------------------------------------------------------<br>
        <span class="hps">Unfortunately,</span> <span class="hps">it
          did not help</span><span>.</span> <br>
        <span class="hps"><br>
          In the picture</span> <span class="hps">chart</span> <span
          class="hps">calls</span> <span class="hps">for this approach</span><span
          class="">:<br>
          <br>
          <a class="moz-txt-link-freetext" href="http://tinypic.com/r/27zb0qb/5">http://tinypic.com/r/27zb0qb/5</a><br>
        </span></span><br>
      *.*.3.1 - UAC (2)<br>
      *.*.1.4 - OpenSIPS [as UAC(1)] - extension on Asterisk<br>
      *.*.1.5 - Asterisk<br>
      <br>
      <div id="gt-src-tools">
        <div id="gt-src-tools-l">
          <div style="display: inline-block;" id="gt-input-tool">
            <div id="itamenu"><span class="ita-kd-inputtools-div"></span></div>
          </div>
        </div>
      </div>
      <div id="gt-res-content" class="almost_half_cell">
        <div dir="ltr" style="zoom:1">
          <div id="tts_button" style="" class=""><object
              type="application/x-shockwave-flash"
              data="//ssl.gstatic.com/translate/sound_player2.swf"
              id="tts" height="18" width="18"></object></div>
          <span id="result_box" class="short_text" lang="en"><span
              class="hps">What else</span> <span class="hps">can I do?</span></span></div>
      </div>
      <br>
      <br>
      22.01.2014 14:16, Justin Zondagh - MWEB ÐÉÛÅÔ:<br>
    </div>
    <blockquote cite="mid:68B2C46A-87B7-4DBA-8EF2-4649DBC6E3E5@mweb.com"
      type="cite">
      <pre wrap="">Set $rd to asterisk ip and then route 

Sent from my iPhone

</pre>
      <blockquote type="cite">
        <pre wrap="">On 22 Jan 2014, at 12:12, "áÌÅËÓÁÎÄÒ ðÕÞËÏ×" <a class="moz-txt-link-rfc2396E" href="mailto:mailex@poig.ru">&lt;mailex@poig.ru&gt;</a> wrote:

Ovidiu, thanks for your answer.

There is some misunderstanding.
I'm probably not very well formulated goal I want to achieve.
Try to describe in more detail:

UAC (1): OpenSIPs registered as a UAC on Asterisk (sip:100@asterisk).
UAC (2): UAC (2) is registered to OpenSIPs (sip:100@opensips).

Everything works well when there is a call : PSTN --&gt; Asterisk --&gt; UAC (1) --&gt; UAC (2).

I would like to learn how to make a call : UAC (2) ---&gt; UAC (1) --&gt; Asterisk --&gt; PSTN

I tried to replace roughly FROM header for OUTGOING calls with UAC (2):

if (db_is_user_in ("$ fu", "asterisk"))
   {
   $var(masking_number) = "sip:" + $fU + "@" + $var(asterisk_ip);
   uac_replace_from ("", "$var(masking_number)");
   }
but it did not help.

Why it need: the client (UAC) registered to OpenSIPS, could provide services Asterisk, without reconfiguring the client equipment.

It would be great if a piece of code, as I'm no guru in Opensips.

Thanks!

21.01.2014 20:41, Ovidiu Sas ÐÉÛÅÔ:
</pre>
        <blockquote type="cite">
          <pre wrap="">When the call is coming in for UAC (1) you need to perform a lookup for UAC (2).
See: <a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/devel/registrar#id294037">http://www.opensips.org/html/docs/modules/devel/registrar#id294037</a>
You need to set the AOR to UAC (2).

Regards,
Ovidiu Sas

2014/1/21 áÌÅËÓÁÎÄÒ ðÕÞËÏ× <a class="moz-txt-link-rfc2396E" href="mailto:mailex@poig.ru">&lt;mailex@poig.ru&gt;</a>:
</pre>
          <blockquote type="cite">
            <pre wrap="">Hi!

I use the module UAC_REGISTRANT. OpenSIPS registered on Asterisk as UAC (1).
There are UAC (2) that is registered on OpenSIPS. When calling with Asterisk
to UAC (1) there is a call UAC (2)
as UAC (2) is registered in the "binding_URI", table "registrant".

How to make an outgoing call UAC (2) a call came from the UAC (1)?

Thank!


áÌÅËÓÁÎÄÒ ðÕÞËÏ×,
óÉÓÔÅÍÎÙÊ ÁÄÍÉÎÉÓÔÒÁÔÏÒ,
ôÅÌ.: +7(496) 569-24-24 ÄÏÂ.ÔÅÌ. 255;
ïïï "ðïéç" (éÎÔÅÒÎÅÔ-ÐÒÏ×ÁÊÄÅÒ Ç. ýÅÌËÏ×Ï)
æÁËÓ: +7(496) 569-24-24 ÄÏÂ. 103;
áÄÒÅÓ: 141108, í.ï., Ç.ýÅÌËÏ×Ï, ðÒÏÌÅÔÁÒÓËÉÊ ÐÒ., Ä.11;
WEB: <a class="moz-txt-link-freetext" href="http://www.schelkovo-net.ru">http://www.schelkovo-net.ru</a>


_______________________________________________
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>
        </blockquote>
        <pre wrap="">
--
ó Õ×ÁÖÅÎÉÅÍ,
áÌÅËÓÁÎÄÒ ðÕÞËÏ×,
óÉÓÔÅÍÎÙÊ ÁÄÍÉÎÉÓÔÒÁÔÏÒ,
ôÅÌ.:      +7(496) 569-24-24 ÄÏÂ.ÔÅÌ. 255;
ïïï "ðïéç" (éÎÔÅÒÎÅÔ-ÐÒÏ×ÁÊÄÅÒ Ç. ýÅÌËÏ×Ï)
æÁËÓ:      +7(496) 569-24-24 ÄÏÂ. 103;
áÄÒÅÓ:     141108, í.ï., Ç.ýÅÌËÏ×Ï, ðÒÏÌÅÔÁÒÓËÉÊ ÐÒ., Ä.11;
WEB:       <a class="moz-txt-link-freetext" href="http://www.schelkovo-net.ru">http://www.schelkovo-net.ru</a>


_______________________________________________
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>
      <pre wrap="">Connect with South Africa’s leading Internet Service Provider and discover the magic of the Internet and all its possibilities. 
Call 087 700 5000 or click here(<a class="moz-txt-link-freetext" href="http://www.mweb.co.za/productspricing/Home.aspx">http://www.mweb.co.za/productspricing/Home.aspx</a>) for more.

MWEB :-)  CONNECT AND YOU CAN.

This electronic communication and the attached file(s) are subject to a disclaimer which can be accessed on the following link: 
Disclaimer - or copy the following URL into your browser - <a class="moz-txt-link-freetext" href="http://www.mweb.co.za/disclaimer">http://www.mweb.co.za/disclaimer</a>. 
If you are unable to view the disclaimer, please contact <a class="moz-txt-link-abbreviated" href="mailto:abuse@mweb.com">abuse@mweb.com</a> for a copy.

_______________________________________________
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>
  
<br>
</hl><br>
<b>Ð�лекÑ�андр ÐŸÑƒÑ‡ÐºÐ¾Ð²,<br>СиÑ�темный Ð°Ð´Ð¼Ð¸Ð½Ð¸Ñ�тратор,<br>Тел.:      +7(496) 569-24-24 Ð´Ð¾Ð±.тел. 255;<br></b>ООО "ПОИГ" (Интернет-провайдер Ð³. Ð©ÐµÐ»ÐºÐ¾Ð²Ð¾)<br>ФакÑ�:      +7(496) 569-24-24 Ð´Ð¾Ð±. 103;<br>Ð�дреÑ�:     141108, Ðœ.О., Ð³.Щелково, ÐŸÑ€Ð¾Ð»ÐµÑ‚арÑ�кий Ð¿Ñ€., Ð´.11;<br>WEB:       <a href="http://www.schelkovo-net.ru">http://www.schelkovo-net.ru</a><br>
<br>
</body>
</html>