[svn-commits] russell: branch group/xcon_bfcp r58097 - in /team/group/xcon_bfcp: ./ apps/ a...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue Mar 6 14:36:55 MST 2007


Author: russell
Date: Tue Mar  6 15:36:54 2007
New Revision: 58097

URL: http://svn.digium.com/view/asterisk?view=rev&rev=58097
Log:
Merge the latest patch from issue 7838

Added:
    team/group/xcon_bfcp/apps/xcon_bfcp/bfcp_threads.h   (with props)
    team/group/xcon_bfcp/build_tools/make_linker_eo_script
      - copied unchanged from r58025, trunk/build_tools/make_linker_eo_script
Modified:
    team/group/xcon_bfcp/apps/app_meetme.c
    team/group/xcon_bfcp/apps/xcon_bfcp/bfcp_base64.c
    team/group/xcon_bfcp/apps/xcon_bfcp/bfcp_floor_list.c
    team/group/xcon_bfcp/apps/xcon_bfcp/bfcp_floor_list.h
    team/group/xcon_bfcp/apps/xcon_bfcp/bfcp_gw.c
    team/group/xcon_bfcp/apps/xcon_bfcp/bfcp_gw.h
    team/group/xcon_bfcp/apps/xcon_bfcp/bfcp_link_list.c
    team/group/xcon_bfcp/apps/xcon_bfcp/bfcp_link_list.h
    team/group/xcon_bfcp/apps/xcon_bfcp/bfcp_messages.c
    team/group/xcon_bfcp/apps/xcon_bfcp/bfcp_messages.h
    team/group/xcon_bfcp/apps/xcon_bfcp/bfcp_messages_build.c
    team/group/xcon_bfcp/apps/xcon_bfcp/bfcp_messages_parse.c
    team/group/xcon_bfcp/apps/xcon_bfcp/bfcp_sdp.c
    team/group/xcon_bfcp/apps/xcon_bfcp/bfcp_sdp.h
    team/group/xcon_bfcp/apps/xcon_bfcp/bfcp_server.c
    team/group/xcon_bfcp/apps/xcon_bfcp/bfcp_server.h
    team/group/xcon_bfcp/apps/xcon_bfcp/bfcp_strings.h
    team/group/xcon_bfcp/apps/xcon_bfcp/bfcp_user_list.c
    team/group/xcon_bfcp/apps/xcon_bfcp/bfcp_user_list.h
    team/group/xcon_bfcp/apps/xcon_bfcp/xcon_blueprints.h
    team/group/xcon_bfcp/apps/xcon_bfcp/xcon_scheduler.c
    team/group/xcon_bfcp/apps/xcon_bfcp/xcon_scheduler.h
    team/group/xcon_bfcp/build_tools/make_version
    team/group/xcon_bfcp/build_tools/make_version_h
    team/group/xcon_bfcp/channels/bfcp_sdp/bfcp_sdp.c
    team/group/xcon_bfcp/channels/bfcp_sdp/bfcp_sdp.h
    team/group/xcon_bfcp/channels/chan_jingle.c
    team/group/xcon_bfcp/channels/chan_sip.c
    team/group/xcon_bfcp/configs/xcon.conf.sample
    team/group/xcon_bfcp/configure
    team/group/xcon_bfcp/pbx/   (props changed)
    team/group/xcon_bfcp/pbx/ael/ael-test/ref.ael-test2
    team/group/xcon_bfcp/pbx/ael/ael-test/ref.ael-test3
    team/group/xcon_bfcp/pbx/ael/ael-test/ref.ael-test4
    team/group/xcon_bfcp/pbx/ael/ael-test/ref.ael-test6
    team/group/xcon_bfcp/pbx/ael/ael-test/ref.ael-test7
    team/group/xcon_bfcp/pbx/ael/ael-test/ref.ael-vtest13
    team/group/xcon_bfcp/pbx/ael/ael.tab.c
    team/group/xcon_bfcp/pbx/pbx_ael.c
    team/group/xcon_bfcp/pbx/pbx_config.c
    team/group/xcon_bfcp/pbx/pbx_dundi.c

Modified: team/group/xcon_bfcp/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/group/xcon_bfcp/apps/app_meetme.c?view=diff&rev=58097&r1=58096&r2=58097
==============================================================================
--- team/group/xcon_bfcp/apps/app_meetme.c (original)
+++ team/group/xcon_bfcp/apps/app_meetme.c Tue Mar  6 15:36:54 2007
@@ -38,8 +38,8 @@
 #include <string.h>
 #include <unistd.h>
 #include <errno.h>
-
-#include "asterisk/zapata.h"
+#include <sys/ioctl.h>
+#include <zaptel/zaptel.h>
 
 #include "asterisk/lock.h"
 #include "asterisk/file.h"
@@ -63,7 +63,7 @@
 #include "asterisk/dial.h"
 
 #include "asterisk/term.h"	/* Needed for some "coloured" console notifications */
-#include "asterisk/rtp.h"	/* Needed for the cascaded conferences trunking and for the external VideoMixer */
+#include "asterisk/rtp.h"	/* Needed for the cascaded conferences trunking and for the external VideoMixer (not used yet) */
 
 /*! The Floor Control Server Gateway, to handle all that's related to BFCP:
 	1. centralized floor control for XCON Conferences;
@@ -78,12 +78,15 @@
 #include "enter.h"
 #include "leave.h"
 
-#define DEFAULT_XCON_PREFIX	 	867	/*!< Prefix wildcard for XCON conferences */
-#define DEFAULT_SCHEDULER_PORT 		2346	/*!< Default XconScheduler listening port */
-#define DEFAULT_BFCP_PORT 		2345	/*!< Default BFCP Server listening port */
-#define DEFAULT_GW_BFCP_PORT 		2354	/*!< Default Gatewayed BFCP Server listening port (if used) */
-#define DEFAULT_GW_BFCP_DISPATCHER 	3000	/*!< Default DCON Dispatcher listening port (if used) */
-#define DEFAULT_BFCP_MAXCONF 	  	10	/*!< Default BFCP Server max number of allowed concurrent conferences */
+#define DEFAULT_XCON_PREFIX	 	867		/*!< Prefix wildcard for XCON conferences */
+#define DEFAULT_SCHEDULER_PORT		2346		/*!< Default XconScheduler listening port */
+#define DEFAULT_BFCP_TRANSPORT		BFCP_OVER_TLS	/*!< Default transport for BFCP (it can be BFCP_OVER_TCP as well) */
+#define DEFAULT_BFCP_PORT		2345		/*!< Default BFCP Server listening port */
+#define DEFAULT_GW_BFCP_PORT		2354		/*!< Default Gatewayed BFCP Server listening port (if used) */
+#define DEFAULT_GW_BFCP_DISPATCHER	3000		/*!< Default DCON Dispatcher listening port (if used) */
+#define DEFAULT_BFCP_MAXCONF	  	10		/*!< Default BFCP Server max number of allowed concurrent conferences */
+#define MAX_QUEUED_VIDEO_FRAMES		100		/*!< Max number of video fraes to enqueue for each user (then drop them) */
+
 #define SLA_CONFIG_FILE  "sla.conf"
 
 /*! Static variable to store the prefix wildcard for XCON conferences as read from the configuration file */
