[asterisk-commits] anthonyl: branch anthonyl/gtalk-bindaddr r45594 - /team/anthonyl/gtalk-bindad...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Oct 18 13:30:43 MST 2006


Author: anthonyl
Date: Wed Oct 18 15:30:39 2006
New Revision: 45594

URL: http://svn.digium.com/view/asterisk?rev=45594&view=rev
Log:
patch written by misaksen

Modified:
    team/anthonyl/gtalk-bindaddr/channels/chan_gtalk.c

Modified: team/anthonyl/gtalk-bindaddr/channels/chan_gtalk.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/gtalk-bindaddr/channels/chan_gtalk.c?rev=45594&r1=45593&r2=45594&view=diff
==============================================================================
--- team/anthonyl/gtalk-bindaddr/channels/chan_gtalk.c (original)
+++ team/anthonyl/gtalk-bindaddr/channels/chan_gtalk.c Wed Oct 18 15:30:39 2006
@@ -1658,6 +1658,8 @@
 	struct ast_codec_pref prefs;
 	struct aji_client_container *clients;
 	struct gtalk_candidate *global_candidates = NULL;
+	struct hostent *hp;
+	struct ast_hostent ahp;
 
 	cfg = ast_config_load(GOOGLE_CONFIG);
 	if (!cfg)
@@ -1681,6 +1683,13 @@
 			ast_parse_allow_disallow(&prefs, &global_capability, var->value, 1);
 		else if (!strcasecmp(var->name, "context"))
 			ast_copy_string(context, var->value, sizeof(context));
+		else if (!strcasecmp(var->name, "bindaddr")) {
+			if (!(hp = ast_gethostbyname(var->value, &ahp))) {
+				ast_log(LOG_WARNING, "Invalid address: %s\n", var->value);
+			} else {
+				memcpy(&bindaddr.sin_addr, hp->h_addr, sizeof(bindaddr.sin_addr));
+			}
+		}
 /*  Idea to allow for custom candidates  */
 /*
 		else if (!strcasecmp(var->name, "candidate")) {



More information about the asterisk-commits mailing list