[Users] Re: [Serusers] AVP Distinctive-Ring question

sip sip at arcdiv.com
Mon Nov 7 20:57:22 CET 2005


SER is severely limited on the passing of variables which ends up making
things like that string of queries necessary to perform some things. 

OpenSER I think allows the use of tossing in pseudo variables here and there,
so you could probably grab the value of the ringtone from the AVP and then
toss it into the Alert-Info header making it into one query instead of 5. 

Not being an OpenSER user, however, this is only what I understand from my
cursory reading of its docs. You'd have to check on that with someone else, I
think. 

N.


On Mon, 7 Nov 2005 12:35:55 -0700, Daryl Sanders wrote
> I am using AVPs for distinctive ring preferences. I allows users to
> store up to 5 phone numbers that can be assigned a custom ring. The
> method below works fine but as you can see it requires 5 db queries.
> There must be a better way to do this. Any ideas?
> 
> - Daryl
> 
> 	if (avp_db_load("$ruri/username", "s:ringone")) {
> 		if (avp_check("s:ringone", "eq/$from/i")) {
> 		append_hf("Alert-Info: Bellcore-r1\r\n");
> 		};
> 	};
> 	if (avp_db_load("$ruri/username", "s:ringtwo")) {
> 		if (avp_check("s:ringtwo", "eq/$from/i")) {
> 		append_hf("Alert-Info: Bellcore-r2\r\n");
> 		};
> 	};
> 	if (avp_db_load("$ruri/username", "s:ringthree")) {
> 		if (avp_check("s:ringthree", "eq/$from/i")) {
> 		append_hf("Alert-Info: Bellcore-r3\r\n");
> 		};
> 	};
> 	if (avp_db_load("$ruri/username", "s:ringfour")) {
> 		if (avp_check("s:ringfour", "eq/$from/i")) {
> 		append_hf("Alert-Info: Bellcore-r4\r\n");
> 		};
> 	};
> 	if (avp_db_load("$ruri/username", "s:ringfive")) {
> 		if (avp_check("s:ringfive", "eq/$from/i")) {
> 		append_hf("Alert-Info: Bellcore-r5\r\n");
> 		};
> 	};
> 
> _______________________________________________
> Serusers mailing list
> Serusers at iptel.org
> http://mail.iptel.org/mailman/listinfo/serusers





More information about the Users mailing list