Changeset 2661 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
- Timestamp:
- Apr 28, 2009 10:19:49 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
r2596 r2661 962 962 963 963 if (param->code/100 != 2 || param->status != PJ_SUCCESS) { 964 965 pjsip_publishc_destroy(param->pubc); 966 acc->publish_sess = NULL; 967 964 968 if (param->status != PJ_SUCCESS) { 965 969 char errmsg[PJ_ERR_MSG_SIZE]; … … 969 973 "Client publication (PUBLISH) failed, status=%d, msg=%s", 970 974 param->status, errmsg)); 975 } else if (param->code == 412) { 976 /* 412 (Conditional Request Failed) 977 * The PUBLISH refresh has failed, retry with new one. 978 */ 979 pjsua_pres_init_publish_acc(acc->index); 980 971 981 } else { 972 982 PJ_LOG(1,(THIS_FILE, … … 976 986 } 977 987 978 pjsip_publishc_destroy(param->pubc); 979 acc->publish_sess = NULL; 988 } else { 989 if (param->expiration == -1) { 990 /* Could happen if server "forgot" to include Expires header 991 * in the response. We will not renew, so destroy the pubc. 992 */ 993 pjsip_publishc_destroy(param->pubc); 994 acc->publish_sess = NULL; 995 } 980 996 } 981 997 } … … 1092 1108 &acc_cfg->id, &acc_cfg->id, 1093 1109 &acc_cfg->id, 1094 PJSUA_P RES_TIMER);1110 PJSUA_PUBLISH_EXPIRATION); 1095 1111 if (status != PJ_SUCCESS) { 1096 1112 acc->publish_sess = NULL; … … 1607 1623 pj_timer_entry *entry) 1608 1624 { 1625 unsigned i; 1609 1626 pj_time_val delay = { PJSUA_PRES_TIMER, 0 }; 1627 1628 /* Retry failed PUBLISH requests */ 1629 for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { 1630 pjsua_acc *acc = &pjsua_var.acc[i]; 1631 if (acc->cfg.publish_enabled && acc->publish_sess==NULL) 1632 pjsua_pres_init_publish_acc(acc->index); 1633 } 1610 1634 1611 1635 entry->id = PJ_FALSE;
Note: See TracChangeset
for help on using the changeset viewer.