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

Freeswitch SVN silik0n at freeswitch.org
Wed Jul 30 14:50:47 EDT 2008


Author: silik0n
Date: Wed Jul 30 14:50:47 2008
New Revision: 9209

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

Log:
record the local servers ip not the domain so we can figure out the right server later

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	Wed Jul 30 14:50:47 2008
@@ -24,7 +24,7 @@
  * Contributor(s):
  * 
  * Anthony Minessale II <anthmct at yahoo.com>
- * Ken Rice, Asteria Solutions Group, Inc <ken at asteriasgi.com>
+ * Ken Rice <krice at cometsig.com>
  * Paul D. Tinsley <pdt at jackhammer.org>
  * Bret McDanel <trixter AT 0xdecafbad.com>
  *

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	Wed Jul 30 14:50:47 2008
@@ -385,9 +385,10 @@
 		long expires = (long) switch_timestamp(NULL);
 		char *profile_name = switch_event_get_header(event, "orig-profile-name");
 		char *to_user = switch_event_get_header(event, "orig-to-user");
-		char *to_host = switch_event_get_header(event, "orig-to-host");
 		sofia_profile_t *profile = NULL;
 
+		char guess_ip4[256];
+
 		if (exp_str) {
 			expires += atol(exp_str);
 		}
@@ -408,9 +409,10 @@
 
 		switch_mutex_lock(profile->ireg_mutex);
 		sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
-
+		
+		switch_find_local_ip(guess_ip4, sizeof(guess_ip4), AF_INET);
 		sql = switch_mprintf("insert into sip_registrations values ('%q', '%q','%q','%q','Registered', '%q', %ld, '%q', '%q', '%q')",
-							 call_id, from_user, from_host, contact_str, rpid, expires, user_agent, to_user, to_host);
+							 call_id, from_user, from_host, contact_str, rpid, expires, user_agent, to_user, guess_ip4);
 
 		if (sql) {
 			sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);

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	Wed Jul 30 14:50:47 2008
@@ -24,7 +24,7 @@
  * Contributor(s):
  * 
  * Anthony Minessale II <anthmct at yahoo.com>
- * Ken Rice, krice at suspicious.org  (work sponsored by CopperCom, Inc and Asteria Solutions Group, Inc)
+ * Ken Rice, <krice at cometsig.com>  (work sponsored by Comet Signaling LLC, CopperCom, Inc and Asteria Solutions Group, Inc)
  * Paul D. Tinsley <pdt at jackhammer.org>
  * Bret McDanel <trixter AT 0xdecafbad.com>
  * Marcel Barbulescu <marcelbarbulescu at gmail.com>
@@ -738,6 +738,7 @@
 
 	if (exptime) {
 		const char *agent = "dunno";
+		char guess_ip4[256];
 
 		if (sip->sip_user_agent) {
 			agent = sip->sip_user_agent->g_string;
@@ -750,9 +751,10 @@
 		}
 		switch_mutex_lock(profile->ireg_mutex);
 		sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
-
+		
+		switch_find_local_ip(guess_ip4, sizeof(guess_ip4), AF_INET);
 		sql = switch_mprintf("insert into sip_registrations values ('%q', '%q','%q','%q','%q', '%q', %ld, '%q', '%q', '%q')", call_id,
-							 to_user, to_host, contact_str, reg_desc, rpid, (long) switch_timestamp(NULL) + (long) exptime * 2, agent, from_user, from_host);
+							 to_user, to_host, contact_str, reg_desc, rpid, (long) switch_timestamp(NULL) + (long) exptime * 2, agent, from_user,  guess_ip4);
 		if (sql) {
 			sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
 		}



More information about the Freeswitch-svn mailing list