Multi instance

Status
Not open for further replies.

pat71

Joined
Mar 17, 2016
Messages
40
Reaction score
0
Hi,

Do 3CX API works with multi instance application. Because i can see that the is hold statics Variables

[DllImport("kernel32.dll", EntryPoint = "GetPrivateProfileStringA")]
static extern int GetKeyValueA ( string strSection, string strKeyName, string strNull, StringBuilder RetVal, int nSize, string strFileName );

So can we call to PBX From the same application?
 
Yes you can. When I was toying around with it some time ago I had created the following method

Code:
private static PhoneSystem connectToInstance(string instanceNumber)
 {
            PhoneSystem.ApplicationName = "App Name"; //any name
            RegistryKey regKeyAppRoot;
            regKeyAppRoot = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Wow6432Node\\3CX\\PhoneSystem");

            var appPath = (string)regKeyAppRoot.GetValue("AppPath");
            appPath = Path.Combine(appPath, "Instance" + instanceNumber);
            var filePath = Path.Combine(appPath, @"Bin\3CXPhoneSystem.ini");

            var value = GetKeyValue("ConfService", "ConfPort", filePath);
            var port = 0;
            if (!String.IsNullOrEmpty(value))
            {
                Int32.TryParse(value.Trim(), out port);
                PhoneSystem.CfgServerPort = port;
            }

            value = GetKeyValue("ConfService", "confUser", filePath);
            if (!String.IsNullOrEmpty(value))
            {
                PhoneSystem.CfgServerUser = value;
            }

            value = GetKeyValue("ConfService", "confPass", filePath);
            if (!String.IsNullOrEmpty(value))
            {
                PhoneSystem.CfgServerPassword = value;
            }

            return PhoneSystem.Root;
}

Then I used to call this for all active Instances and store them in an Array and use them at will.

Hope this helps.
 
Hi,
Thank you, But is this code for V14?

I have develop application that monitor multi instance and interact with them at the same time please see this page

http://www.alnayme.com/projects.aspx?proname=Mex Application for 3CX PBX

I need way that i can keep the connection active for all instance at the same time, but the config setting in the API is static so i can not create new instance of the connection for each instance at the same time. but i can do that for one at time only.
 
Status
Not open for further replies.

Forum statistics

Threads
111,846
Messages
589,344
Members
164,681
Latest member
JV J