<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <tt>First of all, I would consider using the script_trace() function
      in order to be sure that the flow through your script is correct:<br>
         
      <a class="moz-txt-link-freetext" href="https://opensips.org/Documentation/Script-CoreFunctions-2-4#toc42">https://opensips.org/Documentation/Script-CoreFunctions-2-4#toc42</a><br>
      <br>
      So check what happens with your DB load, if it fails or not.<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="https://www.opensips-solutions.com">https://www.opensips-solutions.com</a>
OpenSIPS Summit 2020 online
  <a class="moz-txt-link-freetext" href="https://www.opensips.org/events/Summit-2020Distributed/">https://www.opensips.org/events/Summit-2020Distributed/</a></pre>
    <div class="moz-cite-prefix">On 9/9/20 8:24 AM, Nayani Nikeshala
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:499214199.117124.1599629087643@mail.yahoo.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div class="ydpa3ce5258yahoo-style-wrap"
        style="font-family:Helvetica Neue, Helvetica, Arial,
        sans-serif;font-size:16px;">
        <div dir="ltr" data-setdir="false">Hi!</div>
        <div dir="ltr" data-setdir="false"><br>
        </div>
        <div dir="ltr" data-setdir="false">I'm using OpenSIPS 2.4.7.
          With the below script, call was not forwarded as configured.
          Is there any issue with my script or is there an alternative
          method to do this ?</div>
        <div dir="ltr" data-setdir="false"><br>
        </div>
        <div dir="ltr" data-setdir="false"><br>
        </div>
        <div><br>
        </div>
      </div>
      <div id="ydp80ae7aa4yahoo_quoted_0125967366"
        class="ydp80ae7aa4yahoo_quoted">
        <div style="font-family:'Helvetica Neue', Helvetica, Arial,
          sans-serif;font-size:13px;color:#26282a;">
          <div> On Tuesday, September 8, 2020, 10:48:27 PM GMT+5:30,
            Bogdan-Andrei Iancu <a class="moz-txt-link-rfc2396E" href="mailto:bogdan@opensips.org"><bogdan@opensips.org></a> wrote: </div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div>
            <div id="ydp80ae7aa4yiv0350315889">
              <div> <tt>Hi,<br clear="none">
                  <br clear="none">
                  What version of OpenSIPS do you use ? And your
                  experience is that the avp_db_load fails ?<br
                    clear="none">
                  <br clear="none">
                  Regards,<br clear="none">
                </tt>
                <pre class="ydp80ae7aa4yiv0350315889moz-signature">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a shape="rect" class="ydp80ae7aa4yiv0350315889moz-txt-link-freetext" href="https://www.opensips-solutions.com" rel="nofollow" target="_blank" moz-do-not-send="true">https://www.opensips-solutions.com</a>
OpenSIPS Summit 2020 online
  <a shape="rect" class="ydp80ae7aa4yiv0350315889moz-txt-link-freetext" href="https://www.opensips.org/events/Summit-2020Distributed/" rel="nofollow" target="_blank" moz-do-not-send="true">https://www.opensips.org/events/Summit-2020Distributed/</a></pre>
                <div class="ydp80ae7aa4yiv0350315889yqt8321615232"
                  id="ydp80ae7aa4yiv0350315889yqt77118">
                  <div class="ydp80ae7aa4yiv0350315889moz-cite-prefix">On
                    9/7/20 1:51 PM, Nayani Nikeshala via Users wrote:<br
                      clear="none">
                  </div>
                  <blockquote type="cite"> </blockquote>
                </div>
              </div>
              <div class="ydp80ae7aa4yiv0350315889yqt8321615232"
                id="ydp80ae7aa4yiv0350315889yqt38872">
                <div>
                  <div class="ydp80ae7aa4yiv0350315889yahoo-style-wrap"
                    style="font-family:Helvetica Neue, Helvetica, Arial,
                    sans-serif;font-size:16px;">
                    <div dir="ltr">Hello,</div>
                    <div dir="ltr"><br clear="none">
                    </div>
                    <div dir="ltr">I'm trying to do a simple blind call
                      forwarding with the below script added into "<span>main
                        request routing logic". (123 dials 789 and 789
                        is forwarded to 456)</span></div>
                    <div dir="ltr">
                      <div>
                        <p
                          class="ydp80ae7aa4yiv0350315889ydpcb692f43MsoNormal"
