[mod_sofia] Add abort-on-empty-external-ip global param disabled by default.

This commit is contained in:
Andrey Volk 2020-01-11 01:18:14 +04:00
parent 975e6a6032
commit a074814b3f
3 changed files with 7 additions and 1 deletions

View File

@ -2,6 +2,7 @@
<global_settings>
<param name="log-level" value="0"/>
<!-- <param name="abort-on-empty-external-ip" value="true"/> -->
<!-- <param name="auto-restart" value="false"/> -->
<param name="debug-presence" value="0"/>
<!-- <param name="capture-server" value="udp:homer.domain.com:5060"/> -->

View File

@ -405,6 +405,7 @@ struct mod_sofia_globals {
uint32_t max_reg_threads;
time_t presence_epoch;
int presence_year;
int abort_on_empty_external_ip;
};
extern struct mod_sofia_globals mod_sofia_globals;

View File

@ -4416,6 +4416,8 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
char *val = (char *) switch_xml_attr_soft(param, "value");
if (!strcasecmp(var, "log-level")) {
su_log_set_level(NULL, atoi(val));
} else if (!strcasecmp(var, "abort-on-empty-external-ip")) {
mod_sofia_globals.abort_on_empty_external_ip = switch_true(val);
} else if (!strcasecmp(var, "tracelevel")) {
mod_sofia_globals.tracelevel = switch_log_str2level(val);
} else if (!strcasecmp(var, "debug-presence")) {
@ -5059,7 +5061,9 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name)
}
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid ext-rtp-ip\n");
switch_goto_status(SWITCH_STATUS_GENERR, done);
if (mod_sofia_globals.abort_on_empty_external_ip) {
switch_goto_status(SWITCH_STATUS_GENERR, done);
}
}
} else if (!strcasecmp(var, "rtp-ip")) {
char *ip = mod_sofia_globals.guess_ip;