
// Warning: Please do not make any changes to this file.

function cVaxPhoneFuncSIP()
{
    var m_hEventOnWebSocketSend = null;
    
    ////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////

    this.SetEvent = function (hEventOnWebSocketSend)
    {
        m_hEventOnWebSocketSend = hEventOnWebSocketSend;
    }
           
    ///////////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////

    this.Initialize = function (sDisplayName, sUserName, sAuthLogin, sAuthPwd, sDomainRealm, sServerAddr, nServerPort, sWebSocketServerAddr)
    {
        var obj = { FuncName: "Initialize", SessionId: "", FuncParam: [sDisplayName, sUserName, sAuthLogin, sAuthPwd, sDomainRealm, sServerAddr, nServerPort, sWebSocketServerAddr] };
        var sJson = JSON.stringify(obj);

        this.SendFuncData(sJson);
    }

    ///////////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////

	this.UnInitialize = function()
	{
        var obj = { FuncName: "UnInitialize", FuncParam: [] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);	
	}
        
	this.RegisterToProxy = function (nExpire)
	{
        var obj = { FuncName: "RegisterToProxy", FuncParam: [nExpire] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}
	
	this.UnRegisterToProxy = function()
	{
        var obj = { FuncName: "UnRegisterToProxy", FuncParam: [] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}

    this.DialCall = function (nLineNo, sSDP, sCallerName, sCallerId, sDialNo) 
    {
        var obj = { FuncName: "DialCall", FuncParam: [nLineNo, sSDP, sCallerName, sCallerId, sDialNo] };
        var sJson = JSON.stringify(obj);

        this.SendFuncData(sJson);
	}
	
    this.DisconnectCall = function (nLineNo)
	{
        var obj = { FuncName: "DisconnectCall", FuncParam: [nLineNo] };
    	var sJson = JSON.stringify(obj);

        this.SendFuncData(sJson);
	}

    this.AcceptCall = function (nLineNo, sSDP, sCallId)
	{	
        var obj = { FuncName: "AcceptCall", FuncParam: [nLineNo, sSDP, sCallId] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}

	this.RejectCall = function (sCallId)
	{
        var obj = { FuncName: "RejectCall", FuncParam: [sCallId] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}

    this.HoldCall = function (nLineNo)
    {
        var obj = { FuncName: "HoldCall", FuncParam: [nLineNo] };
        var sJson = JSON.stringify(obj);

        this.SendFuncData(sJson);
    }

    this.UnHoldCall = function (nLineNo)
    {
        var obj = { FuncName: "UnHoldCall", FuncParam: [nLineNo] };
        var sJson = JSON.stringify(obj);

        this.SendFuncData(sJson);
    }
        
    this.TransferCallBlind = function (nLineNo, sToUserName)
	{
        var obj = { FuncName: "TransferCallBlind", FuncParam: [nLineNo, sToUserName] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
    }

    this.TransferCallConsult = function (nLineNoA, nLineNoB)
    {
        var obj = { FuncName: "TransferCallConsult", FuncParam: [nLineNoA, nLineNoB] };
        var sJson = JSON.stringify(obj);

        this.SendFuncData(sJson);
    }
	
	this.EnableKeepAlive = function (nSeconds)
	{
        var obj = { FuncName: "EnableKeepAlive", FuncParam: [nSeconds] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson); 
	}

	this.DisableKeepAlive = function()
	{
        var obj = { FuncName: "DisableKeepAlive", FuncParam: [] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}
		
    this.DigitDTMF = function (nLineNo, sDigit, nTypeDTMF)
	{
        var obj = { FuncName: "DigitDTMF", FuncParam: [nLineNo, sDigit, nTypeDTMF] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}
	    
    ///////////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////
	
	this.DonotDisturb = function (bEnable)
	{
        var obj = { FuncName: "DonotDisturb", FuncParam: [bEnable] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}
		
	this.SetSessionLostTick = function (nSeconds)
	{
        var obj = { FuncName: "SetSessionLostTick", FuncParam: [nSeconds] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}

	this.SetUserAgentSIP = function (sUserAgentName)
	{
        var obj = { FuncName: "SetUserAgentSIP", FuncParam: [sUserAgentName] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}

	this.SetSubjectSDP = function (sSubjectSDP)
	{
        var obj = { FuncName: "SetSubjectSDP", FuncParam: [sSubjectSDP] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}
	
	////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////
	
	this.ChatAddContact = function (sUserName, bPresence)
	{
        var obj = { FuncName: "ChatAddContact", FuncParam: [sUserName, bPresence] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}
	
	this.ChatRemoveContact = function (sUserName)
	{
        var obj = { FuncName: "ChatRemoveContact", FuncParam: [sUserName] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}
	
	this.ChatSendMessageTyping = function (sUserName, nUserValue32bit)
	{
        var obj = { FuncName: "ChatSendMessageTyping", FuncParam: [sUserName, nUserValue32bit] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}
	
	this.ChatSendMessageText = function (sUserName, sMsgText, nMsgType, nUserValue32bit)
	{
        var obj = { FuncName: "ChatSendMessageText", FuncParam: [sUserName, sMsgText, nMsgType, nUserValue32bit] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}
	
	this.ChatSubscribeContactAll = function()
	{
        var obj = { FuncName: "ChatSubscribeContactAll", FuncParam: [] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}
	
	this.ChatSetMyStatus = function (nStatusId)
	{
        var obj = { FuncName: "ChatSetMyStatus", FuncParam: [nStatusId] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}

    ////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////

    this.BusyLampAddContact = function (sUserName)
    {
        var obj = { FuncName: "BusyLampAddContact", FuncParam: [sUserName] };
        var sJson = JSON.stringify(obj);

        this.SendFuncData(sJson);
    }

    this.BusyLampRemoveContact = function (sUserName)
    {
        var obj = { FuncName: "BusyLampRemoveContact", FuncParam: [sUserName] };
        var sJson = JSON.stringify(obj);

        this.SendFuncData(sJson);
    }

    this.BusyLampSubscribeContactAll = function ()
    {
        var obj = { FuncName: "BusyLampSubscribeContactAll", FuncParam: [] };
        var sJson = JSON.stringify(obj);

        this.SendFuncData(sJson);
    }

    ////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////

	this.ForwardCall = function (bEnable, sToUserName)
	{
        var obj = { FuncName: "ForwardCall", FuncParam: [bEnable, sToUserName] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}

    this.AddCustomHeader = function (nLineNo, nReqId, sName, sValue)
	{
        var obj = { FuncName: "AddCustomHeader", FuncParam: [nLineNo, nReqId, sName, sValue] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}
	
    this.RemoveCustomHeader = function (nLineNo, nReqId, sName)
	{
        var obj = { FuncName: "RemoveCustomHeader", FuncParam: [nLineNo, nReqId, sName] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}

    this.RemoveCustomHeaderAll = function (nLineNo, nReqId) 
	{
        var obj = { FuncName: "RemoveCustomHeaderAll", FuncParam: [nLineNo, nReqId] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}

	this.AutoRegistration = function (bEnable, nTickCountLimit, nTickSeconds)
	{
        var obj = { FuncName: "AutoRegistration", FuncParam: [bEnable, nTickCountLimit, nTickSeconds] };
    	var sJson = JSON.stringify(obj);

    	this.SendFuncData(sJson);
	}
	
	this.PostRingingMsg = function ()
	{
        var obj = { FuncName: "PostRingingMsg", FuncParam: [0] };
    	var sJson = JSON.stringify(obj);
		
    	this.SendFuncData(sJson);
    }

    this.AcceptRefreshCall = function (nLineNo, sSDP)
    {
        var obj = { FuncName: "AcceptRefreshCall", FuncParam: [nLineNo, sSDP] };
        var sJson = JSON.stringify(obj);

        this.SendFuncData(sJson);
    }
    
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////

	this.SendFuncData = function (sData) 
    {
        m_hEventOnWebSocketSend(sData)
	}
	
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}