• V20: 3CX Re-engineered. Get V20 for increased security, better call management, a new admin console and Windows softphone. Learn More.

3cx ConfigServer is not connected error.

Status
Not open for further replies.

bugracalim

Joined
Aug 16, 2018
Messages
2
Reaction score
0
Hello there,
I am developing a web service with 3cx 15 api.
Makecall function works when I make a request but when there is more than one request I get the "ConfigServer is not connected error."
What is the problem?
Code:
   public  bool Bootstrap(string filePath, string from , string to)
{
        {
                    var a = new Random(Environment.TickCount);
                    //unique name PhoneSystem.ApplicationName = "TestApi";//any name
                    PhoneSystem.ApplicationName = PhoneSystem.ApplicationName + a.Next().ToString();
                }
              
                #region phone system initialization(init db server)
                var value = Utilities.GetKeyValue("ConfService", "ConfPort", filePath);
                var port = 0;
                PhoneSystem.CfgServerHost = "127.0.0.1";
                if (!string.IsNullOrEmpty(value))
                {
                    int.TryParse(value.Trim(), out port);
                    PhoneSystem.CfgServerPort = port;
                }
                value = Utilities.GetKeyValue("ConfService", "confUser", filePath);
                if (!string.IsNullOrEmpty(value))
                    PhoneSystem.CfgServerUser = value;
                value = Utilities.GetKeyValue("ConfService", "confPass", filePath);
                if (!string.IsNullOrEmpty(value))
                    PhoneSystem.CfgServerPassword = value;
                #endregion

               DN exClient =  PhoneSystem.Root.GetDNByNumber(from);
              if (exClient.GetActiveConnections().Length==0)
                   {
                     PhoneSystem.Root.MakeCall(from, to);                     
                    } 
        }
 
Are you setting the connection information every time you try to make a call? That setup should be done only once during process startup, and then you use the PhoneSystem object all the times you need....
 
Yes, I set the information in every request. How should I call the web service for Call?
Can you help me? That's what I do.
1-web service url: blahbalh.com/makecall.asmx?Call?from=9060&to=9070 (I'll add later token)
2-MakeCall.asmx
[WebMethod]
public bool Call(string from, string to)
{
donen = false;
if (from != "" && to != "" && from != null && to != null)
{
try
{
var a = new Random(Environment.TickCount);
PhoneSystem.ApplicationName = PhoneSystem.ApplicationName + a.Next().ToString();
PhoneSystem.CfgServerHost = "127.0.0.1";
PhoneSystem.CfgServerPort = xxxxx;
PhoneSystem.CfgServerUser = "xxxxxx";
PhoneSystem.CfgServerPassword = "xxxxxx";


if (PhoneSystem.Root.Connected == true)
{

DN exClient = PhoneSystem.Root.GetDNByNumber(from);

if (exClient.GetActiveConnections().Length == 0)
{
PhoneSystem.Root.MakeCall(from, to);
donen =true;
}
else
{
donen =false;
}
}
else
{donen=false;}

}
catch (Exception ex)
{
Gonder.Mail(Func.Email, Func.HataEmail, "", "", "MakeCall Fonksiyon Hata.", ex.Message);
}

}
return donen;
}
 
Status
Not open for further replies.

Getting Started - Admin

Latest Posts

Forum statistics

Threads
141,629
Messages
748,931
Members
144,741
Latest member
Boykins_54
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.