[Devel] how to prevent concurrent calls per subscriber?

Raymond Chen rchen at broadz.com
Mon Sep 5 17:31:25 CEST 2005


Dear all,

 

We want to prevent concurrent calls using avpops module but somehow can't
make it work.  We got "ERROR:avpops:check_avp: value types don't match".  

 

Ray

 

 

modparam("avpops","avp_aliases", "intinuse=i:20")

 

        if (method=="BYE" || method=="CANCEL") {

                if (is_avp_set("s:limit")) {

                        if (avp_check("s:inuse","gt/i:1/g")) {

                                avp_op("s:inuse","sub/i:1/g");

                                avp_db_delete("$from","s:inuse/inuse");

                                avp_db_store("$from,","s:inuse/inuse");

                        }

                } else {

                        avp_db_delete("$from","s:inuse/inuse");

                }

        }

 

        if (method=="INVITE") {

 

                if (!proxy_authorize("", "subscriber")) {

                        proxy_challenge("", "1");

                        exit();

                }

 

                if (avp_db_load("$from", "s:/inuse")) {

                        if (is_avp_set("s:inuse")) {

                                avp_write("s:inuse","$intinuse");

                                if (avp_check("s:limit","gt/$intinuse/g")) {

                                        return;

                                } else {

                                        exit();

                                }

                        } else {

                                avp_write("i:1","s:inuse");

                                avp_db_store("$from","s:inuse/inuse");

                                return;

                        }

                } else {

                        avp_write("i:1","s:inuse");

                        avp_db_store("$from","s:inuse/inuse");

                        return;

                }

 

        }

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openser.org/pipermail/devel/attachments/20050905/4c07869f/attachment.htm


More information about the Devel mailing list