FS-3794 sekil can you test this one

This commit is contained in:
Anthony Minessale
2012-02-01 19:32:22 -06:00
parent b4943888ff
commit 80050b5b27
2 changed files with 13 additions and 8 deletions
+13 -4
View File
@@ -571,13 +571,15 @@ static int sofia_presence_dialog_callback(void *pArg, int argc, char **argv, cha
struct dialog_helper *helper = (struct dialog_helper *) pArg;
if (argc == 3) {
switch_set_string(helper->status, argv[0]);
switch_set_string(helper->rpid, argv[1]);
switch_set_string(helper->presence_id, argv[2]);
if (!helper->hits) {
switch_set_string(helper->status, argv[0]);
switch_set_string(helper->rpid, argv[1]);
switch_set_string(helper->presence_id, argv[2]);
}
helper->hits++;
}
return -1;
return 0;
}
@@ -856,6 +858,7 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
char *call_info_state = switch_event_get_header(event, "presence-call-info-state");
switch_console_callback_match_t *matches;
struct presence_helper helper = { 0 };
int hup = 0;
if (!mod_sofia_globals.running) {
return;
@@ -877,6 +880,7 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
if (status && switch_stristr("CS_HANGUP", status)) {
status = "Available";
hup = 1;
}
if (rpid) {
@@ -1091,6 +1095,11 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
sofia_glue_execute_sql_callback(profile, profile->ireg_mutex, sql, sofia_presence_dialog_callback, &dh);
switch_safe_free(sql);
if (hup && dh.hits > 0) {
goto done;
}
if (zstr(call_id) && (dh.hits && presence_source && (!strcasecmp(presence_source, "register") || switch_stristr("register", status)))) {
goto done;