将独立的UCMA应用程序连接到SIP干线提供商

时间:2015-06-25 13:38:27

标签: c# sip ucma

我正在尝试从独立的UCMA应用程序拨打呼叫到SIP提供商(Gamma),该服务器根据连接的IP地址进行身份验证。以下是我试图实现此目的的代码(直接取自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拒绝我打电话的原因。这个属性是readonly所以我有点卡住 - 有人可以帮助我连接到我的SIP提供商吗?感谢所有的想法,谢谢!

1 个答案:

答案 0 :(得分:0)

联系地址来自ServerPlatformSettings参数(localhost / port)。

如果你将localhost参数更改为虚线地址(或者对你更有意义的名称),我希望这对你有用。

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

相关问题