[asterisk-commits] mmichelson: branch group/CCSS r217559 - /team/group/CCSS/main/ccss.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 9 18:31:43 CDT 2009


Author: mmichelson
Date: Wed Sep  9 18:31:41 2009
New Revision: 217559

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=217559
Log:
More progress on the generic_recall function.

Unfortunately it segfaults right now. In order to
not make it segfault, I will need to rewrite the
way that interface_tree_to_monitor works. It'll
be all right though. Don't cry.


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

Modified: team/group/CCSS/main/ccss.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=217559&r1=217558&r2=217559
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Wed Sep  9 18:31:41 2009
@@ -766,18 +766,32 @@
 static void *generic_recall(void *data)
 {
 	struct ast_cc_agent *agent = data;
+	char *interface = ast_strdupa(agent->interface);
+	char *tech;
+	char *target;
+	int reason;
+	struct ast_channel *chan;
+	struct ast_cc_interface *cc_interface;
+	char *full_extension;
+	char *context;
+	char *exten;
 	ast_log(LOG_NOTICE, "Now we should callback %s\n", agent->interface);
-	/* Params for request and dial
-	 * tech: can be gotten by manipulating agent->interface
-	 * format: Following the lead of pbx_spool, this will be SLINEAR
-	 * requestor: Following the lead of ast_pbx_outgoing_exten, this will be NULL
-	 * data: can be gotten by manipulating agent->interface
-	 * timeout: oh, hmmm... maybe need a new config option?
-	 * reason: output parameter. I'll provide it.
-	 * cid_num: Good question...
-	 * cid_name: Good question...
-	 */
-	ast_request_and_dial();
+	tech = interface;
+	if ((target = strchr(interface, '/'))) {
+		*target++ = '\0';
+	}
+	chan = ast_request_and_dial(tech, AST_FORMAT_SLINEAR, NULL, target, 20000, &reason, NULL, NULL);
+	/* Now we can bust apart the outbound name so that the PBX will run. */
+	cc_interface = AST_LIST_FIRST(agent->interface_tree);
+	full_extension = ast_strdupa(cc_interface->name);
+	exten = full_extension;
+	if ((context = strchr(full_extension, '@'))) {
+		*context++ = '\0';
+	}
+	ast_copy_string(chan->exten, exten, sizeof(chan->exten));
+	ast_copy_string(chan->context, context, sizeof(chan->context));
+	chan->priority = 0;
+	ast_pbx_start(chan);
 	return NULL;
 }
 




More information about the asterisk-commits mailing list