[asterisk-commits] rizzo: branch rizzo/astobj2 r75380 - /team/rizzo/astobj2/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 17 09:37:42 CDT 2007


Author: rizzo
Date: Tue Jul 17 09:37:41 2007
New Revision: 75380

URL: http://svn.digium.com/view/asterisk?view=rev&rev=75380
Log:
use ast_parse_arg for "stunaddr"


Modified:
    team/rizzo/astobj2/channels/chan_sip.c

Modified: team/rizzo/astobj2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/astobj2/channels/chan_sip.c?view=diff&rev=75380&r1=75379&r2=75380
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Tue Jul 17 09:37:41 2007
@@ -17874,13 +17874,10 @@
 		M_INT_GE("registertimeout", global_reg_timeout, 1, DEFAULT_REGISTRATION_TIMEOUT)
 		M_F("registerattempts", global_regattempts_max = atoi(v->value);)	/* XXX */
 		M_F("stunaddr", {
-			if (!(hp = ast_gethostbyname(v->value, &ahp))) {
-				ast_log(LOG_WARNING, "Invalid address: %s\n", v->value);
-			} else {
-				memcpy(&stunaddr.sin_addr, hp->h_addr, sizeof(stunaddr.sin_addr));
-				stunaddr.sin_family = AF_INET;
-				stunaddr.sin_port = htons(3478);
-			} } )
+			stunaddr.sin_port = htons(3478); /* default */
+			if (ast_parse_arg(v->value, PARSE_INADDR, &stunaddr))
+				ast_log(LOG_WARNING, "Invalid stun address: %s\n", v->value);
+			} )
 		M_F("bindaddr", {
 			if (!(hp = ast_gethostbyname(v->value, &ahp))) {
 				ast_log(LOG_WARNING, "Invalid address: %s\n", v->value);




More information about the asterisk-commits mailing list