从.NET连接到Asterisk的(Connecting from .NET to Asterisk

2019-11-01 07:02发布

我想从一个.NET应用程序Asterisk的服务器连接,但连接是不成立的。 我使用下面的代码连接到Asterisk的:

Socket clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint serverEndPoint = new IPEndPoint(IPAddress.Parse("192.168.0.35"), 5038);
clientSocket.Connect(serverEndPoint);

我得到以下错误:

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 192.168.0.35:5038

谁能告诉我什么,我做错了或什么是解决这个?

问候,Tamash

Answer 1:

检查AMI在manager.conf。 它应该是这样的:

 enabled = yes
 port = 5038
 bindaddr = 0.0.0.0


文章来源: Connecting from .NET to Asterisk