<html><head></head><body><div class="ydpd57b4530yahoo-style-wrap" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 10px;"><div><div dir="ltr" data-setdir="false">HI Guys,</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">I'm trying the following setup and outgoing call from msteams drop after answered due ms SBC not sending the ACK. Is there anything wrong in my script ?, Is this something ms should investigate ?<br></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">msteams -> opensips -> asterisk -> linphone</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><div> opensips -V<br>version: opensips 2.4.4 (x86_64/linux)<br>flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT<br>ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535<br>poll method support: poll, epoll, sigio_rt, select.<br>main.c compiled on with gcc 6.3.0<br><br></div><div><br></div></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><div dir="ltr" data-setdir="false"><div>opensips.cfg</div><br>####### Global Parameters #########<br><br>log_level=5<br>log_stderror=yes<br>log_facility=LOG_LOCAL0<br><br>#udp_workers=1<br>#tcp_workers=1<br>tcp_connect_timeout=900<br><br><br>/* comment the next line to enable the auto discovery of local aliases<br> based on reverse DNS on IPs */<br>auto_aliases=no<br>alias=tls:msteamsbctest.voippabx.com.au:5061<br>alias=udp:172.31.36.39:5060<br><br>listen=tls:172.31.36.39:5061<br>listen=udp:172.31.36.39:5060 # CUSTOMIZE ME<br>advertised_address=52.65.18.59<br><br><br>####### Modules Section ########<br><br>#set module path<br>mpath="/usr/lib/x86_64-linux-gnu/opensips/modules/"<br><br>loadmodule "tls_mgm.so"<br>loadmodule "proto_tls.so"<br>#loadmodule "proto_hep.so"<br>loadmodule "uri.so"<br>loadmodule "drouting.so"<br>loadmodule "db_mysql.so"<br>#### SIGNALING module<br>loadmodule "signaling.so"<br>loadmodule "textops.so"<br>#### StateLess module<br>loadmodule "sl.so"<br><br>#### Transaction Module<br>loadmodule "tm.so"<br>modparam("tm", "fr_timeout", 30)<br>modparam("tm", "fr_inv_timeout", 60)<br>modparam("tm", "restart_fr_on_each_reply", 0)<br>modparam("tm", "onreply_avp_mode", 1)<br>modparam("tm", "via1_matching", 0)<br>modparam("tm", "ruri_matching", 0)<br>modparam("tm", "T1_timer", 1000)<br><br>#### Record Route Module<br>loadmodule "rr.so"<br>#modparam("rr", "append_fromtag", 1)<br>#### MAX ForWarD module<br>loadmodule "maxfwd.so"<br><br>loadmodule "nathelper.so"<br><br>#### SIP MSG OPerationS module<br>loadmodule "sipmsgops.so"<br><br>#### FIFO Management Interface<br>loadmodule "mi_fifo.so"<br>modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")<br>modparam("mi_fifo", "fifo_mode", 0666)<br><br>loadmodule "permissions.so"<br>modparam("permissions", "db_url","mysql://opensips:xxx@localhost/opensips")<br><br>loadmodule "proto_udp.so"<br>#loadmodule "proto_tcp.so"<br>modparam("tls_mgm", "certificate", "/etc/opensips/tls/default.crt")<br>modparam("tls_mgm", "private_key","/etc/opensips/tls/default.key")<br>modparam("tls_mgm", "ca_list", "/etc/opensips/tls/ca-default.crt")<br>modparam("tls_mgm", "ca_dir", "/etc/ssl/certs/")<br>modparam("tls_mgm","verify_cert", "1")<br>modparam("tls_mgm","require_cert", "1")<br><br>modparam("tls_mgm", "server_domain", "dom1=172.31.36.39:5061")<br>#modparam("tls_mgm", "match_ip_address", "[dom1]172.31.36.39:5061")<br>#modparam("tls_mgm", "match_sip_domain", "[dom1]msteamsbctest.voippabx.com.au")<br>modparam("tls_mgm","verify_cert", "[dom1]1")<br>modparam("tls_mgm","require_cert", "[dom1]1")<br>modparam("tls_mgm","tls_method", "[dom1]TLSv1_2")<br>modparam("tls_mgm","certificate", "[dom1]/etc/tls/voippabx.com.au/voippabx.com.au.crt")<br>modparam("tls_mgm","private_key", "[dom1]/etc/tls/voippabx.com.au/voippabx.com.au.key")<br>modparam("tls_mgm", "ca_list", "[dom1]/etc/tls/voippabx.com.au/voippabx.com.au-ca.crt")<br>modparam("tls_mgm", "ca_dir", "[dom1]/etc/ssl/certs/")<br>modparam("tls_mgm", "tls_handshake_timeout", 900)<br>modparam("proto_tls", "tls_max_msg_chunks", 1024)<br><br><br>modparam("drouting", "db_url","mysql://opensips:xxxx@localhost/opensips")<br>modparam("drouting", "probing_from", "sip:pinger@52.65.18.59")<br><br>####### Routing Logic ########<br><br># main request routing logic<br><br>route{<br> force_rport();<br> if (!mf_process_maxfwd_header("10")) {<br> sl_send_reply("483","Too Many Hops");<br> exit;<br> }<br><br> if(is_method("OPTIONS")) {<br> xlog("L_INFO", "[MS TEAMS] OPTIONS In\n");<br> sl_send_reply("200", "OK");<br> exit;<br> }<br><br> # absorb retransmissions, but do not create transaction<br> t_check_trans();<br> if (has_totag()) {<br><br> # sequential request within a dialog should<br> # take the path determined by record-routing<br><br> if ( !loose_route() ) {<br> # we do record-routing for all our traffic, so we should not<br> # receive any sequential requests without Route hdr.<br> sl_send_reply("404", "Not here");<br> exit;<br> }<br> # route it out to whatever destination was set by loose_route()<br> # in $du (destination URI).<br> route(relay);<br> exit;<br> }<br><br> # CANCEL processing<br> if (is_method("CANCEL")) {<br> if (t_check_trans())<br> t_relay();<br> exit;<br> }<br><br> # record routing<br><br> if (is_method("INVITE") && ! has_totag() && ! check_source_address("0")) {<br> xlog("Incoming call to MS: RURI=$ruri, SI=$si, M=$rm\n");<br> strip(1);<br> do_routing("1");<br> prefix("+");<br> route(relay); <br> } else if (is_method("INVITE") && ! has_totag()) {<br> xlog("Incoming call from MS: RURI=$ruri, SI=$si, M=$rm\n");<br> rewritehostport("supporttest.voippabx.com.au:5061");<br> route(relay);<br> }<br><br> if (!is_myself("$rd")) {<br> append_hf("P-hint: outbound\r\n"); <br> <br> route(relay);<br> }<br><br> # requests for my domain<br> <br> if (is_method("PUBLISH|SUBSCRIBE")) {<br> sl_send_reply("503", "Service Unavailable");<br> exit;<br> }<br><br> if ($rU==NULL) {<br> # request with no Username in RURI<br> sl_send_reply("484", "Address Incomplete");<br> exit;<br> }<br><br> # when routing via usrloc, log the missed calls also<br> #route(relay);<br>}<br><br><br>route[relay] {<br> # for INVITEs enable some additional helper routes<br> if (is_method("INVITE") && !has_totag() ) {<br> t_newtran();<br> t_on_reply("handle_nat");<br> record_route_preset("msteamsbctest.voippabx.com.au:5061;transport=tls", "172.31.36.39:5060");<br> add_rr_param(";r2=on");<br> }<br> xlog("Method=$rm, RURI=$ruri, SI=$si ,DU=$du\n");<br> if (!t_relay()) {<br> sl_send_reply("500", "Internal Error");<br> }<br> exit;<br>}<br><br><br><br><br>branch_route[per_branch_ops] {<br> xlog("new branch at $ru\n");<br>}<br><br><br>onreply_route[handle_nat] {<br> xlog("incoming reply: RR=$rr, RS=$rs, SI=$si\n");<br>}<br><br><br><br>local_route {<br> $var(dst) = "pstnhub.microsoft.com";<br> if (is_method("OPTIONS") && ($(ru{s.index, $var(dst)}) != NULL))<br> append_hf("Contact: <sip:msteamsbctest.voippabx.com.au:5061;transport=tls>\r\n");<br>}<br><br></div><div><br></div></div><div class="ydpd57b4530signature"><div><div><font style="BACKGROUND-COLOR:#e6e6e6;"></font> </div><div> </div><div dir="ltr" data-setdir="false">below is the message trace I got from logs</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><div>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Mar 31 05:25:27 [2167] DBG:core:build_res_buf_from_sip_res: copied size: orig:125, new: 1248, rest: 1232 msg=<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: SIP/2.0 200 OK<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Via: SIP/2.0/TLS 52.114.14.70:5061;rport=3072;received=52.114.14.70;branch=z9hG4bKfabd2525<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Record-Route: <sip:msteamsbctest.voippabx.com.au:5061;transport=tls;ftag=127ce3aaa0c2420cad2c0183b7bbfadf;lr;r2=on><br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Record-Route: <sip:172.31.36.39:5060;ftag=127ce3aaa0c2420cad2c0183b7bbfadf;lr;r2=on><br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Record-Route: <sip:sip-du-a-as.pstnhub.microsoft.com:5061;transport=tls;lr><br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: From: Pasan Meemaduma<sip:+61291391380@sip.pstnhub.microsoft.com:5061;user=phone>;tag=127ce3aaa0c2420cad2c0183b7bbfadf<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: To: <sip:+61385783273@msteamsbctest.voippabx.com.au:5061;user=phone>;tag=as43b48489<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Call-ID: 71bc7d7ddef8520e953472f28ca8ae46<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: CSeq: 1 INVITE<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Server: Asterisk PBX 16.9.0<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Supported: replaces<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Contact: <sip:+61385783273@119.17.41.176:5061;transport=tls><br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Content-Type: application/sdp<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Content-Length: 338<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: #015<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: v=0<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: o=root 1590470023 1590470023 IN IP4 119.17.41.176<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: s=Asterisk PBX 16.9.0<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: c=IN IP4 119.17.41.176<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: t=0 0<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: m=audio 19240 RTP/SAVP 8 101<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:gG06kfD/N+jLNvmmDsmrFOWqWkKrrBI5O5eAQMnv<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: a=rtpmap:8 PCMA/8000<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: a=rtpmap:101 telephone-event/8000<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: a=fmtp:101 0-16<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: a=ptime:20<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: a=maxptime:150<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: a=sendrecv<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Mar 31 05:25:27 [2167] DBG:tm:insert_timer_unsafe: [2]: 0x7f50d523d760 (47)<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Mar 31 05:25:27 [2167] DBG:core:tcp_conn_get: con found in state 0<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Mar 31 05:25:27 [2167] DBG:core:tcp_conn_get: tcp connection found (0x7f50d51c2d58), acquiring fd<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Mar 31 05:25:27 [2167] DBG:core:tcp_conn_get: c= 0x7f50d51c2d58, n=16, Usock=66<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Mar 31 05:25:27 [2176] DBG:core:handle_worker: read response= 7f50d51c2d58, 1, fd -1 from 12 (2167)<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Mar 31 05:25:27 [2167] DBG:core:tcp_conn_get: after receive_fd: c= 0x7f50d51c2d58 n=8 fd=69<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Mar 31 05:25:27 [2167] DBG:proto_tls:proto_tls_send: sending via fd 69...<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Mar 31 05:25:27 [2167] DBG:proto_tls:tls_update_fd: New fd is 69<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Mar 31 05:25:27 [2167] DBG:proto_tls:tls_write: write was successful (1248 bytes)<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Mar 31 05:25:27 [2167] DBG:proto_tls:proto_tls_send: after write: c= 0x7f50d51c2d58 n=1248 fd=69<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Mar 31 05:25:27 [2167] DBG:proto_tls:proto_tls_send: buf=<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: SIP/2.0 200 OK<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Via: SIP/2.0/TLS 52.114.14.70:5061;rport=3072;received=52.114.14.70;branch=z9hG4bKfabd2525<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Record-Route: <sip:msteamsbctest.voippabx.com.au:5061;transport=tls;ftag=127ce3aaa0c2420cad2c0183b7bbfadf;lr;r2=on><br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Record-Route: <sip:172.31.36.39:5060;ftag=127ce3aaa0c2420cad2c0183b7bbfadf;lr;r2=on><br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Record-Route: <sip:sip-du-a-as.pstnhub.microsoft.com:5061;transport=tls;lr><br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: From: Pasan Meemaduma<sip:+61291391380@sip.pstnhub.microsoft.com:5061;user=phone>;tag=127ce3aaa0c2420cad2c0183b7bbfadf<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: To: <sip:+61385783273@msteamsbctest.voippabx.com.au:5061;user=phone>;tag=as43b48489<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Call-ID: 71bc7d7ddef8520e953472f28ca8ae46<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: CSeq: 1 INVITE<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Server: Asterisk PBX 16.9.0<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Supported: replaces<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Contact: <sip:+61385783273@119.17.41.176:5061;transport=tls><br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Content-Type: application/sdp<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Content-Length: 338<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: #015<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: v=0<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: o=root 1590470023 1590470023 IN IP4 119.17.41.176<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: s=Asterisk PBX 16.9.0<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: c=IN IP4 119.17.41.176<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: t=0 0<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: m=audio 19240 RTP/SAVP 8 101<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:gG06kfD/N+jLNvmmDsmrFOWqWkKrrBI5O5eAQMnv<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: a=rtpmap:8 PCMA/8000<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: a=rtpmap:101 telephone-event/8000<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: a=fmtp:101 0-16<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: a=ptime:20<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: a=maxptime:150<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: a=sendrecv<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Mar 31 05:25:27 [2167] DBG:tm:relay_reply: sent buf=0x7f50dd2ba1e0: SIP/2.0 2..., shmem=0x7f50d51c9388: SIP/2.0 2<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Mar 31 05:25:27 [2167] DBG:tm:cleanup_uac_timers: RETR/FR timers reset<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Mar 31 05:25:27 [2167] DBG:tm:t_unref: UNREF_UNSAFE: [0x7f50d523d6e0] after is 0<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Mar 31 05:25:27 [2167] DBG:core:destroy_avp_list: destroying list (nil)<br>Mar 31 05:25:27 ip-172-31-36-39 opensips[2150]: Mar 31 05:25:27 [2167] DBG:core:receive_msg: cleaning up<br><br></div><div><br></div></div><div><font style="BACKGROUND-COLOR:#e6e6e6;"></font> </div><div dir="ltr" data-setdir="false"> Thank you</div><div dir="ltr" data-setdir="false">Regards,</div><div dir="ltr" data-setdir="false">Pasan<br></div><div><font style="BACKGROUND-COLOR:#e6e6e6;"></font> </div><div><font style="BACKGROUND-COLOR:#e6e6e6;"></font> </div><div><font style="BACKGROUND-COLOR:#e6e6e6;"></font> </div><div><font style="BACKGROUND-COLOR:#e6e6e6;"></font> </div><div><font style="BACKGROUND-COLOR:#e6e6e6;"></font> </div><div><font style="BACKGROUND-COLOR:#e6e6e6;"></font> </div><div><font style="BACKGROUND-COLOR:#e6e6e6;"></font> </div><div><font style="BACKGROUND-COLOR:#e6e6e6;">Distinguishing <font color="#0000ff"><strong>What</strong></font> && <font color="#ff007f"><strong>How</strong></font> !</font></div></div></div></div></div></body></html>