[Freeswitch-svn] [commit] r2571 - freeswitch/trunk/src/mod/applications/mod_conference

Freeswitch SVN mikej at freeswitch.org
Fri Sep 8 00:49:38 EDT 2006


Author: mikej
Date: Fri Sep  8 00:49:38 2006
New Revision: 2571

Modified:
   freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c

Log:
add flags to conference dial.  add mute and/or deaf after the dial string, or none if you dont want any flags, but need to do cid number/name.  Please test.

Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	Fri Sep  8 00:49:38 2006
@@ -197,6 +197,7 @@
 										  switch_core_session_t *session,
 										  char *bridgeto,
 										  uint32_t timeout,
+										  char *flags,
 										  char *cid_name,
 										  char *cid_num);
 static void conference_function(switch_core_session_t *session, char *data);
@@ -1399,7 +1400,7 @@
 					goto done;
 				} else if (!strcasecmp(argv[1], "dial")) {
 					if (argc > 2) {
-						conference_outcall(conference, NULL, argv[2], 60, argv[3], argv[4]);
+						conference_outcall(conference, NULL, argv[2], 60, argv[3], argv[4], argv[5]);
 						stream->write_function(stream, "OK\n");
 						goto done;
 					} else {
@@ -2034,6 +2035,7 @@
 										  switch_core_session_t *session,
 										  char *bridgeto,
 										  uint32_t timeout,
+										  char *flags,
 										  char *cid_name,
 										  char *cid_num)
 {
@@ -2041,6 +2043,7 @@
 	switch_channel_t *peer_channel;
 	switch_status_t status = SWITCH_STATUS_SUCCESS;
 	switch_channel_t *caller_channel = NULL;
+	char appdata[512];
 
 
 	if (switch_ivr_originate(session, &peer_session, bridgeto, timeout, &audio_bridge_peer_state_handlers, cid_name, cid_num, NULL) != SWITCH_STATUS_SUCCESS) {
@@ -2068,7 +2071,13 @@
 			goto done;
 		}
 		/* add them to the conference */
-		switch_caller_extension_add_application(peer_session, extension, (char *) global_app_name, conference->name);
+		if (flags) {
+			snprintf(appdata, sizeof(appdata), "%s +flags{%s}", conference->name, flags);
+			switch_caller_extension_add_application(peer_session, extension, (char *) global_app_name, appdata);
+		} else {
+			switch_caller_extension_add_application(peer_session, extension, (char *) global_app_name, conference->name);
+		}
+
 		switch_channel_set_caller_extension(peer_channel, extension);
 		switch_channel_set_state(peer_channel, CS_EXECUTE);
 
@@ -2303,7 +2312,7 @@
 
 
 	if (!switch_strlen_zero(bridgeto) && strcasecmp(bridgeto, "none")) {
-		if (conference_outcall(conference, session, bridgeto, 60, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
+		if (conference_outcall(conference, session, bridgeto, 60, NULL, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
 			goto done;
 		}
 	}



More information about the Freeswitch-svn mailing list