@@ -91,6 +94,7 @@
 
 /*! Static variable that tells us if we have to be DCON-compliant or not */
 static int dcon_enabled;
+static unsigned short int dcon_stub_userID = 1;
 
 /*! The address we bind the local Mixers' RTPs to */
 static struct sockaddr_in bindaddr = { 0, };
@@ -192,7 +196,7 @@
 enum {
 	OPT_ARG_WAITMARKED = 0,
 	OPT_ARG_ARRAY_SIZE = 1,
-};
+} meetme_option_args;
 
 AST_APP_OPTIONS(meetme_opts, BEGIN_OPTIONS
 	AST_APP_OPTION('A', CONFFLAG_MARKEDUSER ),
@@ -203,8 +207,8 @@
 	AST_APP_OPTION('D', CONFFLAG_DYNAMICPIN ),
 	AST_APP_OPTION('d', CONFFLAG_DYNAMIC ),
 	AST_APP_OPTION('E', CONFFLAG_EMPTYNOPIN ),
+	AST_APP_OPTION('F', CONFFLAG_PASS_DTMF ),
 	AST_APP_OPTION('e', CONFFLAG_EMPTY ),
-	AST_APP_OPTION('F', CONFFLAG_PASS_DTMF ),
 	AST_APP_OPTION('i', CONFFLAG_INTROUSER ),
 	AST_APP_OPTION('I', CONFFLAG_INTROUSERNOREVIEW ),
 	AST_APP_OPTION('M', CONFFLAG_MOH ),
@@ -288,7 +292,8 @@
 "             digit extension ${MEETME_EXIT_CONTEXT} or the current context\n"
 "             if that variable is not defined.\n"
 "      '1' -- do not play message when first person enters\n"
-"      'B' -- trigger XCON Conference mode, enabling BFCP for moderation.\n";
+"      'B' -- trigger XCON Conference mode, enabling BFCP for moderation.\n"
+"      'G' -- trigger DCON Conference mode (stub conference), enabling XCON distribution.\n";
 
 static const char *descrip2 =
 "  MeetMeCount(confno[|var]): Plays back the number of users in the specified\n"
@@ -365,6 +370,8 @@
 	struct ast_frame *origframe;
 	struct ast_trans_pvt *transpath[32];
 
+	int video_switch;			/*! Number of the user who is allowed to send her/his video (MeetMe only) */
+
 	int xcondcontype;			/*!< XCON Local/Remote Conference */
 	unsigned long int xconconferenceID;	/*!< XCON specific Conference ID */
 	char *subject;				/*!< XCON specific Conference Subject (Topic) */
@@ -372,8 +379,6 @@
 	unsigned short int xconpassword;	/*!< XCON Conference Administrator's numeric password */
 	unsigned short int audiofloorID;	/*!< BFCP Floor ID for Audio, if enabled */
 	unsigned short int videofloorID;	/*!< BFCP Floor ID for Video, if enabled */
-
-	struct xcon_videomixer_leg *videomixer;
 
 	AST_LIST_HEAD_NOLOCK(, ast_conf_user) userlist;
 	AST_LIST_HEAD_NOLOCK(, xcon_cascaded_conference) cascadedlist;
@@ -409,7 +414,8 @@
 	int notify_audio_change;		/*!< Flag to notify an user if he has been muted/unmuted */
 	int notify_video_change;		/*!< Flag to notify an user if he can/can't send video */
 
-	struct xcon_videomixer_leg *videomixer;
+	unsigned short int dcon_stub_userID;	/*!< Temporary ID needed in DCON initial transactions */
+
 	unsigned short int queued_video_frames;
 	AST_LIST_HEAD_NOLOCK(, xcon_videoframe) videoframes;
 	ast_mutex_t videoframe_lock;		/*!< Lock to update/retrieve frames */
@@ -434,41 +440,33 @@
 	AST_LIST_ENTRY(xcon_videoframe) list;
 };
 
-struct xcon_videomixer_leg {
-	int is_focus;				/*! Is this leg related to a focus or to an user? */
-	struct ast_conference *conf;		/*!< The local Conference peer, if related to a conference */
-	struct ast_conf_user *user;		/*!< The local Conference peer, if related to an user */
-
-	int active;				/*!< A flag to check if the listener is active */
-	struct ast_rtp *rtp;			/*!< The Mixer's RTP channel to get the mixed video from (if focus) and send mixed video to (if user) */
-	unsigned short int own_port;		/*!< The Mixer's RTP channel local port */
-	pthread_t listening_thread;		/*!< Listening thread for incoming Mixer's RTP (only for focus) */
-	pthread_attr_t listening_attr;		/*!< Listening thread attribute (only for focus) */
-};
-
 struct xcon_cascaded_conference {
 	int xcondcontype;			/*!< This peer is an XCON Local/Remote Conference */
 	struct ast_conference *conf;		/*!< The local Conference peer */
 	int conf_fd;				/*!< Connected local channel */
 
 	int active;				/*!< A flag to check if the listener is active */
-	struct ast_rtp *rtp;			/*!< The Mixer's RTP channel to get the mixed frames from */
-	unsigned short int own_port;		/*!< The Mixer's RTP channel listening port */
-	char *peerIP;
-	unsigned short int peer_port;
-	pthread_t listening_thread;		/*!< Listening thread for incoming Mixer's RTP */
+
+	char *peerIP;				/*! The IP of the cascaded RTP peer */
+
+	struct ast_rtp *audio_rtp;		/*!< The Audio RTP channel to get the mixed frames from */
+	unsigned short int audio_own_port;	/*!< The Audio RTP channel listening port */
+	unsigned short int audioPeerPort;
+
+	struct ast_rtp *video_rtp;		/*!< The Video RTP channel to get the mixed frames from */
+	unsigned short int video_own_port;	/*!< The Video RTP channel listening port */
+	unsigned short int videoPeerPort;
+
+	pthread_t listening_thread;		/*!< Listening thread for incoming Mixers' RTP */
 	pthread_attr_t listening_attr;		/*!< Listening thread attribute */
 
 	AST_LIST_ENTRY(xcon_cascaded_conference) list;
 };
