mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
res_pjsip.c: Added disable_rport option for pjsip.conf
Currently when the pjsip making an outgoing request, it keep adding the rport parameter in a request message as a default. This causes unexpected rport handle at the other end. Added option for disable this behaviour in the pjsip.conf. This is a system option, but working as a gloabl option. ASTERISK-28959 Change-Id: I9596675e52a742774738b5aad5d1fec32f477abc
This commit is contained in:
@@ -59,6 +59,8 @@ struct system_config {
|
||||
*/
|
||||
unsigned int follow_early_media_fork;
|
||||
unsigned int accept_multiple_sdp_answers;
|
||||
/*! Disable the use of rport in outgoing requests */
|
||||
unsigned int disable_rport;
|
||||
};
|
||||
|
||||
static struct ast_threadpool_options sip_threadpool_options = {
|
||||
@@ -131,6 +133,8 @@ static int system_apply(const struct ast_sorcery *sorcery, void *obj)
|
||||
pjsip_cfg()->endpt.disable_tcp_switch =
|
||||
system->disable_tcp_switch ? PJ_TRUE : PJ_FALSE;
|
||||
|
||||
pjsip_cfg()->endpt.disable_rport = system->disable_rport ? PJ_TRUE : PJ_FALSE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -209,6 +213,8 @@ int ast_sip_initialize_system(void)
|
||||
OPT_BOOL_T, 1, FLDSET(struct system_config, follow_early_media_fork));
|
||||
ast_sorcery_object_field_register(system_sorcery, "system", "accept_multiple_sdp_answers", "no",
|
||||
OPT_BOOL_T, 1, FLDSET(struct system_config, accept_multiple_sdp_answers));
|
||||
ast_sorcery_object_field_register(system_sorcery, "system", "disable_rport", "no",
|
||||
OPT_BOOL_T, 1, FLDSET(struct system_config, disable_rport));
|
||||
|
||||
ast_sorcery_load(system_sorcery);
|
||||
|
||||
|
Reference in New Issue
Block a user