From a541609dde8fdcf49d952cf496f1d8d9403d572e Mon Sep 17 00:00:00 2001
From: Russell Bryant <russell@russellbryant.com>
Date: Fri, 2 Apr 2010 23:55:57 +0000
Subject: [PATCH] Export MEETMEBOOKID and fix pin-less conferences with
 realtime conferences

(closes issue #16866)
Reported by: DEA
Patches:
      rt-meetme-options.txt uploaded by DEA (license 3)
Tested by: DEA

Review: https://reviewboard.asterisk.org/r/582/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 apps/app_meetme.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index 73be47145e..1217b39c73 100644
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -3477,6 +3477,11 @@ bailoutandtrynormal:
 		/* Return the number of seconds the user was in the conf */
 		snprintf(meetmesecs, sizeof(meetmesecs), "%d", (int) (time(NULL) - user->jointime));
 		pbx_builtin_setvar_helper(chan, "MEETMESECS", meetmesecs);
+
+		/* Return the RealTime bookid for CDR linking */
+		if (rt_schedule) {
+			pbx_builtin_setvar_helper(chan, "MEETMEBOOKID", conf->bookid);
+		}
 	}
 	ast_free(user);
 	AST_LIST_UNLOCK(&confs);
@@ -4051,6 +4056,14 @@ static int conf_exec(struct ast_channel *chan, const char *data)
 					/* No pin required */
 					allowretry = 0;
 
+					/* For RealTime conferences without a pin 
+					 * should still support loading options
+					 */
+					if (!ast_strlen_zero(cnf->useropts)) {
+						char *opts = ast_strdupa(cnf->useropts);
+						ast_app_parse_options64(meetme_opts, &confflags, optargs, opts);
+					}
+
 					/* Run the conference */
 					res = conf_run(chan, cnf, &confflags, optargs);
 				}
-- 
GitLab