if (type && !strcasecmp(type, "unavailable")) {
signal = LDL_SIGNAL_PRESENCE_OUT;
+ } else if (type && !strcasecmp(type, "probe")) {
+ signal = LDL_SIGNAL_PRESENCE_PROBE;
} else {
signal = LDL_SIGNAL_PRESENCE_IN;
}
}
-
if (resource && strstr(resource, "talk") && (buffer = apr_hash_get(handle->probe_hash, id, APR_HASH_KEY_STRING))) {
apr_cpystrn(buffer->buf, from, buffer->len);
fflush(stderr);
buffer->hit = 1;
}
- if (!type || (type && strcasecmp(type, "probe"))) {
-
- if (handle->session_callback) {
- handle->session_callback(handle, NULL, signal, to, id, status ? status : "n/a", show ? show : "n/a");
- }
- }
-
+ if (handle->session_callback) {
+ handle->session_callback(handle, NULL, signal, to, id, status ? status : "n/a", show ? show : "n/a");
+ }
return IKS_FILTER_EAT;
}
}
if (is_special(to)) {
- ldl_handle_send_presence(profile->handle, to, from, NULL, "unknown", "Click To Call");
+ ldl_handle_send_presence(profile->handle, to, from, NULL, NULL, "Click To Call");
}
#if 0
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", to);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
+ //switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Click To Call");
switch_event_fire(&event);
}
switch_event_fire(&event);
}
break;
+ case LDL_SIGNAL_PRESENCE_PROBE:
+ if (is_special(to)) {
+ ldl_handle_send_presence(profile->handle, to, from, NULL, NULL, "Click To Call");
+ }
+ break;
case LDL_SIGNAL_PRESENCE_IN:
if ((sql = switch_mprintf("update subscriptions set show='%q', status='%q' where sub_from='%q'", msg, subject, from))) {
if (is_special(to)) {
- ldl_handle_send_presence(profile->handle, to, from, NULL, "unknown", "Click To Call");
+ ldl_handle_send_presence(profile->handle, to, from, NULL, NULL, "Click To Call");
}
#if 0
if (is_special(to)) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", to);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
+ //switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "unknown");
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "Click To Call");
switch_event_fire(&event);
}
}
break;
#endif
+
case LDL_SIGNAL_PRESENCE_OUT:
if ((sql = switch_mprintf("update subscriptions set show='%q', status='%q' where sub_from='%q'", msg, subject, from))) {