OK.  On the Freeswitch side there is a double transport=tls but I can’t find 
out where that’s happening so I’ll remove it in the Opensips script

Here’s what Opensips sees from Freeswitch

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

INVITE sip:08435577...@sbc.ip-sentinel.com:5091;transport=tls SIP/2.0
Via: SIP/2.0/TLS 13.80.245.144:5081;rport;branch=z9hG4bKK90SUgZ4ZmN1D
Max-Forwards: 68
From: "James Hogbin" <sip:+442030114146@13.80.245.144>;tag=t4ce3rS0Fy3ga
To: <sip:08435577...@sbc.ip-sentinel.com:5091>
Call-ID: 86371d7b-0e76-1239-bdba-000d3aada04e
CSeq: 20063606 INVITE
Contact: 
<sip:gw+c6ff36e8-d3de-4fe0-9f1b-9da2888c43a9@13.80.245.144:5081;transport=tls;transport=tls;gw=c6ff36e8-d3de-4fe0-9f1b-9da2888c43a9>
User-Agent: FreeSWITCH
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, 
REFER, NOTIFY
Supported: timer, path, replaces
Allow-Events: talk, hold, conference, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 1317
X-FS-Support: update_display,send_info
Remote-Party-ID: "James Hogbin" 
<sip:+442030114146@13.80.245.144>;party=calling;screen=yes;privacy=off
v=0
o=FreeSWITCH 1589217436 1589217437 IN IP4 13.80.245.144
s=FreeSWITCH
c=IN IP4 13.80.245.144
t=0 0
m=audio 17360 RTP/SAVP 9 0 8 101 13
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtpmap:13 CN/8000
a=crypto:1 {removed]
a=ptime:20
m=audio 17360 RTP/AVP 9 0 8 101 13
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtpmap:13 CN/8000
a=ptime:20


Here is my script.  I’m not fixing FROM or TO.  I am fixing the number, the 
Record_Route & the duplicated transport=tls in the CONTACT

if (is_method("INVITE") && !has_totag() && check_source_address(0)) {
                xlog("[ROUTE]Incoming call to MS: RURI=$ruri, SI=$si, M=$rm\n");
                trace("tid");
                strip(1);
                prefix("+44");

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

                $var(reg_input) = $ct;
                $var(reg)= "/transport=tls;transport=tls;/transport=tls;/g";
                xlog("[WARNING]Applying reg exp $var(reg) to $var(reg_input)");
                $var(reg_output) = $(var(reg_input){re.subst,$var(reg)});
                remove_hf("Contact");
                append_hf("Contact: $var(reg_output)");

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

                route(relay);

The RTP_Proxy seems to be updating the SDP correctly

And here is the invite to teams

INVITE sip:+448435577...@sip.pstnhub.microsoft.com:5061;transport=tls SIP/2.0
Record-Route: 
<sip:sbc.ip-sentinel.com:5091;transport=tls;ftag=t4ce3rS0Fy3ga;lr;vsf=TxoZShEfAAYCAwMBAAUFBQJ2cUBMWx5HQhlGS19AXW5lbC5jb206NTA5MT4-;vst=TxoZSgoTAAcNAQQCAgUGd0FTI10AAAMDFhoaARsHQkMKDB9VRl9fRS5jb20+>
Via: SIP/2.0/TLS 137.117.136.143:5091;branch=z9hG4bK9915.ccfe3523.0;i=ae435223
Via: SIP/2.0/TLS 
13.80.245.144:5081;received=13.80.245.144;rport=36423;branch=z9hG4bKK90SUgZ4ZmN1D
Max-Forwards: 68
From: "James Hogbin" 
<sip:+442030114...@sbc.ip-sentinel.com:5091>;tag=t4ce3rS0Fy3ga
To: <sip:+448435577...@sip.pstnhub.microsoft.com>
Call-ID: 86371d7b-0e76-1239-bdba-000d3aada04e
CSeq: 20063606 INVITE
User-Agent: FreeSWITCH
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, 
REFER, NOTIFY
Supported: timer, path, replaces
Allow-Events: talk, hold, conference, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 1339
X-FS-Support: update_display,send_info
Remote-Party-ID: "James Hogbin" 
<sip:+442030114146@13.80.245.144>;party=calling;screen=yes;privacy=off
Contact: 
<sip:gw+c6ff36e8-d3de-4fe0-9f1b-9da2888c43a9@13.80.245.144:5081;transport=tls;gw=c6ff36e8-d3de-4fe0-9f1b-9da2888c43a9>
v=0
o=FreeSWITCH 1589217436 1589217437 IN IP4 137.117.136.143
s=FreeSWITCH
c=IN IP4 137.117.136.143
t=0 0
m=audio 10124 RTP/SAVP 9 0 8 101 13
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtpmap:13 CN/8000
a=crypto:1 {removed}
a=ptime:20
m=audio 19352 RTP/AVP 9 0 8 101 13
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtpmap:13 CN/8000
a=ptime:20
a=nortpproxy:yes


I don’t even get a response from Teams now so I think I’m now going backwards 
even though I think I’ve implemented all the parts of the advice I’ve been 
given throughout this thread.

   0.00 Freeswitch => INVITE => Opensips
   0.01 Freeswitch <=   100  <= Opensips
   0.01                         Opensips => INVITE => MSTeams
30.0    Freeswitch <=   408  <= Opensips
30.0    Freeswitch =>   ACK  => Opensips
31.4    Freeswitch =>   ACK  => Opensips

James

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
_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to