Exemple #1
0
        public static bool Hold(bool isAuto)
        {
            List <Call> calls = new List <Call>();

            if (true == isAuto)
            {
                log.Info("automatically hold the active or held call now");
                calls.AddRange(callManager.GetActiveCalls());
                calls.AddRange(callManager.GetHeldCalls());
            }
            else
            {
                log.Info(" hold the current call now");
                var currentCall = callManager.CurrentCall;
                if (null != currentCall)
                {
                    calls.Add(currentCall);
                }
            }
            foreach (var holdCall in calls)
            {
                var errno = WrapperProxy.HoldCall(holdCall.CallHandle);
                if (ErrorNumberEnum.PLCM_SAMPLE_OK != errno)
                {
                    log.Error("hold a call failed." + "callHanlde is: " + holdCall.CallHandle +
                              ".Error number = " + errno.ToString());
                    return(false);
                }
            }
            return(true);
        }
Exemple #2
0
        /**
         * User agent hold the current call.
         * @param isAuto: true, this call is hold automatically,
         *        for EX. when answer an incoming call, automatically hold the active call;
         *        otherwise, hold the current call
         * @return true: successful; false: fail
         */
        public static bool Hold(Call call)
        {
            var errno = WrapperProxy.HoldCall(call.CallHandle);

            if (ErrorNumberEnum.PLCM_SAMPLE_OK != errno)
            {
                log.Error("hold a call failed." + "callHanlde is: " + call.CallHandle +
                          ".Error number = " + errno.ToString());
                return(false);
            }
            return(true);
        }