diff options
author | Richard Mudgett <rmudgett@digium.com> | 2014-11-03 18:22:59 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2014-11-03 18:22:59 +0000 |
commit | 33f0251b6c2af3da95cf27499506cfca32728208 (patch) | |
tree | 4bc6f14da8d56ba3eed08229a4a815fabcb5710e /res/res_pjsip/config_system.c | |
parent | b9aeff9580efe565fc64017f73e2e87fa2de3324 (diff) |
res_pjsip: Add disable_tcp_switch option.
When a packet exceeds the MTU, pjproject will switch from UDP to TCP. In
some circumstances (on some networks), this can cause some issues with
messages not getting sent to the correct destination - and can also cause
connections to get dropped due to quirks in pjproject deciding to
terminate TCP connections with no messages.
While fixing the routing/messaging issues is important, having a
configuration option in Asterisk that tells pjproject to not switch over
to TCP would be useful. That way, if some glitch is discovered on some
other network/site, we can at least disable the behavior until a fix is
put into place.
AFS-197 #close
Review: https://reviewboard.asterisk.org/r/4137/
........
Merged revisions 427129 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 427130 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip/config_system.c')
-rw-r--r-- | res/res_pjsip/config_system.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/res/res_pjsip/config_system.c b/res/res_pjsip/config_system.c index 7f8da8597..4d0ab467b 100644 --- a/res/res_pjsip/config_system.c +++ b/res/res_pjsip/config_system.c @@ -49,6 +49,8 @@ struct system_config { /*! Maxumum number of threads in the threadpool */ int max_size; } threadpool; + /*! Nonzero to disable switching from UDP to TCP transport */ + unsigned int disable_tcp_switch; }; static struct ast_threadpool_options sip_threadpool_options = { @@ -95,6 +97,7 @@ static int system_apply(const struct ast_sorcery *system_sorcery, void *obj) if (system->compactheaders) { extern pj_bool_t pjsip_use_compact_form; + pjsip_use_compact_form = PJ_TRUE; } @@ -103,6 +106,9 @@ static int system_apply(const struct ast_sorcery *system_sorcery, void *obj) sip_threadpool_options.idle_timeout = system->threadpool.idle_timeout; sip_threadpool_options.max_size = system->threadpool.max_size; + pjsip_cfg()->endpt.disable_tcp_switch = + system->disable_tcp_switch ? PJ_TRUE : PJ_FALSE; + return 0; } @@ -141,6 +147,8 @@ int ast_sip_initialize_system(void) OPT_UINT_T, 0, FLDSET(struct system_config, threadpool.idle_timeout)); ast_sorcery_object_field_register(system_sorcery, "system", "threadpool_max_size", "0", OPT_UINT_T, 0, FLDSET(struct system_config, threadpool.max_size)); + ast_sorcery_object_field_register(system_sorcery, "system", "disable_tcp_switch", "no", + OPT_BOOL_T, 1, FLDSET(struct system_config, disable_tcp_switch)); ast_sorcery_load(system_sorcery); |