gpt4 book ai didi

c# - 将独立 UCMA 应用程序连接到 SIP 中继提供商

转载 作者:太空狗 更新时间:2023-10-29 22:00:35 27 4
gpt4 key购买 nike

我正在尝试从独立的 UCMA 应用程序向基于连接 IP 地址进行身份验证的 SIP 提供商 (Gamma) 发出出站调用。这是我试图实现此目的的代码(直接从 Michael Greenlee ( http://blog.greenl.ee/2012/06/15/outbound-calls-ucma-lync-server/ ) 中提取):

ApplicationEndpointSettings endpointSettings =
new ApplicationEndpointSettings("sip:02037571***@80.229.80.***"); // My Ext. IP

...

CallEstablishOptions options = new CallEstablishOptions();
options.ConnectionContext = new ConnectionContext("88.215.61.***", 5060); // Gamma Ext. IP

Conversation conv = new Conversation(_endpoint);

AudioVideoCall avcall = new AudioVideoCall(conv);

avcall.BeginEstablish("sip:07709411***@88.215.61.***", options,
ar2 =>
{
try
{
avcall.EndEstablish(ar2);
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
},
null);

尝试拨号失败,Gamma 返回 403 Forbidden-Source Endpoint Lookup Failed。

我已经将 wireshark 跟踪与这次失败的尝试以及可以成功拨出的硬件 PBX 的跟踪进行了比较。

工作硬件 PBX:

    From: "02037571***"<sip:02037571***@80.229.80.***>;tag=39E432463135364100006C30
SIP Display info: "02037571***"
SIP from address: sip:02037571040@80.229.80.***
SIP from address User Part: 02037571***
SIP from address Host Part: 80.229.80.***
SIP from tag: 39E432463135364100006C30
To: <sip:07709411420@88.215.61.***:5060>
SIP to address: sip:07709411420@88.215.61.***:5060
SIP to address User Part: 07709411***
SIP to address Host Part: 88.215.61.***
SIP to address Host Port: 5060
Contact: <sip:02037571040@80.229.80.***:5060>
Contact URI: sip:02037571040@80.229.80.***:5060
Contact URI User Part: 02037571***
Contact URI Host Part: 80.229.80.***
Contact URI Host Port: 5060

UCMA 申请失败:

        FROM: ""<sip:02037571***@80.229.80.***>;epid=C18B8F5C05;tag=be8d09ca4
SIP Display info: ""
SIP from address: sip:02037571***@80.229.80.***
SIP from address User Part: 02037571***
SIP from address Host Part: 80.229.80.***
SIP from tag: be8d09ca4
TO: <sip:07709411420@88.215.61.***:5060>
SIP to address: sip:07709411420@88.215.61.***:5060
SIP to address User Part: 07709411***
SIP to address Host Part: 88.215.61.***
SIP to address Host Port: 5060
CONTACT: <sip:ADRIANHAND49F2.UnifyBusiness.local:5060;transport=Tcp;maddr=172.32.42.62;ms-opaque=260fcc58fdb93b58>;automata;actor="attendant";text;audio;video;image
Contact URI: sip:ADRIANHAND49F2.UnifyBusiness.local:5060;transport=Tcp;maddr=172.32.42.62;ms-opaque=260fcc58fdb93b58
Contact URI Host Part: ADRIANHAND49F2.UnifyBusiness.local
Contact URI Host Port: 5060
Contact URI parameter: transport=Tcp
Contact URI parameter: maddr=172.32.42.62
Contact URI parameter: ms-opaque=260fcc58fdb93b58

如您所见,FROM 和 TO 部分非常相似,但 CONTACT 部分包含我的机器和域的详细信息,而不是我指定为应用程序端点的那些,以及我机器的 LAN IP (maddr =172.32.42.62).

如果我调试和检查 _endpoint,EndpointUri 属性包含 ADRIANHAND49F2.UnifyBusiness.local 字符串,我认为这就是 Gamma 拒绝我尝试调用电话的原因。这个属性是只读的,所以我有点卡住了——有人能帮我连接到我的 SIP 提供商吗?感激地收到所有想法,谢谢!

最佳答案

联系地址来自ServerPlatformSettings参数(本地主机/端口)。

如果您将 localhost 参数更改为带点的地址(或对您来说更有意义的名称),我希望这对您有用。

我不知道如何设置联系人 URI 的用户,但我不确定这是否重要。

关于c# - 将独立 UCMA 应用程序连接到 SIP 中继提供商,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31052018/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com