Exemple #1
0
 internal unsafe IAXUrlEventArgs(IAXUnmanaged.iaxc_event e)
     : base(e)
 {
     CallNo = e.url.callNo;
     Type   = (IAXUrlEventType)e.url.type;
     Url    = BytesToString(e.url.url);
 }
Exemple #2
0
 internal unsafe IAXRegistrationEventArgs(IAXUnmanaged.iaxc_event e)
     : base(e)
 {
     ID           = e.reg.id;
     Reply        = (IAXRegistrationReply)e.reg.reply;
     MessageCount = e.reg.msgcount;
 }
Exemple #3
0
 internal unsafe IAXTextEventArgs(IAXUnmanaged.iaxc_event e)
     : base(e)
 {
     Type    = (IAXTTextEventType)e.text.type;
     CallNo  = e.text.callNo;
     Message = BytesToString(e.text.message);
 }
Exemple #4
0
 internal unsafe IAXNetStatsEventArgs(IAXUnmanaged.iaxc_event e)
     : base(e)
 {
     CallNo        = e.netstats.callNo;
     RoundTripTime = e.netstats.rtt;
     Local         = new IAXNetStats(e.netstats.local);
     Remote        = new IAXNetStats(e.netstats.remote);
 }
Exemple #5
0
 internal unsafe IAXVideoEventArgs(IAXUnmanaged.iaxc_event e)
     : base(e)
 {
     CallNo = e.video.callNo;
     Format = e.video.format;
     Width  = e.video.width;
     Height = e.video.height;
     Data   = null; // TODO: how to interpret data?
 }
Exemple #6
0
 internal unsafe IAXStateEventArgs(IAXUnmanaged.iaxc_event e)
     : base(e)
 {
     CallNo       = e.call.callNo;
     State        = (IAXCallState)e.call.state;
     Format       = (IAXFormat)e.call.format;
     Remote       = BytesToString(e.call.remote);
     RemoteName   = BytesToString(e.call.remote_name);
     Local        = BytesToString(e.call.local);
     LocalContext = BytesToString(e.call.local_context);
 }
Exemple #7
0
 internal IAXEventArgs(IAXUnmanaged.iaxc_event ev)
 {
 }
Exemple #8
0
 internal IAXLevelsEventArgs(IAXUnmanaged.iaxc_event e)
     : base(e)
 {
     Input  = e.levels.input;
     Output = e.levels.output;
 }
Exemple #9
0
        internal unsafe int IAXCallback(IAXUnmanaged.iaxc_event e)
        {
            IAXUnmanaged.iaxc_event ev = e;
            while (true)
            {
                switch (ev.type)
                {
                case IAXUnmanaged.IAXC_EVENT_LEVELS:
                    if (LevelsEvent != null)
                    {
                        LevelsEvent(this, new IAXLevelsEventArgs(ev));
                    }
                    break;

                case IAXUnmanaged.IAXC_EVENT_NETSTAT:
                    if (NetStatsEvent != null)
                    {
                        NetStatsEvent(this, new IAXNetStatsEventArgs(ev));
                    }
                    break;

                case IAXUnmanaged.IAXC_EVENT_REGISTRATION:
                    if (RegistrationEvent != null)
                    {
                        RegistrationEvent(this, new IAXRegistrationEventArgs(ev));
                    }
                    break;

                case IAXUnmanaged.IAXC_EVENT_STATE:
                    if (StateEvent != null)
                    {
                        StateEvent(this, new IAXStateEventArgs(ev));
                    }
                    break;

                case IAXUnmanaged.IAXC_EVENT_TEXT:
                    if (TextEvent != null)
                    {
                        TextEvent(this, new IAXTextEventArgs(ev));
                    }
                    break;

                case IAXUnmanaged.IAXC_EVENT_URL:
                    if (UrlEvent != null)
                    {
                        UrlEvent(this, new IAXUrlEventArgs(ev));
                    }
                    break;

                case IAXUnmanaged.IAXC_EVENT_VIDEO:
                    if (VideoEvent != null)
                    {
                        VideoEvent(this, new IAXVideoEventArgs(ev));
                    }
                    break;
                }

                // see if there is a "next" event
                if (ev.next == null)
                {
                    return(0);
                }
                else
                {
                    ev = *ev.next;
                }
            }
        }