mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-11 03:57:14 +00:00
Add more IVR stuff and a test app (mod_ivrtest)
in dialplan (ivrtest <path to file>) if the file is valid it will play the file and you will be expected to dial digits until you dial 10 digits or press # or * (* will end the call) (# will repeat the test endlessly) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@462 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
4a98cfbb88
commit
534db1947e
10 files changed
+504
-29
No files matched your search
@@ -40,7 +40,7 @@ static const char modname[] = "mod_playback";
|
||||
dtmf handler function you can hook up to be executed when a digit is dialed during playback
|
||||
if you return anything but SWITCH_STATUS_SUCCESS the playback will stop.
|
||||
*/
|
||||
static switch_status on_dtmf(switch_core_session *session, char *dtmf)
|
||||
static switch_status on_dtmf(switch_core_session *session, char *dtmf, void *buf, unsigned int buflen)
|
||||
{
|
||||
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Digits %s\n", dtmf);
|
||||
|
||||
@@ -52,7 +52,7 @@ static switch_status on_dtmf(switch_core_session *session, char *dtmf)
|
||||
}
|
||||
|
||||
|
||||
void playback_function(switch_core_session *session, char *data)
|
||||
static void playback_function(switch_core_session *session, char *data)
|
||||
{
|
||||
switch_channel *channel;
|
||||
char *timer_name = NULL;
|
||||
@@ -67,20 +67,20 @@ void playback_function(switch_core_session *session, char *data)
|
||||
channel = switch_core_session_get_channel(session);
|
||||
assert(channel != NULL);
|
||||
|
||||
if (switch_ivr_play_file(session, file_name, timer_name, on_dtmf) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_ivr_play_file(session, file_name, timer_name, on_dtmf, NULL, 0) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_hangup(channel);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void record_function(switch_core_session *session, char *data)
|
||||
static void record_function(switch_core_session *session, char *data)
|
||||
{
|
||||
switch_channel *channel;
|
||||
channel = switch_core_session_get_channel(session);
|
||||
assert(channel != NULL);
|
||||
|
||||
if (switch_ivr_record_file(session, data, on_dtmf) != SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_ivr_record_file(session, data, on_dtmf, NULL, 0) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_channel_hangup(channel);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user