[OpenSIPS-Users] MS team issue
Jeff Pyle
jeff at ugnd.org
Tue May 11 12:42:20 EST 2021
For inbound from Teams, I use the permissions module with the following:
MariaDB [opensips_teamsproxy]> select * from address where grp=1;
+----+-----+-------------+------+------+-------+---------+--------------+
| id | grp | ip | mask | port | proto | pattern | context_info |
+----+-----+-------------+------+------+-------+---------+--------------+
| 1 | 1 | 13.107.64.0 | 18 | 0 | tls | NULL | NULL |
| 2 | 1 | 52.120.0.0 | 14 | 0 | tls | NULL | NULL |
| 3 | 1 | 52.112.0.0 | 14 | 0 | tls | NULL | NULL |
+----+-----+-------------+------+------+-------+---------+--------------+
3 rows in set (0.001 sec)
These are the ranges that Microsoft will send traffic from. In the script,
I use
if (check_address(1, "$si", 0, "$socket_in(proto)")) {
setflag("FROM_MS");
to match inbound traffic to the above table, and then check for the FROM_MS
flag to make routing decisions.
For outbound to Teams, I use the drouting module with the following (using
FQDNs):
MariaDB [opensips_teamsproxy]> select gwid,type,address,probe_mode from
dr_gateways where gwid like 'ms%';
+------+------+----------------------------+------------+
| gwid | type | address | probe_mode |
+------+------+----------------------------+------------+
| ms1 | 0 | sip.pstnhub.microsoft.com | 2 |
| ms2 | 0 | sip2.pstnhub.microsoft.com | 2 |
| ms3 | 0 | sip3.pstnhub.microsoft.com | 2 |
+------+------+----------------------------+------------+
3 rows in set (0.001 sec)
You may need to populate the socket column or others I haven't shown here
according to your needs. Also:
MariaDB [opensips_teamsproxy]> select * from dr_carriers where carrierid
like 'ms%';
+----+------------+-------------+-------+----------+-------+-------+--------------------+
| id | carrierid | gwlist | flags | sort_alg | state | attrs |
description |
+----+------------+-------------+-------+----------+-------+-------+--------------------+
| 2 | ms_pstnhub | ms1,ms2,ms3 | 0 | N | 0 | NULL |
Microsoft PSTN Hub |
+----+------------+-------------+-------+----------+-------+-------+--------------------+
1 row in set (0.001 sec)
This gateway ordering makes sense for someone in North America. You'll
want to check sip, sip2 and sip3 to see which is closest to you and order
the gwlist accordingly.
In the script, I use the following with this 'carrier':
if (!route_to_carrier("ms_pstnhub")) {
xlog("L_NOTICE", "[teamsproxy] NOTICE: couldn't
route to 'ms_pstnhub' carrier\n");
send_reply(500, "Internal Server Error - RtC");
exit;
}
This is just one way to accomplish it. I suspect there are many others
that work just as well based on unique needs.
- Jeff
On Tue, May 11, 2021 at 3:51 AM Miha via Users <users at lists.opensips.org>
wrote:
> hello
>
> i tried to put this in address table:
> "*.pstnhub.microsoft.com" but it does not work.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20210511/dca2f6c9/attachment-0001.html>
More information about the Users
mailing list