Changeset 5090
- Timestamp:
- May 11, 2015 5:57:50 AM (9 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsip/sip_config.h
r4924 r5090 218 218 } regc; 219 219 220 /** TCP transport settings */ 221 struct { 222 /** 223 * Set the interval to send keep-alive packet for TCP transports. 224 * If the value is zero, keep-alive will be disabled for TCP. 225 * 226 * Default is PJSIP_TCP_KEEP_ALIVE_INTERVAL. 227 */ 228 long keep_alive_interval; 229 230 } tcp; 231 232 /** TLS transport settings */ 233 struct { 234 /** 235 * Set the interval to send keep-alive packet for TLS transports. 236 * If the value is zero, keep-alive will be disabled for TLS. 237 * 238 * Default is PJSIP_TLS_KEEP_ALIVE_INTERVAL. 239 */ 240 long keep_alive_interval; 241 242 } tls; 243 220 244 } pjsip_cfg_t; 221 245 … … 650 674 * If the value is zero, keep-alive will be disabled for TCP. 651 675 * 676 * This option can be changed in run-time by settting 677 * \a tcp.keep_alive_interval field of pjsip_cfg(). 678 * 652 679 * Default: 90 (seconds) 653 680 * … … 672 699 * Set the interval to send keep-alive packet for TLS transports. 673 700 * If the value is zero, keep-alive will be disabled for TLS. 701 * 702 * This option can be changed in run-time by settting 703 * \a tls.keep_alive_interval field of pjsip_cfg(). 674 704 * 675 705 * Default: 90 (seconds) -
pjproject/trunk/pjsip/src/pjsip/sip_config.c
r4899 r5090 50 50 { 51 51 PJSIP_REGISTER_CLIENT_CHECK_CONTACT 52 }, 53 54 /* TCP transport settings */ 55 { 56 PJSIP_TCP_KEEP_ALIVE_INTERVAL 57 }, 58 59 /* TLS transport settings */ 60 { 61 PJSIP_TLS_KEEP_ALIVE_INTERVAL 52 62 } 53 63 }; -
pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c
r5000 r5090 1141 1141 } 1142 1142 /* Start keep-alive timer */ 1143 if ( PJSIP_TCP_KEEP_ALIVE_INTERVAL) {1144 pj_time_val delay = { PJSIP_TCP_KEEP_ALIVE_INTERVAL, 0};1143 if (pjsip_cfg()->tcp.keep_alive_interval) { 1144 pj_time_val delay = {pjsip_cfg()->tcp.keep_alive_interval, 0}; 1145 1145 pjsip_endpt_schedule_timer(listener->endpt, 1146 1146 &tcp->ka_timer, … … 1500 1500 1501 1501 /* Start keep-alive timer */ 1502 if ( PJSIP_TCP_KEEP_ALIVE_INTERVAL) {1503 pj_time_val delay = { PJSIP_TCP_KEEP_ALIVE_INTERVAL, 0 };1502 if (pjsip_cfg()->tcp.keep_alive_interval) { 1503 pj_time_val delay = { pjsip_cfg()->tcp.keep_alive_interval, 0 }; 1504 1504 pjsip_endpt_schedule_timer(tcp->base.endpt, &tcp->ka_timer, 1505 1505 &delay); … … 1527 1527 PJ_TIME_VAL_SUB(now, tcp->last_activity); 1528 1528 1529 if (now.sec > 0 && now.sec < PJSIP_TCP_KEEP_ALIVE_INTERVAL) {1529 if (now.sec > 0 && now.sec < pjsip_cfg()->tcp.keep_alive_interval) { 1530 1530 /* There has been activity, so don't send keep-alive */ 1531 delay.sec = PJSIP_TCP_KEEP_ALIVE_INTERVAL- now.sec;1531 delay.sec = pjsip_cfg()->tcp.keep_alive_interval - now.sec; 1532 1532 delay.msec = 0; 1533 1533 … … 1556 1556 1557 1557 /* Register next keep-alive */ 1558 delay.sec = PJSIP_TCP_KEEP_ALIVE_INTERVAL;1558 delay.sec = pjsip_cfg()->tcp.keep_alive_interval; 1559 1559 delay.msec = 0; 1560 1560 -
pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c
r5000 r5090 1282 1282 } else { 1283 1283 /* Start keep-alive timer */ 1284 if ( PJSIP_TLS_KEEP_ALIVE_INTERVAL) {1285 pj_time_val delay = { PJSIP_TLS_KEEP_ALIVE_INTERVAL, 0};1284 if (pjsip_cfg()->tls.keep_alive_interval) { 1285 pj_time_val delay = {pjsip_cfg()->tls.keep_alive_interval, 0}; 1286 1286 pjsip_endpt_schedule_timer(listener->endpt, 1287 1287 &tls->ka_timer, … … 1748 1748 1749 1749 /* Start keep-alive timer */ 1750 if ( PJSIP_TLS_KEEP_ALIVE_INTERVAL) {1751 pj_time_val delay = { PJSIP_TLS_KEEP_ALIVE_INTERVAL, 0 };1750 if (pjsip_cfg()->tls.keep_alive_interval) { 1751 pj_time_val delay = { pjsip_cfg()->tls.keep_alive_interval, 0 }; 1752 1752 pjsip_endpt_schedule_timer(tls->base.endpt, &tls->ka_timer, 1753 1753 &delay); … … 1781 1781 PJ_TIME_VAL_SUB(now, tls->last_activity); 1782 1782 1783 if (now.sec > 0 && now.sec < PJSIP_TLS_KEEP_ALIVE_INTERVAL) {1783 if (now.sec > 0 && now.sec < pjsip_cfg()->tls.keep_alive_interval) { 1784 1784 /* There has been activity, so don't send keep-alive */ 1785 delay.sec = PJSIP_TLS_KEEP_ALIVE_INTERVAL- now.sec;1785 delay.sec = pjsip_cfg()->tls.keep_alive_interval - now.sec; 1786 1786 delay.msec = 0; 1787 1787 … … 1811 1811 1812 1812 /* Register next keep-alive */ 1813 delay.sec = PJSIP_TLS_KEEP_ALIVE_INTERVAL;1813 delay.sec = pjsip_cfg()->tls.keep_alive_interval; 1814 1814 delay.msec = 0; 1815 1815
Note: See TracChangeset
for help on using the changeset viewer.