Index: Makefile =================================================================== --- Makefile (revision 189082) +++ Makefile (working copy) @@ -711,6 +711,7 @@ echo ";nocolor = yes ; Disable console colors" ; \ echo ";dontwarn = yes ; Disable some warnings" ; \ echo ";dumpcore = yes ; Dump core on crash (same as -g at startup)" ; \ + echo ";requireaudio = no ; Send audio before SIP reinvite" ; \ echo ";languageprefix = yes ; Use the new sound prefix path syntax" ; \ echo ";internal_timing = yes" ; \ echo ";systemname = my_system_name ; prefix uniqueid with a system name for global uniqueness issues" ; \ Index: include/asterisk/options.h =================================================================== --- include/asterisk/options.h (revision 189082) +++ include/asterisk/options.h (working copy) @@ -56,6 +56,8 @@ AST_OPT_FLAG_FULLY_BOOTED = (1 << 9), /*! Trascode via signed linear */ AST_OPT_FLAG_TRANSCODE_VIA_SLIN = (1 << 10), + /*! Require audio before invite */ + AST_OPT_FLAG_REQUIRE_AUDIO = (1 << 11), /*! Dump core on a seg fault */ AST_OPT_FLAG_DUMP_CORE = (1 << 12), /*! Cache sound files */ @@ -106,6 +108,7 @@ #define ast_opt_no_color ast_test_flag(&ast_options, AST_OPT_FLAG_NO_COLOR) #define ast_fully_booted ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED) #define ast_opt_transcode_via_slin ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSCODE_VIA_SLIN) +#define ast_opt_require_audio ast_test_flag(&ast_options, AST_OPT_FLAG_REQUIRE_AUDIO) #define ast_opt_dump_core ast_test_flag(&ast_options, AST_OPT_FLAG_DUMP_CORE) #define ast_opt_cache_record_files ast_test_flag(&ast_options, AST_OPT_FLAG_CACHE_RECORD_FILES) #define ast_opt_timestamp ast_test_flag(&ast_options, AST_OPT_FLAG_TIMESTAMP) Index: main/features.c =================================================================== --- main/features.c (revision 189082) +++ main/features.c (working copy) @@ -2554,8 +2554,14 @@ /* Answer if need be */ if (chan->_state != AST_STATE_UP) { - if (ast_raw_answer(chan, 1)) { - return -1; + if (ast_opt_require_audio) { + if (ast_answer(chan)) { + return -1; + } + } else { + if (ast_raw_answer(chan, 1)) { + return -1; + } } } Index: main/asterisk.c =================================================================== --- main/asterisk.c (revision 189082) +++ main/asterisk.c (working copy) @@ -428,57 +428,58 @@ ast_cli(a->fd, "\nPBX Core settings\n"); ast_cli(a->fd, "-----------------\n"); - ast_cli(a->fd, " Version: %s\n", ast_get_version()); - ast_cli(a->fd, " Build Options: %s\n", S_OR(AST_BUILDOPTS, "(none)")); + ast_cli(a->fd, " Version: %s\n", ast_get_version()); + ast_cli(a->fd, " Build Options: %s\n", S_OR(AST_BUILDOPTS, "(none)")); if (option_maxcalls) - ast_cli(a->fd, " Maximum calls: %d (Current %d)\n", option_maxcalls, ast_active_channels()); + ast_cli(a->fd, " Maximum calls: %d (Current %d)\n", option_maxcalls, ast_active_channels()); else - ast_cli(a->fd, " Maximum calls: Not set\n"); + ast_cli(a->fd, " Maximum calls: Not set\n"); if (option_maxfiles) - ast_cli(a->fd, " Maximum open file handles: %d\n", option_maxfiles); + ast_cli(a->fd, " Maximum open file handles: %d\n", option_maxfiles); else - ast_cli(a->fd, " Maximum open file handles: Not set\n"); - ast_cli(a->fd, " Verbosity: %d\n", option_verbose); - ast_cli(a->fd, " Debug level: %d\n", option_debug); - ast_cli(a->fd, " Maximum load average: %lf\n", option_maxload); + ast_cli(a->fd, " Maximum open file handles: Not set\n"); + ast_cli(a->fd, " Verbosity: %d\n", option_verbose); + ast_cli(a->fd, " Debug level: %d\n", option_debug); + ast_cli(a->fd, " Maximum load average: %lf\n", option_maxload); #if defined(HAVE_SYSINFO) - ast_cli(a->fd, " Minimum free memory: %ld MB\n", option_minmemfree); + ast_cli(a->fd, " Minimum free memory: %ld MB\n", option_minmemfree); #endif if (ast_localtime(&ast_startuptime, &tm, NULL)) { ast_strftime(buf, sizeof(buf), "%H:%M:%S", &tm); - ast_cli(a->fd, " Startup time: %s\n", buf); + ast_cli(a->fd, " Startup time: %s\n", buf); } if (ast_localtime(&ast_lastreloadtime, &tm, NULL)) { ast_strftime(buf, sizeof(buf), "%H:%M:%S", &tm); - ast_cli(a->fd, " Last reload time: %s\n", buf); + ast_cli(a->fd, " Last reload time: %s\n", buf); } - ast_cli(a->fd, " System: %s/%s built by %s on %s %s\n", ast_build_os, ast_build_kernel, ast_build_user, ast_build_machine, ast_build_date); - ast_cli(a->fd, " System name: %s\n", ast_config_AST_SYSTEM_NAME); - ast_cli(a->fd, " Entity ID: %s\n", eid_str); - ast_cli(a->fd, " Default language: %s\n", defaultlanguage); - ast_cli(a->fd, " Language prefix: %s\n", ast_language_is_prefix ? "Enabled" : "Disabled"); - ast_cli(a->fd, " User name and group: %s/%s\n", ast_config_AST_RUN_USER, ast_config_AST_RUN_GROUP); - ast_cli(a->fd, " Executable includes: %s\n", ast_test_flag(&ast_options, AST_OPT_FLAG_EXEC_INCLUDES) ? "Enabled" : "Disabled"); - ast_cli(a->fd, " Transcode via SLIN: %s\n", ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSCODE_VIA_SLIN) ? "Enabled" : "Disabled"); - ast_cli(a->fd, " Internal timing: %s\n", ast_test_flag(&ast_options, AST_OPT_FLAG_INTERNAL_TIMING) ? "Enabled" : "Disabled"); - ast_cli(a->fd, " Transmit silence during rec: %s\n", ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSMIT_SILENCE) ? "Enabled" : "Disabled"); + ast_cli(a->fd, " System: %s/%s built by %s on %s %s\n", ast_build_os, ast_build_kernel, ast_build_user, ast_build_machine, ast_build_date); + ast_cli(a->fd, " System name: %s\n", ast_config_AST_SYSTEM_NAME); + ast_cli(a->fd, " Entity ID: %s\n", eid_str); + ast_cli(a->fd, " Default language: %s\n", defaultlanguage); + ast_cli(a->fd, " Language prefix: %s\n", ast_language_is_prefix ? "Enabled" : "Disabled"); + ast_cli(a->fd, " User name and group: %s/%s\n", ast_config_AST_RUN_USER, ast_config_AST_RUN_GROUP); + ast_cli(a->fd, " Executable includes: %s\n", ast_test_flag(&ast_options, AST_OPT_FLAG_EXEC_INCLUDES) ? "Enabled" : "Disabled"); + ast_cli(a->fd, " Transcode via SLIN: %s\n", ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSCODE_VIA_SLIN) ? "Enabled" : "Disabled"); + ast_cli(a->fd, " Internal timing: %s\n", ast_test_flag(&ast_options, AST_OPT_FLAG_INTERNAL_TIMING) ? "Enabled" : "Disabled"); + ast_cli(a->fd, " Transmit silence during rec: %s\n", ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSMIT_SILENCE) ? "Enabled" : "Disabled"); + ast_cli(a->fd, " Require audio before reinvite: %s\n", ast_test_flag(&ast_options, AST_OPT_FLAG_REQUIRE_AUDIO) ? "Enabled" : "Disabled"); ast_cli(a->fd, "\n* Subsystems\n"); ast_cli(a->fd, " -------------\n"); - ast_cli(a->fd, " Manager (AMI): %s\n", check_manager_enabled() ? "Enabled" : "Disabled"); - ast_cli(a->fd, " Web Manager (AMI/HTTP): %s\n", check_webmanager_enabled() ? "Enabled" : "Disabled"); - ast_cli(a->fd, " Call data records: %s\n", check_cdr_enabled() ? "Enabled" : "Disabled"); - ast_cli(a->fd, " Realtime Architecture (ARA): %s\n", ast_realtime_enabled() ? "Enabled" : "Disabled"); + ast_cli(a->fd, " Manager (AMI): %s\n", check_manager_enabled() ? "Enabled" : "Disabled"); + ast_cli(a->fd, " Web Manager (AMI/HTTP): %s\n", check_webmanager_enabled() ? "Enabled" : "Disabled"); + ast_cli(a->fd, " Call data records: %s\n", check_cdr_enabled() ? "Enabled" : "Disabled"); + ast_cli(a->fd, " Realtime Architecture (ARA): %s\n", ast_realtime_enabled() ? "Enabled" : "Disabled"); /*! \todo we could check musiconhold, voicemail, smdi, adsi, queues */ ast_cli(a->fd, "\n* Directories\n"); ast_cli(a->fd, " -------------\n"); - ast_cli(a->fd, " Configuration file: %s\n", ast_config_AST_CONFIG_FILE); - ast_cli(a->fd, " Configuration directory: %s\n", ast_config_AST_CONFIG_DIR); - ast_cli(a->fd, " Module directory: %s\n", ast_config_AST_MODULE_DIR); - ast_cli(a->fd, " Spool directory: %s\n", ast_config_AST_SPOOL_DIR); - ast_cli(a->fd, " Log directory: %s\n", ast_config_AST_LOG_DIR); + ast_cli(a->fd, " Configuration file: %s\n", ast_config_AST_CONFIG_FILE); + ast_cli(a->fd, " Configuration directory: %s\n", ast_config_AST_CONFIG_DIR); + ast_cli(a->fd, " Module directory: %s\n", ast_config_AST_MODULE_DIR); + ast_cli(a->fd, " Spool directory: %s\n", ast_config_AST_SPOOL_DIR); + ast_cli(a->fd, " Log directory: %s\n", ast_config_AST_LOG_DIR); ast_cli(a->fd, "\n\n"); return CLI_SUCCESS; } @@ -2910,6 +2911,9 @@ /* Dump core in case of crash (-g) */ } else if (!strcasecmp(v->name, "dumpcore")) { ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_DUMP_CORE); + /* Require audio before reinvite */ + } else if (!strcasecmp(v->name, "requireaudio")) { + ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_REQUIRE_AUDIO); /* Cache recorded sound files to another directory during recording */ } else if (!strcasecmp(v->name, "cache_record_files")) { ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_CACHE_RECORD_FILES); Index: utils/extconf.c =================================================================== --- utils/extconf.c (revision 189082) +++ utils/extconf.c (working copy) @@ -1798,6 +1798,8 @@ AST_OPT_FLAG_FULLY_BOOTED = (1 << 9), /*! Trascode via signed linear */ AST_OPT_FLAG_TRANSCODE_VIA_SLIN = (1 << 10), + /*! Require audio before reinvite */ + AST_OPT_FLAG_REQUIRE_AUDIO = (1 << 11), /*! Dump core on a seg fault */ AST_OPT_FLAG_DUMP_CORE = (1 << 12), /*! Cache sound files */ @@ -1854,6 +1856,7 @@ #define ast_opt_transcode_via_slin ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSCODE_VIA_SLIN) #define ast_opt_priority_jumping ast_test_flag(&ast_options, AST_OPT_FLAG_PRIORITY_JUMPING) #define ast_opt_dump_core ast_test_flag(&ast_options, AST_OPT_FLAG_DUMP_CORE) +#define ast_opt_require_audio ast_test_flag(&ast_options, AST_OPT_FLAG_REQUIRE_AUDIO) #define ast_opt_cache_record_files ast_test_flag(&ast_options, AST_OPT_FLAG_CACHE_RECORD_FILES) #define ast_opt_timestamp ast_test_flag(&ast_options, AST_OPT_FLAG_TIMESTAMP) #define ast_opt_override_config ast_test_flag(&ast_options, AST_OPT_FLAG_OVERRIDE_CONFIG)