[Users] Re: [Devel] how to prevent concurrent calls per subscriber?

Bogdan-Andrei Iancu bogdan at voice-system.ro
Mon Sep 5 19:31:51 CEST 2005


Hi Raymond,

this is a runtime error. it means that you try to check via "avp_check" 
two avps which have different types of values (int and string).
my guess is that the problem is around :

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

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


avp_write will actually write the "s:inuse" string into $intinuse AVP 
and not copy the value (not sure which is the intention).

Use avp_print() before each "avp_check" to see the values (use debug=6).

regards,
bogdan


Raymond Chen wrote:

> 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;
>
> }
>
> }
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Devel mailing list
>Devel at openser.org
>http://openser.org/cgi-bin/mailman/listinfo/devel
>  
>





More information about the Users mailing list