<html><head></head><body><div class="yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div dir="ltr" data-setdir="false"><div><div>Hello,</div><div><br></div><div>I'm trying to test a Henning's tutorial for Teams SBC described here: https://skalatan.de/en/blog/kamailio-sbc-teams.</div><div><br></div><div>A minor change at the MS Teams setup is just about the login. Now it requires MFA.</div><div>The license I used is : Microsoft 365 developer subscriptions (E5).</div><div>The domanin dv-sbc.openabrik.com is added + 1 user</div><div><br></div><div>PS> Connect-MicrosoftTeams (MFA)</div><div>PS> New-CsOnlinePSTNGateway -Fqdn dev-sbc.openfabrik.com -SipSignalingPort 5061 -MaxConcurrentSessions 10 -ForwardCallHistory $true -Enabled $true</div><div><br></div><div>Everything seems to be OK at MS Teams side.</div><div><br></div><div>I'm using the Kamailio coming with Kazoo. Version 5.2.5</div><div>[root@dev-sbc kamailio]# kamailio -version</div><div>version: kamailio 5.2.5 (x86_64/linux) </div><div>flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES</div><div>ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB</div><div>poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.</div><div>id: unknown </div><div>compiled on 01:14:59 Nov 19 2019 with gcc 7.3.1</div><div><br></div><div><br></div><div><br></div><div>When Kamailio is probing MS Teams, the log shows the following errors (for the 3 GW):</div><div><br></div><div>hG4bKc188.6a606040000000000000000000000000.0#015#012To: <sip:sip2.pstnhub.microsoft.com;transport=tls>#015#012From: <sip:dev-sbc.openfabrik.com>;tag=d9a52ca041d9e6253dd2a7d5399056e3-2f56#015#012CSeq: 10 OPTIONS#015#012Call-ID: 4ed99b8a73a96dcd-10234@155.138.140.233#015#012Max-Forwards: 70#015#012Content-Length: 0</div><div>May 9 01:26:17 dev-sbc kamailio[10234]: ERROR: <core> [core/tcp_main.c:618]: _wbufq_add(): (517 bytes): write queue full or timeout (0, total 1100374016, last write 41683154 s ago)</div><div>May 9 01:26:17 dev-sbc kamailio[10234]: ERROR: <core> [core/tcp_main.c:2673]: tcpconn_1st_send(): 52.114.76.76:5061:<b style="background-color: rgb(255, 255, 255);"><font color="#5b8828"> EAGAIN and write queue full or failed for 0x7fce434db860</font></b></div><div>May 9 01:26:17 dev-sbc kamailio[10234]: ERROR: tm [../../core/forward.h:293]: msg_send_buffer(): tcp_send failed</div><div>May 9 01:26:17 dev-sbc kamailio[10234]: ERROR: tm [uac.c:648]: send_prepared_request_impl(): Attempt to send to precreated request failed</div><div>May 9 01:26:17 dev-sbc kamailio[10234]: INFO: <script>: Sent out tm request to Teams: OPTIONS sip:sip.pstnhub.microsoft.com;transport=tls SIP/2.0#015#012Via: SIP/2.0/TLS 155.138.140.233:5061;branc</div><div><br></div><div>config:</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">tls.cfg</div><div dir="ltr" data-setdir="false"><br></div><div>[server:default]</div><div>method = TLSv1.2+</div><div>verify_certificate = yes</div><div>require_certificate = yes</div><div>private_key = /etc/letsencrypt/live/openfabrik.com/privkey.pem</div><div>certificate = /etc/letsencrypt/live/openfabrik.com/fullchain.pem</div><div>ca_list = /etc/letsencrypt/live/openfabrik.com/bc2025.pem</div><div>server_name = dev-sbc.openfabrik.com</div><div><br></div><div>[client:default]</div><div>method = TLSv1.2+</div><div>verify_certificate = yes</div><div>require_certificate = yes</div><div>private_key = /etc/letsencrypt/live/openfabrik.com/privkey.pem</div><div>certificate = /etc/letsencrypt/live/openfabrik.com/fullchain.pem</div><div>ca_list = /etc/letsencrypt/live/openfabrik.com/bc2025.pem</div><div><br></div><div>====</div><div><br></div><div>event_route[tm:local-request]</div><div>{</div><div> setflag(FLAG_LOCAL_REQUEST);</div><div><br></div><div> if(is_method("OPTIONS") && $ru =~ "pstnhub.microsoft.com") {</div><div> append_hf("Contact: <sip:dev-sbc.openfabrik.com:5061;transport=tls>\r\n");</div><div> xlog("L_INFO", "Sent out tm request to Teams: $mb\n");</div><div> }</div><div><br></div><div> xlog("L_DEBUG", "$ci|local|start $pr request $rm $ou\n");</div><div> xlog("L_DEBUG", "$ci|local|source $si:$sp -> $dd:$dp\n");</div><div> xlog("L_DEBUG", "$ci|local|from $fu\n");</div><div> xlog("L_DEBUG", "$ci|local|to $tu\n");</div><div><br></div><div> #!ifdef SIP_TRACE_ROLE</div><div> route(SIP_TRACE);</div><div> #!endif</div><div><br></div><div> #!ifdef PRESENCE_ROLE</div><div> route(PRESENCE_LOCAL_REQUEST);</div><div> #!endif</div><div><br></div><div>}</div><div><br></div><div>====</div><div># setid(integer) destination(sip uri) flags (integer, optional), priority(int,opt), attrs (str,optional)</div><div>kamctl dispatcher add 2 'sip:sip.pstnhub.microsoft.com;transport=tls' 0 3 'socket=tls:155.138.140.233:5061;ping_from=sip:dev-sbc.openfabrik.com'</div><div>kamctl dispatcher add 3 'sip:sip2.pstnhub.microsoft.com;transport=tls' 0 2 'socket=tls:155.138.140.233:5061;ping_from=sip:dev-sbc.openfabrik.com'</div><div>kamctl dispatcher add 4 'sip:sip3.pstnhub.microsoft.com;transport=tls' 0 1 'socket=tls:155.138.140.233:5061;ping_from=sip:dev-sbc.openfabrik.com'</div><div><br></div><div>[root@dev-sbc kamailio]# kamctl dispatcher show</div><div>dispatcher gateways</div><div>sqlite_query: /usr/bin/sqlite3 /etc/kazoo/kamailio/db/kazoo.db select * FROM dispatcher ORDER BY setid; </div><div>1|1|sip:155.138.140.233:11000|9|0|zone=local;profile=sipinterface_1;duid=243;node=freeswitch@dev-sbc.openfabrik.com|added by nodes role</div><div>2|2|sip:sip.pstnhub.microsoft.com;transport=tls|0|3|socket=tls:155.138.140.233:5061;ping_from=sip:dev-sbc.openfabrik.com|</div><div>3|3|sip:sip2.pstnhub.microsoft.com;transport=tls|0|2|socket=tls:155.138.140.233:5061;ping_from=sip:dev-sbc.openfabrik.com|</div><div>4|4|sip:sip3.pstnhub.microsoft.com;transport=tls|0|1|socket=tls:155.138.140.233:5061;ping_from=sip:dev-sbc.openfabrik.com|</div><div><br></div><div><br></div><div><br></div><div>Is it a bug on the Kamailio 5.2.5 release or Do I miss something?</div><div><br></div></div>Thanks,</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Victor</div><div dir="ltr" data-setdir="false"><br></div></div></body></html>