Changeset 6035
- Timestamp:
- Jul 1, 2019 7:12:43 AM (5 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r6028 r6035 1064 1064 if (h->type == PJSIP_H_CONTACT) { 1065 1065 const pjsip_contact_hdr *c = (const pjsip_contact_hdr*)h; 1066 inte = c->expires;1067 1068 if (e < 0) {1066 unsigned e = c->expires; 1067 1068 if (e != PJSIP_EXPIRES_NOT_SPECIFIED) { 1069 1069 if (exp) 1070 1070 e = exp->ivalue; -
pjproject/trunk/pjsip-apps/src/samples/footprint.c
r5241 r6035 404 404 pjsip_evsub_get_state(NULL); 405 405 pjsip_evsub_get_state_name(NULL); 406 pjsip_evsub_initiate(NULL, NULL, -1, NULL);406 pjsip_evsub_initiate(NULL, NULL, PJSIP_EXPIRES_NOT_SPECIFIED, NULL); 407 407 pjsip_evsub_accept(NULL, NULL, 200, NULL); 408 408 pjsip_evsub_notify(NULL, PJSIP_EVSUB_STATE_ACTIVE, NULL, NULL, NULL); -
pjproject/trunk/pjsip-apps/src/samples/sipecho.c
r5241 r6035 435 435 pjsip_hdr hdr_list, *h; 436 436 pjsip_msg *msg; 437 int expires = -1;437 unsigned expires = PJSIP_EXPIRES_NOT_SPECIFIED; 438 438 439 439 pj_list_init(&hdr_list); … … 445 445 PJ_LOG(3,(THIS_FILE, " Expires=%d", expires)); 446 446 } 447 if (expires != 0 ) {447 if (expires != 0 && expires != PJSIP_EXPIRES_NOT_SPECIFIED) { 448 448 h = (pjsip_hdr*)pjsip_msg_find_hdr(msg, PJSIP_H_CONTACT, NULL); 449 449 if (h) -
pjproject/trunk/pjsip/include/pjsip-simple/evsub.h
r5558 r6035 364 364 * @param expires Subscription expiration. If the value is set to zero, 365 365 * this will request unsubscription. If the value is 366 * negative, default expiration as defined by the package367 * 366 * PJSIP_EXPIRES_NOT_SPECIFIED, default expiration 367 * as defined by the package will be used. 368 368 * @param p_tdata Pointer to receive the request. 369 369 * … … 372 372 PJ_DECL(pj_status_t) pjsip_evsub_initiate( pjsip_evsub *sub, 373 373 const pjsip_method *method, 374 pj_ int32_t expires,374 pj_uint32_t expires, 375 375 pjsip_tx_data **p_tdata); 376 376 -
pjproject/trunk/pjsip/include/pjsip-simple/evsub_msg.h
r3553 r6035 89 89 pj_str_t sub_state; /**< Subscription state. */ 90 90 pj_str_t reason_param; /**< Optional termination reason. */ 91 int expires_param; /**< Expires param, or -1. */ 91 unsigned expires_param; /**< Expires param, or 92 PJSIP_EXPIRES_NOT_SPECIFIED. */ 92 93 int retry_after; /**< Retry after param, or -1. */ 93 94 pjsip_param other_param; /**< Other parameters. */ -
pjproject/trunk/pjsip/include/pjsip-simple/mwi.h
r3553 r6035 122 122 * @param sub Client subscription instance. 123 123 * @param expires Subscription expiration. If the value is set to zero, 124 * this will request unsubscription. 124 * this will request unsubscription. If the value is 125 * PJSIP_EXPIRES_NOT_SPECIFIED, default expiration 126 * as defined by the package will be used. 125 127 * @param p_tdata Pointer to receive the request. 126 128 * … … 128 130 */ 129 131 PJ_DECL(pj_status_t) pjsip_mwi_initiate( pjsip_evsub *sub, 130 pj_ int32_t expires,132 pj_uint32_t expires, 131 133 pjsip_tx_data **p_tdata); 132 134 -
pjproject/trunk/pjsip/include/pjsip-simple/presence.h
r3553 r6035 172 172 * @param sub Client subscription instance. 173 173 * @param expires Subscription expiration. If the value is set to zero, 174 * this will request unsubscription. 174 * this will request unsubscription. If the value is 175 * PJSIP_EXPIRES_NOT_SPECIFIED, default expiration 176 * as defined by the package will be used. 175 177 * @param p_tdata Pointer to receive the request. 176 178 * … … 178 180 */ 179 181 PJ_DECL(pj_status_t) pjsip_pres_initiate( pjsip_evsub *sub, 180 pj_ int32_t expires,182 pj_uint32_t expires, 181 183 pjsip_tx_data **p_tdata); 182 184 -
pjproject/trunk/pjsip/include/pjsip-simple/publish.h
r4173 r6035 98 98 pj_str_t reason; /**< SIP reason phrase received. */ 99 99 pjsip_rx_data *rdata; /**< The complete received response. */ 100 int expiration;/**< Next expiration interval. If the 101 value is -1, it means the session 102 will not renew itself. */ 100 unsigned expiration;/**< Next expiration interval. If the 101 value is 102 PJSIP_PUBC_EXPIRATION_NOT_SPECIFIED, 103 it means the session will not renew 104 itself. */ 103 105 }; 104 106 -
pjproject/trunk/pjsip/include/pjsip-ua/sip_regc.h
r5356 r6035 52 52 53 53 /** Expiration not specified. */ 54 #define PJSIP_REGC_EXPIRATION_NOT_SPECIFIED ((pj_uint32_t)0xFFFFFFFFUL)54 #define PJSIP_REGC_EXPIRATION_NOT_SPECIFIED PJSIP_EXPIRES_NOT_SPECIFIED 55 55 56 56 /** Buffer to hold all contacts. */ … … 75 75 pj_str_t reason; /**< SIP reason phrase received. */ 76 76 pjsip_rx_data *rdata; /**< The complete received response. */ 77 int expiration;/**< Next expiration interval. */ 77 unsigned expiration;/**< Next expiration interval, 78 PJSIP_REGC_EXPIRATION_NOT_SPECIFIED 79 if not specified. */ 78 80 int contact_cnt;/**<Number of contacts in response. */ 79 81 pjsip_contact_hdr *contact[PJSIP_REGC_MAX_CONTACT]; /**< Contacts. */ … … 110 112 pj_bool_t is_busy; /**< Have pending transaction? */ 111 113 pj_bool_t auto_reg; /**< Will register automatically? */ 112 intinterval; /**< Registration interval (seconds). */113 intnext_reg; /**< Time until next registration (seconds). */114 unsigned interval; /**< Registration interval (seconds). */ 115 unsigned next_reg; /**< Time until next registration (seconds). */ 114 116 pjsip_transport *transport; /**< Last transport used. */ 115 117 }; -
pjproject/trunk/pjsip/include/pjsip/sip_msg.h
r5807 r6035 1071 1071 PJSIP_DECL_HDR_MEMBER(struct pjsip_generic_int_hdr); 1072 1072 /** ivalue */ 1073 pj_ int32_t ivalue;1073 pj_uint32_t ivalue; 1074 1074 } pjsip_generic_int_hdr; 1075 1075 … … 1088 1088 PJ_DECL(pjsip_generic_int_hdr*) pjsip_generic_int_hdr_create( pj_pool_t *pool, 1089 1089 const pj_str_t *hname, 1090 inthvalue );1090 unsigned hvalue ); 1091 1091 1092 1092 … … 1111 1111 void *mem, 1112 1112 const pj_str_t *hname, 1113 intvalue );1113 unsigned value ); 1114 1114 1115 1115 /* **************************************************************************/ … … 1350 1350 1351 1351 /* **************************************************************************/ 1352 1353 /** Expires not specified. */ 1354 #define PJSIP_EXPIRES_NOT_SPECIFIED ((pj_uint32_t)0xFFFFFFFFUL) 1355 1352 1356 /** 1353 1357 * Contact header. … … 1359 1363 { 1360 1364 PJSIP_DECL_HDR_MEMBER(struct pjsip_contact_hdr); 1361 int star; /**< The contact contains only a '*' character */ 1362 pjsip_uri *uri; /**< URI in the contact. */ 1363 int q1000; /**< The "q" value times 1000 (to avoid float) */ 1364 pj_int32_t expires; /**< Expires parameter, otherwise -1 if not present. */ 1365 pjsip_param other_param; /**< Other parameters, concatenated in a single string. */ 1365 int star; /**< The contact contains only a '*' 1366 character */ 1367 pjsip_uri *uri; /**< URI in the contact. */ 1368 int q1000; /**< The "q" value times 1000 1369 (to avoid float) */ 1370 pj_uint32_t expires; /**< Expires parameter, otherwise 1371 PJSIP_EXPIRES_NOT_SPECIFIED 1372 if not present. */ 1373 pjsip_param other_param; /**< Other parameters, concatenated in 1374 a single string. */ 1366 1375 } pjsip_contact_hdr; 1367 1376 … … 1442 1451 */ 1443 1452 PJ_DECL(pjsip_expires_hdr*) pjsip_expires_hdr_create( pj_pool_t *pool, 1444 intvalue);1453 unsigned value); 1445 1454 1446 1455 /** … … 1461 1470 PJ_DECL(pjsip_expires_hdr*) pjsip_expires_hdr_init( pj_pool_t *pool, 1462 1471 void *mem, 1463 intvalue );1472 unsigned value ); 1464 1473 1465 1474 … … 1565 1574 */ 1566 1575 PJ_DECL(pjsip_max_fwd_hdr*) 1567 pjsip_max_fwd_hdr_create(pj_pool_t *pool, intvalue);1576 pjsip_max_fwd_hdr_create(pj_pool_t *pool, unsigned value); 1568 1577 1569 1578 … … 1584 1593 */ 1585 1594 PJ_DECL(pjsip_max_fwd_hdr*) 1586 pjsip_max_fwd_hdr_init( pj_pool_t *pool, void *mem, intvalue );1595 pjsip_max_fwd_hdr_init( pj_pool_t *pool, void *mem, unsigned value ); 1587 1596 1588 1597 … … 1602 1611 */ 1603 1612 PJ_DECL(pjsip_min_expires_hdr*) pjsip_min_expires_hdr_create(pj_pool_t *pool, 1604 intvalue);1613 unsigned value); 1605 1614 1606 1615 … … 1622 1631 PJ_DECL(pjsip_min_expires_hdr*) pjsip_min_expires_hdr_init( pj_pool_t *pool, 1623 1632 void *mem, 1624 intvalue );1633 unsigned value ); 1625 1634 1626 1635 -
pjproject/trunk/pjsip/include/pjsip/sip_parser.h
r5697 r6035 53 53 #define PJSIP_MAX_Q1000 PJ_MAXINT32 / 1000 54 54 #define PJSIP_MIN_EXPIRES 0 55 #define PJSIP_MAX_EXPIRES PJ_MAXINT3255 #define PJSIP_MAX_EXPIRES ((pj_uint32_t)0xFFFFFFFFUL) 56 56 #define PJSIP_MIN_CSEQ 0 57 57 #define PJSIP_MAX_CSEQ PJ_MAXINT32 -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r6004 r6035 4177 4177 4178 4178 /** 4179 * An up to date expiration interval for account registration session. 4180 */ 4181 int expires; 4179 * An up to date expiration interval for account registration session, 4180 * PJSIP_EXPIRES_NOT_SPECIFIED if the account doesn't have reg session. 4181 */ 4182 unsigned expires; 4182 4183 4183 4184 /** -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h
r6015 r6035 219 219 int acc_id; /**< Account ID. */ 220 220 pjsip_dialog *dlg; /**< Dialog. */ 221 int expires; /**< "expires" value in the request. */ 221 unsigned expires; /**< "expires" value in the request, 222 PJSIP_EXPIRES_NOT_SPECIFIED 223 if not present. */ 222 224 }; 223 225 -
pjproject/trunk/pjsip/include/pjsua2/account.hpp
r6026 r6035 1282 1282 * An up to date expiration interval for account registration session. 1283 1283 */ 1284 intregExpiresSec;1284 unsigned regExpiresSec; 1285 1285 1286 1286 /** … … 1374 1374 * Next expiration interval. 1375 1375 */ 1376 intexpiration;1376 unsigned expiration; 1377 1377 }; 1378 1378 -
pjproject/trunk/pjsip/src/pjsip-simple/evsub.c
r5917 r6035 500 500 */ 501 501 static void set_timer( pjsip_evsub *sub, int timer_id, 502 pj_ int32_t seconds)502 pj_uint32_t seconds) 503 503 { 504 504 if (sub->timer.id != TIMER_TYPE_NONE) { … … 510 510 } 511 511 512 if (timer_id != TIMER_TYPE_NONE && seconds > 0) { 512 if (timer_id != TIMER_TYPE_NONE && seconds != PJSIP_EXPIRES_NOT_SPECIFIED) 513 { 513 514 pj_time_val timeout; 514 515 … … 1069 1070 PJ_DEF(pj_status_t) pjsip_evsub_initiate( pjsip_evsub *sub, 1070 1071 const pjsip_method *method, 1071 pj_ int32_t expires,1072 pj_uint32_t expires, 1072 1073 pjsip_tx_data **p_tdata) 1073 1074 { … … 1097 1098 1098 1099 /* Update and add expires header: */ 1099 if (expires >= 0)1100 if (expires != PJSIP_EXPIRES_NOT_SPECIFIED) 1100 1101 sub->expires->ivalue = expires; 1101 1102 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) … … 1997 1998 */ 1998 1999 if (sub->expires->ivalue != 0 && 1999 sub_state->expires_param >= 0&&2000 sub_state->expires_param != PJSIP_EXPIRES_NOT_SPECIFIED && 2000 2001 (pj_stricmp(&sub_state->sub_state, &STR_ACTIVE)==0 || 2001 2002 pj_stricmp(&sub_state->sub_state, &STR_PENDING)==0)) 2002 2003 { 2003 intnext_refresh = sub_state->expires_param;2004 unsigned next_refresh = sub_state->expires_param; 2004 2005 unsigned timeout; 2005 2006 … … 2100 2101 evpkg = find_pkg(&event_hdr->event_type); 2101 2102 if (evpkg) { 2102 if (expires->ivalue < (pj_int32_t)evpkg->pkg_expires)2103 if (expires->ivalue < evpkg->pkg_expires) 2103 2104 sub->expires->ivalue = expires->ivalue; 2104 2105 else -
pjproject/trunk/pjsip/src/pjsip-simple/evsub_msg.c
r5558 r6035 150 150 hdr->name = hdr->sname = sub_state; 151 151 hdr->vptr = &sub_state_hdr_vptr; 152 hdr->expires_param = -1;152 hdr->expires_param = PJSIP_EXPIRES_NOT_SPECIFIED; 153 153 hdr->retry_after = -1; 154 154 pj_list_init(hdr); … … 172 172 copy_advance_pair_escape(p, ";reason=", 8, hdr->reason_param, 173 173 pc->pjsip_TOKEN_SPEC); 174 if (hdr->expires_param >= 0) {174 if (hdr->expires_param != PJSIP_EXPIRES_NOT_SPECIFIED) { 175 175 pj_memcpy(p, ";expires=", 9); 176 176 p += 9; … … 275 275 } else if (pj_stricmp(&pname, &expires) == 0) { 276 276 hdr->expires_param = pj_strtoul(&pvalue); 277 if (hdr->expires_param == PJSIP_EXPIRES_NOT_SPECIFIED) 278 hdr->expires_param--; 277 279 278 280 } else if (pj_stricmp(&pname, &retry_after) == 0) { -
pjproject/trunk/pjsip/src/pjsip-simple/mwi.c
r4172 r6035 304 304 */ 305 305 PJ_DEF(pj_status_t) pjsip_mwi_initiate( pjsip_evsub *sub, 306 pj_ int32_t expires,306 pj_uint32_t expires, 307 307 pjsip_tx_data **p_tdata) 308 308 { … … 567 567 pjsip_tx_data *tdata; 568 568 569 status = pjsip_mwi_initiate(sub, -1, &tdata);569 status = pjsip_mwi_initiate(sub, PJSIP_EXPIRES_NOT_SPECIFIED, &tdata); 570 570 if (status == PJ_SUCCESS) 571 571 pjsip_mwi_send_request(sub, tdata); -
pjproject/trunk/pjsip/src/pjsip-simple/presence.c
r4713 r6035 348 348 */ 349 349 PJ_DEF(pj_status_t) pjsip_pres_initiate( pjsip_evsub *sub, 350 pj_ int32_t expires,350 pj_uint32_t expires, 351 351 pjsip_tx_data **p_tdata) 352 352 { … … 910 910 pjsip_tx_data *tdata; 911 911 912 status = pjsip_pres_initiate(sub, -1, &tdata); 912 status = pjsip_pres_initiate(sub, PJSIP_EXPIRES_NOT_SPECIFIED, 913 &tdata); 913 914 if (status == PJ_SUCCESS) 914 915 pjsip_pres_send_request(sub, tdata); -
pjproject/trunk/pjsip/src/pjsip-simple/publishc.c
r5984 r6035 533 533 static void call_callback(pjsip_publishc *pubc, pj_status_t status, 534 534 int st_code, const pj_str_t *reason, 535 pjsip_rx_data *rdata, pj_ int32_t expiration)535 pjsip_rx_data *rdata, pj_uint32_t expiration) 536 536 { 537 537 struct pjsip_publishc_cbparam cbparam; … … 563 563 char errmsg[PJ_ERR_MSG_SIZE]; 564 564 pj_str_t reason = pj_strerror(status, errmsg, sizeof(errmsg)); 565 call_callback(pubc, status, 400, &reason, NULL, -1); 565 call_callback(pubc, status, 400, &reason, NULL, 566 PJSIP_PUBC_EXPIRATION_NOT_SPECIFIED); 566 567 return; 567 568 } … … 605 606 call_callback(pubc, status, tsx->status_code, 606 607 &rdata->msg_info.msg->line.status.reason, 607 rdata, -1);608 rdata, PJSIP_PUBC_EXPIRATION_NOT_SPECIFIED); 608 609 } else { 609 610 status = pjsip_publishc_send(pubc, tdata); … … 612 613 } else { 613 614 pjsip_rx_data *rdata; 614 pj_ int32_t expiration = 0xFFFF;615 pj_uint32_t expiration = PJSIP_PUBC_EXPIRATION_NOT_SPECIFIED; 615 616 616 617 if (tsx->status_code/100 == 2) { … … 639 640 expiration = expires->ivalue; 640 641 641 if (pubc->auto_refresh && expiration!=0 && expiration!=0xFFFF) { 642 if (pubc->auto_refresh && expiration!=0 && 643 expiration!=PJSIP_PUBC_EXPIRATION_NOT_SPECIFIED) 644 { 642 645 pj_time_val delay = { 0, 0}; 643 646 … … 672 675 673 676 /* Call callback. */ 674 if (expiration == 0xFFFF) expiration = -1;677 // if (expiration == 0xFFFF) expiration = -1; 675 678 676 679 /* Temporarily increment pending_tsx to prevent callback from -
pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c
r5984 r6035 46 46 #define REGC_TSX_TIMEOUT 33000 47 47 48 enum { NOEXP = 0x1FFFFFFF};48 enum { NOEXP = PJSIP_REGC_EXPIRATION_NOT_SPECIFIED }; 49 49 50 50 static const pj_str_t XUID_PARAM_NAME = { "x-uid", 5 }; … … 740 740 pj_status_t status, int st_code, 741 741 const pj_str_t *reason, 742 pjsip_rx_data *rdata, pj_ int32_t expiration,742 pjsip_rx_data *rdata, pj_uint32_t expiration, 743 743 int contact_cnt, pjsip_contact_hdr *contact[], 744 744 pj_bool_t is_unreg) … … 751 751 cbparam->rdata = rdata; 752 752 cbparam->contact_cnt = contact_cnt; 753 cbparam->expiration = (expiration >= 0? expiration:754 753 cbparam->expiration = (expiration != PJSIP_REGC_EXPIRATION_NOT_SPECIFIED? 754 expiration: regc->expires_requested); 755 755 cbparam->is_unreg = is_unreg; 756 756 if (contact_cnt) { … … 762 762 static void call_callback(pjsip_regc *regc, pj_status_t status, int st_code, 763 763 const pj_str_t *reason, 764 pjsip_rx_data *rdata, pj_ int32_t expiration,764 pjsip_rx_data *rdata, pj_uint32_t expiration, 765 765 int contact_cnt, pjsip_contact_hdr *contact[], 766 766 pj_bool_t is_unreg) … … 799 799 char errmsg[PJ_ERR_MSG_SIZE]; 800 800 pj_str_t reason = pj_strerror(status, errmsg, sizeof(errmsg)); 801 call_callback(regc, status, 400, &reason, NULL, -1, 0, NULL,801 call_callback(regc, status, 400, &reason, NULL, NOEXP, 0, NULL, 802 802 PJ_FALSE); 803 803 } … … 809 809 } 810 810 811 static void schedule_registration ( pjsip_regc *regc, pj_ int32_t expiration )812 { 813 if (regc->auto_reg && expiration > 0 ) {811 static void schedule_registration ( pjsip_regc *regc, pj_uint32_t expiration ) 812 { 813 if (regc->auto_reg && expiration > 0 && expiration != NOEXP) { 814 814 pj_time_val delay = { 0, 0}; 815 815 … … 893 893 894 894 895 static pj_ int32_t calculate_response_expiration(const pjsip_regc *regc,896 const pjsip_rx_data *rdata,897 unsigned *contact_cnt,898 unsigned max_contact,899 pjsip_contact_hdr *contacts[])900 { 901 pj_ int32_t expiration = NOEXP;895 static pj_uint32_t calculate_response_expiration(const pjsip_regc *regc, 896 const pjsip_rx_data *rdata, 897 unsigned *contact_cnt, 898 unsigned max_contact, 899 pjsip_contact_hdr *contacts[]) 900 { 901 pj_uint32_t expiration = NOEXP; 902 902 const pjsip_msg *msg = rdata->msg_info.msg; 903 903 const pjsip_hdr *hdr; … … 983 983 has_our_contact = PJ_TRUE; 984 984 985 if (contacts[i]->expires >= 0 &&986 contacts[i]->expires < expiration)985 if (contacts[i]->expires != PJSIP_EXPIRES_NOT_SPECIFIED 986 && contacts[i]->expires < expiration) 987 987 { 988 988 /* Get the lowest expiration time. */ … … 1038 1038 1039 1039 if (*contact_cnt == our_contact_cnt && *contact_cnt && 1040 contacts[0]->expires >= 0)1040 contacts[0]->expires != PJSIP_EXPIRES_NOT_SPECIFIED) 1041 1041 { 1042 1042 expiration = contacts[0]->expires; … … 1098 1098 (event->body.tsx_state.type==PJSIP_EVENT_RX_MSG) ? 1099 1099 event->body.tsx_state.src.rdata : NULL, 1100 -1, 0, NULL, PJ_FALSE);1100 NOEXP, 0, NULL, PJ_FALSE); 1101 1101 1102 1102 /* Call regc tsx callback before handling any response */ … … 1118 1118 pjsip_contact_hdr *next = h->next; 1119 1119 1120 if (h->expires == -1) {1120 if (h->expires == PJSIP_EXPIRES_NOT_SPECIFIED) { 1121 1121 pj_list_erase(h); 1122 1122 } … … 1206 1206 call_callback(regc, status, tsx->status_code, 1207 1207 &rdata->msg_info.msg->line.status.reason, 1208 rdata, -1, 0, NULL, is_unreg);1208 rdata, NOEXP, 0, NULL, is_unreg); 1209 1209 pj_lock_acquire(regc->lock); 1210 1210 } … … 1233 1233 pjsip_min_expires_hdr *me_hdr; 1234 1234 pjsip_tx_data *tdata; 1235 pj_ int32_t min_exp;1235 pj_uint32_t min_exp; 1236 1236 1237 1237 /* reset current op */ … … 1295 1295 call_callback(regc, status, tsx->status_code, 1296 1296 &rdata->msg_info.msg->line.status.reason, 1297 rdata, -1, 0, NULL, PJ_FALSE);1297 rdata, NOEXP, 0, NULL, PJ_FALSE); 1298 1298 pj_lock_acquire(regc->lock); 1299 1299 } … … 1307 1307 if (!handled) { 1308 1308 pjsip_rx_data *rdata; 1309 pj_ int32_t expiration = NOEXP;1309 pj_uint32_t expiration = NOEXP; 1310 1310 unsigned contact_cnt = 0; 1311 1311 pjsip_contact_hdr *contact[PJSIP_REGC_MAX_CONTACT]; … … 1331 1331 1332 1332 /* Update registration */ 1333 if (expiration==NOEXP) expiration=-1;1333 // if (expiration==NOEXP) expiration=-1; 1334 1334 regc->expires = expiration; 1335 1335 -
pjproject/trunk/pjsip/src/pjsip-ua/sip_xfer.c
r4890 r6035 310 310 311 311 /* Create basic REFER request */ 312 status = pjsip_evsub_initiate(sub, pjsip_get_refer_method(), -1,313 312 status = pjsip_evsub_initiate(sub, pjsip_get_refer_method(), 313 PJSIP_EXPIRES_NOT_SPECIFIED, &tdata); 314 314 if (status != PJ_SUCCESS) 315 315 goto on_return; -
pjproject/trunk/pjsip/src/pjsip/sip_msg.c
r5727 r6035 814 814 void *mem, 815 815 const pj_str_t *hnames, 816 intvalue)816 unsigned value) 817 817 { 818 818 pjsip_generic_int_hdr *hdr = (pjsip_generic_int_hdr*) mem; … … 829 829 PJ_DEF(pjsip_generic_int_hdr*) pjsip_generic_int_hdr_create( pj_pool_t *pool, 830 830 const pj_str_t *hnames, 831 intvalue)831 unsigned value) 832 832 { 833 833 void *mem = pj_pool_alloc(pool, sizeof(pjsip_generic_int_hdr)); … … 1196 1196 pj_bzero(mem, sizeof(pjsip_contact_hdr)); 1197 1197 init_hdr(hdr, PJSIP_H_CONTACT, &contact_hdr_vptr); 1198 hdr->expires = -1;1198 hdr->expires = PJSIP_EXPIRES_NOT_SPECIFIED; 1199 1199 pj_list_init(&hdr->other_param); 1200 1200 return hdr; … … 1264 1264 } 1265 1265 1266 if (hdr->expires >= 0) {1266 if (hdr->expires != PJSIP_EXPIRES_NOT_SPECIFIED) { 1267 1267 if (buf+23 >= endbuf) 1268 1268 return -1; … … 1423 1423 PJ_DEF(pjsip_expires_hdr*) pjsip_expires_hdr_init( pj_pool_t *pool, 1424 1424 void *mem, 1425 intvalue)1425 unsigned value) 1426 1426 { 1427 1427 pjsip_expires_hdr *hdr = (pjsip_expires_hdr*) mem; … … 1436 1436 1437 1437 PJ_DEF(pjsip_expires_hdr*) pjsip_expires_hdr_create( pj_pool_t *pool, 1438 intvalue )1438 unsigned value ) 1439 1439 { 1440 1440 void *mem = pj_pool_alloc(pool, sizeof(pjsip_expires_hdr)); … … 1586 1586 PJ_DEF(pjsip_max_fwd_hdr*) pjsip_max_fwd_hdr_init( pj_pool_t *pool, 1587 1587 void *mem, 1588 intvalue)1588 unsigned value) 1589 1589 { 1590 1590 pjsip_max_fwd_hdr *hdr = (pjsip_max_fwd_hdr*) mem; … … 1599 1599 1600 1600 PJ_DEF(pjsip_max_fwd_hdr*) pjsip_max_fwd_hdr_create(pj_pool_t *pool, 1601 intvalue)1601 unsigned value) 1602 1602 { 1603 1603 void *mem = pj_pool_alloc(pool, sizeof(pjsip_max_fwd_hdr)); … … 1612 1612 PJ_DEF(pjsip_min_expires_hdr*) pjsip_min_expires_hdr_init( pj_pool_t *pool, 1613 1613 void *mem, 1614 intvalue )1614 unsigned value ) 1615 1615 { 1616 1616 pjsip_min_expires_hdr *hdr = (pjsip_min_expires_hdr*) mem; … … 1624 1624 1625 1625 PJ_DEF(pjsip_min_expires_hdr*) pjsip_min_expires_hdr_create(pj_pool_t *pool, 1626 intvalue )1626 unsigned value ) 1627 1627 { 1628 1628 void *mem = pj_pool_alloc(pool, sizeof(pjsip_min_expires_hdr)); -
pjproject/trunk/pjsip/src/pjsip/sip_parser.c
r5697 r6035 1886 1886 pvalue.slen) 1887 1887 { 1888 strtoi_validate(&pvalue, PJSIP_MIN_EXPIRES, PJSIP_MAX_EXPIRES, 1889 &hdr->expires); 1888 hdr->expires = pj_strtoul(&pvalue); 1889 if (hdr->expires == PJSIP_EXPIRES_NOT_SPECIFIED) 1890 hdr->expires--; 1891 if (hdr->expires > PJSIP_MAX_EXPIRES) 1892 hdr->expires = PJSIP_MAX_EXPIRES; 1893 if (hdr->expires < PJSIP_MIN_EXPIRES) 1894 hdr->expires = PJSIP_MIN_EXPIRES; 1890 1895 } else { 1891 1896 pjsip_param *p = PJ_POOL_ALLOC_T(pool, pjsip_param); -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r6015 r6035 2877 2877 info->expires = regc_info.next_reg; 2878 2878 } else { 2879 info->expires = -1;2879 info->expires = PJSIP_EXPIRES_NOT_SPECIFIED; 2880 2880 } 2881 2881 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
r5949 r6035 980 980 uapres->expires = expires_hdr->ivalue; 981 981 else 982 uapres->expires = -1;982 uapres->expires = PJSIP_EXPIRES_NOT_SPECIFIED; 983 983 984 984 st_code = (pjsip_status_code)200; … … 1908 1908 pjsip_evsub_set_mod_data(buddy->sub, pjsua_var.mod.id, buddy); 1909 1909 1910 status = pjsip_pres_initiate(buddy->sub, -1, &tdata); 1910 status = pjsip_pres_initiate(buddy->sub, PJSIP_EXPIRES_NOT_SPECIFIED, 1911 &tdata); 1911 1912 if (status != PJ_SUCCESS) { 1912 1913 if (buddy->dlg) pjsip_dlg_dec_lock(buddy->dlg); -
pjproject/trunk/pjsip/src/test/regc_test.c
r5678 r6035 217 217 int code; 218 218 pj_bool_t have_reg; 219 intexpiration;219 unsigned expiration; 220 220 unsigned contact_cnt; 221 221 pj_bool_t auth; … … 228 228 229 229 /* Additional results */ 230 intinterval;231 intnext_reg;230 unsigned interval; 231 unsigned next_reg; 232 232 }; 233 233 … … 251 251 return; 252 252 253 client->have_reg = info.auto_reg && info.interval>0 && 254 param->expiration>0; 253 client->have_reg = info.auto_reg && 254 info.interval != PJSIP_EXPIRES_NOT_SPECIFIED && 255 param->expiration != PJSIP_EXPIRES_NOT_SPECIFIED; 255 256 client->expiration = param->expiration; 256 257 client->contact_cnt = param->contact_cnt;
Note: See TracChangeset
for help on using the changeset viewer.