dist-dtmf flag in conference
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13191 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
4ef0633663
commit
ffe5fde0b5
|
@ -144,7 +144,8 @@ typedef enum {
|
||||||
MFLAG_TALKING = (1 << 11),
|
MFLAG_TALKING = (1 << 11),
|
||||||
MFLAG_RESTART = (1 << 12),
|
MFLAG_RESTART = (1 << 12),
|
||||||
MFLAG_MINTWO = (1 << 13),
|
MFLAG_MINTWO = (1 << 13),
|
||||||
MFLAG_MUTE_DETECT = (1 << 14)
|
MFLAG_MUTE_DETECT = (1 << 14),
|
||||||
|
MFLAG_DIST_DTMF = (1 << 15)
|
||||||
} member_flag_t;
|
} member_flag_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -153,7 +154,7 @@ typedef enum {
|
||||||
CFLAG_ENFORCE_MIN = (1 << 2),
|
CFLAG_ENFORCE_MIN = (1 << 2),
|
||||||
CFLAG_DESTRUCT = (1 << 3),
|
CFLAG_DESTRUCT = (1 << 3),
|
||||||
CFLAG_LOCKED = (1 << 4),
|
CFLAG_LOCKED = (1 << 4),
|
||||||
CFLAG_ANSWERED = (1 << 5)
|
CFLAG_ANSWERED = (1 << 5),
|
||||||
} conf_flag_t;
|
} conf_flag_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -358,6 +359,7 @@ static void *SWITCH_THREAD_FUNC conference_video_thread_run(switch_thread_t *thr
|
||||||
static void conference_loop_output(conference_member_t *member);
|
static void conference_loop_output(conference_member_t *member);
|
||||||
static uint32_t conference_stop_file(conference_obj_t *conference, file_stop_t stop);
|
static uint32_t conference_stop_file(conference_obj_t *conference, file_stop_t stop);
|
||||||
static switch_status_t conference_play_file(conference_obj_t *conference, char *file, uint32_t leadin, switch_channel_t *channel, uint8_t async);
|
static switch_status_t conference_play_file(conference_obj_t *conference, char *file, uint32_t leadin, switch_channel_t *channel, uint8_t async);
|
||||||
|
static void conference_send_all_dtmf(conference_obj_t *conference, const char *dtmf);
|
||||||
static switch_status_t conference_say(conference_obj_t *conference, const char *text, uint32_t leadin);
|
static switch_status_t conference_say(conference_obj_t *conference, const char *text, uint32_t leadin);
|
||||||
static void conference_list(conference_obj_t *conference, switch_stream_handle_t *stream, char *delim);
|
static void conference_list(conference_obj_t *conference, switch_stream_handle_t *stream, char *delim);
|
||||||
static conference_obj_t *conference_find(char *name);
|
static conference_obj_t *conference_find(char *name);
|
||||||
|
@ -1999,11 +2001,14 @@ static void conference_loop_output(conference_member_t *member)
|
||||||
if (switch_channel_has_dtmf(channel)) {
|
if (switch_channel_has_dtmf(channel)) {
|
||||||
switch_channel_dequeue_dtmf_string(channel, dtmf, sizeof(dtmf));
|
switch_channel_dequeue_dtmf_string(channel, dtmf, sizeof(dtmf));
|
||||||
|
|
||||||
if (member->conference->dtmf_parser != NULL) {
|
if (switch_test_flag(member, MFLAG_DIST_DTMF)) {
|
||||||
|
conference_send_all_dtmf(member->conference, dtmf);
|
||||||
for (digit = dtmf; *digit && caller_action == NULL; digit++) {
|
} else {
|
||||||
caller_action = (caller_control_action_t *)
|
if (member->conference->dtmf_parser != NULL) {
|
||||||
switch_ivr_digit_stream_parser_feed(member->conference->dtmf_parser, member->digit_stream, *digit);
|
for (digit = dtmf; *digit && caller_action == NULL; digit++) {
|
||||||
|
caller_action = (caller_control_action_t *)
|
||||||
|
switch_ivr_digit_stream_parser_feed(member->conference->dtmf_parser, member->digit_stream, *digit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* otherwise, clock the parser so that it can handle digit timeout detection */
|
/* otherwise, clock the parser so that it can handle digit timeout detection */
|
||||||
|
@ -2414,6 +2419,27 @@ static uint32_t conference_member_stop_file(conference_member_t *member, file_st
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void conference_send_all_dtmf(conference_obj_t *conference, const char *dtmf)
|
||||||
|
{
|
||||||
|
conference_member_t *imember;
|
||||||
|
|
||||||
|
switch_mutex_lock(conference->mutex);
|
||||||
|
switch_mutex_lock(conference->member_mutex);
|
||||||
|
|
||||||
|
for (imember = conference->members; imember; imember = imember->next) {
|
||||||
|
if (imember->session) {
|
||||||
|
const char *p;
|
||||||
|
for (p = dtmf; p && *p; p++) {
|
||||||
|
switch_dtmf_t dtmf = { *p, SWITCH_DEFAULT_DTMF_DURATION};
|
||||||
|
switch_channel_queue_dtmf(switch_core_session_get_channel(imember->session), &dtmf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch_mutex_unlock(conference->member_mutex);
|
||||||
|
switch_mutex_unlock(conference->mutex);
|
||||||
|
}
|
||||||
|
|
||||||
/* Play a file in the conference room */
|
/* Play a file in the conference room */
|
||||||
static switch_status_t conference_play_file(conference_obj_t *conference, char *file, uint32_t leadin, switch_channel_t *channel, uint8_t async)
|
static switch_status_t conference_play_file(conference_obj_t *conference, char *file, uint32_t leadin, switch_channel_t *channel, uint8_t async)
|
||||||
{
|
{
|
||||||
|
@ -4431,6 +4457,8 @@ static void set_mflags(char *flags, member_flag_t *f)
|
||||||
*f |= MFLAG_WASTE_BANDWIDTH;
|
*f |= MFLAG_WASTE_BANDWIDTH;
|
||||||
} else if (!strcasecmp(argv[i], "mute-detect")) {
|
} else if (!strcasecmp(argv[i], "mute-detect")) {
|
||||||
*f |= MFLAG_MUTE_DETECT;
|
*f |= MFLAG_MUTE_DETECT;
|
||||||
|
} else if (!strcasecmp(argv[i], "dist-dtmf")) {
|
||||||
|
*f |= MFLAG_DIST_DTMF;
|
||||||
} else if (!strcasecmp(argv[i], "endconf")) {
|
} else if (!strcasecmp(argv[i], "endconf")) {
|
||||||
*f |= MFLAG_ENDCONF;
|
*f |= MFLAG_ENDCONF;
|
||||||
} else if (!strcasecmp(argv[i], "mintwo")) {
|
} else if (!strcasecmp(argv[i], "mintwo")) {
|
||||||
|
|
Loading…
Reference in New Issue