[svn-commits] mmichelson: branch group/CCSS r240504 - /team/group/CCSS/main/ccss.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jan 15 15:51:05 CST 2010


Author: mmichelson
Date: Fri Jan 15 15:51:02 2010
New Revision: 240504

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=240504
Log:
When using a generic agent, save the Caller ID of the caller.

Apparently this has to be set manually when originating a call. Not
sure why that is, but hey, it's fixed now.


Modified:
    team/group/CCSS/main/ccss.c

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=240504&r1=240503&r2=240504
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Fri Jan 15 15:51:02 2010
@@ -1937,6 +1937,24 @@
 	 * Scheduler id of offer timer.
 	 */
 	int offer_timer_id;
+	/*!
+	 * Caller ID number
+	 *
+	 * When we re-call the caller, we need
+	 * to provide this information to 
+	 * ast_request_and_dial so that the
+	 * information will be present in the
+	 * call to the callee
+	 */
+	char cid_num[AST_CHANNEL_NAME];
+	/*!
+	 * Caller ID name
+	 *
+	 * See the description of cid_num.
+	 * The same applies here, except this
+	 * is the caller's name.
+	 */
+	char cid_name[AST_CHANNEL_NAME];
 };
 
 static int cc_generic_agent_init(struct ast_cc_agent *agent, struct ast_channel *chan)
@@ -1948,6 +1966,8 @@
 	}
 
 	generic_pvt->offer_timer_id = -1;
+	ast_copy_string(generic_pvt->cid_num, chan->cid.cid_num, sizeof(generic_pvt->cid_num));
+	ast_copy_string(generic_pvt->cid_name, chan->cid.cid_name, sizeof(generic_pvt->cid_name));
 	agent->private_data = generic_pvt;
 	ast_set_flag(agent, AST_CC_AGENT_SKIP_OFFER);
 	return 0;
@@ -2061,6 +2081,7 @@
 static void *generic_recall(void *data)
 {
 	struct ast_cc_agent *agent = data;
+	struct cc_generic_agent_pvt *generic_pvt = agent->private_data;
 	char *interface = ast_strdupa(agent->interface);
 	char *tech;
 	char *target;
@@ -2076,7 +2097,7 @@
 	if ((target = strchr(interface, '/'))) {
 		*target++ = '\0';
 	}
-	if (!(chan = ast_request_and_dial(tech, AST_FORMAT_SLINEAR, NULL, target, 20000, &reason, NULL, NULL))) {
+	if (!(chan = ast_request_and_dial(tech, AST_FORMAT_SLINEAR, NULL, target, 20000, &reason, generic_pvt->cid_num, generic_pvt->cid_name))) {
 		/* Hmm, no channel. Sucks for you, bud.
 		 */
 		ast_log_dynamic_level(cc_logger_level, "Failed to call back %s for reason %d\n", agent->interface, reason);




More information about the svn-commits mailing list