[OpenSIPS-Users] OpenSIPS as Teams SBC

James Hogbin james at ip-sentinel.com
Sun May 10 16:26:07 EST 2020


OK.

Thank you for the Record_Route_Preset fix.  I had followed the example without understanding what it was doing.  It always seemed odd to put the 5060 port after the TLS port.  I understand why now. And more importantly why not to do it.

Adding a * to the listen port caused an error in the script. I’m running 3.0.2 if that matters?

However the routing is still not working correctly

        if (is_method("INVITE") && !has_totag() && check_source_address(0)) {
                xlog("[ROUTE]Incoming call to MS: RURI=$ruri, SI=$si, M=$rm\n");
                strip(1);
                prefix("+44");
                uac_replace_from( , "sip:$fU at sbc.ip-sentinel.com:5091");

$rd="sip.pstnhub.microsoft.com<http://sip.pstnhub.microsoft.com>";
                $rp=5061;

                $var(ct) = $ct;
                xlog("[INFO] Old Contact = $var(ct)\n”);

                remove_hf("Contact");
                append_hf("Contact: <sip:$fU at sbc.ip-sentinel.com:5091;transport=tls>\r\n");

                record_route_preset("sbc.ip-sentinel.com:5091<http://sbc.ip-sentinel.com:5091>;transport=tls");

                route(relay);


This routes the call from Zoiper -> Freeswich -> OpenSIPS -> Teams and I get ringing.

If I pick up the call In Teams the Zopier client knows it has been accepted.
I can hang up the call from Zoiper and Teams hangs up

I don’t get Audio from Zoiper -> Teams but I do get Audio from Teams back to Teams with a slight delay
Teams then hangs up the call after 20 seconds but the call remains open on Zoiper

I’m pretty sure it has something to do with how/where I’m fixing the contact.  Any suggestions?

Also how do I get one of those nice sip traffic flows given everything is on TLS?  I’m grabbing stuff out of the debug log and it’s not pretty.


For future reference this is a great resource on MSTeams expected SIP traffic https://docs.microsoft.com/en-us/microsoftteams/direct-routing-protocols-sip

For all incoming calls to the Microsoft SIP proxy, the Contact header must have the paired SBC FQDN in the URI hostname as follows:
Syntax: Contact: <sip:phone or sip address at FQDN of the SBC;transport=tls<sip:phone%20or%20sip%20address at FQDN%20of%20the%20SBC;transport=tls>>

If more than one value in the Contact header presented in a SIP message is sent by the SBC, only the FQDN portion of the first value of the Contact header is used.

Use of an IP address is not supported in either Record-Route or Contact. The only supported option is an FQDN, which must match either the Common Name or Subject Alternative Name of the SBC certificate (wildcard values in the certificate are supported).
• If an IP address is presented in Record-route or Contact, the certificate check fails and the call fails.
• If the FQDN does not match the value of the Common or Subject Alternative Name in the presented certificate, the call fails.

But there is nothing in the instructions in the https://blog.opensips.org/2019/09/16/opensips-as-ms-teams-sbc/ that specifies fixing the contact in anything other than OPTIONS

James Hogbin
Director 
 
IP Sentinel 
t. +44 (0)20 3011 4150
m. +44 7786910895
w. https://www.ip-sentinel.com

On 8 May 2020, at 09:12, John Quick <john.quick at smartvox.co.uk<mailto:john.quick at smartvox.co.uk>> wrote:

James,

Just to add to Alexey's last comment, if your SBC *is* changing the
transport from UDP to TLS, then you must ensure the correct socket is used
on the SBC when it is sending requests to the Teams Proxy:
force_send_socket(tls:137.117.136.143:5091);

You may also find it helpful to add " AS sbc.ip-sentinel.com:5091<http://sbc.ip-sentinel.com:5091>" on the
end of your tls listen statement

John Quick
Smartvox Limited
Web: www.smartvox.co.uk<http://www.smartvox.co.uk>

IP Sentinel Disclaimer 
This communication is for the information of the person to whom it has been delivered and neither it nor any of its contents should be passed on to or used by any other person. IP Sentinel Ltd is a limited company registered in England and Wales under Registered Number 08648097. Registered Office: Newnhams Wood, Horsted Keynes, West Sussex, RH17 7BT. 
Disclaimer: Q3dhRSrm_disclaimer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20200510/90dc9a76/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 120051017261100395.png
Type: image/png
Size: 3317 bytes
Desc: not available
URL: <http://lists.opensips.org/pipermail/users/attachments/20200510/90dc9a76/attachment-0001.png>


More information about the Users mailing list