using System;
using System.Collections.Generic;
using System.Text;

namespace CS_PABX
{
    public class CSSIPPABXEnv : GTAPIASM.GTAPIEnv 
    {
        public Form1 m_pMainWnd;

        public override void On_RecvConnected(int ch)
        {
            base.On_RecvConnected(ch);
            m_pMainWnd.On_RecvConnected(ch);
        }

        public override void On_RecvDialing(int ch, string sCaller, string sCallee)
        {
            base.On_RecvDialing(ch, sCaller, sCallee);
            m_pMainWnd.On_RecvDialing(ch, sCaller, sCallee);
        }


        public override void On_RecvOffered(int ch, string sCaller, string sCallee, string sDestAddr, string sViaAddr, string sFromIP, ushort nFromPort)
        {
            base.On_RecvOffered(ch, sCaller, sCallee, sDestAddr, sViaAddr, sFromIP, nFromPort);
            m_pMainWnd.On_RecvOffered(ch, sCaller, sCallee, sDestAddr, sViaAddr, sFromIP, nFromPort);
        }

        public override void On_RecvIdle(int ch, int code, string desc)
        {
            base.On_RecvIdle(ch, code, desc);
            m_pMainWnd.On_RecvIdle(ch, code, desc);
        }

        public override void On_RecvRinging(int ch)
        {
            base.On_RecvRinging(ch);
            m_pMainWnd.On_RecvRinging(ch);
        }

        public override void On_RecvRegStatus(int user_id, int status, int regtime)
        {
            base.On_RecvRegStatus(user_id, status, regtime);
            m_pMainWnd.On_RecvRegStatus(user_id, status, regtime);
        }

        public override void On_RecvDTMFKeyDown(int ch, byte keyValue, uint ticks)
        {
            base.On_RecvDTMFKeyDown(ch, keyValue, ticks);
        }

        public override void On_RecvDTMFKeyUp(int ch, byte keyValue, uint ticks)
        {
            base.On_RecvDTMFKeyUp(ch, keyValue, ticks);
        }

        public override void On_RecvDTMFDone(int ch, int doneReason, string dtmfBuf)
        {
            base.On_RecvDTMFDone(ch, doneReason, dtmfBuf);
        }

        public override void On_VoiceActivityDetected(int ch, int voice_dir, int voice_on, int level, uint reserved)
        {
            base.On_VoiceActivityDetected(ch, voice_dir, voice_on, level, reserved);
        }

        public override void On_ProxyUserRegistered(uint pid, string username, ulong tnow, uint exp_sec, string org_contact, string mapped_contact, string szUAName, int UANatType, string from_id, string to_id, string src_ip, ushort src_port)
        {
            base.On_ProxyUserRegistered(pid, username, tnow, exp_sec, org_contact, mapped_contact, szUAName, UANatType, from_id, to_id, src_ip, src_port);
            m_pMainWnd.On_ProxyUserRegistered(pid, username, tnow, exp_sec, org_contact, mapped_contact, szUAName, UANatType, from_id, to_id, src_ip, src_port);
        }

        public override string On_ProxyNewCallSession(uint pid, uint sid, IntPtr msg, string authid, string fromid, string toid, string suri, string via, string saddr, ushort nport, bool bCredit)
        {
            return m_pMainWnd.On_ProxyNewCallSession(pid, sid, msg, authid, fromid, toid, suri, via, saddr, nport, bCredit);
        }
    }
}
