<div dir="ltr"><div dir="ltr"><div>For inbound from Teams, I use the permissions module with the following:</div><div><br></div><div><span style="font-family:monospace">MariaDB [opensips_teamsproxy]> select * from address where grp=1;<br>+----+-----+-------------+------+------+-------+---------+--------------+<br>| id | grp | ip | mask | port | proto | pattern | context_info |<br>+----+-----+-------------+------+------+-------+---------+--------------+<br>| 1 | 1 | 13.107.64.0 | 18 | 0 | tls | NULL | NULL |<br>| 2 | 1 | 52.120.0.0 | 14 | 0 | tls | NULL | NULL |<br>| 3 | 1 | 52.112.0.0 | 14 | 0 | tls | NULL | NULL |<br>+----+-----+-------------+------+------+-------+---------+--------------+<br>3 rows in set (0.001 sec)</span><br><br></div><div>These are the ranges that Microsoft will send traffic from. In the script, I use</div><div><br></div><div><span style="font-family:monospace"> if (check_address(1, "$si", 0, "$socket_in(proto)")) {<br> setflag("FROM_MS");</span></div><div><br></div><div>to match inbound traffic to the above table, and then check for the FROM_MS flag to make routing decisions.<br></div><div><br></div><div>For outbound to Teams, I use the drouting module with the following (using FQDNs):<br><br><span style="font-family:monospace">MariaDB [opensips_teamsproxy]> select gwid,type,address,probe_mode from dr_gateways where gwid like 'ms%';<br>+------+------+----------------------------+------------+<br>| gwid | type | address | probe_mode |<br>+------+------+----------------------------+------------+<br>| ms1 | 0 | <a href="http://sip.pstnhub.microsoft.com" target="_blank">sip.pstnhub.microsoft.com</a> | 2 |<br>| ms2 | 0 | <a href="http://sip2.pstnhub.microsoft.com" target="_blank">sip2.pstnhub.microsoft.com</a> | 2 |<br>| ms3 | 0 | <a href="http://sip3.pstnhub.microsoft.com" target="_blank">sip3.pstnhub.microsoft.com</a> | 2 |<br>+------+------+----------------------------+------------+<br>3 rows in set (0.001 sec)</span></div><div><br></div><div>You may need to populate the socket column or others I haven't shown here according to your needs. Also:<br></div><div><br></div><div><span style="font-family:monospace">MariaDB [opensips_teamsproxy]> select * from dr_carriers where carrierid like 'ms%';<br>+----+------------+-------------+-------+----------+-------+-------+--------------------+<br>| id | carrierid | gwlist | flags | sort_alg | state | attrs | description |<br>+----+------------+-------------+-------+----------+-------+-------+--------------------+<br>| 2 | ms_pstnhub | ms1,ms2,ms3 | 0 | N | 0 | NULL | Microsoft PSTN Hub |<br>+----+------------+-------------+-------+----------+-------+-------+--------------------+<br>1 row in set (0.001 sec)</span></div><div><br></div><div>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.<br></div><div><br></div><div>In the script, I use the following with this 'carrier':</div><div><br></div><div><span style="font-family:monospace"> if (!route_to_carrier("ms_pstnhub")) {<br> xlog("L_NOTICE", "[teamsproxy] NOTICE: couldn't route to 'ms_pstnhub' carrier\n");<br> send_reply(500, "Internal Server Error - RtC");<br> exit;<br> }</span></div><div><br></div><div>This is just one way to accomplish it. I suspect there are many others that work just as well based on unique needs.</div><font color="#888888"><div><br></div><div><br></div><div>- Jeff</div></font></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 11, 2021 at 3:51 AM Miha via Users <<a href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">hello<br>
<br>
i tried to put this in address table:<br>
"*.<a href="http://pstnhub.microsoft.com" rel="noreferrer" target="_blank">pstnhub.microsoft.com</a>" but it does not work.<br>
<br>
</blockquote></div></div>