[OpenSIPS-Users] update query in avpops

prasad kelkar durga144 at gmail.com
Fri Jun 22 10:15:42 CEST 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20120622/085559eb/attachment.htm>


More information about the Users mailing list