aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-23 18:39:37 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-23 18:39:37 +0000
commit73d1a699c392dfa85c090a3a861cd70fe881192b (patch)
tree3c7b9da05bd75e946110f5a7b51fa7140b66b7f7 /apps/app_queue.c
parentef50431e9da902f133a0277ceafbbd293e658878 (diff)
new parameter 'R' to the Queue application
The 'R' argument stops moh and indicates ringing once the agent is ringing. This allows the person in the queue to know their call is potentially about to be answered. (closes issue #16384) Reported by: haakon Patches: new_app_queue.c.patch uploaded by haakon (license 880) Tested by: haakon, loloski, dvossel git-svn-id: http://svn.digium.com/svn/asterisk/trunk@236304 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 2e79909ca..421ddbae4 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -153,6 +153,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
<option name="r">
<para>Ring instead of playing MOH. Periodic Announcements are still made, if applicable.</para>
</option>
+ <option name="R">
+ <para>Ring instead of playing MOH when a member channel is actually ringing.</para>
+ </option>
<option name="t">
<para>Allow the <emphasis>called</emphasis> user to transfer the calling user.</para>
</option>
@@ -807,6 +810,7 @@ struct queue_ent {
int pos; /*!< Where we are in the queue */
int prio; /*!< Our priority */
int last_pos_said; /*!< Last position we told the user */
+ int ring_when_ringing; /*!< Should we only use ring indication when a channel is ringing? */
time_t last_periodic_announce_time; /*!< The last time we played a periodic announcement */
int last_periodic_announce_sound; /*!< The last periodic announcement we made */
time_t last_pos; /*!< Last time we told the user their position */
@@ -3092,6 +3096,13 @@ static void record_abandoned(struct queue_ent *qe)
static void rna(int rnatime, struct queue_ent *qe, char *interface, char *membername, int pause)
{
ast_verb(3, "Nobody picked up in %d ms\n", rnatime);
+
+ /* Stop ringing, and resume MOH if specified */
+ if (qe->ring_when_ringing) {
+ ast_indicate(qe->chan, -1);
+ ast_moh_start(qe->chan, qe->moh, NULL);
+ }
+
if (qe->parent->eventwhencalled) {
char vars[2048];
@@ -3392,6 +3403,12 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
break;
case AST_CONTROL_RINGING:
ast_verb(3, "%s is ringing\n", ochan_name);
+
+ /* Start ring indication when the channel is ringing, if specified */
+ if (qe->ring_when_ringing) {
+ ast_moh_stop(qe->chan);
+ ast_indicate(qe->chan, AST_CONTROL_RINGING);
+ }
break;
case AST_CONTROL_OFFHOOK:
/* Ignore going off hook */
@@ -5527,6 +5544,12 @@ static int queue_exec(struct ast_channel *chan, const char *data)
if (args.options && (strchr(args.options, 'r')))
ringing = 1;
+ if (ringing != 1 && args.options && (strchr(args.options, 'R'))) {
+ qe.ring_when_ringing = 1;
+ } else {
+ qe.ring_when_ringing = 0;
+ }
+
if (args.options && (strchr(args.options, 'c')))
qcontinue = 1;