mitigate zoiper endless loop bug by not sending notify with expires: 0 when zoiper is detected
This commit is contained in:
parent
8258abc3ac
commit
cc986efede
|
@ -3602,6 +3602,8 @@ void sofia_presence_handle_sip_i_subscribe(int status,
|
||||||
contact_user = sip->sip_contact->m_url->url_user;
|
contact_user = sip->sip_contact->m_url->url_user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
full_agent = sip_header_as_string(nh->nh_home, (void *) sip->sip_user_agent);
|
||||||
|
|
||||||
//tl_gets(tags, NUTAG_SUBSTATE_REF(sub_state), TAG_END());
|
//tl_gets(tags, NUTAG_SUBSTATE_REF(sub_state), TAG_END());
|
||||||
|
|
||||||
//sip->sip_subscription_state->ss_substate
|
//sip->sip_subscription_state->ss_substate
|
||||||
|
@ -3756,7 +3758,6 @@ void sofia_presence_handle_sip_i_subscribe(int status,
|
||||||
|
|
||||||
sub_state = nua_substate_active;
|
sub_state = nua_substate_active;
|
||||||
|
|
||||||
full_agent = sip_header_as_string(nh->nh_home, (void *) sip->sip_user_agent);
|
|
||||||
while (ap) {
|
while (ap) {
|
||||||
switch_snprintf(accept + strlen(accept), sizeof(accept) - strlen(accept), "%s%s ", ap->ac_type, ap->ac_next ? "," : "");
|
switch_snprintf(accept + strlen(accept), sizeof(accept) - strlen(accept), "%s%s ", ap->ac_type, ap->ac_next ? "," : "");
|
||||||
ap = ap->ac_next;
|
ap = ap->ac_next;
|
||||||
|
@ -3896,10 +3897,16 @@ void sofia_presence_handle_sip_i_subscribe(int status,
|
||||||
if (mod_sofia_globals.debug_presence > 0) {
|
if (mod_sofia_globals.debug_presence > 0) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Sending NOTIFY with Expires [0] and State [%s]\n", sstr);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Sending NOTIFY with Expires [0] and State [%s]\n", sstr);
|
||||||
}
|
}
|
||||||
nua_notify(nh,
|
|
||||||
SIPTAG_EXPIRES_STR("0"),
|
if (zstr(full_agent) || !switch_stristr("zoiper", full_agent)) {
|
||||||
SIPTAG_SUBSCRIPTION_STATE_STR(sstr),
|
/* supress endless loop bug with zoiper */
|
||||||
TAG_END());
|
nua_notify(nh,
|
||||||
|
SIPTAG_EXPIRES_STR("0"),
|
||||||
|
SIPTAG_SUBSCRIPTION_STATE_STR(sstr),
|
||||||
|
TAG_END());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue