diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index babfc9937e..27267ea994 100644 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -668,6 +668,12 @@ static void fax_detect_session_function(switch_core_session_t *session, char *da switch_ivr_fax_detect_session(session); } +static void system_session_function(switch_core_session_t *session, char *data) +{ + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Executing command: %s\n",data); + system(data); +} + static void stop_fax_detect_session_function(switch_core_session_t *session, char *data) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Disabling fax detection\n"); @@ -1012,6 +1018,15 @@ static switch_api_interface_t presence_api_interface = { /*.next */ &dptools_api_interface }; +static switch_application_interface_t system_application_interface = { + /*.interface_name */ "system", + /*.application_function */ system_session_function, + /* long_desc */ "Execute a system command", + /* short_desc */ "Execute a system command", + /* syntax */ "", + /* flags */ SAF_NONE, + /*.next */ NULL +}; static switch_application_interface_t bridge_application_interface = { /*.interface_name */ "bridge", @@ -1019,7 +1034,8 @@ static switch_application_interface_t bridge_application_interface = { /* long_desc */ "Bridge the audio between two sessions", /* short_desc */ "Bridge Audio", /* syntax */ "", - /* flags */ SAF_SUPPORT_NOMEDIA + /* flags */ SAF_SUPPORT_NOMEDIA, + /* next */ &system_application_interface }; static switch_application_interface_t speak_application_interface = {