从.NET连接到Asterisk [英] Connecting from .NET to Asterisk

查看:96
本文介绍了从.NET连接到Asterisk的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从.NET应用程序连接到Asterisk服务器,但未建立连接.我正在使用以下代码连接到Asterisk:

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?

关于, 塔玛什(Tamash)

Regards, Tamash

推荐答案

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

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

 enabled = yes
 port = 5038
 bindaddr = 0.0.0.0

这篇关于从.NET连接到Asterisk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