Connecting from .NET to Asterisk

被刻印的时光 ゝ 提交于 2020-01-06 08:26:32

问题


I am trying to connect from a .NET application to the Asterisk server, but the connection is not established. I am using the following code to connect to 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);

and I get the following error:

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

Can someone tell me what am I doing wrong or what is the solution to this?

Regards, Tamash


回答1:


Check AMI in manager.conf. It should be like this:

 enabled = yes
 port = 5038
 bindaddr = 0.0.0.0


来源:https://stackoverflow.com/questions/13837136/connecting-from-net-to-asterisk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!