-
-/*! \brief Method to setup a new videomixer leg */
-int xcon_setup_new_videomixer(int is_focus, void *leg);
-static void *videomixer_listener(void *args);	/*!< The VideoMixer(s) listening thread(s) */
 
 /*! \brief Method to setup a new cascaded conference */
 struct xcon_cascaded_conference *xcon_setup_new_cascaded_conference(struct ast_conference *cnf);
 static void *cascaded_listener(void *args);	/*!< The Cascaded audio frames listening thread(s) */
+
 
 enum sla_trunk_state {
 	SLA_TRUNK_STATE_IDLE,
@@ -482,9 +480,9 @@
 struct sla_station {
 	AST_RWLIST_ENTRY(sla_station) entry;
 	AST_DECLARE_STRING_FIELDS(
-		AST_STRING_FIELD(name);	
-		AST_STRING_FIELD(device);	
-		AST_STRING_FIELD(autocontext);	
+		AST_STRING_FIELD(name);
+		AST_STRING_FIELD(device);
+		AST_STRING_FIELD(autocontext);
 	);
 	AST_LIST_HEAD_NOLOCK(, sla_trunk_ref) trunks;
 	struct ast_dial *dial;
@@ -520,7 +518,9 @@
 int scheduler_notifications(int type, ...);
 
 /*! XCON Binary Floor Control Protocol (BFCP) management */
+static int xcon_debug_level;		/*! Level of verbose debug about XCON/DCON (0=no debug) */
 static int bfcp_exists;			/*! A static variable to check whether the FCS is up or not */
+static int bfcp_transport;		/*! A static variable that tells which transport will be used for BFCP */
 static unsigned short int bfcp_port;	/*! The port the BFCP server will listen on (TCP only, TLS not supported yet) */
 static unsigned short int gw_bfcp_port;	/*! The port the BFCP server will listen on, if gatewayed (TCP only, TLS not supported yet) */
 static char gw_ip[15];			/*! The IP the BFCP server will listen on, if gatewayed (TCP only, TLS not supported yet) */
@@ -560,7 +560,7 @@
 /*! Wrapper functions to get pointers to a conference and/or an user */
 struct ast_conference *xcon_get_conference(unsigned long int conferenceID);
 struct ast_conf_user *xcon_get_user(struct ast_conference *cnf, unsigned short int userID);
-struct ast_conf_user *xcon_get_user_from_info(struct ast_conference *cnf, char *uri, char *display);
+struct ast_conf_user *xcon_get_user_from_info(struct ast_conference *cnf, unsigned short int tempUserID, char *uri, char *display);
 
 /*! Muting/Unmuting XCON wrappers */
 int xcon_mute_user(struct ast_conference *cnf, struct ast_conf_user *user);
@@ -571,7 +571,7 @@
 struct dcon_user *dcon_get_remote_user(struct ast_conference *cnf, unsigned short int userID);
 int dcon_remove_remote_user(struct ast_conference *cnf, unsigned short int userID);
 int dcon_free_remote_users(struct ast_conference *cnf);
- 
+
 struct sla_trunk_ref {
 	AST_LIST_ENTRY(sla_trunk_ref) entry;
 	struct sla_trunk *trunk;
@@ -611,6 +611,9 @@
 	.thread = AST_PTHREADT_NULL,
 };
 
+static int audio_buffers;			/*!< The number of audio buffers to be allocated on pseudo channels
+						   when in a conference
+						*/
 /*! The number of audio buffers to be allocated on pseudo channels
  *  when in a conference */
 static int audio_buffers;
@@ -809,6 +812,7 @@
  * \param make Make the conf if it doesn't exist
  * \param dynamic Mark the newly created conference as dynamic
  * \param refcount How many references to mark on the conference
+ * \param xcon If this is a MeetMe(0), XCON (1) or DCON(2) conference
  *
  * \return A pointer to the conference struct, or NULL if it wasn't found and
  *         make or dynamic were not set.
@@ -910,7 +914,7 @@
 					if (option_verbose > 2)
 						ast_verbose(VERBOSE_PREFIX_3 "Could not create the Cascaded Conference RTP channel...\n");
 				}
-				if (!fatal && (option_verbose > 2))
+				if (!fatal && (option_verbose > 2) && (xcon_debug_level > 2))
 					ast_verbose(VERBOSE_PREFIX_3 "The new remote conference (ConferenceID: %lu) has been added to the BFCP Server:\n", cnf->xconconferenceID);
 			} else {
 				/* We don't read the file for that: we use the locally registered conferences */
@@ -941,7 +945,7 @@
 									ast_verbose(VERBOSE_PREFIX_3 "The new local conference could not be added to the BFCP Server...\n");
 								break;
 							}
-							if (option_verbose > 2)
+							if ((option_verbose > 2) && (xcon_debug_level > 2))
 								ast_verbose(VERBOSE_PREFIX_3 "The new local conference (ConferenceID: %lu) has been added to the BFCP Server:\n", cnf->xconconferenceID);
 							/* ...and finally we add the required floors to the BFCP conference */
 							if(conferences->audiofloorID) { /* Add a Floor for Audio */
@@ -952,28 +956,22 @@
 										ast_verbose(VERBOSE_PREFIX_3 "Couldn't add the new Audio Floor to the Conference...\n");
 									break;
 								}
