[OpenSIPS-Users] update query in avpops

SamyGo govoiper at gmail.com
Fri Jun 22 10:20:29 CEST 2012


>
> if (is_method("INVITET"))


What exactly are you trying to do !! what I can understand is that you are
trying to keep count of calls routed to a specific destination. I suggest
don't reinvent the wheel and look for other modules which do this for you
automatically  like dialog module with profiles.or load-balancer module.



On Fri, Jun 22, 2012 at 1:15 PM, prasad kelkar <durga144 at gmail.com> wrote:

> hello,
> I tried following
> if (is_method("INVITET"))
>     {
>     avp_db_query("select count from load_count where
> dest='1'","$avp(i:1)");
>     avp_db_query("select count from load_count where
> dest='2'","$avp(i:2)");
>     if ($(avp(i:1){s.int})<$(avp(i:2){s.int})
>     {
>         #$avp(i:3)=1+(avp(i:1){s.int};
>         #avp_db_query("update load_count set count='$(avp(i:3)' where
> dest='1';");
>         avp_op("$avp(i:1)", "add/1/g");
>         forward("172.29.9.140:5060");
>         exit;
>     }
>     else
>     {    #$avp(i:3)=1+(avp(i:2){s.int};
>         #avp_db_query("update load_count set count='$(avp(i:3)' where
> dest='2';");
>         avp_op("$avp(i:2)", "add/1/g");
>         forward("172.29.9.131:5060");
>         exit;
>     }
>
>     }
>
> I think there is problem in update query
> How to add count?
> please help
> thank you
>
>
>
> _______________________________________________
> Users mailing list
> 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/20120622/b1a00841/attachment-0001.htm>


More information about the Users mailing list