sofia_profile_t *profile;
switch_event_t *event;
int rowcount;
+ int noreg;
};
struct presence_helper {
if (!h.rowcount) {
+ h.noreg++;
switch_safe_free(sql);
/* find ones with presence_id defined that are not registred */
sql = switch_mprintf("select sip_from_user, sip_from_host, 'Registered', '', '', "
if ((p = strchr(free_me, '@'))) *p = '\0';
user = free_me;
}
-
}
if (zstr(proto)) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", user, host);
+ if (h->noreg) {
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Force-Direction", "inbound");
+ }
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "status", status);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "rpid", rpid);
if (helper->event) {
switch_stream_handle_t stream = { 0 };
const char *direction = switch_str_nil(switch_event_get_header(helper->event, "presence-call-direction"));
+ const char *force_direction = switch_str_nil(switch_event_get_header(helper->event, "force-direction"));
const char *uuid = switch_str_nil(switch_event_get_header(helper->event, "unique-id"));
const char *event_status = switch_str_nil(switch_event_get_header(helper->event, "status"));
const char *astate = switch_str_nil(switch_event_get_header(helper->event, "astate"));
if (is_dialog) {
SWITCH_STANDARD_STREAM(stream);
}
+
+ if (!zstr(force_direction)) {
+ direction = force_direction;
+ }
if (!strcasecmp(direction, "outbound")) {
direction = "recipient";