-								if (option_verbose > 2)
+								if ((option_verbose > 2) && (xcon_debug_level > 2))
 									ast_verbose(VERBOSE_PREFIX_3 "    Floor: Audio, ID %d (%s)\n", cnf->audiofloorID, conferences->audiousers ? "limited users" : "unlimited users");
 							}
 							if(conferences->videofloorID) { /* Add a Floor for Video */
 								cnf->videofloorID = conferences->videofloorID;
 								/* Only add to the list if Audio and Video floors are different (they could be managed together in the same floor) */
-/*								if(cnf->videofloorID != cnf->audiofloorID) {*/
+								if(cnf->videofloorID != cnf->audiofloorID) {
 									if(bfcp_gw_add_floor_server(conferences->conferenceID, VIDEO_FLOOR, conferences->videofloorID, 0, conferences->videousers) <0 ) {
 										fatal++;
 										if (option_verbose > 2)
 											ast_verbose(VERBOSE_PREFIX_3 "Couldn't add the new Video Floor to the Conference...\n");
 										break;
 									}
-/*								}*/
-								if (option_verbose > 2)
+								}
+								if ((option_verbose > 2) && (xcon_debug_level > 2))
 									ast_verbose(VERBOSE_PREFIX_3 "    Floor: Video, ID %d (%s)\n", cnf->videofloorID, conferences->videousers ? "limited users" : "unlimited users");
-								/* NOTE: we create an RTP channel to latterly receive mixed frames from the video mixer as well
-								if(xcon_setup_new_videomixer(1, cnf) < 0) {
-									fatal++;
-									if (option_verbose > 2)
-										ast_verbose(VERBOSE_PREFIX_3 "Could not create the VideoMixer RTP channel...\n");
-								}	*/
 							}
 							cnf->subject = conferences->subject;
 							conferences->is_active = 1;
@@ -984,7 +982,7 @@
 				AST_LIST_UNLOCK(&regxconfs);
 			}
 			/* Show the results */
-			if (option_verbose > 2)
+			if ((option_verbose > 2) && (xcon_debug_level > 2))
 				ast_verbose(VERBOSE_PREFIX_3 "    Adding conference to the BFCP Server: %s\n", fatal ? "FAILED" : "DONE");
 		}
 		if(!fatal) {
@@ -1006,7 +1004,7 @@
 		AST_LIST_INSERT_HEAD(&confs, cnf, list);
 	}
 
-cnfout:
+ cnfout:
 	if (cnf)
 		cnf->refcount += refcount;
 
@@ -1017,20 +1015,29 @@
 
 /*! \brief CLI commands for XCON related information */
 static int xcon_info(int fd, int argc, char *argv[]);
+static int xcon_debug(int fd, int argc, char *argv[]);
 static int xcon_show_registered(int fd, int argc, char *argv[]);
 static int xcon_show_conferences(int fd, int argc, char *argv[]);
 static int xcon_show_conference(int fd, int argc, char *argv[]);
 static int xcon_show_users(int fd, int argc, char *argv[]);
 static int xcon_show_user(int fd, int argc, char *argv[]);
+static int xcon_show_cascaded(int fd, int argc, char *argv[]);
 static int xcon_remove_conference(int fd, int argc, char *argv[]);
 static int xcon_remove_user(int fd, int argc, char *argv[]);
-static int xcon_add_mixer(int fd, int argc, char *argv[]);
 static int xcon_play(int fd, int argc, char *argv[]);
 
 static char xcon_info_usage[] = 
 "Usage: xcon info\n"
 "       Shows information on the XCON Servers.\n";
 
+static char xcon_debug_usage[] = 
+"Usage: xcon debug <level>\n"
+"       Set the level of verbose debug for XCON/DCON:\n"
+"          0 - no debug (only joins/leaves)\n"
+"          1 - only DCON/XCON messages\n"
+"          2 - BFCP messages too\n"
+"          3 - full debug\n";
+
 static char xcon_show_registered_usage[] = 
 "Usage: xcon show registered\n"
 "       Shows the registered conferences in the XCON Server.\n";
@@ -1051,6 +1058,10 @@
 "Usage: xcon show user <conferenceID> <userID>\n"
 "       Shows the user number <userID> in conference <conferenceID> on the XCON Server.\n";
 
+static char xcon_show_cascaded_usage[] = 
+"Usage: xcon show cascaded <conferenceID>\n"
+"       Shows all the cascaded peers in conference <conferenceID> on the XCON Server.\n";
+
 static char xcon_remove_conference_usage[] = 
 "Usage: xcon remove conference <ID>\n"
 "       Removes the conference number <ID> and all its users from the XCON Server.\n";
@@ -1059,24 +1070,22 @@
 "Usage: xcon remove user <conferenceID> <userID>\n"
 "       Removes the user <userID> from the conference <confID> in the XCON Server.\n";
 
-static char xcon_add_mixer_usage[] = 
-"Usage: xcon add mixer <conferenceID> <IP> <port>\n"
-"       Add a Video Mixer (<IP>:<port>) to the conference <confID>.\n";
-
 static char xcon_play_usage[] = 
 "Usage: xcon play <conferenceID>\n"
 "       Play an announcement in conference <confID>.\n";
 
+
 static struct ast_cli_entry xcon_cli[] = {
 	{ { "xcon", "info", NULL }, xcon_info, "Shows information on the XCON Server", xcon_info_usage },
+	{ { "xcon", "debug", NULL }, xcon_debug, "Set the level of verbose debug for XCON/DCON", xcon_debug_usage },
 	{ { "xcon", "show", "registered", NULL }, xcon_show_registered, "Shows the registered conferences in the XCON Server", xcon_show_registered_usage },
 	{ { "xcon", "show", "conferences", NULL }, xcon_show_conferences, "Shows the active conferences on the XCON Server", xcon_show_conferences_usage },
 	{ { "xcon", "show", "conference", NULL }, xcon_show_conference, "Shows info about a conference in the XCON Server", xcon_show_conference_usage },
 	{ { "xcon", "show", "users", NULL }, xcon_show_users, "Shows all the users in an active conferences on the XCON Server", xcon_show_users_usage },
 	{ { "xcon", "show", "user", NULL }, xcon_show_user, "Shows info about an user in a conference in the XCON Server", xcon_show_user_usage },
+	{ { "xcon", "show", "cascaded", NULL }, xcon_show_cascaded, "Shows all the cascaded peers in an active conferences on the XCON Server", xcon_show_cascaded_usage },
 	{ { "xcon", "remove", "conference", NULL }, xcon_remove_conference, "Removes a conference from the XCON Server", xcon_remove_conference_usage },
 	{ { "xcon", "remove", "user", NULL }, xcon_remove_user, "Removes an user from a conference in the XCON Server", xcon_remove_user_usage },
-	{ { "xcon", "add", "mixer", NULL }, xcon_add_mixer, "Add a Video Mixer to a conference", xcon_add_mixer_usage },
 	{ { "xcon", "play", NULL }, xcon_play, "Play an announcement in a conference", xcon_play_usage },
 };
 
