don't send presence for hangup if you never sent it for early in presence_disable_early mode, it causes issues in yealink
This commit is contained in:
parent
434a286b48
commit
8dd4c8f9f1
|
@ -2700,13 +2700,18 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
|
||||||
const char *to_user = switch_str_nil(switch_event_get_header(helper->event, "variable_sip_to_user"));
|
const char *to_user = switch_str_nil(switch_event_get_header(helper->event, "variable_sip_to_user"));
|
||||||
const char *from_user = switch_str_nil(switch_event_get_header(helper->event, "variable_sip_from_user"));
|
const char *from_user = switch_str_nil(switch_event_get_header(helper->event, "variable_sip_from_user"));
|
||||||
const char *disable_early = switch_str_nil(switch_event_get_header(helper->event, "variable_presence_disable_early"));
|
const char *disable_early = switch_str_nil(switch_event_get_header(helper->event, "variable_presence_disable_early"));
|
||||||
|
const char *answer_epoch = switch_str_nil(switch_event_get_header(helper->event, "variable_answer_epoch"));
|
||||||
|
int answered = 0;
|
||||||
char *clean_to_user = NULL;
|
char *clean_to_user = NULL;
|
||||||
char *clean_from_user = NULL;
|
char *clean_from_user = NULL;
|
||||||
int force_status = 0;
|
int force_status = 0;
|
||||||
|
|
||||||
char *call_info_state = switch_event_get_header(helper->event, "presence-call-info-state");
|
|
||||||
int term = 0;
|
int term = 0;
|
||||||
|
|
||||||
|
if (answer_epoch) {
|
||||||
|
answered = atoi(answer_epoch);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (user_agent && switch_stristr("snom", user_agent) && uuid) {
|
if (user_agent && switch_stristr("snom", user_agent) && uuid) {
|
||||||
default_dialog = "full" ;
|
default_dialog = "full" ;
|
||||||
}
|
}
|
||||||
|
@ -2845,7 +2850,8 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
|
||||||
|
|
||||||
|
|
||||||
if ((sofia_test_pflag(profile, PFLAG_PRESENCE_DISABLE_EARLY) || switch_true(disable_early)) &&
|
if ((sofia_test_pflag(profile, PFLAG_PRESENCE_DISABLE_EARLY) || switch_true(disable_early)) &&
|
||||||
(!zstr(call_info_state) && (!strcasecmp(call_info_state, "alterting") || !strcasecmp(call_info_state, "progressing")))) {
|
((!zstr(astate) && (!strcasecmp(astate, "early") || !strcasecmp(astate, "ringing") || (!strcasecmp(astate, "terminated") && !answered))))) {
|
||||||
|
switch_safe_free(stream.data);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue