<html><head></head><body><div class="ydpaf5a2b1eyahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div></div>
        <div dir="ltr" data-setdir="false">Thanks Brett & Bogdan for your valuable comments. I will try these and get back to you. </div><div><br></div>
        
        </div><div id="yahoo_quoted_0553585612" class="yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Thursday, September 10, 2020, 01:58:11 PM GMT+5:30, Bogdan-Andrei Iancu <bogdan@opensips.org> wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div id="yiv6983955618"><div>
    <tt>Yes, the note about the AVP name is 100% correct. Even if at the
      opensips cfg level it is ok and the actual name of the AVP will be
      "s:callfwd", it will not match the naming from the DB table.<br clear="none">
      <br clear="none">
      So just drop the "s:" prefix in the avp name at the script level.<br clear="none">
      <br clear="none">
      Regards,<br clear="none">
    </tt>
    <pre class="yiv6983955618moz-signature">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a rel="nofollow" shape="rect" class="yiv6983955618moz-txt-link-freetext" target="_blank" href="https://www.opensips-solutions.com">https://www.opensips-solutions.com</a>
OpenSIPS Summit 2020 online
  <a rel="nofollow" shape="rect" class="yiv6983955618moz-txt-link-freetext" target="_blank" href="https://www.opensips.org/events/Summit-2020Distributed/">https://www.opensips.org/events/Summit-2020Distributed/</a></pre>
    <div class="yiv6983955618yqt8802107922" id="yiv6983955618yqt62809"><div class="yiv6983955618moz-cite-prefix">On 9/9/20 5:08 PM, Brett Nemeroff
      wrote:<br clear="none">
    </div>
    <blockquote type="cite">
      </blockquote></div></div><div class="yiv6983955618yqt8802107922" id="yiv6983955618yqt99001"><div><div dir="ltr">Hello Nayani,
        <div>Your avp spec is for a much older version of OpenSIPs. I'm
          not sure if that's your problem or not, but the "s:" syntax is
          dated for 2.4.x. </div>
        <div><br clear="none">
        </div>
        <div>Here's the documentation you should reference for your
          version of OpenSIPs: </div>
        <div><a rel="nofollow" shape="rect" target="_blank" href="https://opensips.org/html/docs/modules/2.4.x/avpops.html#func_avp_db_load">https://opensips.org/html/docs/modules/2.4.x/avpops.html#func_avp_db_load</a><br clear="none">
        </div>
        <div><br clear="none">
        </div>
        <div>Also, see Bogdan's comment above, did avp_db_load return
          false? </div>
        <div><br clear="none">
        </div>
        <div>Just my perspective, but for these kinds of "DB Loads", I
          almost always prefer a avp_db_query over a avp_db_load. The
          syntax is clearer for me, but I also just really like SQL to
          begin with. The original avp_db_load syntax was more inline
          with how OpenSIPs/OpenSER works from "back in the day". Would
          love other's feedback on that. Perhaps avp_db_load is easier
          for simple matches, but I think under the hood it's just doing
          a simple query anyway. avp_db_query just gives you full access
          to the actual SQL if you are into that kind of thing. </div>
        <div><br clear="none">
        </div>
        <div>-Brett</div>
        <div><br clear="none">
        </div>
        <div><br clear="none">
        </div>
        <div><br clear="none">
        </div>
        <div><br clear="none">
        </div>
      </div>
      <br clear="none">
      <div class="yiv6983955618gmail_quote">
        <div class="yiv6983955618gmail_attr" dir="ltr">On Wed, Sep 9, 2020 at 12:25
          AM Nayani Nikeshala via Users <<a rel="nofollow" shape="rect" ymailto="mailto:users@lists.opensips.org" target="_blank" href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>>
          wrote:<br clear="none">
        </div>
        <blockquote class="yiv6983955618gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;">
          <div>
            <div style="font-family:Helvetica, Arial, sans-serif;font-size:16px;">
              <div dir="ltr">Hi!</div>
              <div dir="ltr"><br clear="none">
              </div>
              <div dir="ltr">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"><br clear="none">
              </div>
              <div dir="ltr"><br clear="none">
              </div>
              <div><br clear="none">
              </div>
            </div>
            <div id="yiv6983955618gmail-m_2207947096525326095ydp80ae7aa4yahoo_quoted_0125967366">
              <div style="font-family:Helvetica, Arial, sans-serif;font-size:13px;color:rgb(38,40,42);">
                <div> On Tuesday, September 8, 2020, 10:48:27 PM
                  GMT+5:30, Bogdan-Andrei Iancu <<a rel="nofollow" shape="rect" ymailto="mailto:bogdan@opensips.org" target="_blank" href="mailto:bogdan@opensips.org">bogdan@opensips.org</a>>
                  wrote: </div>
                <div><br clear="none">
                </div>
                <div><br clear="none">
                </div>
                <div>
                  <div id="yiv6983955618gmail-m_2207947096525326095ydp80ae7aa4yiv0350315889">
                    <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>Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a rel="nofollow" shape="rect" target="_blank" href="https://www.opensips-solutions.com">https://www.opensips-solutions.com</a>