@@ -1084,21 +1093,38 @@
 static int xcon_info(int fd, int argc, char *argv[])
 {
 	if (bfcp_exists) {
+		ast_cli(fd, "\tXCON prefix %dxxxx\n", xcon_prefix);
 		if(dcon_enabled) {
-			ast_cli(fd,"  Real BFCP Server listening on port %d.\n", gw_bfcp_port);
-			ast_cli(fd,"  Gateway/Proxy BFCP Server listening on port %d.\n", bfcp_port);
+			ast_cli(fd, "\tDCON Dispatcher listening on port %hu\n", gw_bfcp_dispatcher);
+			ast_cli(fd, "\tReal BFCP Server listening on port %hu (%s)\n", gw_bfcp_port, bfcp_transport ? "TCP/TLS/BFCP" : "TCP/BFCP");
+			ast_cli(fd, "\tGateway/Proxy BFCP Server listening on port %hu (%s)\n", bfcp_port, bfcp_transport ? "TCP/TLS/BFCP" : "TCP/BFCP");
 		} else
-			ast_cli(fd,"  BFCP Server listening on port %d.\n", bfcp_port);
+			ast_cli(fd, "\tBFCP Server listening on port %hu (%s)\n", bfcp_port, bfcp_transport ? "TCP/TLS/BFCP" : "TCP/BFCP");
 		bfcp list = bfcp_gw_get_list();
 		if(list)
-			ast_cli(fd,"  BFCP Server List active with max %d conferences allowed (%d active).\n", list->Max_number_conference + 1, list->Actual_number_conference);
+			ast_cli(fd, "\tBFCP Server List active with max %d conferences allowed (%d active).\n", list->Max_number_conference + 1, list->Actual_number_conference);
 	}
 	else
-		ast_cli(fd,"BFCP Server not up.\n");
+		ast_cli(fd, "BFCP Server not up.\n");
 	if (scheduler_exists)
-		ast_cli(fd,"  XconScheduler Server listening on port %d.\n", scheduler_port);
+		ast_cli(fd, "\tXconScheduler Server listening on port %d.\n", scheduler_port);
 	else
-		ast_cli(fd,"XconScheduler Server not up.\n");
+		ast_cli(fd, "XconScheduler Server not up.\n");
+	return RESULT_SUCCESS;
+}
+
+static int xcon_debug(int fd, int argc, char *argv[])
+{
+	if (argc != 3)
+		return RESULT_SHOWUSAGE;
+
+	int level = atoi(argv[2]);
+	if((level < 0) || (level > 3))
+		return RESULT_SHOWUSAGE;
+
+	xcon_debug_level = level;
+	ast_cli(fd, "Debug level for XCON/DCON set to %d.\n", level);
+
 	return RESULT_SUCCESS;
 }
 
@@ -1109,13 +1135,13 @@
 	struct xcon_registered_conference *conferences = NULL;
 	AST_LIST_LOCK(&regxconfs);
 	if (AST_LIST_EMPTY(&regxconfs)) {
-		ast_cli(fd,"  There are no registered conferences.\n");
+		ast_cli(fd, "\tThere are no registered conferences.\n");
 		return RESULT_SUCCESS;
 	}
-	ast_cli(fd,"  Registered conferences:\n");
+	ast_cli(fd, "\tRegistered conferences:\n");
 	AST_LIST_TRAVERSE(&regxconfs, conferences, list) {
 		i++;
-		ast_cli(fd,"    %d: %li (password=%d), %s (PIN=%d), Audio %s, Video %s (Topic: %s)\n",i,conferences->conferenceID,conferences->password,conferences->pin ? "Private" : "Public",conferences->pin,conferences->audiofloorID ? "enabled" : "disabled",conferences->videofloorID ? "enabled" : "disabled", conferences->subject ? conferences->subject : "(none)");
+		ast_cli(fd, "\t  %d: %li (password=%d), %s (PIN=%d), Audio %s, Video %s (Topic: %s)\n",i,conferences->conferenceID,conferences->password,conferences->pin ? "Private" : "Public",conferences->pin,conferences->audiofloorID ? "enabled" : "disabled",conferences->videofloorID ? "enabled" : "disabled", conferences->subject ? conferences->subject : "(none)");
 	}
 	AST_LIST_UNLOCK(&regxconfs);
 	return RESULT_SUCCESS;
@@ -1125,26 +1151,26 @@
 static int xcon_show_conferences(int fd, int argc, char *argv[])
 {
 	if (!bfcp_exists)
-		ast_cli(fd,"  BFCP Server List has not been created yet.\n");
+		ast_cli(fd, "\tBFCP Server List has not been created yet.\n");
 	else {
 		bfcp list = bfcp_gw_get_list();
 		if(!list) {
-			ast_cli(fd,"  BFCP Server List doesn't exist?\n");
+			ast_cli(fd, "\tBFCP Server List doesn't exist?\n");
 			return RESULT_FAILURE;
 		}
 		bfcp_conference *lconferences = list->list_conferences;
 		int i = 0;
 		if (lconferences == NULL) {
-			ast_cli(fd,"  The BFCP Server List is NULL.\n");
+			ast_cli(fd, "\tThe BFCP Server List is NULL.\n");
 			return RESULT_SUCCESS;
 		}
 		if (list->Actual_number_conference == 0) {
-			ast_cli(fd,"  There are no active conferences in the BFCP Server.\n");
+			ast_cli(fd, "\tThere are no active conferences in the BFCP Server.\n");
 			return RESULT_SUCCESS;
 		}		
-		ast_cli(fd,"  Conferences:\n");
+		ast_cli(fd, "\tConferences:\n");
 		for(i=0; i < list->Actual_number_conference; i++)
-			ast_cli(fd,"    %d: %li\n",i+1,list->list_conferences[i].conferenceID);
+			ast_cli(fd, "\t  %d: %li\n",i+1,list->list_conferences[i].conferenceID);
 	}
 	return RESULT_SUCCESS;
 }
