[asterisk-commits] tzafrir: branch tzafrir/monitor-rtp-14 r213891 - /team/tzafrir/monitor-rtp-14...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 24 18:25:24 CDT 2009


Author: tzafrir
Date: Mon Aug 24 18:25:21 2009
New Revision: 213891

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=213891
Log:
actually read monitor.conf in reload of res_monitor.c

Modified:
    team/tzafrir/monitor-rtp-14/res/res_monitor.c

Modified: team/tzafrir/monitor-rtp-14/res/res_monitor.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/tzafrir/monitor-rtp-14/res/res_monitor.c?view=diff&rev=213891&r1=213890&r2=213891
==============================================================================
--- team/tzafrir/monitor-rtp-14/res/res_monitor.c (original)
+++ team/tzafrir/monitor-rtp-14/res/res_monitor.c Mon Aug 24 18:25:21 2009
@@ -68,6 +68,11 @@
 static char rtp_server_name[BUFSIZ];
 /*! Sender hostname in SIP packets we send */
 static char reporting_host[BUFSIZ];
+
+/* Used for sending metadata to recording server: */
+static int sip_socket = -1;
+static struct sockaddr_in sip_server_addr;
+
 static in_port_t rtp_portbase_rx = 9000;
 static in_port_t rtp_portbase_tx = 11000;
 static char *monitor_synopsis = "Monitor a channel";
@@ -768,6 +773,16 @@
 
 static int load_module(void)
 {
+	if(reload_config(CHANNEL_MODULE_LOAD))
+		return AST_MODULE_LOAD_DECLINE;
+	if(rtp_server_name[0] != '\0') {
+		if((sip_socket = sip_stream(rtp_server_name, 5060, &sip_server_addr)) < 0) {
+			ast_log(LOG_WARNING,
+				"Failed to create SIP stream to '%s:%d'\n",
+				rtp_server_name, 5060);
+			return AST_MODULE_LOAD_DECLINE;
+		}
+	}
 	ast_register_application("Monitor", start_monitor_exec, monitor_synopsis, monitor_descrip);
 	ast_register_application("StopMonitor", stop_monitor_exec, stopmonitor_synopsis, stopmonitor_descrip);
 	ast_register_application("ChangeMonitor", change_monitor_exec, changemonitor_synopsis, changemonitor_descrip);
@@ -795,6 +810,8 @@
 	ast_manager_unregister("PauseMonitor");
 	ast_manager_unregister("UnpauseMonitor");
 
+	if(sip_socket != -1)
+		close(sip_socket);
 	return 0;
 }
 




More information about the asterisk-commits mailing list