style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;background:white;"><span
style="font-size:12.0pt;font-family:sans-serif;color:black;"><br
                              clear="none">
                          </span><span
                            style="font-size:10pt;font-family:Consolas;"><font
                              style="background-color:inherit;"
                              color="#a46016">if(avp_db_load("$ru","$avp(s:callfwd)"))
                              {</font></span></p>
                        <p
                          class="ydp80ae7aa4yiv0350315889ydpcb692f43MsoNormal"
style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;background:white;"><span
                            style="font-size:10pt;font-family:Consolas;"><font
                              style="background-color:inherit;"
                              color="#a46016">$ru = $avp(s:callfwd);</font></span></p>
                        <p
                          class="ydp80ae7aa4yiv0350315889ydpcb692f43MsoNormal"
style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;background:white;"><span
                            style="font-size:10pt;font-family:Consolas;"><font
                              style="background-color:inherit;"
                              color="#a46016">xlog("forwarded to:
                              $avp(s:callfwd)");</font></span></p>
                        <p
                          class="ydp80ae7aa4yiv0350315889ydpcb692f43MsoNormal"
style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;background:white;"><span
                            style="font-size:10pt;font-family:Consolas;"><font
                              style="background-color:inherit;"
                              color="#a46016">route(1);</font></span></p>
                        <p
                          class="ydp80ae7aa4yiv0350315889ydpcb692f43MsoNormal"
style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;background:white;"><span
                            style="font-size:10pt;font-family:Consolas;"><font
                              style="background-color:inherit;"
                              color="#a46016">exit;</font></span></p>
                        <p
                          class="ydp80ae7aa4yiv0350315889ydpcb692f43MsoNormal"
style="margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;background:white;"><span
                            style="font-size:10pt;font-family:Consolas;"><font
                              style="background-color:inherit;"
                              color="#a46016">}</font></span></p>
                      </div>
                    </div>
                    <div dir="ltr">
                      <div><br clear="none">
                      </div>
                      <div dir="ltr">My usr_preferences table is as
                        below. </div>
                      <div dir="ltr"><br clear="none">
                      </div>
                      <div dir="ltr">
                        <p
                          class="ydp80ae7aa4yiv0350315889ydp5aa7ffcMsoNormal"><span
style="font-size:10.0pt;line-height:107%;font-family:Consolas;"><font
                              style="background-color:inherit;"
                              color="#a46016">opensips=> select *
                              from usr_preferences;</font></span></p>
                        <p
                          class="ydp80ae7aa4yiv0350315889ydp5aa7ffcMsoNormal"><span
style="font-size:10.0pt;line-height:107%;font-family:Consolas;"><font
                              style="background-color:inherit;"
                              color="#a46016"><span> </span>id | uuid |
                              username | domain | attribute | type |<span>        
                              </span>value<span>          </span>|<span>   
                              </span>last_modified<span>    </span></font></span></p>
                        <p
                          class="ydp80ae7aa4yiv0350315889ydp5aa7ffcMsoNormal"><span
style="font-size:10.0pt;line-height:107%;font-family:Consolas;"><font
                              style="background-color:inherit;"
                              color="#a46016">----+------+----------+--------+-----------+------+------------------------+---------------------</font></span></p>
                        <p
                          class="ydp80ae7aa4yiv0350315889ydp5aa7ffcMsoNormal"><span
style="font-size:10.0pt;line-height:107%;font-family:Consolas;"><font
                              style="background-color:inherit;"
                              color="#a46016"><span>  </span>1 |<span>     
                              </span>| 789<span>      </span>|<span>       
                              </span>| callfwd<span>   </span>|<span>   
                              </span>0 | <a shape="rect"
                                class="ydp80ae7aa4yiv0350315889moz-txt-link-freetext"
                                moz-do-not-send="true">sip:456@xxxxxxxxxxx</a><span>  
                              </span><span> </span>| 1900-01-01 00:00:01</font></span></p>
                        <p
                          class="ydp80ae7aa4yiv0350315889ydp5aa7ffcMsoNormal"><span
style="font-size:10.0pt;line-height:107%;font-family:Consolas;"><font
                              style="background-color:inherit;"
                              color="#a46016">(1 row)</font></span></p>
                        <div><span
                            style="font-size:10.0pt;line-height:107%;font-family:Consolas;"><font
                              style="background-color:inherit;"
                              color="#a46016">opensips=></font></span></div>
                        <div><span
                            style="font-size:10.0pt;line-height:107%;font-family:Consolas;"><br
                              clear="none">
                          </span></div>
                        <div dir="ltr"><span
                            style="line-height:107%;font-family:Consolas;"><font
                              style="background-color:inherit;" size="3">I
                              have added the avpops module as below. </font></span></div>
                        <div dir="ltr">
                          <p
                            class="ydp80ae7aa4yiv0350315889ydp53c62242MsoNormal"><span
style="font-size:10.0pt;line-height:107%;font-family:Consolas;"><font
                                style="background-color:inherit;"
                                color="#a46016">#AVPOPS module</font></span></p>
                          <p
                            class="ydp80ae7aa4yiv0350315889ydp53c62242MsoNormal"><span
style="font-size:10.0pt;line-height:107%;font-family:Consolas;"><font
                                style="background-color:inherit;"
                                color="#a46016">loadmodule "avpops.so"</font></span></p>
                          <p
                            class="ydp80ae7aa4yiv0350315889ydp53c62242MsoNormal"><span
style="font-size:10.0pt;line-height:107%;font-family:Consolas;"><font
                                style="background-color:inherit;"
                                color="#a46016">modparam("avpops",
"db_url","postgres://opensips:xxxxxxxx@localhost/opensips")</font></span></p>
                          <div><span
                              style="font-size:10.0pt;line-height:107%;font-family:Consolas;"><font
                                style="background-color:inherit;"
                                color="#a46016">modparam("avpops","avp_table","usr_preferences")</font></span></div>
                        </div>
                      </div>
                      <div dir="ltr">
                        <div dir="ltr"><span></span><br clear="none">
                        </div>
                        <div dir="ltr">Anyways, this script does not do
                          the call forwarding task. Anyone could help on
                          this please. Could there be a problem of the
                          position that I have added the script in <span><span
                              style="color:rgb(0, 0,
                              0);font-family:Helvetica, Arial,
                              sans-serif;font-size:16px;">"</span><span
                              style="color:rgb(0, 0,
                              0);font-family:Helvetica, Arial,
                              sans-serif;font-size:16px;">main request
                              routing logic". </span></span></div>
                        <div dir="ltr"><br clear="none">
                        </div>
                        <br clear="none">
                      </div>
                    </div>
                  </div>
                  <br clear="none">
                  <fieldset
                    class="ydp80ae7aa4yiv0350315889mimeAttachmentHeader"></fieldset>
                  <pre class="ydp80ae7aa4yiv0350315889moz-quote-pre">_______________________________________________
Users mailing list
<a shape="rect" class="ydp80ae7aa4yiv0350315889moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" rel="nofollow" target="_blank" moz-do-not-send="true">Users@lists.opensips.org</a>
<a shape="rect" class="ydp80ae7aa4yiv0350315889moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="nofollow" target="_blank" moz-do-not-send="true">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
                  <br clear="none">
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>