예제 #1
0
        /// <summary>
        /// An outgoing call was successfully answered.
        /// </summary>
        /// <param name="uac">The local SIP user agent client that initiated the call.</param>
        /// <param name="sipResponse">The SIP answer response received from the remote party.</param>
        private void CallAnswered(ISIPClientUserAgent uac, SIPResponse sipResponse)
        {
            StatusMessage(this, "Call answered: " + sipResponse.StatusCode + " " + sipResponse.ReasonPhrase + ".");

            if (sipResponse.StatusCode >= 200 && sipResponse.StatusCode <= 299)
            {
                if (sipResponse.Header.ContentType != _sdpMimeContentType)
                {
                    // Payload not SDP, I don't understand :(.
                    StatusMessage(this, "Call was hungup as the answer response content type was not recognized: " + sipResponse.Header.ContentType + ". :(");
                    Hangup();
                }
                else if (sipResponse.Body.IsNullOrBlank())
                {
                    // They said SDP but didn't give us any :(.
                    StatusMessage(this, "Call was hungup as the answer response had an empty SDP payload. :(");
                    Hangup();
                }
                else
                {
                    CallAnswer?.Invoke(this);
                }
            }
            else
            {
                CallFinished();
            }
        }
예제 #2
0
        public CallAnswer HandleCallRequest(CallRequest callRequest)
        {
            CallAnswer result = null;
            MethodInfo methodInfo;

            methodInfos.TryGetValue(callRequest.MethodInfoId, out methodInfo);
            if (methodInfo != null)
            {
                callRequest.Target = GetRealObject(callRequest.Target);
                object[] paramValues = callRequest.ParameterValues;
                for (int i = 0; i < paramValues.Length; i++)
                {
                    paramValues[i] = GetRealObject(paramValues[i]);
                }

                result = new CallAnswer();

                try
                {
                    object returnValue = methodInfo.Invoke(callRequest.Target, paramValues);
                    result.ReturnValue = GetObjectId(returnValue);
                    //foreach()
                }
                catch (Exception ex)
                {
                    result.ExceptionMessage = ex.Message;
                }
            }
            return(result);
        }
예제 #3
0
        /// <summary>
        /// An outgoing call was successfully answered.
        /// </summary>
        /// <param name="uac">The local SIP user agent client that initiated the call.</param>
        /// <param name="sipResponse">The SIP answer response received from the remote party.</param>
        private async void CallAnswered(ISIPClientUserAgent uac, SIPResponse sipResponse)
        {
            StatusMessage(this, "Call answered: " + sipResponse.StatusCode + " " + sipResponse.ReasonPhrase + ".");

            // This call will allow the session source to be adjusted depending on whether the underlying
            // session has support for audio or video.
            await MediaSession.SetSources(null, null).ConfigureAwait(false);

            CallAnswer?.Invoke(this);
        }
예제 #4
0
        public void Save(CallAnswerItem uiAnswer)
        {
            CallAnswer dbAnswer;

            if (uiAnswer.Id == 0)
            {
                dbAnswer = new CallAnswer();
                Db.CallAnswers.Add(dbAnswer);
            }
            else
            {
                dbAnswer = Db.CallAnswers.Single(x => x.Id == uiAnswer.Id);
            }

            dbAnswer.Text           = uiAnswer.Text;
            dbAnswer.FromQuestionId = uiAnswer.FromQuestionId;
            dbAnswer.ToQuestionId   = uiAnswer.ToQuestionId;
            Db.SaveChanges();
            uiAnswer.Id = dbAnswer.Id;
        }
예제 #5
0
 /// <summary>
 /// An outgoing call was successfully answered.
 /// </summary>
 /// <param name="uac">The local SIP user agent client that initiated the call.</param>
 /// <param name="sipResponse">The SIP answer response received from the remote party.</param>
 private void CallAnswered(ISIPClientUserAgent uac, SIPResponse sipResponse)
 {
     StatusMessage(this, "Call answered: " + sipResponse.StatusCode + " " + sipResponse.ReasonPhrase + ".");
     CallAnswer?.Invoke(this);
 }
예제 #6
0
 public void HandleCallAnswer(CallAnswer callAnswer)
 {
     throw new NotImplementedException();
 }