add disable_ec app

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@506 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Anthony Minessale
2008-07-30 15:05:07 +00:00
parent 44e8be160a
commit e2cb2de28e
4 changed files with 54 additions and 2 deletions

View File

@@ -1848,10 +1848,28 @@ SWITCH_STANDARD_API(oz_function)
}
SWITCH_STANDARD_APP(disable_ec_function)
{
private_t *tech_pvt;
int x = 0;
if (!switch_core_session_check_interface(session, openzap_endpoint_interface)) {
zap_log(ZAP_LOG_ERROR, "This application is only for OpenZAP channels.\n");
return;
}
tech_pvt = switch_core_session_get_private(session);
zap_channel_command(tech_pvt->zchan, ZAP_COMMAND_DISABLE_ECHOCANCEL, &x);
zap_channel_command(tech_pvt->zchan, ZAP_COMMAND_DISABLE_ECHOTRAIN, &x);
zap_log(ZAP_LOG_ERROR, "Echo Canceller Disabled\n");
}
SWITCH_MODULE_LOAD_FUNCTION(mod_openzap_load)
{
switch_api_interface_t *commands_api_interface;
switch_application_interface_t *app_interface;
module_pool = pool;
@@ -1875,6 +1893,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_openzap_load)
SWITCH_ADD_API(commands_api_interface, "oz", "OpenZAP commands", oz_function, OZ_SYNTAX);
SWITCH_ADD_APP(app_interface, "disable_ec", "Disable Echo Canceller", "Disable Echo Canceller", disable_ec_function, "", SAF_NONE);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
}