help freeradius sqlbill in per seconds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I have a set up that uses redhat linux ES3 with postgresql 7.3.8 and
freeradius 1.0.5 and gnugk 2.2.3-2 and I used sqlbill from gnugk 2.0.9 and
the calls were going ok.

If I used the per minute billing in the voipcall_update_cost, all the call
get dropped as the orinating gateway's accounts get to 0, however, when I
edited the voipcall_update_cost (as below) I got the per seconds billing but
the negative biling now comes up .i.e the call is not disconnected until the
originating gateway dropped.

Can someone please direct me to what to do so that I can get the case of
negative billing sorted out?


Goksie




voipcall_update_cost  "trigger" plpgsql 
Definition 

DECLARE
        costdiff NUMERIC(9,2);
BEGIN
        IF NEW.price IS NOT NULL THEN
                NEW.cost := NEW.price::NUMERIC(9,3) *
NEW.duration::NUMERIC(9,3);
                IF NEW.accountid IS NOT NULL THEN
                        IF TG_OP = 'UPDATE' THEN
                                IF OLD.cost IS NULL THEN
                                        costdiff := NEW.cost;
                                ELSE
                                        costdiff := NEW.cost - OLD.cost;
                                END IF;
                        ELSE
                                costdiff := NEW.cost;
                        END IF;
                        UPDATE voipaccount SET balance = balance - costdiff
                                WHERE id = NEW.accountid;
                END IF;
        END IF;
        RETURN NEW;
END;




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________________

Posting: mailto:Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
Archive: http://sourceforge.net/mailarchive/forum.php?forum_id=8549
Unsubscribe: http://lists.sourceforge.net/lists/listinfo/openh323gk-users
Homepage: http://www.gnugk.org/

[Index of Archives]     [SIP]     [Open H.323]     [Gnu Gatekeeper]     [Asterisk PBX]     [ISDN Cause Codes]     [Yosemite News]

  Powered by Linux