aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-19 20:44:39 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-19 20:44:39 +0000
commit6049bb6539153c2f400f1f2dbc763c74d796204b (patch)
tree3c36781db3a5a7a08967cbe8d83acb5d82e581cb /apps
parent28df168d0f9fd12f5914263015dc26898e834146 (diff)
merge Russell's 'hold_handling' branch, finally implementing music-on-hold handling the way it was decided at AstriDevCon Europe 2006 (and the way people really want it to be)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@37988 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_dial.c10
-rw-r--r--apps/app_followme.c5
-rw-r--r--apps/app_meetme.c6
-rw-r--r--apps/app_queue.c9
4 files changed, 14 insertions, 16 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index f2834885d..24fe9b7e0 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -1214,8 +1214,8 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
/* Our status will at least be NOANSWER */
strcpy(status, "NOANSWER");
if (ast_test_flag(outgoing, OPT_MUSICBACK)) {
- moh=1;
- ast_moh_start(chan, opt_args[OPT_ARG_MUSICBACK]);
+ moh = 1;
+ ast_moh_start(chan, opt_args[OPT_ARG_MUSICBACK], NULL);
} else if (ast_test_flag(outgoing, OPT_RINGBACK)) {
ast_indicate(chan, AST_CONTROL_RINGING);
sentringing++;
@@ -1273,7 +1273,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
if (ast_test_flag(&opts, OPT_MUSICBACK) && !ast_strlen_zero(opt_args[OPT_ARG_MUSICBACK])) {
ast_indicate(chan, -1);
- ast_moh_start(chan, opt_args[OPT_ARG_MUSICBACK]);
+ ast_moh_start(chan, opt_args[OPT_ARG_MUSICBACK], NULL);
} else if (ast_test_flag(&opts, OPT_RINGBACK)) {
ast_indicate(chan, AST_CONTROL_RINGING);
sentringing++;
@@ -1701,7 +1701,7 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
res = ast_waitstream(chan, AST_DIGIT_ANY);
if (!res && sleep) {
if (!ast_test_flag(chan, AST_FLAG_MOH))
- ast_moh_start(chan, NULL);
+ ast_moh_start(chan, NULL, NULL);
res = ast_waitfordigit(chan, sleep);
}
} else {
@@ -1709,7 +1709,7 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
res = ast_waitstream(chan, "");
if (sleep) {
if (!ast_test_flag(chan, AST_FLAG_MOH))
- ast_moh_start(chan, NULL);
+ ast_moh_start(chan, NULL, NULL);
if (!res)
res = ast_waitfordigit(chan, sleep);
}
diff --git a/apps/app_followme.c b/apps/app_followme.c
index 85dda00aa..42986c96f 100644
--- a/apps/app_followme.c
+++ b/apps/app_followme.c
@@ -1010,10 +1010,7 @@ static int app_exec(struct ast_channel *chan, void *data)
goto outrun;
if (ast_waitstream(chan, "") < 0)
goto outrun;
- if (!strcmp(targs.mohclass, ""))
- ast_moh_start(chan, NULL);
- else
- ast_moh_start(chan, targs.mohclass);
+ ast_moh_start(chan, S_OR(targs.mohclass, NULL), NULL);
targs.status = 0;
diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index 698995d19..6b5355ae7 100644
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -1407,7 +1407,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
}
}
if (musiconhold == 0 && (confflags & CONFFLAG_MOH)) {
- ast_moh_start(chan, NULL);
+ ast_moh_start(chan, NULL, NULL);
musiconhold = 1;
} else {
ztc.confmode = ZT_CONF_CONF;
@@ -1445,7 +1445,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
if ((confflags & CONFFLAG_MOH) && !(confflags & CONFFLAG_WAITMARKED)) {
if (conf->users == 1) {
if (musiconhold == 0) {
- ast_moh_start(chan, NULL);
+ ast_moh_start(chan, NULL, NULL);
musiconhold = 1;
}
} else {
@@ -1749,7 +1749,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
}
}
if (musiconhold)
- ast_moh_start(chan, NULL);
+ ast_moh_start(chan, NULL, NULL);
if (ioctl(fd, ZT_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
diff --git a/apps/app_queue.c b/apps/app_queue.c
index b9b578df1..84583250a 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -761,7 +761,8 @@ static void queue_set_param(struct call_queue *q, const char *param, const char
char *c, *lastc;
char buff[80];
- if (!strcasecmp(param, "music") || !strcasecmp(param, "musiconhold")) {
+ if (!strcasecmp(param, "musicclass") ||
+ !strcasecmp(param, "music") || !strcasecmp(param, "musiconhold")) {
ast_copy_string(q->moh, val, sizeof(q->moh));
} else if (!strcasecmp(param, "announce")) {
ast_copy_string(q->announce, val, sizeof(q->announce));
@@ -1343,7 +1344,7 @@ playout:
/* Don't restart music on hold if we're about to exit the caller from the queue */
if (!res)
- ast_moh_start(qe->chan, qe->moh);
+ ast_moh_start(qe->chan, qe->moh, NULL);
return res;
}
@@ -1782,7 +1783,7 @@ static int say_periodic_announcement(struct queue_ent *qe)
/* Resume Music on Hold if the caller is going to stay in the queue */
if (!res)
- ast_moh_start(qe->chan, qe->moh);
+ ast_moh_start(qe->chan, qe->moh, NULL);
/* update last_periodic_announce_time */
qe->last_periodic_announce_time = now;
@@ -3311,7 +3312,7 @@ check_turns:
if (ringing) {
ast_indicate(chan, AST_CONTROL_RINGING);
} else {
- ast_moh_start(chan, qe.moh);
+ ast_moh_start(chan, qe.moh, NULL);
}
for (;;) {
/* This is the wait loop for callers 2 through maxlen */