<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[Freeswitch-trunk][16575] </title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<div id="header">FreeSWITCH Subversion</div>
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://fisheye.freeswitch.org/changelog/FreeSWITCH?cs=16575">16575</a></dd>
<dt>Author</dt> <dd>mrene</dd>
<dt>Date</dt> <dd>2010-02-05 01:05:33 -0600 (Fri, 05 Feb 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre><a href="http://jira.freeswitch.org/browse/MODSOFIA-46">MODSOFIA-46</a> with some NULL-proofing</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunksrcmodendpointsmod_sofiasofiac">freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_sofiasofia_gluec">freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_sofiasofia_regc">freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunksrcmodendpointsmod_sofiasofiac"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (16574 => 16575)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c        2010-02-05 02:46:45 UTC (rev 16574)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c        2010-02-05 07:05:33 UTC (rev 16575)
</span><span class="lines">@@ -888,24 +888,63 @@
</span><span class="cx"> void event_handler(switch_event_t *event)
</span><span class="cx"> {
</span><span class="cx">         char *subclass, *sql;
</span><ins>+        char *class;
+        switch_event_t *pevent;
</ins><span class="cx">
</span><del>-        if ((subclass = switch_event_get_header(event, "orig-event-subclass")) && !strcasecmp(subclass, MY_EVENT_REGISTER)) {
-                char *from_user = switch_event_get_header(event, "orig-from-user");
-                char *from_host = switch_event_get_header(event, "orig-from-host");
-                char *to_host = switch_event_get_header(event, "orig-to-host");
-                char *contact_str = switch_event_get_header(event, "orig-contact");
-                char *exp_str = switch_event_get_header(event, "orig-expires");
-                char *rpid = switch_event_get_header(event, "orig-rpid");
-                char *call_id = switch_event_get_header(event, "orig-call-id");
-                char *user_agent = switch_event_get_header(event, "orig-user-agent");
</del><ins>+        /* Get Original Event Name */
+        class = switch_event_get_header_nil(event, "orig-event-name");
+        if (!strcasecmp(class, "PRESENCE_IN")) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "\nGot Presence IN event via MultiCast\n");
+                if (switch_event_create(&pevent, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
+                                 switch_event_add_header_string(pevent, SWITCH_STACK_BOTTOM, "proto", switch_event_get_header_nil(event, "orig-proto"));
+ switch_event_add_header_string(pevent, SWITCH_STACK_BOTTOM, "login", switch_event_get_header_nil(event, "orig-login"));
+ switch_event_add_header_string(pevent, SWITCH_STACK_BOTTOM, "from", switch_event_get_header_nil(event, "orig-from"));
+ switch_event_add_header_string(pevent, SWITCH_STACK_BOTTOM, "rpid", switch_event_get_header_nil(event, "orig-rpid"));
+ switch_event_add_header_string(pevent, SWITCH_STACK_BOTTOM, "status", switch_event_get_header_nil(event, "orig-status"));
+ switch_event_add_header_string(pevent, SWITCH_STACK_BOTTOM, "answer-state", switch_event_get_header_nil(event, "orig-answer-state"));
+ switch_event_add_header_string(pevent, SWITCH_STACK_BOTTOM, "alt_event_type", switch_event_get_header_nil(event, "orig-alt_event_type"));
+ switch_event_add_header_string(pevent, SWITCH_STACK_BOTTOM, "presence-call-direction", switch_event_get_header_nil(event, "orig-presence-call-direction"));
+ switch_event_add_header_string(pevent, SWITCH_STACK_BOTTOM, "channel-state", switch_event_get_header_nil(event, "orig-channel-state"));
+ switch_event_add_header_string(pevent, SWITCH_STACK_BOTTOM, "call-direction", switch_event_get_header_nil(event, "orig-call-direction"));
+                        /* we cannot use switch_event_fire, or otherwise we'll start an endless loop */
+                        sofia_presence_event_handler(pevent);
+                        return;
+                } else {                
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "\nCannot inject PRESENCE_IN event\n");
+                        return;
+                }
+        } else if (!strcasecmp(class, "MESSAGE_WAITING")) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "\nGot MWI event via MultiCast\n");
+                if (switch_event_create(&pevent, SWITCH_EVENT_MESSAGE_WAITING) == SWITCH_STATUS_SUCCESS) {
+                        switch_event_add_header_string(pevent, SWITCH_STACK_BOTTOM, "MWI-Messages-Waiting", switch_event_get_header_nil(event, "orig-MWI-Messages-Waiting"));
+                        switch_event_add_header_string(pevent, SWITCH_STACK_BOTTOM, "MWI-Message-Account", switch_event_get_header_nil(event, "orig-MWI-Message-Account"));
+                        switch_event_add_header_string(pevent, SWITCH_STACK_BOTTOM, "MWI-Voice-Message", switch_event_get_header_nil(event, "orig-MWI-Voice-Message"));
+                        /* we cannot use switch_event_fire, or otherwise we'll start an endless loop */
+                        sofia_presence_mwi_event_handler(pevent);
+                        return;
+                } else {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "\nCannot inject MWI event\n");
+                        return;
+                }
+        } else if ((subclass = switch_event_get_header_nil(event, "orig-event-subclass")) && !strcasecmp(subclass, MY_EVENT_REGISTER)) {
+                char *from_user = switch_event_get_header_nil(event, "orig-from-user");
+                char *from_host = switch_event_get_header_nil(event, "orig-from-host");
+                char *to_host = switch_event_get_header_nil(event, "orig-to-host");
+                char *contact_str = switch_event_get_header_nil(event, "orig-contact");
+                char *exp_str = switch_event_get_header_nil(event, "orig-expires");
+                char *rpid = switch_event_get_header_nil(event, "orig-rpid");
+                char *call_id = switch_event_get_header_nil(event, "orig-call-id");
+                char *user_agent = switch_event_get_header_nil(event, "orig-user-agent");
</ins><span class="cx">                 long expires = (long) switch_epoch_time_now(NULL);
</span><del>-                char *profile_name = switch_event_get_header(event, "orig-profile-name");
-                char *to_user = switch_event_get_header(event, "orig-to-user");
-                char *presence_hosts = switch_event_get_header(event, "orig-presence-hosts");
-                char *network_ip = switch_event_get_header(event, "orig-network-ip");
-                char *network_port = switch_event_get_header(event, "orig-network-port");
-                char *username = switch_event_get_header(event, "orig-username");
-                char *realm = switch_event_get_header(event, "orig-realm");
</del><ins>+                char *profile_name = switch_event_get_header_nil(event, "orig-profile-name");
+                char *to_user = switch_event_get_header_nil(event, "orig-to-user");
+                char *presence_hosts = switch_event_get_header_nil(event, "orig-presence-hosts");
+                char *network_ip = switch_event_get_header_nil(event, "orig-network-ip");
+                char *network_port = switch_event_get_header_nil(event, "orig-network-port");
+                char *username = switch_event_get_header_nil(event, "orig-username");
+                char *realm = switch_event_get_header_nil(event, "orig-realm");
+                char *orig_server_host = switch_event_get_header_nil(event, "orig-FreeSWITCH-IPv4");
+                char *orig_hostname = switch_event_get_header_nil(event, "orig-FreeSWITCH-Hostname");
</ins><span class="cx">                 char *fixed_contact_str = NULL;
</span><span class="cx">
</span><span class="cx">                 sofia_profile_t *profile = NULL;
</span><span class="lines">@@ -916,7 +955,7 @@
</span><span class="cx">                 char *mwi_user = NULL;
</span><span class="cx">                 char *mwi_host = NULL;
</span><span class="cx">
</span><del>-                if ((mwi_account = switch_event_get_header(event, "orig-mwi-account"))) {
</del><ins>+                if ((mwi_account = switch_event_get_header_nil(event, "orig-mwi-account"))) {
</ins><span class="cx">                         dup_mwi_account = strdup(mwi_account);
</span><span class="cx">                         switch_assert(dup_mwi_account != NULL);
</span><span class="cx">                         sofia_glue_get_user_host(dup_mwi_account, &mwi_user, &mwi_host);
</span><span class="lines">@@ -963,7 +1002,20 @@
</span><span class="cx">                                 sptr = strchr(fixed_contact_str, '\0') - 1;
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        switch_snprintf(sptr, len - (sptr - fixed_contact_str), ";fs_path=sip:%s%s", to_host, eptr ? eptr : ">");
</del><ins>+                        switch (mod_sofia_globals.rewrite_multicasted_fs_path) {
+                                case 1:
+                                        switch_snprintf(sptr, len - (sptr - fixed_contact_str), ";fs_path=sip:%s%s", to_host, eptr ? eptr : ">");
+                                break;
+                                case 2:
+                                        switch_snprintf(sptr, len - (sptr - fixed_contact_str), ";fs_path=sip:%s%s", orig_server_host, eptr ? eptr : ">");
+                                break;
+                                case 3:
+                                        switch_snprintf(sptr, len - (sptr - fixed_contact_str), ";fs_path=sip:%s%s", orig_hostname, eptr ? eptr : ">");
+                                break;
+                                default:
+                                        switch_snprintf(sptr, len - (sptr - fixed_contact_str), ";fs_path=sip:%s%s", to_host, eptr ? eptr : ">");
+                                break;
+                        }
</ins><span class="cx">
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Rewrote contact string from '%s' to '%s'\n", contact_str, fixed_contact_str);
</span><span class="cx">                         contact_str = fixed_contact_str;
</span><span class="lines">@@ -975,10 +1027,12 @@
</span><span class="cx">                 switch_find_local_ip(guess_ip4, sizeof(guess_ip4), NULL, AF_INET);
</span><span class="cx">                 sql = switch_mprintf("insert into sip_registrations "
</span><span class="cx">                                                          "(call_id, sip_user, sip_host, presence_hosts, contact, status, rpid, expires,"
</span><del>-                                                         "user_agent, server_user, server_host, profile_name, hostname, network_ip, network_port, sip_username, sip_realm, mwi_user, mwi_host) "
-                                                         "values ('%q','%q','%q','%q','%q','Registered','%q',%ld, '%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q')",
</del><ins>+                                                         "user_agent, server_user, server_host, profile_name, hostname, network_ip, network_port, sip_username, sip_realm,"
+                                                         "mwi_user, mwi_host, orig_server_host, orig_hostname) "
+                                                         "values ('%q','%q','%q','%q','%q','Registered','%q',%ld, '%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q')",
</ins><span class="cx">                                                          call_id, from_user, from_host, presence_hosts, contact_str, rpid, expires, user_agent, to_user, guess_ip4,
</span><del>-                                                         profile_name, mod_sofia_globals.hostname, network_ip, network_port, username, realm, mwi_user, mwi_host);
</del><ins>+                                                         profile_name, mod_sofia_globals.hostname, network_ip, network_port, username, realm, mwi_user, mwi_host,
+                                                         orig_server_host, orig_hostname);
</ins><span class="cx">
</span><span class="cx">                 if (sql) {
</span><span class="cx">                         sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
</span><span class="lines">@@ -2526,7 +2580,16 @@
</span><span class="cx">                         } else if (!strcasecmp(var, "auto-restart")) {
</span><span class="cx">                                 mod_sofia_globals.auto_restart = switch_true(val);
</span><span class="cx">                         } else if (!strcasecmp(var, "rewrite-multicasted-fs-path")) {
</span><del>-                                mod_sofia_globals.rewrite_multicasted_fs_path = switch_true(val);
</del><ins>+                                if( (!strcasecmp(val, "to_host")) || (!strcasecmp(val, "1")) ) {
+                                        /* old behaviour */
+         mod_sofia_globals.rewrite_multicasted_fs_path = 1;
+                                } else if (!strcasecmp(val, "original_server_host")) {
+         mod_sofia_globals.rewrite_multicasted_fs_path = 2;
+                                } else if (!strcasecmp(val, "original_hostname")) {
+         mod_sofia_globals.rewrite_multicasted_fs_path = 3;
+                                } else {
+                                        mod_sofia_globals.rewrite_multicasted_fs_path = SWITCH_FALSE;
+                                }
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_sofiasofia_gluec"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (16574 => 16575)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c        2010-02-05 02:46:45 UTC (rev 16574)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c        2010-02-05 07:05:33 UTC (rev 16575)
</span><span class="lines">@@ -3835,25 +3835,27 @@
</span><span class="cx">
</span><span class="cx">         char reg_sql[] =
</span><span class="cx">                 "CREATE TABLE sip_registrations (\n"
</span><del>-                " call_id VARCHAR(255),\n"
-                " sip_user VARCHAR(255),\n"
-                " sip_host VARCHAR(255),\n"
-                " presence_hosts VARCHAR(255),\n"
-                " contact VARCHAR(1024),\n"
-                " status VARCHAR(255),\n"
-                " rpid VARCHAR(255),\n"
-                " expires INTEGER,\n"
-                " user_agent VARCHAR(255),\n"
-                " server_user VARCHAR(255),\n"
-                " server_host VARCHAR(255),\n"
-                " profile_name VARCHAR(255),\n"
-                " hostname VARCHAR(255),\n"
-                " network_ip VARCHAR(255),\n"
-                " network_port VARCHAR(6),\n"
-                " sip_username VARCHAR(255),\n"
-                " sip_realm VARCHAR(255),\n"
-                " mwi_user VARCHAR(255),\n"
-                " mwi_host VARCHAR(255)\n"
</del><ins>+                " call_id VARCHAR(255),\n"
+                " sip_user VARCHAR(255),\n"
+                " sip_host VARCHAR(255),\n"
+                " presence_hosts VARCHAR(255),\n"
+                " contact VARCHAR(1024),\n"
+                " status VARCHAR(255),\n"
+                " rpid VARCHAR(255),\n"
+                " expires INTEGER,\n"
+                " user_agent VARCHAR(255),\n"
+                " server_user VARCHAR(255),\n"
+                " server_host VARCHAR(255),\n"
+                " profile_name VARCHAR(255),\n"
+                " hostname VARCHAR(255),\n"
+                " network_ip VARCHAR(255),\n"
+                " network_port VARCHAR(6),\n"
+                " sip_username VARCHAR(255),\n"
+                " sip_realm VARCHAR(255),\n"
+                " mwi_user VARCHAR(255),\n"
+                " mwi_host VARCHAR(255),\n"
+                " orig_server_host VARCHAR(255),\n"
+                " orig_hostname VARCHAR(255)\n"
</ins><span class="cx">                 ");\n";
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -3963,6 +3965,8 @@
</span><span class="cx">                         "create index sr_network_port on sip_registrations (network_port)",
</span><span class="cx">                         "create index sr_sip_username on sip_registrations (sip_username)",
</span><span class="cx">                         "create index sr_sip_realm on sip_registrations (sip_realm)",
</span><ins>+                        "create index sr_orig_server_host on sip_registrations (orig_server_host)",
+                        "create index sr_orig_hostname on sip_registrations (orig_hostname)",
</ins><span class="cx">                         "create index ss_call_id on sip_subscriptions (call_id)",
</span><span class="cx">                         "create index ss_hostname on sip_subscriptions (hostname)",
</span><span class="cx">                         "create index ss_network_ip on sip_subscriptions (network_ip)",
</span><span class="lines">@@ -4011,7 +4015,8 @@
</span><span class="cx">                 test_sql = switch_mprintf("delete from sip_registrations where (contact like '%%TCP%%' "
</span><span class="cx">                                                                  "or status like '%%TCP%%' or status like '%%TLS%%') and hostname='%q' "
</span><span class="cx">                                                                  "and network_ip like '%%' and network_port like '%%' and sip_username "
</span><del>-                                                                 "like '%%' and mwi_user like '%%' and mwi_host like '%%'",
</del><ins>+                                                                 "like '%%' and mwi_user like '%%' and mwi_host like '%%' "
+                                                                 "and orig_server_host like '%%' and orig_hostname like '%%'",
</ins><span class="cx">                                                                  mod_sofia_globals.hostname);
</span><span class="cx">
</span><span class="cx">                 if (switch_odbc_handle_exec(odbc_dbh, test_sql, NULL, NULL) != SWITCH_ODBC_SUCCESS) {
</span><span class="lines">@@ -4101,7 +4106,8 @@
</span><span class="cx">                 test_sql = switch_mprintf("delete from sip_registrations where (contact like '%%TCP%%' "
</span><span class="cx">                                                                  "or status like '%%TCP%%' or status like '%%TLS%%') and hostname='%q' "
</span><span class="cx">                                                                  "and network_ip like '%%' and network_port like '%%' and sip_username "
</span><del>-                                                                 "like '%%' and mwi_user like '%%' and mwi_host like '%%'",
</del><ins>+                                                                 "like '%%' and mwi_user like '%%' and mwi_host like '%%'"
+                                                                 "and orig_server_host like '%%' and orig_hostname like '%%'",
</ins><span class="cx">                                                                  mod_sofia_globals.hostname);
</span><span class="cx">                 
</span><span class="cx">                 switch_core_db_test_reactive(db, test_sql, "DROP TABLE sip_registrations", reg_sql);
</span><span class="lines">@@ -4171,6 +4177,8 @@
</span><span class="cx">                 switch_core_db_exec(db, "create index if not exists sr_network_port on sip_registrations (network_port)", NULL, NULL, NULL);
</span><span class="cx">                 switch_core_db_exec(db, "create index if not exists sr_sip_username on sip_registrations (sip_username)", NULL, NULL, NULL);
</span><span class="cx">                 switch_core_db_exec(db, "create index if not exists sr_sip_realm on sip_registrations (sip_realm)", NULL, NULL, NULL);
</span><ins>+                switch_core_db_exec(db, "create index if not exists sr_orig_server_host on sip_registrations (orig_server_host)", NULL, NULL, NULL);
+                switch_core_db_exec(db, "create index if not exists sr_orig_hostname on sip_registrations (orig_hostname)", NULL, NULL, NULL);
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx">                 switch_core_db_exec(db, "create index if not exists ss_call_id on sip_subscriptions (call_id)", NULL, NULL, NULL);
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_sofiasofia_regc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c (16574 => 16575)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c        2010-02-05 02:46:45 UTC (rev 16574)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c        2010-02-05 07:05:33 UTC (rev 16575)
</span><span class="lines">@@ -1136,11 +1136,13 @@
</span><span class="cx">                 switch_find_local_ip(guess_ip4, sizeof(guess_ip4), NULL, AF_INET);
</span><span class="cx">                 sql = switch_mprintf("insert into sip_registrations "
</span><span class="cx">                                                          "(call_id,sip_user,sip_host,presence_hosts,contact,status,rpid,expires,"
</span><del>-                                                         "user_agent,server_user,server_host,profile_name,hostname,network_ip,network_port,sip_username,sip_realm,mwi_user,mwi_host) "
-                                                         "values ('%q','%q', '%q','%q','%q','%q', '%q', %ld, '%q', '%q', '%q', '%q', '%q', '%q', '%q','%q','%q','%q','%q')",
</del><ins>+                                                         "user_agent,server_user,server_host,profile_name,hostname,network_ip,network_port,sip_username,sip_realm,"
+                                                         "mwi_user,mwi_host, orig_server_host, orig_hostname) "
+                                                         "values ('%q','%q', '%q','%q','%q','%q', '%q', %ld, '%q', '%q', '%q', '%q', '%q', '%q', '%q','%q','%q','%q','%q','%q','%q')",
</ins><span class="cx">                                                          call_id, to_user, reg_host, profile->presence_hosts ? profile->presence_hosts : reg_host,
</span><span class="cx">                                                          contact_str, reg_desc, rpid, (long) switch_epoch_time_now(NULL) + (long) exptime * 2,
</span><del>-                                                         agent, from_user, guess_ip4, profile->name, mod_sofia_globals.hostname, network_ip, network_port_c, username, realm, mwi_user, mwi_host);
</del><ins>+                                                         agent, from_user, guess_ip4, profile->name, mod_sofia_globals.hostname, network_ip, network_port_c, username, realm,
+                                                         mwi_user, mwi_host, guess_ip4, mod_sofia_globals.hostname);
</ins><span class="cx">                                                         
</span><span class="cx">                 if (sql) {
</span><span class="cx">                         sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>