[Asterisk-cvs] asterisk/channels chan_agent.c,1.76,1.77

markster at lists.digium.com markster at lists.digium.com
Mon Jun 28 14:54:49 CDT 2004


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv11113/channels

Modified Files:
	chan_agent.c 
Log Message:
Allow custom beep to be specified for agents (bug #1938)


Index: chan_agent.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_agent.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- chan_agent.c	22 Jun 2004 18:48:59 -0000	1.76
+++ chan_agent.c	28 Jun 2004 18:40:41 -0000	1.77
@@ -102,6 +102,7 @@
 static char urlprefix[AST_MAX_BUF];
 static char savecallsin[AST_MAX_BUF];
 static int updatecdr = 0;
+static char beep[AST_MAX_BUF] = "beep";
 
 #define GETAGENTBYCALLERID	"AGENTBYCALLERID"
 
@@ -459,7 +460,7 @@
 	}
 	ast_verbose( VERBOSE_PREFIX_3 "agent_call, call to agent '%s' call on '%s'\n", p->agent, p->chan->name);
 	ast_log( LOG_DEBUG, "Playing beep, lang '%s'\n", p->chan->language);
-	res = ast_streamfile(p->chan, "beep", p->chan->language);
+	res = ast_streamfile(p->chan, beep, p->chan->language);
 	ast_log( LOG_DEBUG, "Played beep, result '%d'\n", res);
 	if (!res) {
 		res = ast_waitstream(p->chan, "");
@@ -832,6 +833,8 @@
 				snprintf(savecallsin, sizeof(savecallsin) - 2, "/%s", v->value);
 			if (savecallsin[strlen(savecallsin) - 1] != '/')
 				strcat(savecallsin, "/");
+		} else if (!strcasecmp(v->name, "custom_beep")) {
+			strncpy(beep, v->value, sizeof(beep) - 1);
 		}
 		v = v->next;
 	}
@@ -900,7 +903,7 @@
 			res = 0;
 		} else {
 			ast_log( LOG_DEBUG, "Playing beep, lang '%s'\n", newlyavailable->chan->language);
-			res = ast_streamfile(newlyavailable->chan, "beep", newlyavailable->chan->language);
+			res = ast_streamfile(newlyavailable->chan, beep, newlyavailable->chan->language);
 			ast_log( LOG_DEBUG, "Played beep, result '%d'\n", res);
 			if (!res) {
 				res = ast_waitstream(newlyavailable->chan, "");
@@ -960,7 +963,7 @@
 	if (p) {
 		ast_mutex_unlock(&newlyavailable->lock);
 		ast_log( LOG_DEBUG, "Playing beep, lang '%s'\n", newlyavailable->chan->language);
-		res = ast_streamfile(newlyavailable->chan, "beep", newlyavailable->chan->language);
+		res = ast_streamfile(newlyavailable->chan, beep, newlyavailable->chan->language);
 		ast_log( LOG_DEBUG, "Played beep, result '%d'\n", res);
 		if (!res) {
 			res = ast_waitstream(newlyavailable->chan, "");




More information about the svn-commits mailing list