From bfaed1394344a743ad9e2605d691bf86ec94ad8c Mon Sep 17 00:00:00 2001 From: marian Date: Wed, 19 Jan 2011 16:13:39 +0000 Subject: [PATCH] Optionally drop the conference room when assisted channel is hungup (defaults to yes). git-svn-id: http://voip.null.ro/svn/yate@4041 acf43c95-373e-0410-b603-e72c3f656dc1 --- conf.d/pbxassist.conf.sample | 6 ++++++ modules/server/pbxassist.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/conf.d/pbxassist.conf.sample b/conf.d/pbxassist.conf.sample index dc891769..51927200 100644 --- a/conf.d/pbxassist.conf.sample +++ b/conf.d/pbxassist.conf.sample @@ -42,6 +42,12 @@ ; This parameter can be overridden from routing by a 'pbxlang' parameter ;lang= +; dropconfhangup: bool: Drop (terminate) the conference room on hangup if the call is in one +; This parameter can be overridden from routing by a 'pbxdropconfhangup' parameter +; This parameter is applied on reload +; Defaults to yes +;dropconfhangup=yes + ; Every other section defines an operation to trigger ;[operation] diff --git a/modules/server/pbxassist.cpp b/modules/server/pbxassist.cpp index 748127ea..5a73bf36 100644 --- a/modules/server/pbxassist.cpp +++ b/modules/server/pbxassist.cpp @@ -136,6 +136,9 @@ static String s_error; // Language parameter for tones played by the pbx static String s_lang; +// Drop conference on hangup +static bool s_dropConfHangup = true; + // on-hangup transfer list static ObjList s_transList; static Mutex s_transMutex(false,"PBXAssist::transfer"); @@ -233,6 +236,7 @@ void PBXList::initialize() s_onhold = s_cfg.getValue("general","onhold","moh/default"); s_error = s_cfg.getValue("general","error","tone/outoforder"); s_lang = s_cfg.getValue("general","lang"); + s_dropConfHangup = s_cfg.getBoolValue("general","dropconfhangup",true); unlock(); if (s_cfg.getBoolValue("general","enabled",false)) ChanAssistList::initialize(); @@ -1050,7 +1054,8 @@ void PBXAssist::msgHangup(Message& msg) l = l->skipNext(); } s_transMutex.unlock(); - if (m_room && (state() == "conference")) { + if (m_room && (state() == "conference") && + m_keep.getBoolValue("pbxdropconfhangup",s_dropConfHangup)) { // hangup the conference if we didn't switch out of it Message* m = new Message("call.drop"); m->addParam("id",m_room);