git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4885 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-04-07 21:13:54 +00:00
parent 7c82c7abd7
commit 46a282bda2
2 changed files with 24 additions and 9 deletions

View File

@ -559,6 +559,8 @@ static int on_disco_default(void *user_data, ikspak *pak)
globals.logger(DL_LOG_DEBUG, "FixME!!! node=[%s]\n", node?node:""); globals.logger(DL_LOG_DEBUG, "FixME!!! node=[%s]\n", node?node:"");
} else if (pak->subtype == IKS_TYPE_GET) { } else if (pak->subtype == IKS_TYPE_GET) {
if ((iq = iks_new("iq"))) { if ((iq = iks_new("iq"))) {
int all = 0;
iks_insert_attrib(iq, "from", handle->login); iks_insert_attrib(iq, "from", handle->login);
iks_insert_attrib(iq, "to", pak->from->full); iks_insert_attrib(iq, "to", pak->from->full);
iks_insert_attrib(iq, "id", pak->id); iks_insert_attrib(iq, "id", pak->id);
@ -577,12 +579,16 @@ static int on_disco_default(void *user_data, ikspak *pak)
goto fail; goto fail;
} }
if (!strcasecmp(ns, FEATURE_DISCO) && !node) {
all++;
}
iks_insert_attrib(tag, "category", "gateway"); iks_insert_attrib(tag, "category", "gateway");
iks_insert_attrib(tag, "type", "voice"); iks_insert_attrib(tag, "type", "voice");
iks_insert_attrib(tag, "name", "LibDingaLing"); iks_insert_attrib(tag, "name", "LibDingaLing");
for (x = 0; FEATURES[x].name; x++) { for (x = 0; FEATURES[x].name; x++) {
if (!ns || !strcasecmp(ns, FEATURES[x].name)) { if (all || !ns || !strcasecmp(ns, FEATURES[x].name)) {
if (!(tag = iks_insert (query, "feature"))) { if (!(tag = iks_insert (query, "feature"))) {
goto fail; goto fail;
} }

View File

@ -108,7 +108,9 @@ struct mdl_profile {
char *login; char *login;
char *password; char *password;
char *message; char *message;
#ifdef AUTO_REPLY
char *auto_reply; char *auto_reply;
#endif
char *dialplan; char *dialplan;
char *ip; char *ip;
char *extip; char *extip;
@ -723,13 +725,15 @@ static void dl_logger(char *file, const char *func, int line, int level, char *f
if (ll) { if (ll) {
if ((xmltxt = strchr(ll, ':'))) { if ((xmltxt = strchr(ll, ':'))) {
*xmltxt++ = '\0'; *xmltxt++ = '\0';
xml = switch_xml_parse_str(xmltxt, strlen(xmltxt)); if (strlen(xmltxt) > 2) {
form = switch_xml_toxml(xml); xml = switch_xml_parse_str(xmltxt, strlen(xmltxt));
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, level, form = switch_xml_toxml(xml);
"%s:\n-------------------------------------------------------------------------------\n" switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, level,
"%s\n", ll, form); "%s:\n-------------------------------------------------------------------------------\n"
switch_xml_free(xml); "%s\n", ll, form);
free(data); switch_xml_free(xml);
free(data);
}
} }
} }
} else { } else {
@ -1959,8 +1963,10 @@ static void set_profile_val(mdl_profile_t *profile, char *var, char *val)
switch_set_flag(profile, TFLAG_TIMER); switch_set_flag(profile, TFLAG_TIMER);
} else if (!strcasecmp(var, "dialplan")) { } else if (!strcasecmp(var, "dialplan")) {
profile->dialplan = switch_core_strdup(module_pool, val); profile->dialplan = switch_core_strdup(module_pool, val);
#ifdef AUTO_REPLY // gotta fix looping on this
} else if (!strcasecmp(var, "auto-reply")) { } else if (!strcasecmp(var, "auto-reply")) {
profile->auto_reply = switch_core_strdup(module_pool, val); profile->auto_reply = switch_core_strdup(module_pool, val);
#endif
} else if (!strcasecmp(var, "name")) { } else if (!strcasecmp(var, "name")) {
profile->name = switch_core_strdup(module_pool, val); profile->name = switch_core_strdup(module_pool, val);
} else if (!strcasecmp(var, "message")) { } else if (!strcasecmp(var, "message")) {
@ -2396,6 +2402,8 @@ static ldl_status handle_signalling(ldl_handle_t * handle, ldl_session_t * dlses
switch_mutex_unlock(profile->mutex); switch_mutex_unlock(profile->mutex);
if (is_special(to)) { if (is_special(to)) {
ldl_handle_send_presence(profile->handle, to, from, NULL, NULL, "Click To Call", profile->avatar); ldl_handle_send_presence(profile->handle, to, from, NULL, NULL, "Click To Call", profile->avatar);
} else {
ldl_handle_send_presence(profile->handle, to, from, NULL, NULL, "Authenticated.\nCome to ClueCon!\nhttp://www.cluecon.com", profile->avatar);
} }
#if 0 #if 0
if (is_special(to)) { if (is_special(to)) {
@ -2491,12 +2499,13 @@ static ldl_status handle_signalling(ldl_handle_t * handle, ldl_session_t * dlses
char *proto = MDL_CHAT_PROTO; char *proto = MDL_CHAT_PROTO;
char *pproto = NULL, *ffrom = NULL; char *pproto = NULL, *ffrom = NULL;
char *hint; char *hint;
#ifdef AUTO_REPLY
if (profile->auto_reply) { if (profile->auto_reply) {
ldl_handle_send_msg(handle, ldl_handle_send_msg(handle,
(profile->user_flags & LDL_FLAG_COMPONENT) ? to : ldl_handle_get_login(profile->handle), from, "", (profile->user_flags & LDL_FLAG_COMPONENT) ? to : ldl_handle_get_login(profile->handle), from, "",
profile->auto_reply); profile->auto_reply);
} }
#endif
if (strchr(to, '+')) { if (strchr(to, '+')) {
pproto = strdup(to); pproto = strdup(to);