- Timestamp:
- May 29, 2007 12:33:09 AM (18 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h
r1134 r1311 207 207 pjsua_buddy buddy[PJSUA_MAX_BUDDIES]; /**< Buddy array. */ 208 208 209 /* Presence: */ 210 pj_timer_entry pres_timer;/**< Presence refresh timer. */ 211 209 212 /* Media: */ 210 213 pjsua_media_config media_cfg; /**< Media config. */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
r1281 r1311 23 23 #define THIS_FILE "pjsua_pres.c" 24 24 25 #ifndef PJSUA_PRES_TIMER 26 # define PJSUA_PRES_TIMER 120 27 #endif 28 25 29 26 30 /* … … 1134 1138 } 1135 1139 1140 /* Timer callback to re-create client subscription */ 1141 static void pres_timer_cb(pj_timer_heap_t *th, 1142 pj_timer_entry *entry) 1143 { 1144 pj_time_val delay = { PJSUA_PRES_TIMER, 0 }; 1145 1146 PJ_UNUSED_ARG(th); 1147 1148 PJSUA_LOCK(); 1149 1150 entry->id = PJ_FALSE; 1151 refresh_client_subscriptions(); 1152 1153 pjsip_endpt_schedule_timer(pjsua_var.endpt, entry, &delay); 1154 entry->id = PJ_TRUE; 1155 1156 PJSUA_UNLOCK(); 1157 } 1158 1136 1159 1137 1160 /* … … 1162 1185 pj_status_t pjsua_pres_start(void) 1163 1186 { 1164 /* Nothing to do (is it?) */ 1187 /* Start presence timer to re-subscribe to buddy's presence when 1188 * subscription has failed. 1189 */ 1190 if (pjsua_var.pres_timer.id == PJ_FALSE) { 1191 pj_time_val pres_interval = {PJSUA_PRES_TIMER, 0}; 1192 1193 pjsua_var.pres_timer.cb = &pres_timer_cb; 1194 pjsip_endpt_schedule_timer(pjsua_var.endpt, &pjsua_var.pres_timer, 1195 &pres_interval); 1196 } 1197 1165 1198 return PJ_SUCCESS; 1166 1199 } … … 1189 1222 { 1190 1223 unsigned i; 1224 1225 if (pjsua_var.pres_timer.id != 0) { 1226 pjsip_endpt_cancel_timer(pjsua_var.endpt, &pjsua_var.pres_timer); 1227 pjsua_var.pres_timer.id = PJ_FALSE; 1228 } 1191 1229 1192 1230 for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.acc); ++i) {
Note: See TracChangeset
for help on using the changeset viewer.