[Freeswitch-svn] [commit] r8778 - freeswitch/trunk/src/mod/endpoints/mod_sofia
Freeswitch SVN
anthm at freeswitch.org
Fri Jun 6 10:52:42 EDT 2008
Author: anthm
Date: Fri Jun 6 10:52:41 2008
New Revision: 8778
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
Log:
add CtRiX's patch, beat him up if it causes a regression
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 Fri Jun 6 10:52:41 2008
@@ -1453,8 +1453,8 @@
struct cb_helper *cb = (struct cb_helper *) pArg;
char *contact;
- if (!switch_strlen_zero(argv[0]) && (contact = sofia_glue_get_url_from_contact(argv[0], 1))) {
- cb->stream->write_function(cb->stream, "sofia/%s/%s,", cb->profile->name, contact + 4);
+ if (!switch_strlen_zero(argv[0]) && (contact = sofia_glue_get_url_from_contact(argv[0], 1)) ) {
+ cb->stream->write_function(cb->stream, "%ssofia/%s/%s,", argv[1], cb->profile->name, contact + 4);
free(contact);
}
@@ -1466,6 +1466,7 @@
char *data;
char *user = NULL;
char *domain = NULL;
+ char *concat = NULL;
char *profile_name = NULL;
char *p;
sofia_profile_t *profile = NULL;
@@ -1496,6 +1497,14 @@
if ((domain = strchr(user, '@'))) {
*domain++ = '\0';
+ if ( (concat = strchr( domain, '/')) ) {
+ *concat++ = '\0';
+ }
+ }
+ else {
+ if ( (concat = strchr( user, '/')) ) {
+ *concat++ = '\0';
+ }
}
if (!profile_name && domain) {
@@ -1528,10 +1537,11 @@
cb.stream = &mystream;
if (exclude_contact) {
- sql = switch_mprintf("select contact from sip_registrations where sip_user='%q' and sip_host='%q' and contact not like '%%%s%%'",
- user, domain, exclude_contact);
+ sql = switch_mprintf("select contact, '%q' from sip_registrations where sip_user='%q' and sip_host='%q' and contact not like '%%%s%%'",
+ ( concat != NULL ) ? concat : "", user, domain, exclude_contact);
} else {
- sql = switch_mprintf("select contact from sip_registrations where sip_user='%q' and sip_host='%q'", user, domain);
+ sql = switch_mprintf("select contact, '%q' from sip_registrations where sip_user='%q' and sip_host='%q'",
+ ( concat != NULL ) ? concat : "", user, domain);
}
switch_assert(sql);
More information about the Freeswitch-svn
mailing list