Exemple #1
0
 public void Start()
 {
     try
     {
         SipAgentNet.Start();
     }
     catch (Exception x)
     {
         LogException(x, "Start Exception");
     }
 }
Exemple #2
0
 public void MixerUnlink(int srcId, int dstId)
 {
     try
     {
         SipAgentNet.MixerUnlink(srcId, dstId);
     }
     catch (Exception x)
     {
         LogException(x, "MixerUnlink Exception");
     }
 }
Exemple #3
0
 public void DestroyWavPlayer(int wavplayer)
 {
     try
     {
         SipAgentNet.DestroyWavPlayer(wavplayer);
     }
     catch (Exception x)
     {
         LogException(x, "DestroyWavPlayer Exception");
     }
 }
Exemple #4
0
 public void HangupCall(int callid, int code)
 {
     try
     {
         _log.From().Trace("HangupCall {0}, {1}", callid, code);
         SipAgentNet.HangupCall(callid, code);
     }
     catch (Exception x)
     {
         LogException(x, "AnswerCall Exception");
     }
 }
Exemple #5
0
 public void AnswerCall(int callid, int code)
 {
     try
     {
         _log.From().Trace($"AnswerCall {callid}, {code}");
         SipAgentNet.AnswerCall(callid, code);
     }
     catch (Exception x)
     {
         LogException(x, "AnswerCall Exception");
     }
 }
Exemple #6
0
 public void SquelchSet(int callid, bool valor,
                        CORESIP_PttType tipoptt = CORESIP_PttType.CORESIP_PTT_OFF, ushort pttId = 0)
 {
     try
     {
         SipAgentNet.SqhOnOffSet(callid, valor, tipoptt, pttId);
     }
     catch (Exception x)
     {
         LogException(x, "SquelchSet Exception");
     }
 }
Exemple #7
0
 public string SendOptionsMsg(string OptionsUri)
 {
     try
     {
         string callid = "";
         SipAgentNet.SendOptionsMsg(OptionsUri, out callid);
         return(callid);
     }
     catch (Exception x)
     {
         LogException(x, "SendOptionsMsg Exception");
     }
     return("");
 }
Exemple #8
0
        public int CreateWavPlayer(string file, bool loop)
        {
            int wavplayer = -1;

            try
            {
                wavplayer = SipAgentNet.CreateWavPlayer(file, loop);
            }
            catch (Exception x)
            {
                LogException(x, "CreateWavPlayer Exception");
                wavplayer = -1;
            }
            return(wavplayer);
        }
Exemple #9
0
 public void PttSet(int callid, CORESIP_PttType tipo, ushort pttId = 0, int pttMute = 0)
 {
     try
     {
         if (tipo == CORESIP_PttType.CORESIP_PTT_OFF)
         {
             SipAgentNet.PttOff(callid);
         }
         else
         {
             SipAgentNet.PttOn(callid, pttId, tipo, pttMute);
         }
     }
     catch (Exception x)
     {
         LogException(x, "PttSet Exception");
     }
 }
Exemple #10
0
        public void Init(int maxcall = 32)
        {
            try
            {
                SipAgentNet.CallState      += OnCallState;
                SipAgentNet.CallIncoming   += OnCallIncoming;
                SipAgentNet.RdInfo         += OnRdInfo;
                SipAgentNet.KaTimeout      += OnKaTimeout;
                SipAgentNet.OptionsReceive += OnOptionsReceive;
                SipAgentNet.InfoReceived   += OnInfoReceived;
                SipAgentNet.Log            += OnLog;

                SipAgentNet.Init(settings, "ROIPSIM",
                                 IpBase,
                                 SipPort, (uint)maxcall);
            }
            catch (Exception x)
            {
                LogException(x, "Init Exception");
            }
        }
Exemple #11
0
        public void End()
        {
            try
            {
                SipAgentNet.CallState      -= OnCallState;
                SipAgentNet.CallIncoming   -= OnCallIncoming;
                SipAgentNet.RdInfo         -= OnRdInfo;
                SipAgentNet.KaTimeout      -= OnKaTimeout;
                SipAgentNet.OptionsReceive -= OnOptionsReceive;
                SipAgentNet.InfoReceived   -= OnInfoReceived;

                SipAgentNet.End();

                SipAgentNet.Log -= OnLog;
            }
            catch (Exception x)
            {
                LogException(x, "End Exception");
            }
            finally
            {
                SipAgentEvent = null;
            }
        }