
Public Class VBSIPPABXEnv
    Inherits GTAPIASM.GTAPIEnv
    Public m_pMainWnd As Form1

    Public Overrides Sub On_RecvConnected(ByVal ch As Integer)
        MyBase.On_RecvConnected(ch)
        m_pMainWnd.On_RecvConnected(ch)
    End Sub

    Public Overrides Sub On_RecvDialing(ByVal ch As Integer, ByVal sCaller As String, ByVal sCallee As String)
        MyBase.On_RecvDialing(ch, sCaller, sCallee)
        m_pMainWnd.On_RecvDialing(ch, sCaller, sCallee)
    End Sub


    Public Overrides Sub On_RecvOffered(ByVal ch As Integer, ByVal sCaller As String, ByVal sCallee As String, ByVal sDestAddr As String, ByVal sViaAddr As String, ByVal sFromIP As String, ByVal nFromPort As System.UInt16)
        MyBase.On_RecvOffered(ch, sCaller, sCallee, sDestAddr, sViaAddr, sFromIP, nFromPort)
        m_pMainWnd.On_RecvOffered(ch, sCaller, sCallee, sDestAddr, sViaAddr, sFromIP, nFromPort)
    End Sub

    Public Overrides Sub On_RecvIdle(ByVal ch As Integer, ByVal code As Integer, ByVal desc As String)
        MyBase.On_RecvIdle(ch, code, desc)
        m_pMainWnd.On_RecvIdle(ch, code, desc)
    End Sub

    Public Overrides Sub On_RecvRinging(ByVal ch As Integer)
        MyBase.On_RecvRinging(ch)
        m_pMainWnd.On_RecvRinging(ch)
    End Sub

    Public Overrides Sub On_RecvRegStatus(ByVal user_id As Integer, ByVal status As Integer, ByVal regtime As Integer)
        MyBase.On_RecvRegStatus(user_id, status, regtime)
        m_pMainWnd.On_RecvRegStatus(user_id, status, regtime)
    End Sub

    Public Overrides Sub On_RecvDTMFKeyDown(ByVal ch As Integer, ByVal keyValue As Byte, ByVal ticks As System.UInt32)
        MyBase.On_RecvDTMFKeyDown(ch, keyValue, ticks)
    End Sub

    Public Overrides Sub On_RecvDTMFKeyUp(ByVal ch As Integer, ByVal keyValue As Byte, ByVal ticks As System.UInt32)
        MyBase.On_RecvDTMFKeyUp(ch, keyValue, ticks)
    End Sub

    Public Overrides Sub On_RecvDTMFDone(ByVal ch As Integer, ByVal doneReason As Integer, ByVal dtmfBuf As String)
        MyBase.On_RecvDTMFDone(ch, doneReason, dtmfBuf)
    End Sub

    Public Overrides Sub On_VoiceActivityDetected(ByVal ch As Integer, ByVal voice_dir As Integer, ByVal voice_on As Integer, ByVal level As Integer, ByVal reserved As System.UInt32)
        MyBase.On_VoiceActivityDetected(ch, voice_dir, voice_on, level, reserved)
    End Sub

    Public Overrides Sub On_ProxyUserRegistered(ByVal pid As UInteger, ByVal username As String, ByVal tnow As ULong, ByVal exp_sec As UInteger, ByVal org_contact As String, ByVal mapped_contact As String, ByVal szUAName As String, ByVal UANatType As Integer, ByVal from_id As String, ByVal to_id As String, ByVal src_ip As String, ByVal src_port As UShort)
        MyBase.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)

    End Sub

    Public Overrides Function On_ProxyNewCallSession(ByVal pid As UInteger, ByVal sid As UInteger, ByVal msg As System.IntPtr, ByVal authid As String, ByVal fromid As String, ByVal toid As String, ByVal suri As String, ByVal via As String, ByVal saddr As String, ByVal nport As UShort, ByVal bCredit As Boolean) As String
        'Return MyBase.On_ProxyNewCallSession(pid, sid, msg, authid, fromid, toid, suri, via, saddr, nport, bCredit)
        Return m_pMainWnd.On_ProxyNewCallSession(pid, sid, msg, authid, fromid, toid, suri, via, saddr, nport, bCredit)

    End Function

End Class

