[OpenSIPS-Users] Blind call forwarding in OpenSIPS

Bogdan-Andrei Iancu bogdan at opensips.org
Thu Sep 10 08:26:13 EST 2020


First of all, I would consider using the script_trace() function in 
order to be sure that the flow through your script is correct:
https://opensips.org/Documentation/Script-CoreFunctions-2-4#toc42

So check what happens with your DB load, if it fails or not.

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS Summit 2020 online
   https://www.opensips.org/events/Summit-2020Distributed/

On 9/9/20 8:24 AM, Nayani Nikeshala wrote:
> Hi!
>
> 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 ?
>
>
>
> On Tuesday, September 8, 2020, 10:48:27 PM GMT+5:30, Bogdan-Andrei 
> Iancu <bogdan at opensips.org> wrote:
>
>
> Hi,
>
> What version of OpenSIPS do you use ? And your experience is that the 
> avp_db_load fails ?
>
> Regards,
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>    https://www.opensips-solutions.com
> OpenSIPS Summit 2020 online
>    https://www.opensips.org/events/Summit-2020Distributed/
> On 9/7/20 1:51 PM, Nayani Nikeshala via Users wrote:
> Hello,
>
> I'm trying to do a simple blind call forwarding with the below script 
> added into "main request routing logic". (123 dials 789 and 789 is 
> forwarded to 456)
>
>
> if(avp_db_load("$ru","$avp(s:callfwd)")) {
>
> $ru = $avp(s:callfwd);
>
> xlog("forwarded to: $avp(s:callfwd)");
>
> route(1);
>
> exit;
>
> }
>
>
> My usr_preferences table is as below.
>
> opensips=> select * from usr_preferences;
>
> id | uuid | username | domain | attribute | type |value|last_modified
>
> ----+------+----------+--------+-----------+------+------------------------+---------------------
>
> 1 || 789|| callfwd|0 | sip:456 at xxxxxxxxxxx| 1900-01-01 00:00:01
>
> (1 row)
>
> opensips=>
>
> I have added the avpops module as below.
>
> #AVPOPS module
>
> loadmodule "avpops.so"
>
> modparam("avpops", 
> "db_url","postgres://opensips:xxxxxxxx@localhost/opensips")
>
> modparam("avpops","avp_table","usr_preferences")
>
> 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 "main request routing logic".
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org  <mailto:Users at lists.opensips.org>
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20200910/2b7f9d51/attachment.html>


More information about the Users mailing list