FS-3724 2 ways to fix after updating to this version, 1) run set_zombie_exec in the dp; 2) use system_on_fax_success/system_on_fax_failure vars with explicit name of your command
This commit is contained in:
parent
ead7c770bd
commit
12f2bdf66a
|
@ -4140,7 +4140,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
|
||||||
SWITCH_ADD_APP(app_interface, "bridge", "Bridge Audio", "Bridge the audio between two sessions", audio_bridge_function, "<channel_url>",
|
SWITCH_ADD_APP(app_interface, "bridge", "Bridge Audio", "Bridge the audio between two sessions", audio_bridge_function, "<channel_url>",
|
||||||
SAF_SUPPORT_NOMEDIA);
|
SAF_SUPPORT_NOMEDIA);
|
||||||
SWITCH_ADD_APP(app_interface, "system", "Execute a system command", "Execute a system command", system_session_function, "<command>",
|
SWITCH_ADD_APP(app_interface, "system", "Execute a system command", "Execute a system command", system_session_function, "<command>",
|
||||||
SAF_SUPPORT_NOMEDIA);
|
SAF_SUPPORT_NOMEDIA | SAF_ZOMBIE_EXEC);
|
||||||
SWITCH_ADD_APP(app_interface, "say", "say", "say", say_function, SAY_SYNTAX, SAF_NONE);
|
SWITCH_ADD_APP(app_interface, "say", "say", "say", say_function, SAY_SYNTAX, SAF_NONE);
|
||||||
|
|
||||||
SWITCH_ADD_APP(app_interface, "wait_for_silence", "wait_for_silence", "wait_for_silence", wait_for_silence_function, WAIT_FOR_SILENCE_SYNTAX,
|
SWITCH_ADD_APP(app_interface, "wait_for_silence", "wait_for_silence", "wait_for_silence", wait_for_silence_function, WAIT_FOR_SILENCE_SYNTAX,
|
||||||
|
|
|
@ -316,6 +316,8 @@ static void phase_e_handler(t30_state_t *s, void *user_data, int result)
|
||||||
char *fax_transfer_rate = NULL;
|
char *fax_transfer_rate = NULL;
|
||||||
char *fax_result_code = NULL;
|
char *fax_result_code = NULL;
|
||||||
switch_event_t *event;
|
switch_event_t *event;
|
||||||
|
const char *var;
|
||||||
|
char *expanded;
|
||||||
|
|
||||||
pvt = (pvt_t *) user_data;
|
pvt = (pvt_t *) user_data;
|
||||||
switch_assert(pvt);
|
switch_assert(pvt);
|
||||||
|
@ -432,14 +434,36 @@ static void phase_e_handler(t30_state_t *s, void *user_data, int result)
|
||||||
switch_event_fire(&event);
|
switch_event_fire(&event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((var = switch_channel_get_variable(channel, "system_on_fax_result"))) {
|
||||||
|
expanded = switch_channel_expand_variables(channel, var);
|
||||||
|
switch_system(expanded, SWITCH_FALSE);
|
||||||
|
if (expanded != var) {
|
||||||
|
free(expanded);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch_channel_execute_on(channel, "execute_on_fax_result");
|
switch_channel_execute_on(channel, "execute_on_fax_result");
|
||||||
|
|
||||||
if (result == T30_ERR_OK) {
|
if (result == T30_ERR_OK) {
|
||||||
|
if ((var = switch_channel_get_variable(channel, "system_on_fax_success"))) {
|
||||||
|
expanded = switch_channel_expand_variables(channel, var);
|
||||||
|
switch_system(expanded, SWITCH_FALSE);
|
||||||
|
if (expanded != var) {
|
||||||
|
free(expanded);
|
||||||
|
}
|
||||||
|
}
|
||||||
switch_channel_execute_on(channel, "execute_on_fax_success");
|
switch_channel_execute_on(channel, "execute_on_fax_success");
|
||||||
} else {
|
} else {
|
||||||
|
if ((var = switch_channel_get_variable(channel, "system_on_fax_failure"))) {
|
||||||
|
expanded = switch_channel_expand_variables(channel, var);
|
||||||
|
switch_system(expanded, SWITCH_FALSE);
|
||||||
|
if (expanded != var) {
|
||||||
|
free(expanded);
|
||||||
|
}
|
||||||
|
}
|
||||||
switch_channel_execute_on(channel, "execute_on_fax_failure");
|
switch_channel_execute_on(channel, "execute_on_fax_failure");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int t38_tx_packet_handler(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count)
|
static int t38_tx_packet_handler(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count)
|
||||||
|
|
|
@ -2408,6 +2408,7 @@ static int max_open(void)
|
||||||
static int switch_system_fork(const char *cmd, switch_bool_t wait)
|
static int switch_system_fork(const char *cmd, switch_bool_t wait)
|
||||||
{
|
{
|
||||||
int pid;
|
int pid;
|
||||||
|
char *dcmd = strdup(cmd);
|
||||||
|
|
||||||
switch_core_set_signal_handlers();
|
switch_core_set_signal_handlers();
|
||||||
|
|
||||||
|
@ -2417,6 +2418,7 @@ static int switch_system_fork(const char *cmd, switch_bool_t wait)
|
||||||
if (wait) {
|
if (wait) {
|
||||||
waitpid(pid, NULL, 0);
|
waitpid(pid, NULL, 0);
|
||||||
}
|
}
|
||||||
|
free(dcmd);
|
||||||
} else {
|
} else {
|
||||||
int open_max = max_open();
|
int open_max = max_open();
|
||||||
int i;
|
int i;
|
||||||
|
@ -2426,7 +2428,8 @@ static int switch_system_fork(const char *cmd, switch_bool_t wait)
|
||||||
}
|
}
|
||||||
|
|
||||||
set_low_priority();
|
set_low_priority();
|
||||||
i = system(cmd);
|
i = system(dcmd);
|
||||||
|
free(dcmd);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue