[svn-commits] tzafrir: branch tzafrir/monitor-rtp r214072 - /team/tzafrir/monitor-rtp/res/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Aug 25 14:40:33 CDT 2009


Author: tzafrir
Date: Tue Aug 25 14:40:29 2009
New Revision: 214072

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

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

Modified: team/tzafrir/monitor-rtp/res/res_monitor.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/tzafrir/monitor-rtp/res/res_monitor.c?view=diff&rev=214072&r1=214071&r2=214072
==============================================================================
--- team/tzafrir/monitor-rtp/res/res_monitor.c (original)
+++ team/tzafrir/monitor-rtp/res/res_monitor.c Tue Aug 25 14:40:29 2009
@@ -258,6 +258,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;
 
@@ -959,6 +964,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_xml("Monitor", start_monitor_exec);
 	ast_register_application_xml("StopMonitor", stop_monitor_exec);
 	ast_register_application_xml("ChangeMonitor", change_monitor_exec);
@@ -986,6 +1001,8 @@
 	ast_manager_unregister("PauseMonitor");
 	ast_manager_unregister("UnpauseMonitor");
 
+	if(sip_socket != -1)
+		close(sip_socket);
 	return 0;
 }
 




More information about the svn-commits mailing list