[Freeswitch-svn] [commit] r4894 - freeswitch/trunk/src/mod/endpoints/mod_sofia

Freeswitch SVN mikej at freeswitch.org
Sun Apr 8 12:32:08 EDT 2007


Author: mikej
Date: Sun Apr  8 12:32:08 2007
New Revision: 4894

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c

Log:
merged patch from http://jira.freeswitch.org/browse/MDXMLINT-4, thanks bblack

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c	Sun Apr  8 12:32:08 2007
@@ -247,6 +247,7 @@
 	switch_event_t *event;
 	const char *rpid = "unknown";
 	const char *display = "\"user\"";
+	char network_addr[80];
 
 	/* all callers must confirm that sip, sip->sip_request and sip->sip_contact are not NULL */
 	assert(sip != NULL && sip->sip_contact != NULL && sip->sip_request != NULL);
@@ -325,7 +326,8 @@
 	}
 
 	if (!authorization || stale) {
-		snprintf(params, sizeof(params), "from_user=%s&from_host=%s&contact=%s", from_user, from_host, contact_str);
+		get_addr(network_addr, sizeof(network_addr), &((struct sockaddr_in *) msg_addrinfo(nua_current_request(nua))->ai_addr)->sin_addr);
+		snprintf(params, sizeof(params), "network_addr=%s&from_user=%s&from_host=%s&contact=%s", network_addr, from_user, from_host, contact_str);
 
 
 		if (switch_xml_locate("directory", "domain", "name", from_host, &xml, &domain, params) != SWITCH_STATUS_SUCCESS) {
@@ -780,3 +782,4 @@
 
 
 
+



More information about the Freeswitch-svn mailing list