summaryrefslogtreecommitdiff
path: root/apps/app_confbridge.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_confbridge.c')
-rw-r--r--apps/app_confbridge.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c
index 8045680e4..5976d39db 100644
--- a/apps/app_confbridge.c
+++ b/apps/app_confbridge.c
@@ -118,6 +118,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
<value name="KICKED">The channel was kicked from the conference.</value>
<value name="ENDMARKED">The channel left the conference as a result of the last marked user leaving.</value>
<value name="DTMF">The channel pressed a DTMF sequence to exit the conference.</value>
+ <value name="TIMEOUT">The channel reached its configured timeout.</value>
</variable>
</variablelist>
</description>
@@ -1542,6 +1543,13 @@ static int conf_get_pin(struct ast_channel *chan, struct confbridge_user *user)
return -1;
}
+static int user_timeout(struct ast_bridge_channel *bridge_channel, void *ignore)
+{
+ ast_bridge_channel_leave_bridge(bridge_channel, BRIDGE_CHANNEL_STATE_END, 0);
+ pbx_builtin_setvar_helper(bridge_channel->chan, "CONFBRIDGE_RESULT", "TIMEOUT");
+ return -1;
+}
+
static int conf_rec_name(struct confbridge_user *user, const char *conf_name)
{
char destdir[PATH_MAX];
@@ -1776,6 +1784,16 @@ static int confbridge_exec(struct ast_channel *chan, const char *data)
ast_autoservice_stop(chan);
}
+ if (user.u_profile.timeout) {
+ ast_bridge_interval_hook(&user.features,
+ 0,
+ user.u_profile.timeout * 1000,
+ user_timeout,
+ NULL,
+ NULL,
+ AST_BRIDGE_HOOK_REMOVE_ON_PULL);
+ }
+
/* See if we need to automatically set this user as a video source or not */
handle_video_on_join(conference, user.chan, ast_test_flag(&user.u_profile, USER_OPT_MARKEDUSER));