[Users] AVP Distinctive-Ring question

Daryl Sanders daryl.sanders at gmail.com
Mon Nov 7 20:35:55 CET 2005


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");
		};
	};




More information about the Users mailing list