summaryrefslogtreecommitdiff
path: root/res/res_stasis_playback.c
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2014-04-17 21:57:36 +0000
committerJonathan Rose <jrose@digium.com>2014-04-17 21:57:36 +0000
commita8742e327f8de3866526a653977c0eae58d85d40 (patch)
tree02464cf2984c6beb6efe2864e252b33aefab899c /res/res_stasis_playback.c
parentc3497aa2bbfcf2e78d479a9d586b0320ba2b7cb0 (diff)
ARI: Add tones playback resource
Adds a tones URI type to the playback resource. The tone can be specified by name (from indications.conf) or by a tone pattern. In addition, tonezone can be specified in the URI (by appending ;tonezone=<zone>). Tones must be stopped manually in order for a stasis control to move on from playback of the tone. Tones may be paused, resumed, restarted, and stopped. They may not be rewound or fast forwarded (tones can't be controlled in a way that lets you skip around from note to note and pausing and resuming will also restart the tone from the beginning). Tests are currently in development for this feature (https://reviewboard.asterisk.org/r/3428/). (closes issue ASTERISK-23433) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/3427/ ........ Merged revisions 412535 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_stasis_playback.c')
-rw-r--r--res/res_stasis_playback.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/res/res_stasis_playback.c b/res/res_stasis_playback.c
index 79c2bab9c..960f2e334 100644
--- a/res/res_stasis_playback.c
+++ b/res/res_stasis_playback.c
@@ -48,6 +48,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/stringfields.h"
#include "asterisk/uuid.h"
#include "asterisk/say.h"
+#include "asterisk/indications.h"
/*! Number of hash buckets for playback container. Keep it prime! */
#define PLAYBACK_BUCKETS 127
@@ -60,6 +61,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#define NUMBER_URI_SCHEME "number:"
#define DIGITS_URI_SCHEME "digits:"
#define CHARACTERS_URI_SCHEME "characters:"
+#define TONE_URI_SCHEME "tone:"
/*! Container of all current playbacks */
static struct ao2_container *playbacks;
@@ -323,6 +325,9 @@ static void play_on_channel(struct stasis_app_playback *playback,
} else if (ast_begins_with(playback->media, CHARACTERS_URI_SCHEME)) {
res = ast_say_character_str(chan, playback->media + strlen(CHARACTERS_URI_SCHEME),
stop, playback->language, AST_SAY_CASE_NONE);
+ } else if (ast_begins_with(playback->media, TONE_URI_SCHEME)) {
+ playback->controllable = 1;
+ res = ast_control_tone(chan, playback->media + strlen(TONE_URI_SCHEME));
} else {
/* Play URL */
ast_log(LOG_ERROR, "Attempted to play URI '%s' on channel '%s' but scheme is unsupported",