提交 90da4deb authored 作者: Anthony Minessale's avatar Anthony Minessale

do not retry so fast on failed outbound subs

上级 cd1bab67
......@@ -461,6 +461,7 @@ typedef enum {
SUB_STATE_SUBED,
SUB_STATE_UNSUBSCRIBE,
SUB_STATE_FAILED,
SUB_STATE_FAIL_WAIT,
SUB_STATE_EXPIRED,
SUB_STATE_NOSUB,
v_STATE_LAST
......
......@@ -4245,8 +4245,6 @@ void sofia_presence_handle_sip_r_subscribe(int status,
default:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "status (%d) != 200, updated state to SUB_STATE_FAILED.\n", status);
gw_sub_ptr->state = SUB_STATE_FAILED;
gw_sub_ptr->expires = switch_epoch_time_now(NULL);
gw_sub_ptr->retry = switch_epoch_time_now(NULL);
if (!sofia_private) {
nua_handle_destroy(nh);
......
......@@ -253,6 +253,15 @@ void sofia_sub_check_gateway(sofia_profile_t *profile, time_t now)
break;
case SUB_STATE_FAILED:
gw_sub_ptr->expires = now;
gw_sub_ptr->retry = now + gw_sub_ptr->retry_seconds;
gw_sub_ptr->state = SUB_STATE_FAIL_WAIT;
break;
case SUB_STATE_FAIL_WAIT:
if (!gw_sub_ptr->retry || now >= gw_sub_ptr->retry) {
gw_sub_ptr->state = SUB_STATE_UNSUBED;
}
break;
case SUB_STATE_TRYING:
if (gw_sub_ptr->retry && now >= gw_sub_ptr->retry) {
gw_sub_ptr->state = SUB_STATE_UNSUBED;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论