HI Andrei,
Finally get the avp_check working, we have not problem adding a entry using
avp_db_store now. But how to catch SIP 404 not found message and
avp_db_delete the entry in database? We've tried
if (t_check_status("404|487")) {
if (avp_db_load("$from","s:inuse/inuse")) {
avp_db_delete("$from","s:/inuse");
}
exit();
}
In failure_route, but it doesn't seem to catch the 404 status message. Any
idea?
Thanks
Ray
-----Original Message-----
From: Bogdan-Andrei Iancu [mailto:bogdan@voice-system.ro]
Sent: Tuesday, September 06, 2005 1:32 AM
To: Raymond Chen
Cc: users(a)openser.org
Subject: Re: [Devel] how to prevent concurrent calls per subscriber?
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(a)openser.org
http://openser.org/cgi-bin/mailman/listinfo/devel