@@ -1158,14 +1184,14 @@
 	bfcp_queue *list_link;
 	bfcp_user *user;
 	bfcp_node *node;
-	bfcp_floor *FloorID;
+	bfcp_floor *floor;
 	floor_request_query *query_floorrequest;
 	floor_query *query;
 
 	if (argc != 4)
 		return RESULT_SHOWUSAGE;
 	if (!bfcp_exists)
-		ast_cli(fd,"  BFCP Server List has not been created yet.\n");
+		ast_cli(fd, "\tBFCP Server List has not been created yet.\n");
 	else {
 		unsigned long int ID = atoi(argv[3]);
 		if(!ID)
@@ -1173,41 +1199,41 @@
 		int i = 0;
 		bfcp list = bfcp_gw_get_list();
 		if(!list) {
-			ast_cli(fd,"  BFCP Server List doesn't exist?\n");
+			ast_cli(fd, "\tBFCP Server List doesn't exist?\n");
 			return RESULT_FAILURE;
 		}
 		if (list->list_conferences == NULL) {
-			ast_cli(fd,"  The BFCP Server List is NULL.\n");
+			ast_cli(fd, "\tThe BFCP Server List is NULL.\n");
 			return RESULT_FAILURE;
 		}
 		if (list->Actual_number_conference == 0) {
-			ast_cli(fd,"  There are no active conferences in the BFCP Server.\n");
+			ast_cli(fd, "\tThere are no active conferences in the BFCP Server.\n");
 			return RESULT_FAILURE;
 		}		
 		for(i=0; i < list->Actual_number_conference; i++) {
 			if (list->list_conferences[i].conferenceID == ID) {
-				ast_cli(fd,"ConferenceID: %li\n\n", list->list_conferences[i].conferenceID);
+				ast_cli(fd, "ConferenceID: %li\n\n", list->list_conferences[i].conferenceID);
 				list_floor = list->list_conferences[i].floor;
 				if (list_floor !=NULL) {
-					ast_cli(fd,"Maximum number of floors in the conference: %d\n", list_floor->number_floors + 1);
-					ast_cli(fd,"FLOORS\n");
+					ast_cli(fd, "Maximum number of floors in the conference: %d\n", list_floor->number_floors + 1);
+					ast_cli(fd, "FLOORS\n");
 					for(j= 0;j<list_floor->actual_number_floors;j++) {
-						ast_cli(fd,"FloorID: %u, ", list_floor->floors[j].floorID);
-						ast_cli(fd,"ChairID: %u", list_floor->floors[j].chairID);
+						ast_cli(fd, "floor: %u, ", list_floor->floors[j].floorID);
+						ast_cli(fd, "ChairID: %u", list_floor->floors[j].chairID);
 						if (list_floor->floors[j].floorState==0)
-							ast_cli(fd," state: FREE\n");
+							ast_cli(fd, " state: FREE\n");
 						else if (list_floor->floors[j].floorState==1)
-							ast_cli(fd," state: ACCEPTED\n");
+							ast_cli(fd, " state: ACCEPTED\n");
 						else if (list_floor->floors[j].floorState>=2)
-							ast_cli(fd," state: GRANTED\n");
+							ast_cli(fd, " state: GRANTED\n");
 						else
-							ast_cli(fd," state: error!\n");
-						ast_cli(fd,"Number of simultaneous granted users: %d\n", list_floor->floors[j].limit_granted_floor-1);
+							ast_cli(fd, " state: error!\n");
+						ast_cli(fd, "Number of simultaneous granted users: %d\n", list_floor->floors[j].limit_granted_floor-1);
 						query= list_floor->floors[j].floorquery;
 						if (query!=NULL)
-							ast_cli(fd,"QUERY LIST\n");
+							ast_cli(fd, "QUERY LIST\n");
 						while(query) {
-							ast_cli(fd,"User: %i\n",query->userID);
+							ast_cli(fd, "User: %i\n",query->userID);
 							query=query->next;
 						}
 					}
@@ -1215,119 +1241,119 @@
 				list_user = list->list_conferences[i].user;
 				if (list_user !=NULL) {
 					user=list_user->users;
-					ast_cli(fd,"Maximum number of request per floors in the conference: %d\n", list_user->max_number_floor_request);
-					ast_cli(fd,"USERS\n");
+					ast_cli(fd, "Maximum number of request per floors in the conference: %d\n", list_user->max_number_floor_request);
+					ast_cli(fd, "USERS\n");
 					while(user){
-						ast_cli(fd,"userID: %u (Display Name: %s, URI: %s)\n",
+						ast_cli(fd, "userID: %u (Display Name: %s, URI: %s)\n",
 							user->userID,
 							user->user_display_name ? user->user_display_name : "none",
 							user->user_URI ? user->user_URI : "none");
-						ast_cli(fd,"\n");
+						ast_cli(fd, "\n");
 						user= user->next;
 					}
 				}
 				list_link = list->list_conferences[i].pending;
 				if (list_link !=NULL) {
 					node=list_link->head;
-					if (node) ast_cli(fd,"PENDING LIST\n");
+					if (node) ast_cli(fd, "PENDING LIST\n");
 					while(node!=NULL) {
-						ast_cli(fd,"FloorRequestID: %u userID: %u Priority: %u Queue_position: %u ", node->floorRequestID, node->userID, node->priority, node->queue_position); 
+						ast_cli(fd, "FloorRequestID: %u userID: %u Priority: %u Queue_position: %u ", node->floorRequestID, node->userID, node->priority, node->queue_position); 
 						if (node->beneficiaryID!=0)
-							ast_cli(fd,"BeneficiaryID: %u", node->beneficiaryID);
-						ast_cli(fd,"\n");
-						FloorID=node->floorID;
-						while(FloorID) {
-							ast_cli(fd,"FloorID: %u ", FloorID->floorID);
-							if (FloorID->chair_info!=NULL)
-								ast_cli(fd,"chair_information: %s ", FloorID->chair_info);
-							if (FloorID->status==0)
-								ast_cli(fd," state: FREE\n");
-							else if (FloorID->status==1)
-								ast_cli(fd," state: ACCEPTED\n");
-							else if (FloorID->status>=2)
-								ast_cli(fd," state: GRANTED\n");                          
+							ast_cli(fd, "BeneficiaryID: %u", node->beneficiaryID);
+						ast_cli(fd, "\n");
+						floor=node->floor;
+						while(floor) {
+							ast_cli(fd, "floor: %u ", floor->floorID);
+							if (floor->chair_info!=NULL)
+								ast_cli(fd, "chair_information: %s ", floor->chair_info);
+							if (floor->status==0)
+								ast_cli(fd, " state: FREE\n");
+							else if (floor->status==1)
+								ast_cli(fd, " state: ACCEPTED\n");
+							else if (floor->status>=2)
+								ast_cli(fd, " state: GRANTED\n");                          
 							else
-								ast_cli(fd," state: error!\n");
-							FloorID= FloorID->next;
+								ast_cli(fd, " state: error!\n");
+							floor= floor->next;
 						}
 						query_floorrequest=node->floorrequest;
 						while(query_floorrequest) {
-							ast_cli(fd,"Floor Request query: %u \n", query_floorrequest->userID);
+							ast_cli(fd, "Floor Request query: %u \n", query_floorrequest->userID);
 							query_floorrequest= query_floorrequest->next;
 						}
 						node= node->next;
-						ast_cli(fd,"-----------------\n");
+						ast_cli(fd, "-----------------\n");
 					}
 				}
 				list_link = list->list_conferences[i].accepted;
 				if (list_link !=NULL) {
 					node=list_link->head;
 					if (node)
-						ast_cli(fd,"ACCEPTED LIST\n");
+						ast_cli(fd, "ACCEPTED LIST\n");
 					while(node!=NULL) {
-						ast_cli(fd,"FloorRequestID: %u userID: %u Priority: %u Queue_position: %u ", node->floorRequestID, node->userID, node->priority, node->queue_position);
+						ast_cli(fd, "FloorRequestID: %u userID: %u Priority: %u Queue_position: %u ", node->floorRequestID, node->userID, node->priority, node->queue_position);
 						if (node->beneficiaryID!=0)
-							ast_cli(fd,"BeneficiaryID: %u", node->beneficiaryID);
-						ast_cli(fd,"\n");
-						FloorID=node->floorID;
-						while(FloorID) {
-							ast_cli(fd,"FloorID: %u ", FloorID->floorID);
-							if (FloorID->chair_info!=NULL)
-								ast_cli(fd,"chair_information: %s ", FloorID->chair_info);
-							if (FloorID->status==0)
-								ast_cli(fd," state: FREE\n");
-							else if (FloorID->status==1)
-								ast_cli(fd," state: ACCEPTED\n");
-							else if (FloorID->status>=2)
-								ast_cli(fd," state: GRANTED\n");
-							else ast_cli(fd," state: error!\n");
-							FloorID= FloorID->next;
+							ast_cli(fd, "BeneficiaryID: %u", node->beneficiaryID);
+						ast_cli(fd, "\n");
+						floor=node->floor;
+						while(floor) {
+							ast_cli(fd, "floor: %u ", floor->floorID);
+							if (floor->chair_info!=NULL)
+								ast_cli(fd, "chair_information: %s ", floor->chair_info);
+							if (floor->status==0)
+								ast_cli(fd, " state: FREE\n");
+							else if (floor->status==1)
+								ast_cli(fd, " state: ACCEPTED\n");
+							else if (floor->status>=2)
+								ast_cli(fd, " state: GRANTED\n");
+							else ast_cli(fd, " state: error!\n");
+							floor= floor->next;
 						}
 					
 						query_floorrequest=node->floorrequest;
 						while(query_floorrequest) {
-							ast_cli(fd,"Floor Request query: %u \n", query_floorrequest->userID);
+							ast_cli(fd, "Floor Request query: %u \n", query_floorrequest->userID);
 							query_floorrequest= query_floorrequest->next;
 						}
 						node= node->next;
-						ast_cli(fd,"-----------------\n");
+						ast_cli(fd, "-----------------\n");
 					}
 				}
 				list_link = list->list_conferences[i].granted;
 				if (list_link !=NULL) {
 					node=list_link->head;
 					if (node)
-						ast_cli(fd,"GRANTED LIST\n");
+						ast_cli(fd, "GRANTED LIST\n");
 					while(node!=NULL) {
-						ast_cli(fd,"FloorRequestID: %u userID: %u Priority: %u Queue_position: %u ", node->floorRequestID, node->userID, node->priority, node->queue_position);
+						ast_cli(fd, "FloorRequestID: %u userID: %u Priority: %u Queue_position: %u ", node->floorRequestID, node->userID, node->priority, node->queue_position);
 						if (node->beneficiaryID!=0)
-							ast_cli(fd,"BeneficiaryID: %u", node->beneficiaryID);
-						ast_cli(fd,"\n");
-						FloorID=node->floorID;
-						while(FloorID) {
-							ast_cli(fd,"FloorID: %u ", FloorID->floorID);
-							if (FloorID->chair_info!=NULL)
-								ast_cli(fd,"chair_information: %s ", FloorID->chair_info);
-							if (FloorID->status==0)
-								ast_cli(fd," state: FREE\n");
-							else if (FloorID->status==1)
-								ast_cli(fd," state: ACCEPTED\n");
-							else if (FloorID->status>=2)
-								ast_cli(fd," state: GRANTED\n");
-							else ast_cli(fd," state: error!\n"); 
-							FloorID= FloorID->next;
+							ast_cli(fd, "BeneficiaryID: %u", node->beneficiaryID);
+						ast_cli(fd, "\n");
+						floor=node->floor;
+						while(floor) {
+							ast_cli(fd, "floor: %u ", floor->floorID);
+							if (floor->chair_info!=NULL)
+								ast_cli(fd, "chair_information: %s ", floor->chair_info);
+							if (floor->status==0)
+								ast_cli(fd, " state: FREE\n");
+							else if (floor->status==1)
+								ast_cli(fd, " state: ACCEPTED\n");
+							else if (floor->status>=2)
+								ast_cli(fd, " state: GRANTED\n");
+							else ast_cli(fd, " state: error!\n"); 
+							floor= floor->next;
 						}
 						query_floorrequest=node->floorrequest;
 						while(query_floorrequest) {
-							ast_cli(fd,"Floor Request query: %u \n", query_floorrequest->userID);
+							ast_cli(fd, "Floor Request query: %u \n", query_floorrequest->userID);
 							query_floorrequest= query_floorrequest->next;
 						}
 						node= node->next;
-						ast_cli(fd,"-----------------\n");
+						ast_cli(fd, "-----------------\n");
 					}
 				}			
 			} else {
-				ast_cli(fd,"  There is no active conference with ID %lu in the BFCP Server.\n",ID);
+				ast_cli(fd, "\tThere is no active conference with ID %lu in the BFCP Server.\n",ID);
 				return RESULT_FAILURE;
 			}		
 		}
@@ -1346,7 +1372,7 @@
 		return RESULT_SHOWUSAGE;
 
 	if(AST_LIST_EMPTY(&confs)) {
-		ast_cli(fd,"  There are no active conferences in the BFCP Server.\n");
+		ast_cli(fd, "\tThere are no active conferences in the BFCP Server.\n");
 		return RESULT_FAILURE;
 	}	
 
@@ -1355,44 +1381,44 @@
 	if(cnf) {
 		AST_LIST_LOCK(&confs);
 		struct ast_conf_user *user;
-		ast_cli(fd,"  Users in Conference %lu:\n",ID);
+		ast_cli(fd, "\tUsers in Conference %lu:\n",ID);
 		AST_LIST_TRAVERSE(&cnf->userlist, user, list) {
 			if(!user)
 				break;
 			user_count++;
-			ast_cli(fd,"    %d: UserID %u (Display Name: %s, URI: %s)",
+			ast_cli(fd, "\t  %d: UserID %u (Display Name: %s, URI: %s)",
 				user_count,
 				user->xconuserID,
 				user->xconuserdisplay ? user->xconuserdisplay : "none",
 				user->xconuseruri ? user->xconuseruri : "none");
 			if(cnf->audiofloorID)
-				ast_cli(fd,", Audio %s", user->audiofloorstatus ? bfcp_status[user->audiofloorstatus-1].description : "NOT GRANTED");
+				ast_cli(fd, ", Audio %s", user->audiofloorstatus ? bfcp_status[user->audiofloorstatus-1].description : "NOT GRANTED");
 			if(cnf->videofloorID)
-				ast_cli(fd,", Video %s", user->videofloorstatus ? bfcp_status[user->videofloorstatus-1].description : "NOT GRANTED");
-			ast_cli(fd,"\n");
+				ast_cli(fd, ", Video %s", user->videofloorstatus ? bfcp_status[user->videofloorstatus-1].description : "NOT GRANTED");
+			ast_cli(fd, "\n");
 		}
 		if(!AST_LIST_EMPTY(&cnf->dconuserlist)) {	/* There are remote users too */
 			struct dcon_user *dconuser;
-			ast_cli(fd,"  Remote Users in Conference %lu:\n",ID);
+			ast_cli(fd, "\tRemote Users in Conference %lu:\n",ID);
 			AST_LIST_TRAVERSE(&cnf->dconuserlist, dconuser, list) {
 				if(!dconuser)
 					break;
 				user_count++;
-				ast_cli(fd,"    %d: UserID %u (Display Name: %s, URI: %s)",
+				ast_cli(fd, "\t  %d: UserID %u (Display Name: %s, URI: %s)",
 					user_count,
 					dconuser->xconuserID,
 					dconuser->xconuserdisplay ? dconuser->xconuserdisplay : "none",
 					dconuser->xconuseruri ? dconuser->xconuseruri : "none");
 				if(cnf->audiofloorID)
-					ast_cli(fd,", Audio %s", dconuser->audiofloorstatus ? bfcp_status[dconuser->audiofloorstatus-1].description : "NOT GRANTED");
+					ast_cli(fd, ", Audio %s", dconuser->audiofloorstatus ? bfcp_status[dconuser->audiofloorstatus-1].description : "NOT GRANTED");
 				if(cnf->videofloorID)
-					ast_cli(fd,", Video %s", dconuser->videofloorstatus ? bfcp_status[dconuser->videofloorstatus-1].description : "NOT GRANTED");
-				ast_cli(fd," (REMOTE USER)\n");
+					ast_cli(fd, ", Video %s", dconuser->videofloorstatus ? bfcp_status[dconuser->videofloorstatus-1].description : "NOT GRANTED");
+				ast_cli(fd, " (REMOTE USER)\n");
 			}
 		}
 		AST_LIST_UNLOCK(&confs);
 	} else {
-		ast_cli(fd,"  There is no active conference with ID %lu in the BFCP Server.\n",ID);
+		ast_cli(fd, "\tThere is no active conference with ID %lu in the BFCP Server.\n",ID);
 		return RESULT_FAILURE;
 	}	
 
@@ -1413,7 +1439,7 @@
 		return RESULT_SHOWUSAGE;
 
 	if(AST_LIST_EMPTY(&confs)) {
-		ast_cli(fd,"  There are no active conferences in the BFCP Server.\n");
+		ast_cli(fd, "\tThere are no active conferences in the BFCP Server.\n");
 		return RESULT_FAILURE;
 	}	
 
@@ -1422,44 +1448,44 @@
 		AST_LIST_LOCK(&confs);
 		struct ast_conf_user *user = xcon_get_user(cnf, userID);
 		if(user) {
-			ast_cli(fd,"  UserID %u (Display Name: %s, URI: %s)",
+			ast_cli(fd, "\tUserID %u (Display Name: %s, URI: %s)",
 				user->xconuserID,
 				user->xconuserdisplay ? user->xconuserdisplay : "none",
 				user->xconuseruri ? user->xconuseruri : "none");
 			if(cnf->audiofloorID)
-				ast_cli(fd,", Audio %s", user->audiofloorstatus ? bfcp_status[user->audiofloorstatus-1].description : "NOT GRANTED");
+				ast_cli(fd, ", Audio %s", user->audiofloorstatus ? bfcp_status[user->audiofloorstatus-1].description : "NOT GRANTED");
 			if(cnf->videofloorID)

[... 34069 lines stripped ...]


More information about the svn-commits mailing list