Revision
14756
Author
anthm
Date
2009-09-03 13:21:15 -0500 (Thu, 03 Sep 2009)

Log Message

allow profile to be specified sep from domain user@domain.com@myprofile

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c (14755 => 14756)


--- freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c	2009-09-03 17:55:21 UTC (rev 14755)
+++ freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c	2009-09-03 18:21:15 UTC (rev 14756)
@@ -2614,7 +2614,7 @@
 static switch_status_t voicemail_inject(const char *data)
 {
 	vm_profile_t *profile;
-	char *dup = NULL, *user = NULL, *domain = NULL;
+	char *dup = NULL, *user = NULL, *domain = NULL, *profile_name = NULL;
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
 	int isgroup = 0, isall = 0;
 	int argc = 0;
@@ -2649,6 +2649,12 @@
 		domain = user;
 	}
 
+	if ((profile_name = strchr(domain, '@'))) {
+		*profile_name++ = '\0';
+	} else {
+		profile_name = domain;
+	}
+
 	if (switch_stristr("group=", user)) {
 		user += 6;
 		isgroup++;
@@ -2662,8 +2668,10 @@
 		goto end;
 	}
 
-	if (!(profile = get_profile(domain))) {
-		profile = get_profile("default");
+	if (!(profile = get_profile(profile_name))) {
+		if (!(profile = get_profile(domain))) {
+			profile = get_profile("default");
+		}
 	}
 	
 	if (!profile) {