[asterisk-commits] kmoore: branch kmoore/stasis-mwi r382321 - in /team/kmoore/stasis-mwi: ./ add...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Feb 28 21:26:23 CST 2013
Author: kmoore
Date: Thu Feb 28 21:26:17 2013
New Revision: 382321
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=382321
Log:
Multiple revisions 382306,382313
........
r382306 | dlee | 2013-02-28 16:20:32 -0600 (Thu, 28 Feb 2013) | 1 line
Addressed more review feedback
........
r382313 | dlee | 2013-02-28 16:23:21 -0600 (Thu, 28 Feb 2013) | 2 lines
Merged revisions 381703-382299 from http://svn.asterisk.org/svn/asterisk/trunk
........
Merged revisions 382306,382313 from http://svn.asterisk.org/svn/asterisk/team/dlee/stasis-core
Modified:
team/kmoore/stasis-mwi/ (props changed)
team/kmoore/stasis-mwi/CHANGES
team/kmoore/stasis-mwi/addons/res_config_mysql.c
team/kmoore/stasis-mwi/apps/app_confbridge.c
team/kmoore/stasis-mwi/apps/app_dial.c
team/kmoore/stasis-mwi/apps/app_meetme.c
team/kmoore/stasis-mwi/apps/app_parkandannounce.c
team/kmoore/stasis-mwi/apps/confbridge/conf_config_parser.c
team/kmoore/stasis-mwi/apps/confbridge/include/confbridge.h
team/kmoore/stasis-mwi/channels/chan_iax2.c
team/kmoore/stasis-mwi/channels/chan_jingle.c
team/kmoore/stasis-mwi/channels/chan_motif.c
team/kmoore/stasis-mwi/channels/chan_sip.c
team/kmoore/stasis-mwi/channels/chan_skinny.c
team/kmoore/stasis-mwi/configs/confbridge.conf.sample
team/kmoore/stasis-mwi/configs/skinny.conf.sample
team/kmoore/stasis-mwi/configure
team/kmoore/stasis-mwi/configure.ac
team/kmoore/stasis-mwi/include/asterisk.h
team/kmoore/stasis-mwi/include/asterisk/channel.h
team/kmoore/stasis-mwi/include/asterisk/module.h
team/kmoore/stasis-mwi/include/asterisk/threadpool.h
team/kmoore/stasis-mwi/main/Makefile
team/kmoore/stasis-mwi/main/channel.c
team/kmoore/stasis-mwi/main/cli.c
team/kmoore/stasis-mwi/main/features.c
team/kmoore/stasis-mwi/main/loader.c
team/kmoore/stasis-mwi/main/manager.c
team/kmoore/stasis-mwi/main/stasis.c
team/kmoore/stasis-mwi/main/stasis_cache.c
team/kmoore/stasis-mwi/main/threadpool.c
team/kmoore/stasis-mwi/res/res_agi.c
team/kmoore/stasis-mwi/res/res_rtp_asterisk.c
team/kmoore/stasis-mwi/res/snmp/agent.c
Propchange: team/kmoore/stasis-mwi/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.
Propchange: team/kmoore/stasis-mwi/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Feb 28 21:26:17 2013
@@ -1,1 +1,1 @@
-/team/dlee/stasis-core:1-382290
+/team/dlee/stasis-core:1-382320
Modified: team/kmoore/stasis-mwi/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/CHANGES?view=diff&rev=382321&r1=382320&r2=382321
==============================================================================
--- team/kmoore/stasis-mwi/CHANGES (original)
+++ team/kmoore/stasis-mwi/CHANGES Thu Feb 28 21:26:17 2013
@@ -73,6 +73,14 @@
* Added the 'queue_log_realtime_use_gmt' option to have timestamps in GMT
for realtime queue log entries.
+MeetMe
+-------------------
+* Added the 'n' option to MeetMe to prevent application of the DENOISE function
+ to a channel joining a conference. Some channel drivers that vary the number
+ of audio samples in a voice frame will experience significant quality problems
+ if a denoiser is attached to the channel; this option gives them the ability
+ to remove the denoiser without having to unload func_speex.
+
Queue
-------------------
* Add queue available hint. exten => 8501,hint,Queue:markq_avail
@@ -145,6 +153,9 @@
* Added announcement configuration option to user profile. If set the sound
file will be played to the user, and only the user, upon joining the
conference bridge.
+
+ * Added record_file_append option that defaults to "yes", but if set to no
+ will create a new file between each start/stop recording.
Dial
Modified: team/kmoore/stasis-mwi/addons/res_config_mysql.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/addons/res_config_mysql.c?view=diff&rev=382321&r1=382320&r2=382321
==============================================================================
--- team/kmoore/stasis-mwi/addons/res_config_mysql.c (original)
+++ team/kmoore/stasis-mwi/addons/res_config_mysql.c Thu Feb 28 21:26:17 2013
@@ -343,9 +343,7 @@
}
/* Get the first parameter and first value in our list of passed paramater/value pairs */
- newparam = va_arg(ap, const char *);
- newval = va_arg(ap, const char *);
- if (!newparam || !newval) {
+ if (!(newparam = va_arg(ap, const char *)) || !(newval = va_arg(ap, const char *))) {
ast_log(LOG_WARNING, "MySQL RealTime: Realtime retrieval requires at least 1 parameter and 1 value to search on.\n");
release_database(dbh);
return NULL;
@@ -376,7 +374,6 @@
ESCAPE_STRING(buf, newval);
ast_str_append(&sql, 0, " AND %s%s '%s'", newparam, op, ast_str_buffer(buf));
}
- va_end(ap);
ast_debug(1, "MySQL RealTime: Retrieve SQL: %s\n", ast_str_buffer(sql));
@@ -457,9 +454,7 @@
}
/* Get the first parameter and first value in our list of passed paramater/value pairs */
- newparam = va_arg(ap, const char *);
- newval = va_arg(ap, const char *);
- if (!newparam || !newval) {
+ if (!(newparam = va_arg(ap, const char *)) || !(newval = va_arg(ap, const char *))) {
ast_log(LOG_WARNING, "MySQL RealTime: Realtime retrieval requires at least 1 parameter and 1 value to search on.\n");
ast_config_destroy(cfg);
release_database(dbh);
@@ -498,8 +493,6 @@
if (initfield) {
ast_str_append(&sql, 0, " ORDER BY %s", initfield);
}
-
- va_end(ap);
ast_debug(1, "MySQL RealTime: Retrieve SQL: %s\n", ast_str_buffer(sql));
@@ -581,9 +574,7 @@
}
/* Get the first parameter and first value in our list of passed paramater/value pairs */
- newparam = va_arg(ap, const char *);
- newval = va_arg(ap, const char *);
- if (!newparam || !newval) {
+ if (!(newparam = va_arg(ap, const char *)) || !(newval = va_arg(ap, const char *))) {
ast_log(LOG_WARNING, "MySQL RealTime: Realtime update requires at least 1 parameter and 1 value to update.\n");
release_table(table);
release_database(dbh);
@@ -633,7 +624,6 @@
internal_require(database, tablename, newparam, RQ_CHAR, ast_str_strlen(buf), SENTINEL);
}
}
- va_end(ap);
ESCAPE_STRING(buf, lookup);
ast_str_append(&sql, 0, " WHERE `%s` = '%s'", keyfield, ast_str_buffer(buf));
@@ -667,7 +657,7 @@
{
struct mysql_conn *dbh;
my_ulonglong numrows;
- int first = 1;
+ int first;
const char *newparam, *newval;
struct ast_str *sql = ast_str_thread_get(&sql_buf, 100), *buf = ast_str_thread_get(&scratch_buf, 100);
struct ast_str *where = ast_str_thread_get(&sql2_buf, 100);
@@ -706,6 +696,7 @@
return -1;
}
+ first = 1;
while ((newparam = va_arg(ap, const char *))) {
if (!(column = find_column(table, newparam))) {
ast_log(LOG_ERROR, "Updating on column '%s', but that column does not exist within the table '%s'!\n", newparam, tablename);
@@ -753,7 +744,7 @@
internal_require(database, tablename, newparam, RQ_CHAR, ast_str_strlen(buf), SENTINEL);
}
}
- va_end(ap);
+
release_table(table);
ast_str_append(&sql, 0, " %s", ast_str_buffer(where));
@@ -802,9 +793,7 @@
return -1;
}
/* Get the first parameter and first value in our list of passed paramater/value pairs */
- newparam = va_arg(ap, const char *);
- newval = va_arg(ap, const char *);
- if (!newparam || !newval) {
+ if (!(newparam = va_arg(ap, const char *)) || !(newval = va_arg(ap, const char *))) {
ast_log(LOG_WARNING, "MySQL RealTime: Realtime storage requires at least 1 parameter and 1 value to search on.\n");
release_database(dbh);
return -1;
@@ -833,7 +822,6 @@
ast_str_append(&sql2, 0, ", '%s'", ast_str_buffer(buf));
}
}
- va_end(ap);
ast_str_append(&sql, 0, "%s)", ast_str_buffer(sql2));
ast_debug(1,"MySQL RealTime: Insert SQL: %s\n", ast_str_buffer(sql));
@@ -901,7 +889,6 @@
ESCAPE_STRING(buf, newval);
ast_str_append(&sql, 0, " AND `%s` = '%s'", newparam, ast_str_buffer(buf));
}
- va_end(ap);
ast_debug(1, "MySQL RealTime: Delete SQL: %s\n", ast_str_buffer(sql));
Modified: team/kmoore/stasis-mwi/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/apps/app_confbridge.c?view=diff&rev=382321&r1=382320&r2=382321
==============================================================================
--- team/kmoore/stasis-mwi/apps/app_confbridge.c (original)
+++ team/kmoore/stasis-mwi/apps/app_confbridge.c Thu Feb 28 21:26:17 2013
@@ -596,6 +596,37 @@
return tmp;
}
+static void set_rec_filename(struct conference_bridge *bridge, struct ast_str **filename)
+{
+ char *rec_file = bridge->b_profile.rec_file;
+ time_t now;
+ char *ext;
+
+ if (ast_str_strlen(*filename) && ast_test_flag(&bridge->b_profile, BRIDGE_OPT_RECORD_FILE_APPEND)) {
+ return;
+ }
+
+ time(&now);
+
+ ast_str_reset(*filename);
+ if (ast_strlen_zero(rec_file)) {
+ ast_str_set(filename, 0, "confbridge-%s-%u.wav", bridge->name, (unsigned int)now);
+ } else {
+ /* insert time before file extension */
+ ext = strrchr(rec_file, '.');
+ if (ext) {
+ ast_str_set_substr(filename, 0, rec_file, ext - rec_file);
+ ast_str_append(filename, 0, "-%u%s", (unsigned int)now, ext);
+ } else {
+ ast_str_set(filename, 0, "%s-%u", rec_file, (unsigned int)now);
+ }
+ }
+
+ if (ast_test_flag(&bridge->b_profile, BRIDGE_OPT_RECORD_FILE_APPEND)) {
+ ast_str_append(filename, 0, ",a");
+ }
+}
+
static void *record_thread(void *obj)
{
struct conference_bridge *conference_bridge = obj;
@@ -614,16 +645,7 @@
/* XXX If we get an EXIT right here, START will essentially be a no-op */
while (conference_bridge->record_state != CONF_RECORD_EXIT) {
- if (!(ast_strlen_zero(conference_bridge->b_profile.rec_file))) {
- ast_str_append(&filename, 0, "%s", conference_bridge->b_profile.rec_file);
- } else {
- time_t now;
- time(&now);
- ast_str_append(&filename, 0, "confbridge-%s-%u.wav",
- conference_bridge->name,
- (unsigned int) now);
- }
-
+ set_rec_filename(conference_bridge, &filename);
chan = ast_channel_ref(conference_bridge->record_chan);
ast_answer(chan);
pbx_exec(chan, mixmonapp, ast_str_buffer(filename));
@@ -753,9 +775,16 @@
*/
static int start_conf_record_thread(struct conference_bridge *conference_bridge)
{
+ conf_start_record(conference_bridge);
+
+ /*
+ * if the thread has already been started, don't start another
+ */
+ if (conference_bridge->record_thread != AST_PTHREADT_NULL) {
+ return 0;
+ }
+
ao2_ref(conference_bridge, +1); /* give the record thread a ref */
-
- conf_start_record(conference_bridge);
if (ast_pthread_create_background(&conference_bridge->record_thread, NULL, record_thread, conference_bridge)) {
ast_log(LOG_WARNING, "Failed to create recording channel for conference %s\n", conference_bridge->name);
@@ -2151,6 +2180,29 @@
return 0;
}
+static int kick_conference_participant(struct conference_bridge *bridge, const char *channel)
+{
+ struct conference_bridge_user *participant = NULL;
+
+ SCOPED_AO2LOCK(bridge_lock, bridge);
+ AST_LIST_TRAVERSE(&bridge->active_list, participant, list) {
+ if (!strcasecmp(ast_channel_name(participant->chan), channel)) {
+ participant->kicked = 1;
+ ast_bridge_remove(bridge->bridge, participant->chan);
+ return 0;
+ }
+ }
+ AST_LIST_TRAVERSE(&bridge->waiting_list, participant, list) {
+ if (!strcasecmp(ast_channel_name(participant->chan), channel)) {
+ participant->kicked = 1;
+ ast_bridge_remove(bridge->bridge, participant->chan);
+ return 0;
+ }
+ }
+
+ return -1;
+}
+
static char *complete_confbridge_name(const char *line, const char *word, int pos, int state)
{
int which = 0;
@@ -2173,11 +2225,44 @@
return res;
}
+static char *complete_confbridge_participant(const char *bridge_name, const char *line, const char *word, int pos, int state)
+{
+ int which = 0;
+ RAII_VAR(struct conference_bridge *, bridge, NULL, ao2_cleanup);
+ struct conference_bridge tmp;
+ struct conference_bridge_user *participant;
+ char *res = NULL;
+ int wordlen = strlen(word);
+
+ ast_copy_string(tmp.name, bridge_name, sizeof(tmp.name));
+ bridge = ao2_find(conference_bridges, &tmp, OBJ_POINTER);
+ if (!bridge) {
+ return NULL;
+ }
+
+ {
+ SCOPED_AO2LOCK(bridge_lock, bridge);
+ AST_LIST_TRAVERSE(&bridge->active_list, participant, list) {
+ if (!strncasecmp(ast_channel_name(participant->chan), word, wordlen) && ++which > state) {
+ res = ast_strdup(ast_channel_name(participant->chan));
+ return res;
+ }
+ }
+ AST_LIST_TRAVERSE(&bridge->waiting_list, participant, list) {
+ if (!strncasecmp(ast_channel_name(participant->chan), word, wordlen) && ++which > state) {
+ res = ast_strdup(ast_channel_name(participant->chan));
+ return res;
+ }
+ }
+ }
+
+ return NULL;
+}
+
static char *handle_cli_confbridge_kick(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
struct conference_bridge *bridge = NULL;
struct conference_bridge tmp;
- struct conference_bridge_user *participant = NULL;
switch (cmd) {
case CLI_INIT:
@@ -2190,11 +2275,9 @@
if (a->pos == 2) {
return complete_confbridge_name(a->line, a->word, a->pos, a->n);
}
- /*
if (a->pos == 3) {
- return complete_confbridge_channel(a->line, a->word, a->pos, a->n);
- }
- */
+ return complete_confbridge_participant(a->argv[2], a->line, a->word, a->pos, a->n);
+ }
return NULL;
}
@@ -2208,19 +2291,12 @@
ast_cli(a->fd, "No conference bridge named '%s' found!\n", a->argv[2]);
return CLI_SUCCESS;
}
- ao2_lock(bridge);
- AST_LIST_TRAVERSE(&bridge->active_list, participant, list) {
- if (!strncmp(a->argv[3], ast_channel_name(participant->chan), strlen(ast_channel_name(participant->chan)))) {
- break;
- }
- }
- if (participant) {
- ast_cli(a->fd, "Kicking %s from confbridge %s\n", ast_channel_name(participant->chan), bridge->name);
- participant->kicked = 1;
- ast_bridge_remove(bridge->bridge, participant->chan);
- }
- ao2_unlock(bridge);
+ if (kick_conference_participant(bridge, a->argv[3])) {
+ ast_cli(a->fd, "No participant named '%s' found!\n", a->argv[3]);
+ return CLI_SUCCESS;
+ }
ao2_ref(bridge, -1);
+ ast_cli(a->fd, "Participant '%s' kicked out of conference '%s'\n", a->argv[3], a->argv[2]);
return CLI_SUCCESS;
}
@@ -2408,12 +2484,16 @@
case CLI_INIT:
e->command = "confbridge mute";
e->usage =
- "Usage: confbridge mute <conference> <channel>\n";
+ "Usage: confbridge mute <conference> <channel>\n"
+ " Mute a channel in a conference.\n";
return NULL;
case CLI_GENERATE:
if (a->pos == 2) {
return complete_confbridge_name(a->line, a->word, a->pos, a->n);
}
+ if (a->pos == 3) {
+ return complete_confbridge_participant(a->argv[2], a->line, a->word, a->pos, a->n);
+ }
return NULL;
}
if (a->argc != 4) {
@@ -2431,12 +2511,16 @@
case CLI_INIT:
e->command = "confbridge unmute";
e->usage =
- "Usage: confbridge unmute <conference> <channel>\n";
+ "Usage: confbridge unmute <conference> <channel>\n"
+ " Unmute a channel in a conference.\n";
return NULL;
case CLI_GENERATE:
if (a->pos == 2) {
return complete_confbridge_name(a->line, a->word, a->pos, a->n);
}
+ if (a->pos == 3) {
+ return complete_confbridge_participant(a->argv[2], a->line, a->word, a->pos, a->n);
+ }
return NULL;
}
if (a->argc != 4) {
@@ -2454,7 +2538,9 @@
case CLI_INIT:
e->command = "confbridge lock";
e->usage =
- "Usage: confbridge lock <conference>\n";
+ "Usage: confbridge lock <conference>\n"
+ " Lock a conference. While locked, no new non-admins\n"
+ " may join the conference.\n";
return NULL;
case CLI_GENERATE:
if (a->pos == 2) {
@@ -2479,7 +2565,8 @@
case CLI_INIT:
e->command = "confbridge unlock";
e->usage =
- "Usage: confbridge unlock <conference>\n";
+ "Usage: confbridge unlock <conference>\n"
+ " Unlock a previously locked conference.\n";
return NULL;
case CLI_GENERATE:
if (a->pos == 2) {
@@ -2567,7 +2654,8 @@
case CLI_INIT:
e->command = "confbridge record stop";
e->usage =
- "Usage: confbridge record stop <conference>\n";
+ "Usage: confbridge record stop <conference>\n"
+ " Stop a previously started recording.\n";
return NULL;
case CLI_GENERATE:
if (a->pos == 3) {
@@ -2823,7 +2911,6 @@
{
const char *conference = astman_get_header(m, "Conference");
const char *channel = astman_get_header(m, "Channel");
- struct conference_bridge_user *participant = NULL;
struct conference_bridge *bridge = NULL;
struct conference_bridge tmp;
int found = 0;
@@ -2836,6 +2923,7 @@
astman_send_error(s, m, "No active conferences.");
return 0;
}
+
ast_copy_string(tmp.name, conference, sizeof(tmp.name));
bridge = ao2_find(conference_bridges, &tmp, OBJ_POINTER);
if (!bridge) {
@@ -2843,16 +2931,7 @@
return 0;
}
- ao2_lock(bridge);
- AST_LIST_TRAVERSE(&bridge->active_list, participant, list) {
- if (!strcasecmp(ast_channel_name(participant->chan), channel)) {
- participant->kicked = 1;
- ast_bridge_remove(bridge->bridge, participant->chan);
- found = 1;
- break;
- }
- }
- ao2_unlock(bridge);
+ found = !kick_conference_participant(bridge, channel);
ao2_ref(bridge, -1);
if (found) {
@@ -3031,6 +3110,9 @@
ao2_lock(bridge);
if (!strncasecmp(args.type, "parties", 7)) {
AST_LIST_TRAVERSE(&bridge->active_list, participant, list) {
+ count++;
+ }
+ AST_LIST_TRAVERSE(&bridge->waiting_list, participant, list) {
count++;
}
} else if (!strncasecmp(args.type, "admins", 6)) {
Modified: team/kmoore/stasis-mwi/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/apps/app_dial.c?view=diff&rev=382321&r1=382320&r2=382321
==============================================================================
--- team/kmoore/stasis-mwi/apps/app_dial.c (original)
+++ team/kmoore/stasis-mwi/apps/app_dial.c Thu Feb 28 21:26:17 2013
@@ -3096,7 +3096,7 @@
}
ast_channel_early_bridge(chan, NULL);
- hanguptree(&out_chans, NULL, ast_channel_hangupcause(chan)==AST_CAUSE_ANSWERED_ELSEWHERE ? 1 : 0 ); /* forward 'answered elsewhere' if we received it */
+ hanguptree(&out_chans, NULL, ast_channel_hangupcause(chan)==AST_CAUSE_ANSWERED_ELSEWHERE || ast_test_flag64(&opts, OPT_CANCEL_ELSEWHERE) ? 1 : 0 ); /* forward 'answered elsewhere' if we received it */
pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);
senddialendevent(chan, pa.status);
ast_debug(1, "Exiting with DIALSTATUS=%s.\n", pa.status);
Modified: team/kmoore/stasis-mwi/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/apps/app_meetme.c?view=diff&rev=382321&r1=382320&r2=382321
==============================================================================
--- team/kmoore/stasis-mwi/apps/app_meetme.c (original)
+++ team/kmoore/stasis-mwi/apps/app_meetme.c Thu Feb 28 21:26:17 2013
@@ -147,6 +147,14 @@
specify a musiconhold class to use. If one is not provided, it will use the
channel's currently set music class, or <literal>default</literal>.</para>
<argument name="class" required="true" />
+ </option>
+ <option name="n">
+ <para>Disable the denoiser. By default, if <literal>func_speex</literal> is loaded, Asterisk
+ will apply a denoiser to channels in the MeetMe conference. However, channel
+ drivers that present audio with a varying rate will experience degraded
+ performance with a denoiser attached. This parameter allows a channel joining
+ the conference to choose not to have a denoiser attached without having to
+ unload <literal>func_speex</literal>.</para>
</option>
<option name="o">
<para>Set talker optimization - treats talkers who aren't speaking as
@@ -657,6 +665,8 @@
#define CONFFLAG_INTROUSER_VMREC (1ULL << 33)
/*! If there's only one person left in a conference when someone leaves, kill the conference */
#define CONFFLAG_KILL_LAST_MAN_STANDING ((uint64_t)1 << 34)
+/*! If set, don't enable a denoiser for the channel */
+#define CONFFLAG_DONT_DENOISE (1ULL << 33)
enum {
OPT_ARG_WAITMARKED = 0,
@@ -687,6 +697,7 @@
AST_APP_OPTION('k', CONFFLAG_KILL_LAST_MAN_STANDING ),
AST_APP_OPTION_ARG('M', CONFFLAG_MOH, OPT_ARG_MOH_CLASS ),
AST_APP_OPTION('m', CONFFLAG_STARTMUTED ),
+ AST_APP_OPTION('n', CONFFLAG_DONT_DENOISE ),
AST_APP_OPTION('o', CONFFLAG_OPTIMIZETALKER ),
AST_APP_OPTION('P', CONFFLAG_ALWAYSPROMPT ),
AST_APP_OPTION_ARG('p', CONFFLAG_KEYEXIT, OPT_ARG_EXITKEYS ),
@@ -3218,7 +3229,8 @@
}
/* Reduce background noise from each participant */
- if ((mod_speex = ast_module_helper("", "codec_speex", 0, 0, 0, 0))) {
+ if (!ast_test_flag64(confflags, CONFFLAG_DONT_DENOISE) &&
+ (mod_speex = ast_module_helper("", "func_speex", 0, 0, 0, 0))) {
ast_free(mod_speex);
ast_func_write(chan, "DENOISE(rx)", "on");
}
Modified: team/kmoore/stasis-mwi/apps/app_parkandannounce.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/apps/app_parkandannounce.c?view=diff&rev=382321&r1=382320&r2=382321
==============================================================================
--- team/kmoore/stasis-mwi/apps/app_parkandannounce.c (original)
+++ team/kmoore/stasis-mwi/apps/app_parkandannounce.c Thu Feb 28 21:26:17 2013
@@ -139,6 +139,8 @@
if (!ast_strlen_zero(args.return_context)) {
ast_clear_flag(ast_channel_flags(chan), AST_FLAG_IN_AUTOLOOP);
ast_parseable_goto(chan, args.return_context);
+ } else {
+ ast_channel_priority_set(chan, ast_channel_priority(chan) + 1);
}
ast_verb(3, "Return Context: (%s,%s,%d) ID: %s\n", ast_channel_context(chan), ast_channel_exten(chan),
Modified: team/kmoore/stasis-mwi/apps/confbridge/conf_config_parser.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/apps/confbridge/conf_config_parser.c?view=diff&rev=382321&r1=382320&r2=382321
==============================================================================
--- team/kmoore/stasis-mwi/apps/confbridge/conf_config_parser.c (original)
+++ team/kmoore/stasis-mwi/apps/confbridge/conf_config_parser.c Thu Feb 28 21:26:17 2013
@@ -504,6 +504,7 @@
struct ao2_container *menus;
};
+static int verify_default_profiles(void);
static void *bridge_profile_alloc(const char *category);
static void *bridge_profile_find(struct ao2_container *container, const char *category);
static struct bridge_profile_sounds *bridge_profile_sounds_alloc(void);
@@ -641,6 +642,7 @@
CONFIG_INFO_STANDARD(cfg_info, cfg_handle, confbridge_cfg_alloc,
.files = ACO_FILES(&confbridge_conf),
+ .pre_apply_config = verify_default_profiles,
);
/*! bridge profile container functions */
@@ -1328,6 +1330,10 @@
ast_cli(a->fd,"Record Conference: %s\n",
b_profile.flags & BRIDGE_OPT_RECORD_CONFERENCE ?
+ "yes" : "no");
+
+ ast_cli(a->fd,"Record File Append: %s\n",
+ b_profile.flags & BRIDGE_OPT_RECORD_FILE_APPEND ?
"yes" : "no");
ast_cli(a->fd,"Record File: %s\n",
@@ -1745,6 +1751,41 @@
return 0;
}
+static int verify_default_profiles(void)
+{
+ RAII_VAR(struct user_profile *, user_profile, NULL, ao2_cleanup);
+ RAII_VAR(struct bridge_profile *, bridge_profile, NULL, ao2_cleanup);
+ struct confbridge_cfg *cfg = aco_pending_config(&cfg_info);
+
+ if (!cfg) {
+ return 0;
+ }
+
+ bridge_profile = ao2_find(cfg->bridge_profiles, DEFAULT_BRIDGE_PROFILE, OBJ_KEY);
+ if (!bridge_profile) {
+ bridge_profile = bridge_profile_alloc(DEFAULT_BRIDGE_PROFILE);
+ if (!bridge_profile) {
+ return -1;
+ }
+ ast_log(AST_LOG_NOTICE, "Adding %s profile to app_confbridge\n", DEFAULT_BRIDGE_PROFILE);
+ aco_set_defaults(&bridge_type, DEFAULT_BRIDGE_PROFILE, bridge_profile);
+ ao2_link(cfg->bridge_profiles, bridge_profile);
+ }
+
+ user_profile = ao2_find(cfg->bridge_profiles, DEFAULT_USER_PROFILE, OBJ_KEY);
+ if (!user_profile) {
+ user_profile = user_profile_alloc(DEFAULT_USER_PROFILE);
+ if (!user_profile) {
+ return -1;
+ }
+ ast_log(AST_LOG_NOTICE, "Adding %s profile to app_confbridge\n", DEFAULT_USER_PROFILE);
+ aco_set_defaults(&user_type, DEFAULT_USER_PROFILE, user_profile);
+ ao2_link(cfg->user_profiles, user_profile);
+ }
+
+ return 0;
+}
+
int conf_load_config(int reload)
{
if (!reload) {
@@ -1788,6 +1829,7 @@
aco_option_register_custom(&cfg_info, "mixing_interval", ACO_EXACT, bridge_types, "20", mix_interval_handler, 0);
aco_option_register(&cfg_info, "record_conference", ACO_EXACT, bridge_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct bridge_profile, flags), BRIDGE_OPT_RECORD_CONFERENCE);
aco_option_register_custom(&cfg_info, "video_mode", ACO_EXACT, bridge_types, NULL, video_mode_handler, 0);
+ aco_option_register(&cfg_info, "record_file_append", ACO_EXACT, bridge_types, "yes", OPT_BOOLFLAG_T, 1, FLDSET(struct bridge_profile, flags), BRIDGE_OPT_RECORD_FILE_APPEND);
aco_option_register(&cfg_info, "max_members", ACO_EXACT, bridge_types, "0", OPT_UINT_T, 0, FLDSET(struct bridge_profile, max_members));
aco_option_register(&cfg_info, "record_file", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_file));
aco_option_register_custom(&cfg_info, "^sound_", ACO_REGEX, bridge_types, NULL, sound_option_handler, 0);
Modified: team/kmoore/stasis-mwi/apps/confbridge/include/confbridge.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/apps/confbridge/include/confbridge.h?view=diff&rev=382321&r1=382320&r2=382321
==============================================================================
--- team/kmoore/stasis-mwi/apps/confbridge/include/confbridge.h (original)
+++ team/kmoore/stasis-mwi/apps/confbridge/include/confbridge.h Thu Feb 28 21:26:17 2013
@@ -65,6 +65,7 @@
BRIDGE_OPT_VIDEO_SRC_LAST_MARKED = (1 << 1), /*!< Set if conference should feed video of last marked user to all participants. */
BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED = (1 << 2), /*!< Set if conference should feed video of first marked user to all participants. */
BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER = (1 << 3), /*!< Set if conference set the video feed to follow the loudest talker. */
+ BRIDGE_OPT_RECORD_FILE_APPEND = (1 << 4), /*!< Set if the record file should be appended to between start/stops. */
};
enum conf_menu_action_id {
Modified: team/kmoore/stasis-mwi/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/channels/chan_iax2.c?view=diff&rev=382321&r1=382320&r2=382321
==============================================================================
--- team/kmoore/stasis-mwi/channels/chan_iax2.c (original)
+++ team/kmoore/stasis-mwi/channels/chan_iax2.c Thu Feb 28 21:26:17 2013
@@ -11574,13 +11574,15 @@
ast_string_field_set(iaxs[fr->callno], cid_name, connected.id.name.str);
iaxs[fr->callno]->calling_pres = ast_party_id_presentation(&connected.id);
- if (iaxs[fr->callno]->owner) {
+ iax2_lock_owner(fr->callno);
+ if (iaxs[fr->callno] && iaxs[fr->callno]->owner) {
ast_set_callerid(iaxs[fr->callno]->owner,
S_COR(connected.id.number.valid, connected.id.number.str, ""),
S_COR(connected.id.name.valid, connected.id.name.str, ""),
NULL);
ast_channel_caller(iaxs[fr->callno]->owner)->id.number.presentation = connected.id.number.presentation;
ast_channel_caller(iaxs[fr->callno]->owner)->id.name.presentation = connected.id.name.presentation;
+ ast_channel_unlock(iaxs[fr->callno]->owner);
}
}
ast_party_connected_line_free(&connected);
Modified: team/kmoore/stasis-mwi/channels/chan_jingle.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/channels/chan_jingle.c?view=diff&rev=382321&r1=382320&r2=382321
==============================================================================
--- team/kmoore/stasis-mwi/channels/chan_jingle.c (original)
+++ team/kmoore/stasis-mwi/channels/chan_jingle.c Thu Feb 28 21:26:17 2013
@@ -2002,6 +2002,7 @@
ast_log(LOG_WARNING, "Unable to create I/O context\n");
}
+ bindaddr.sin_family = AF_INET;
ast_sockaddr_from_sin(&bindaddr_tmp, &bindaddr);
if (ast_find_ourip(&ourip_tmp, &bindaddr_tmp, AF_INET)) {
ast_log(LOG_WARNING, "Unable to get own IP address, Jingle disabled\n");
Modified: team/kmoore/stasis-mwi/channels/chan_motif.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/channels/chan_motif.c?view=diff&rev=382321&r1=382320&r2=382321
==============================================================================
--- team/kmoore/stasis-mwi/channels/chan_motif.c (original)
+++ team/kmoore/stasis-mwi/channels/chan_motif.c Thu Feb 28 21:26:17 2013
@@ -2719,7 +2719,7 @@
ast_format_cap_add_all_by_type(jingle_tech.capabilities, AST_FORMAT_TYPE_AUDIO);
if (aco_process_config(&cfg_info, 0)) {
- ast_log(LOG_ERROR, "Unable to read config file motif.conf. Not loading module.\n");
+ ast_log(LOG_ERROR, "Unable to read config file motif.conf. Module loaded but not running.\n");
aco_info_destroy(&cfg_info);
return AST_MODULE_LOAD_DECLINE;
}
Modified: team/kmoore/stasis-mwi/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/channels/chan_sip.c?view=diff&rev=382321&r1=382320&r2=382321
==============================================================================
--- team/kmoore/stasis-mwi/channels/chan_sip.c (original)
+++ team/kmoore/stasis-mwi/channels/chan_sip.c Thu Feb 28 21:26:17 2013
@@ -17245,7 +17245,16 @@
return get_pai(p, req);
}
+ /*
+ * RPID is not:
+ * rpid = (name-addr / addr-spec) *(SEMI rpi-token)
+ * But it is:
+ * rpid = [display-name] LAQUOT addr-spec RAQUOT *(SEMI rpi-token)
+ * Ergo, calling parse_name_andor_addr() on it wouldn't be
+ * correct because that would allow addr-spec style too.
+ */
start = tmp;
+ /* Quoted (note that we're not dealing with escapes properly) */
if (*start == '"') {
*start++ = '\0';
end = strchr(start, '"');
@@ -17254,6 +17263,17 @@
*end++ = '\0';
cid_name = start;
start = ast_skip_blanks(end);
+ /* Unquoted */
+ } else {
+ cid_name = start;
+ start = end = strchr(start, '<');
+ if (!start) {
+ return 0;
+ }
+ /* trim blanks if there are any. the mandatory NUL is done below */
+ while (--end >= cid_name && *end < 33) {
+ *end = '\0';
+ }
}
if (*start != '<')
@@ -17643,7 +17663,10 @@
frommismatch = !!strcmp(fromtag, sip_pvt_ptr->theirtag);
tomismatch = !!strcmp(totag, sip_pvt_ptr->tag);
- if (frommismatch || tomismatch) {
+ /* Don't check from if the dialog is not established, due to multi forking the from
+ * can change when the call is not answered yet.
+ */
+ if ((frommismatch && ast_test_flag(&sip_pvt_ptr->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED)) || tomismatch) {
sip_pvt_unlock(sip_pvt_ptr);
if (frommismatch) {
ast_debug(4, "Matched %s call for callid=%s - pedantic from tag check fails; their tag is %s our tag is %s\n",
Modified: team/kmoore/stasis-mwi/channels/chan_skinny.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-mwi/channels/chan_skinny.c?view=diff&rev=382321&r1=382320&r2=382321
==============================================================================
--- team/kmoore/stasis-mwi/channels/chan_skinny.c (original)
+++ team/kmoore/stasis-mwi/channels/chan_skinny.c Thu Feb 28 21:26:17 2013
@@ -402,6 +402,11 @@
#define HEADSET_STATUS_MESSAGE 0x002B
#define REGISTER_AVAILABLE_LINES_MESSAGE 0x002D
+#define SERVICEURL_STATREQ_MESSAGE 0x0033
+struct serviceurl_statreq_message {
+ uint32_t instance;
+};
+
#define REGISTER_ACK_MESSAGE 0x0081
struct register_ack_message {
uint32_t keepAlive;
@@ -576,6 +581,7 @@
#define STIMULUS_LINE 0x09
#define STIMULUS_VOICEMAIL 0x0F
#define STIMULUS_AUTOANSWER 0x11
+#define STIMULUS_SERVICEURL 0x14
#define STIMULUS_DND 0x3F
#define STIMULUS_CONFERENCE 0x7D
#define STIMULUS_CALLPARK 0x7E
@@ -594,6 +600,7 @@
#define BT_LINE STIMULUS_LINE
#define BT_VOICEMAIL STIMULUS_VOICEMAIL
#define BT_AUTOANSWER STIMULUS_AUTOANSWER
+#define BT_SERVICEURL STIMULUS_SERVICEURL
#define BT_DND STIMULUS_DND
#define BT_CONFERENCE STIMULUS_CONFERENCE
#define BT_CALLPARK STIMULUS_CALLPARK
@@ -1080,7 +1087,29 @@
uint32_t callReference;
};
+#define MAX_SERVICEURL 256
+#define SERVICEURL_STAT_MESSAGE 0x012F
+struct serviceurl_stat_message {
+ uint32_t instance;
+ char url[MAX_SERVICEURL];
+ char displayName[40];
+};
+
#define MAXCALLINFOSTR 256
+#define MAXDISPLAYNOTIFYSTR 32
+
+#define DISPLAY_PRINOTIFY_MESSAGE 0x0120
+struct display_prinotify_message {
+ uint32_t timeout;
+ uint32_t priority;
+ char text[MAXDISPLAYNOTIFYSTR];
+};
+
+#define CLEAR_PRINOTIFY_MESSAGE 0x0121
+struct clear_prinotify_message {
+ uint32_t priority;
+};
+
#define CALL_INFO_MESSAGE_VARIABLE 0x014A
struct call_info_message_variable {
uint32_t instance;
@@ -1092,6 +1121,13 @@
uint32_t unknown4;
uint32_t unknown5;
char calldetails[MAXCALLINFOSTR];
+};
+
+#define DISPLAY_PRINOTIFY_MESSAGE_VARIABLE 0x0144
+struct display_prinotify_message_variable {
+ uint32_t timeout;
+ uint32_t priority;
+ char text[MAXDISPLAYNOTIFYSTR];
};
#define DISPLAY_PROMPT_STATUS_MESSAGE_VARIABLE 0x0145
@@ -1152,6 +1188,10 @@
struct bksp_req_message bkspmessage;
struct call_info_message_variable callinfomessagevariable;
struct display_prompt_status_message_variable displaypromptstatusvar;
+ struct serviceurl_stat_message serviceurlmessage;
+ struct clear_prinotify_message clearprinotify;
+ struct display_prinotify_message displayprinotify;
+ struct display_prinotify_message_variable displayprinotifyvar;
};
/* packet composition */
@@ -1342,6 +1382,8 @@
int aa_beep;
int aa_mute;
int dialer_sched;
+ char *origtonum;
+ char *origtoname;
AST_LIST_ENTRY(skinny_subchannel) list;
struct skinny_subchannel *related;
@@ -1467,6 +1509,14 @@
struct skinny_device *parent;
};
+struct skinny_serviceurl {
+ int instance;
+ char url[MAX_SERVICEURL];
+ char displayName[40];
+ AST_LIST_ENTRY(skinny_serviceurl) list;
+ struct skinny_device *device;
+};
+
#define SKINNY_DEVICECONTAINER 1
#define SKINNY_LINECONTAINER 2
#define SKINNY_SUBLINECONTAINER 3
@@ -1516,6 +1566,7 @@
struct ast_format_cap *confcap;
AST_LIST_HEAD(, skinny_line) lines;
AST_LIST_HEAD(, skinny_speeddial) speeddials;
+ AST_LIST_HEAD(, skinny_serviceurl) serviceurls;
AST_LIST_HEAD(, skinny_addon) addons;
AST_LIST_ENTRY(skinny_device) list;
};
@@ -2377,7 +2428,8 @@
}
//static void transmit_callinfo(struct skinny_subchannel *sub)
-static void transmit_callinfo(struct skinny_device *d, int instance, int callid, char *fromname, char *fromnum, char *toname, char *tonum, int calldirection)
+static void transmit_callinfo(struct skinny_device *d, int instance, int callid,
+ char *fromname, char *fromnum, char *toname, char *tonum, int calldirection, char *origtonum, char *origtoname)
{
struct skinny_req *req;
@@ -2388,17 +2440,24 @@
ast_copy_string(req->data.callinfo.callingParty, fromnum, sizeof(req->data.callinfo.callingParty));
ast_copy_string(req->data.callinfo.calledPartyName, toname, sizeof(req->data.callinfo.calledPartyName));
ast_copy_string(req->data.callinfo.calledParty, tonum, sizeof(req->data.callinfo.calledParty));
+ if (origtoname) {
+ ast_copy_string(req->data.callinfo.originalCalledPartyName, origtoname, sizeof(req->data.callinfo.originalCalledPartyName));
+ }
+ if (origtonum) {
+ ast_copy_string(req->data.callinfo.originalCalledParty, origtonum, sizeof(req->data.callinfo.originalCalledParty));
+ }
+
req->data.callinfo.instance = htolel(instance);
req->data.callinfo.reference = htolel(callid);
req->data.callinfo.type = htolel(calldirection);
- SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting CALL_INFO_MESSAGE to %s, to %s(%s) from %s(%s) (dir=%d) on %s(%d)\n",
- d->name, toname, tonum, fromname, fromnum, calldirection, d->name, instance);
+ SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting CALL_INFO_MESSAGE to %s, to %s(%s) from %s(%s), origto %s(%s) (dir=%d) on %s(%d)\n",
+ d->name, toname, tonum, fromname, fromnum, origtoname, origtonum, calldirection, d->name, instance);
transmit_response(d, req);
}
static void transmit_callinfo_variable(struct skinny_device *d, int instance, int callreference,
- char *fromname, char *fromnum, char *toname, char *tonum, int calldirection)
+ char *fromname, char *fromnum, char *toname, char *tonum, int calldirection, char *origtonum, char *origtoname)
{
struct skinny_req *req;
char *strptr;
@@ -2423,10 +2482,11 @@
thestrings[1] = ""; /* Appears to be origfrom */
if (calldirection == SKINNY_OUTGOING) {
thestrings[2] = tonum;
+ thestrings[3] = origtonum;
} else {
thestrings[2] = "";
- }
- thestrings[3] = "";
+ thestrings[3] = "";
+ }
thestrings[4] = "";
thestrings[5] = "";
thestrings[6] = "";
@@ -2435,21 +2495,27 @@
thestrings[8] = "";
thestrings[9] = fromname;
thestrings[10] = toname;
- thestrings[11] = "";
+ thestrings[11] = origtoname;
thestrings[12] = "";
strptr = req->data.callinfomessagevariable.calldetails;
for(i = 0; i < 13; i++) {
- ast_copy_string(strptr, thestrings[i], callinfostrleft);
- strptr += strlen(thestrings[i]) + 1;
- callinfostrleft -= strlen(thestrings[i]) + 1;
+ if (thestrings[i]) {
+ ast_copy_string(strptr, thestrings[i], callinfostrleft);
+ strptr += strlen(thestrings[i]) + 1;
+ callinfostrleft -= strlen(thestrings[i]) + 1;
+ } else {
+ ast_copy_string(strptr, "", callinfostrleft);
+ strptr++;
+ callinfostrleft--;
+ }
}
req->len = req->len - (callinfostrleft & ~0x3);
- SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting CALL_INFO_MESSAGE_VARIABLE to %s, to %s(%s) from %s(%s) (dir=%d) on %s(%d)\n",
- d->name, toname, tonum, fromname, fromnum, calldirection, d->name, instance);
+ SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting CALL_INFO_MESSAGE_VARIABLE to %s, to %s(%s) from %s(%s), origto %s(%s) (dir=%d) on %s(%d)\n",
+ d->name, toname, tonum, fromname, fromnum, origtoname, origtonum, calldirection, d->name, instance);
transmit_response(d, req);
}
@@ -2494,9 +2560,9 @@
}
if (d->protocolversion < 17) {
- transmit_callinfo(d, l->instance, sub->callid, fromname, fromnum, toname, tonum, sub->calldirection);
+ transmit_callinfo(d, l->instance, sub->callid, fromname, fromnum, toname, tonum, sub->calldirection, sub->origtonum, sub->origtoname);
} else {
- transmit_callinfo_variable(d, l->instance, sub->callid, fromname, fromnum, toname, tonum, sub->calldirection);
+ transmit_callinfo_variable(d, l->instance, sub->callid, fromname, fromnum, toname, tonum, sub->calldirection, sub->origtonum, sub->origtoname);
}
}
@@ -2541,9 +2607,9 @@
}
if (d->protocolversion < 17) {
- transmit_callinfo(subline->line->device, subline->line->instance, subline->callid, fromname, fromnum, toname, tonum, sub->calldirection);
+ transmit_callinfo(subline->line->device, subline->line->instance, subline->callid, fromname, fromnum, toname, tonum, sub->calldirection, sub->origtonum, sub->origtoname);
} else {
- transmit_callinfo_variable(subline->line->device, subline->line->instance, subline->callid, fromname, fromnum, toname, tonum, sub->calldirection);
+ transmit_callinfo_variable(subline->line->device, subline->line->instance, subline->callid, fromname, fromnum, toname, tonum, sub->calldirection, sub->origtonum, sub->origtoname);
}
}
@@ -2725,6 +2791,83 @@
SKINNY_DEBUG(DEBUG_PACKET, 3, "Transmitting DISPLAY_NOTIFY_MESSAGE to %s, text %s\n", d->name, text);
transmit_response(d, req);
+}
+
+static void transmit_clearprinotify(struct skinny_device *d, int priority)
+{
+ struct skinny_req *req;
+
+ if (!(req = req_alloc(sizeof(struct clear_prinotify_message), CLEAR_PRINOTIFY_MESSAGE)))
+ return;
+
[... 1675 lines stripped ...]
More information about the asterisk-commits
mailing list