- Timestamp:
- Aug 12, 2009 7:04:02 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip-ua/sip_timer.c
r2869 r2870 606 606 pjsip_timer_init_session(inv, NULL); 607 607 608 /* If refresher role (i.e: ours or peer) has been set/negotiated, 609 * better to keep it. 610 */ 611 if (inv->timer->refresher != TR_UNKNOWN) { 612 pj_bool_t as_refresher; 613 614 /* Check our refresher role */ 615 as_refresher = 616 (inv->timer->refresher==TR_UAC && inv->timer->role==PJSIP_ROLE_UAC) || 617 (inv->timer->refresher==TR_UAS && inv->timer->role==PJSIP_ROLE_UAS); 618 619 /* Update transaction role */ 620 inv->timer->role = PJSIP_ROLE_UAC; 621 622 /* Update refresher role */ 623 inv->timer->refresher = as_refresher? TR_UAC : TR_UAS; 624 } 625 608 626 /* Add Session Timers headers */ 609 627 add_timer_headers(inv, tdata, PJ_TRUE, PJ_TRUE); … … 879 897 else if (se_hdr && pj_stricmp(&se_hdr->refresher, &STR_UAS) == 0) 880 898 inv->timer->refresher = TR_UAS; 881 else 882 /* If UAC support timer (currently check the existance of883 * Session-Expires header in the request), set UAC as refresher.899 else { 900 /* If refresher role (i.e: ours or peer) has been set/negotiated, 901 * better to keep it. 884 902 */ 885 inv->timer->refresher = se_hdr? TR_UAC : TR_UAS; 903 if (inv->timer->refresher != TR_UNKNOWN) { 904 pj_bool_t as_refresher; 905 906 /* Check our refresher role */ 907 as_refresher = 908 (inv->timer->refresher==TR_UAC && inv->timer->role==PJSIP_ROLE_UAC) || 909 (inv->timer->refresher==TR_UAS && inv->timer->role==PJSIP_ROLE_UAS); 910 911 /* Update refresher role */ 912 inv->timer->refresher = as_refresher? TR_UAS : TR_UAC; 913 } else { 914 /* If UAC support timer (currently check the existance of 915 * Session-Expires header in the request), set UAC as refresher. 916 */ 917 inv->timer->refresher = se_hdr? TR_UAC : TR_UAS; 918 } 919 } 920 921 /* Remember our role in this transaction */ 922 inv->timer->role = PJSIP_ROLE_UAS; 886 923 887 924 /* Set active flag */ … … 911 948 { 912 949 if (inv->timer && inv->timer->active) { 913 /* Remember our role in this transaction */914 inv->timer->role = PJSIP_ROLE_UAS;915 916 950 /* Add Session-Expires header and start the timer */ 917 951 add_timer_headers(inv, tdata, PJ_TRUE, PJ_FALSE);
Note: See TracChangeset
for help on using the changeset viewer.