Beispiel #1
0
        public override void onIncomingCall(OnIncomingCallParam prm)
        {
            CallOpParam cprm = new CallOpParam();

            cprm.statusCode = pjsip_status_code.PJSIP_SC_RINGING;
            PjsipCall call = new PjsipCall(this, prm.callId);

            call.answer(cprm);

            if (onAccountIncomingCall != null)
            {
                onAccountIncomingCall(this, call, prm.callId);
            }
        }
Beispiel #2
0
 /// <summary>
 /// Ответ на входящий вызов
 /// </summary>
 private void Answer()
 {
     if (ring != null)
     {
         ring.Stop = true;
         ring      = null;
     }
     if (currentCall != null)
     {
         CallOpParam prm = new CallOpParam();
         prm.statusCode = pjsip_status_code.PJSIP_SC_OK;
         currentCall.answer(prm);
         SetCallButtonState(CallButtonState.Hungup);
     }
 }
Beispiel #3
0
 /// <summary>
 /// Обработка входящего вызова
 /// </summary>
 /// <param name="acc"></param>
 /// <param name="callId"></param>
 private void IncomingCall(PjsipAccount acc, PjsipCall call, int callId)
 {
     if (InvokeRequired)
     {
         AccountIncomingCall ic = new AccountIncomingCall(IncomingCall);
         Invoke(ic, new object[] { acc, call, callId });
     }
     else
     {
         try
         {
             if (currentCall != null && currentCall.IsOnline)
             {
                 CallOpParam prm = new CallOpParam();
                 prm.statusCode = pjsip_status_code.PJSIP_SC_BUSY_HERE;
                 call.answer(prm);
                 call.Dispose();
             }
             else
             {
                 SelectAccount(acc);
                 currentCall = call;
                 currentCall.OnCallIncoming     = CallIncomingInfo;
                 currentCall.OnCallDisconnected = CallDisconnect;
                 SetCallButtonState(CallButtonState.Ring);
                 ring = new PjsipRing();
             }
         }
         catch
         {
             if (currentCall != null)
             {
                 Hungup();
             }
         }
     }
 }