[Freeswitch-branches] [commit] r13554 - freeswitch/branches/brian/trunk/src/mod/endpoints/mod_sofia
FreeSWITCH SVN
brian at freeswitch.org
Tue Jun 2 14:49:39 PDT 2009
Author: brian
Date: Tue Jun 2 16:49:39 2009
New Revision: 13554
Log:
tweak sla to work inside out
Modified:
freeswitch/branches/brian/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
freeswitch/branches/brian/trunk/src/mod/endpoints/mod_sofia/sofia_sla.c
Modified: freeswitch/branches/brian/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/branches/brian/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (original)
+++ freeswitch/branches/brian/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Tue Jun 2 16:49:39 2009
@@ -3547,7 +3547,8 @@
" aor VARCHAR(255),\n"
" profile_name VARCHAR(255),\n"
" hostname VARCHAR(255),\n"
- " contact_str VARCHAR(255)\n"
+ " contact_str VARCHAR(255),\n"
+ " network_ip VARCHAR(255)\n"
");\n";
char shared_appearance_dialogs_sql[] =
Modified: freeswitch/branches/brian/trunk/src/mod/endpoints/mod_sofia/sofia_sla.c
==============================================================================
--- freeswitch/branches/brian/trunk/src/mod/endpoints/mod_sofia/sofia_sla.c (original)
+++ freeswitch/branches/brian/trunk/src/mod/endpoints/mod_sofia/sofia_sla.c Tue Jun 2 16:49:39 2009
@@ -159,7 +159,7 @@
*/
aor = switch_mprintf("sip:%s@%s;transport=%s", sip->sip_contact->m_url->url_user,
- sip->sip_from->a_url->url_host, sofia_glue_transport2str(transport));
+ profile->sipip, sofia_glue_transport2str(transport));
/*
* ok, and now that we HAVE the AOR, we REALLY should go check in the XML config and see if this particular
@@ -180,9 +180,9 @@
}
if ((sql =
- switch_mprintf("insert into sip_shared_appearance_subscriptions (subscriber, call_id, aor, profile_name, hostname, contact_str) "
- "values ('%q','%q','%q','%q','%q','%q')",
- subscriber, sip->sip_call_id->i_id, aor, profile->name, mod_sofia_globals.hostname, contact_str))) {
+ switch_mprintf("insert into sip_shared_appearance_subscriptions (subscriber, call_id, aor, profile_name, hostname, contact_str, network_ip) "
+ "values ('%q','%q','%q','%q','%q','%q','%q')",
+ subscriber, sip->sip_call_id->i_id, aor, profile->name, mod_sofia_globals.hostname, contact_str, network_ip))) {
sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
}
@@ -298,7 +298,7 @@
/* calculate the AOR we're trying to tell people about. should probably double-check before derferencing XXX MTK */
aor = switch_mprintf("sip:%s@%s;transport=%s", sip->sip_to->a_url->url_user,
- sip->sip_to->a_url->url_host, sofia_glue_transport2str(transport));
+ profile->sipip, sofia_glue_transport2str(transport));
/* this isn't sufficient because on things like the polycom, the subscriber is the 'main' ext number, but the
* 'main' ext number isn't in ANY of the headers they send us in the notify. of course.
@@ -312,8 +312,10 @@
if (sip->sip_payload && sip->sip_payload->pl_data) {
sql = switch_mprintf("select subscriber,call_id,aor,profile_name,hostname,contact_str from sip_shared_appearance_subscriptions where "
- "aor='%q' and subscriber<>'%q' and profile_name='%q' and hostname='%q'",
- aor, contact, profile->name, mod_sofia_globals.hostname);
+ "aor='%q' and profile_name='%q' and hostname='%q'",
+ aor, profile->name, mod_sofia_globals.hostname);
+ printf("WTF %s\n", sql);
+
helper.profile = profile;
@@ -340,7 +342,6 @@
nua_handle_t *nh;
char *route_uri = NULL;
-
nh = nua_handle_by_call_id(helper->profile->nua, call_id); /* that's all you need to find the subscription's nh */
if (nh) {
More information about the Freeswitch-branches
mailing list