[英]Asterisk: Connect attempt from '192.168.x.xxx' unable to authenticate
嘗試從我的.NET應用程序連接到Ubuntu虛擬機上的Asterisk 13.4.0: AsterNET.ARI > 會議示例,使用以下配置:
ari.conf
[general]
enabled = yes
pretty = yes
[asterisk]
type = user
read_only = no
password = asterisk
extensions.conf
[default]
exten = 1000,1,Noop()
same = n,Answer()
same = n,Stasis(simpleconf,test)
same = n,Hangup()
manager.conf
[general]
enabled = yes
webenabled = yes
port = 5038
bindaddr = 0.0.0.0
AsterNET.ARI.SimpleConfExample
public class AppConfig
{
public const string AppName = "simpleconf";
public const string RestAddress = "http://localhost:8088/";
public const string ServerIP = "192.168.x.xx";
public const int Port = 5038;
public const string UserName = "asterisk";
public const string UserPassword = "asterisk";
public const string ConfName = "test";
}
private static void Main(string[] args)
{
try
{
// Create a message client to receive events on
Client = new AriClient(new StasisEndpoint(AppConfig.ServerIP, AppConfig.Port, AppConfig.UserName, AppConfig.UserPassword), AppConfig.AppName);
Conference.Conferences.Add(new Conference(Client, Guid.NewGuid(), AppConfig.ConferenceName));
....
}
我從CLI終端獲得以下信息:
Connect attempt from '192.168.x.xxx' unable to authenticate
我究竟做錯了什么?
Asterisk管理器接口(AMI)和Asterisk REST接口(ARI)是兩種不同的動物。 您的代碼正在混合和匹配這兩者的各種內容,特別是要連接的端口-5038是AMI端口,而不是ARI端口。 將您的Port
聲明更改為:
public const int Port = 8088;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.