Connect a standalone UCMA application to a SIP trunk provider

I am trying to make an outgoing call from a standalone UCMA application to a SIP provider (Gamma), which authenticates based on the connection IP address. Here is the code I'm trying to do with it (picked up directly from Michael Greenley ( 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); 

The dialing attempt failed with a Gamma error, after which 403 could not find the search endpoint with the forbidden code.

I compared wirehark routes with this unsuccessful attempt and a hardware exchange that can dial a number successfully.

PBX Hardware:

  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 

Unsuccessful application of 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 

As you can see, the FROM and TO parts are very similar in many respects, but the CONTACT part contains data about my machine and domain, and not the data that I specified as the application endpoint, as well as the IP address of the local network of my machine (maddr = 172.32 .42.62).

If I debug and check _endpoint, the EndpointUri property contains the string ADRIANHAND49F2.UnifyBusiness.local, which I believe is the reason that Gamma refuses my attempt to make a call. This property is read-only, so I'm a little stuck - can someone help me connect to my SIP provider, please? All thoughts gratefully received, thank you!

+6
source share
1 answer

The contact address comes from the ServerPlatformSettings (localhost / port) parameters.

If you change the localhost parameter to a point address (or a name that makes more sense to you), I hope this works for you.

I don’t know how to set the user contact URI, but I’m not sure if this is important.

0
source

Source: https://habr.com/ru/post/989748/


All Articles