OpenSIPS Summit 2020 online
  <a rel="nofollow" shape="rect" target="_blank" href="https://www.opensips.org/events/Summit-2020Distributed/">https://www.opensips.org/events/Summit-2020Distributed/</a></pre>
                      <div id="yiv6983955618gmail-m_2207947096525326095ydp80ae7aa4yiv0350315889yqt77118">
                        <div>On 9/7/20 1:51 PM, Nayani Nikeshala via
                          Users wrote:<br clear="none">
                        </div>
                        <blockquote type="cite"> </blockquote>
                      </div>
                    </div>
                    <div id="yiv6983955618gmail-m_2207947096525326095ydp80ae7aa4yiv0350315889yqt38872">
                      <div>
                        <div style="font-family: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 style="margin-bottom:0.0001pt;line-height:normal;background:white;"><span style="font-size:12pt;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 style="margin-bottom:0.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 style="margin-bottom:0.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 style="margin-bottom:0.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 style="margin-bottom:0.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 style="margin-bottom:0.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><span style="font-size:10pt;line-height:107%;font-family:Consolas;"><font style="background-color:inherit;" color="#a46016">opensips=> select
                                    * from usr_preferences;</font></span></p>
                              <p><span style="font-size:10pt;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><span style="font-size:10pt;line-height:107%;font-family:Consolas;"><font style="background-color:inherit;" color="#a46016">----+------+----------+--------+-----------+------+------------------------+---------------------</font></span></p>
                              <p><span style="font-size:10pt;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 rel="nofollow" shape="rect">sip:456@xxxxxxxxxxx</a><span>  
                                    </span><span> </span>| 1900-01-01
                                    00:00:01</font></span></p>
                              <p><span style="font-size:10pt;line-height:107%;font-family:Consolas;"><font style="background-color:inherit;" color="#a46016">(1 row)</font></span></p>
                              <div><span style="font-size:10pt;line-height:107%;font-family:Consolas;"><font style="background-color:inherit;" color="#a46016">opensips=></font></span></div>
                              <div><span style="font-size:10pt;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><span style="font-size:10pt;line-height:107%;font-family:Consolas;"><font style="background-color:inherit;" color="#a46016">#AVPOPS module</font></span></p>
                                <p><span style="font-size:10pt;line-height:107%;font-family:Consolas;"><font style="background-color:inherit;" color="#a46016">loadmodule
                                      "avpops.so"</font></span></p>
                                <p><span style="font-size:10pt;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:10pt;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></fieldset>
                        <pre>_______________________________________________
Users mailing list
<a rel="nofollow" shape="rect" ymailto="mailto:Users@lists.opensips.org" target="_blank" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a rel="nofollow" shape="rect" target="_blank" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
                        <br clear="none">
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          _______________________________________________<br clear="none">
          Users mailing list<br clear="none">
          <a rel="nofollow" shape="rect" ymailto="mailto:Users@lists.opensips.org" target="_blank" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br clear="none">
          <a rel="nofollow" shape="rect" target="_blank" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br clear="none">
        </blockquote>
      </div>
    
    <br clear="none">
  </div></div></div></div>
            </div>
        </div></body></html>