[asterisk-commits] mmichelson: branch group/issue8824 r141681 - in /team/group/issue8824: ./ apps/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Sep 8 12:09:27 CDT 2008


Author: mmichelson
Date: Mon Sep  8 12:09:26 2008
New Revision: 141681

URL: http://svn.digium.com/view/asterisk?view=rev&rev=141681
Log:
Adding the 'I' option to app_queue and bringing it up
to date with app_dial regarding connectedline updates


Modified:
    team/group/issue8824/CHANGES
    team/group/issue8824/apps/app_queue.c

Modified: team/group/issue8824/CHANGES
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/CHANGES?view=diff&rev=141681&r1=141680&r2=141681
==============================================================================
--- team/group/issue8824/CHANGES (original)
+++ team/group/issue8824/CHANGES Mon Sep  8 12:09:26 2008
@@ -584,6 +584,8 @@
     when a realtime queue member is removed. Since there is no calling channel associated
     with these events, the string "REALTIME" is placed where the channel's unique id
     is typically placed.
+  * A new option, 'I' has been added to both app_queue and app_dial. By setting this option, Asterisk
+    will not update the caller with connected line changes when they occur.
 
 MeetMe Changes
 --------------

Modified: team/group/issue8824/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/apps/app_queue.c?view=diff&rev=141681&r1=141680&r2=141681
==============================================================================
--- team/group/issue8824/apps/app_queue.c (original)
+++ team/group/issue8824/apps/app_queue.c Mon Sep  8 12:09:26 2008
@@ -166,6 +166,8 @@
 "             go to the next step.\n"
 "      'i' -- ignore call forward requests from queue members and do nothing\n"
 "             when they are requested.\n"
+"      'I' -- Asterisk will ignore any connected line update requests it may receive\n"
+"             on this dial attempt.\n"
 "      'r' -- ring instead of playing MOH. Periodic Announcements are still made, if applicable.\n"
 "      't' -- allow the called user to transfer the calling user.\n"
 "      'T' -- allow the calling user to transfer the call.\n"
@@ -344,6 +346,7 @@
 	time_t lastcall;
 	struct call_queue *lastqueue;
 	struct member *member;
+	int update_connectedline;
 };
 
 
@@ -2213,6 +2216,7 @@
 		} else if (!ast_strlen_zero(S_OR(qe->chan->macroexten, qe->chan->exten))) {
 			ast_set_callerid(tmp->chan, S_OR(qe->chan->macroexten, qe->chan->exten), NULL, NULL); 
 		}
+		tmp->update_connectedline = 0;
 	}
 
 	if (tmp->chan->lid.lid_num)
@@ -2513,7 +2517,7 @@
  * \param[in] caller_disconnect if the 'H' option is used when calling Queue(), this is used to detect if the caller pressed * to disconnect the call
  * \param[in] forwardsallowed used to detect if we should allow call forwarding, based on the 'i' option to Queue()
  */
-static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callattempt *outgoing, int *to, char *digit, int prebusies, int caller_disconnect, int forwardsallowed)
+static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callattempt *outgoing, int *to, char *digit, int prebusies, int caller_disconnect, int forwardsallowed, int update_connectedline)
 {
 	const char *queue = qe->parent->name;
 	struct callattempt *o, *start = NULL, *prev = NULL;
@@ -2586,6 +2590,9 @@
 			if (o->stillgoing && (o->chan) &&  (o->chan->_state == AST_STATE_UP)) {
 				if (!peer) {
 					ast_verb(3, "%s answered %s\n", o->chan->name, in->name);
+					if (update_connectedline && o->update_connectedline) {
+						ast_connectedline_update(in, o->chan->cid.cid_num, o->chan->cid.cid_name, o->chan->cid.cid_pres);
+					}
 					peer = o;
 				}
 			} else if (o->chan && (o->chan == winner)) {
@@ -2666,6 +2673,9 @@
 							/* This is our guy if someone answered. */
 							if (!peer) {
 								ast_verb(3, "%s answered %s\n", o->chan->name, in->name);
+								if (update_connectedline && o->update_connectedline) {
+									ast_connectedline_update(in, o->chan->cid.cid_num, o->chan->cid.cid_name, o->chan->cid.cid_pres);
+								}
 								peer = o;
 							}
 							break;
@@ -2705,6 +2715,13 @@
 						case AST_CONTROL_OFFHOOK:
 							/* Ignore going off hook */
 							break;
+						case AST_CONTROL_CONNECTEDLINE: 
+							if (!update_connectedline) {
+								ast_verb(3, "Connected line update to %s prevented.\n", in->name);
+							} else {
+								ast_verb(3, "%s connected line has changed, passing it to %s\n", o->chan->name, in->name);
+								ast_indicate_data(in, AST_CONTROL_CONNECTEDLINE, f->data.ptr, f->datalen);
+							}
 						default:
 							ast_debug(1, "Dunno what to do with control type %d\n", f->subclass);
 						}
@@ -3269,6 +3286,7 @@
 	char *p;
 	char vars[2048];
 	int forwardsallowed = 1;
+	int update_connectedline = 1;
 	int callcompletedinsl;
 	struct ao2_iterator memi;
 	struct ast_datastore *datastore;
@@ -3330,13 +3348,15 @@
 		case 'i':
 			forwardsallowed = 0;
 			break;
+		case 'I':
+			update_connectedline = 0;
+			break;
 		case 'x':
 			ast_set_flag(&(bridge_config.features_callee), AST_FEATURE_AUTOMIXMON);
 			break;
 		case 'X':
 			ast_set_flag(&(bridge_config.features_caller), AST_FEATURE_AUTOMIXMON);
 			break;
-
 		}
 
 	/* Hold the lock while we setup the outgoing calls */
@@ -3430,6 +3450,7 @@
 		tmp->oldstatus = cur->status;
 		tmp->lastcall = cur->lastcall;
 		tmp->lastqueue = cur->lastqueue;
+		tmp->update_connectedline = 1;
 		ast_copy_string(tmp->interface, cur->interface, sizeof(tmp->interface));
 		/* Special case: If we ring everyone, go ahead and ring them, otherwise
 		   just calculate their metric for the appropriate strategy */
@@ -3470,7 +3491,7 @@
 	ring_one(qe, outgoing, &numbusies);
 	if (use_weight)
 		ao2_unlock(queues);
-	lpeer = wait_for_answer(qe, outgoing, &to, &digit, numbusies, ast_test_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT), forwardsallowed);
+	lpeer = wait_for_answer(qe, outgoing, &to, &digit, numbusies, ast_test_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT), forwardsallowed, update_connectedline);
 	/* The ast_channel_datastore_remove() function could fail here if the
 	 * datastore was moved to another channel during a masquerade. If this is
 	 * the case, don't free the datastore here because later, when the channel




More information about the asterisk-commits mailing list