summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--UPGRADE.txt8
-rw-r--r--configs/samples/pjsip.conf.sample4
-rw-r--r--res/res_pjsip.c7
-rw-r--r--res/res_pjsip/config_system.c8
4 files changed, 27 insertions, 0 deletions
diff --git a/UPGRADE.txt b/UPGRADE.txt
index 32bbb78ea..f00983176 100644
--- a/UPGRADE.txt
+++ b/UPGRADE.txt
@@ -21,6 +21,14 @@
=== UPGRADE-12.txt -- Upgrade info for 11 to 12
===========================================================
+From 13.0.0 to 13.1.0:
+
+PJSIP:
+ - Added the pjsip.conf system type disable_tcp_switch option. The option
+ allows the user to disable switching from UDP to TCP transports described
+ by RFC 3261 section 18.1.1.
+
+From 12 to 13:
General Asterisk Changes:
- The asterisk command line -I option and the asterisk.conf internal_timing
option are removed and always enabled if any timing module is loaded.
diff --git a/configs/samples/pjsip.conf.sample b/configs/samples/pjsip.conf.sample
index 854f49156..36807df2d 100644
--- a/configs/samples/pjsip.conf.sample
+++ b/configs/samples/pjsip.conf.sample
@@ -828,6 +828,10 @@
; should be disposed of (default: "60")
;threadpool_max_size=0 ; Maximum number of threads in the res_pjsip threadpool
; A value of 0 indicates no maximum (default: "0")
+;disable_tcp_switch=no ; Disable automatic switching from UDP to TCP transports
+ ; if outgoing request is too large.
+ ; See RFC 3261 section 18.1.1.
+ ; (default: "no")
;type= ; Must be of type system (default: "")
;==========================GLOBAL SECTION OPTIONS=========================
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 944d329f3..a3e33cbbf 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -1136,6 +1136,13 @@
<synopsis>Maximum number of threads in the res_pjsip threadpool.
A value of 0 indicates no maximum.</synopsis>
</configOption>
+ <configOption name="disable_tcp_switch" default="no">
+ <synopsis>Disable automatic switching from UDP to TCP transports.</synopsis>
+ <description><para>
+ Disable automatic switching from UDP to TCP transports if outgoing
+ request is too large. See RFC 3261 section 18.1.1.
+ </para></description>
+ </configOption>
<configOption name="type">
<synopsis>Must be of type 'system'.</synopsis>
</configOption>
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);