[asterisk-commits] file: branch file/issue11797 r203225 - in /team/file/issue11797: channels/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 25 12:31:09 CDT 2009


Author: file
Date: Thu Jun 25 12:31:05 2009
New Revision: 203225

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=203225
Log:
Address comments from the review from Russell.

Modified:
    team/file/issue11797/channels/chan_multicast_rtp.c
    team/file/issue11797/res/res_rtp_multicast.c

Modified: team/file/issue11797/channels/chan_multicast_rtp.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/file/issue11797/channels/chan_multicast_rtp.c?view=diff&rev=203225&r1=203224&r2=203225
==============================================================================
--- team/file/issue11797/channels/chan_multicast_rtp.c (original)
+++ team/file/issue11797/channels/chan_multicast_rtp.c Thu Jun 25 12:31:05 2009
@@ -111,7 +111,7 @@
 {
 	char *tmp = ast_strdupa(data), *multicast_type = tmp, *destination, *control;
 	struct ast_rtp_instance *instance;
-	struct sockaddr_in control_address = { 0, }, destination_address = { 0, };
+	struct sockaddr_in control_address = { .sin_family = AF_INET, }, destination_address = { .sin_family = AF_INET, };
 	struct ast_channel *chan;
 	int fmt = ast_best_codec(format);
 
@@ -167,7 +167,7 @@
 {
 	if (ast_channel_register(&multicast_rtp_tech)) {
 		ast_log(LOG_ERROR, "Unable to register channel class 'MulticastRTP'\n");
-		return AST_MODULE_LOAD_FAILURE;
+		return AST_MODULE_LOAD_DECLINE;
 	}
 
 	return AST_MODULE_LOAD_SUCCESS;

Modified: team/file/issue11797/res/res_rtp_multicast.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/file/issue11797/res/res_rtp_multicast.c?view=diff&rev=203225&r1=203224&r2=203225
==============================================================================
--- team/file/issue11797/res/res_rtp_multicast.c (original)
+++ team/file/issue11797/res/res_rtp_multicast.c Thu Jun 25 12:31:05 2009
@@ -151,7 +151,7 @@
 		return -1;
 	}
 
-	memcpy(&control_packet.ip, &remote_address.sin_addr, sizeof(control_packet.ip));
+	control_packet.ip = remote_address.sin_addr.s_addr;
 	control_packet.port = htonl(ntohs(remote_address.sin_port));
 
 	/* Based on a recommendation by Brian West who did the FreeSWITCH implementation we send control packets twice */
@@ -221,7 +221,12 @@
 
 	/* Finally send it out to the eager phones listening for us */
 	ast_rtp_instance_get_remote_address(instance, &remote_address);
-	res = sendto(multicast->socket, (void *)rtpheader, f->datalen + hdrlen, 0, (struct sockaddr *)&remote_address, sizeof(remote_address));
+	res = sendto(multicast->socket, (void *) rtpheader, f->datalen + hdrlen, 0, (struct sockaddr *) &remote_address, sizeof(remote_address));
+
+	if (res < 0) {
+		ast_log(LOG_ERROR, "Multicast RTP Transmission error to %s:%u: %s\n",
+			ast_inet_ntoa(remote_address.sin_addr), ntohs(remote_address.sin_port), strerror(errno));
+	}
 
 	/* If we were forced to duplicate the frame free the new one */
 	if (frame != f) {
@@ -253,7 +258,4 @@
 	return 0;
 }
 
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Multicast RTP Engine",
-		.load = load_module,
-		.unload = unload_module,
-		);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Multicast RTP Engine");




More information about the asterisk-commits mailing list