<div dir="ltr"><div>Hi Sergiu..</div><div><br></div><div>I've made many test and many change...</div><div><br></div><div>In tls.cfg I have this:</div><div><br></div><div>[server:default]<br>method = TLSv1.2<br>verify_certificate = yes<br>require_certificate = yes<br>private_key = /etc/letsencrypt/ssl/cert.key<br>certificate = /etc/letsencrypt/ssl/cert.crt<br>ca_list = /etc/letsencrypt/ssl/ca.crt<br><br>[client:default]<br>method = TLSv1.2<br>verify_certificate = yes<br>require_certificate = yes<br>private_key = /etc/letsencrypt/ssl/cert.key<br>certificate = /etc/letsencrypt/ssl/cert.crt<br>ca_list = /etc/letsencrypt/ssl/ca.crt</div><div><br></div><div>But when I make Kamcmd tls.list I have not response.. Not show me anything.</div><div><br></div><div>Problem with certificated??</div><div><br></div><div>Thanks<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El jue., 16 abr. 2020 a las 20:31, Sergiu Pojoga (<<a href="mailto:pojogas@gmail.com">pojogas@gmail.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi SIP User/anonymous/one-time-visitor/,</div><div><br></div>Your TLS config isn't correct. The article clearly says verify/require_certificate must be set to 'yes'<br><div><br></div><div><b>kamcmd tls.list</b><br></div><div>Does it show any 'established' connections with MS proxy?</div><div><br></div><div>Good luck,</div><div><br></div><div>--Sergiu</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 16, 2020 at 11:41 AM Ovidiu Sas <<a href="mailto:osas@voipembedded.com" target="_blank">osas@voipembedded.com</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">The tutorial is pretty clear:<br>
You need to add the Contact header only for OPTIONS pings.<br>
You need to use the proper Record-Route headers based on the direction<br>
of the call.<br>
There's no out of the box solution because each setup is different.<br>
<br>
If you understand how loose routing works in SIP, then you know how to<br>
adjust the config to use record_route_preset(), just as explained in<br>
the tutorial. There is also an example of an INVITE that has the right<br>
Record-Route headers in the tutorial.<br>
<br>
You can choose to use the FQDN for the Record-Route header facing MS<br>
and the IP for the Record-Route header facing the carrier or use the<br>
FQDN for both Record-Route headers (just like in the tutorialexample).<br>
Alternatively, one can try to advertise the FQDN in the listen<br>
directive in the config and then the Record-Route headers should be<br>
populated automatically.<br>
<br>
Regards,<br>
Ovidiu Sas<br>
<br>
On Thu, Apr 16, 2020 at 10:50 AM sip user <<a href="mailto:sipuser404@gmail.com" target="_blank">sipuser404@gmail.com</a>> wrote:<br>
><br>
> Hi Nasida.. Thanks for answerd to me...<br>
><br>
> I've activarted the debugger module, and I see the same:<br>
><br>
> Apr 15 11:11:41 vps793907 kamailio[23122]: 13(23167) DEBUG: <core> [ip_addr.c:243]: print_ip(): tcpconn_new: new tcp connection: 52.114.7.24<br>
> Apr 15 11:11:41 vps793907 kamailio[23122]: 13(23167) DEBUG: <core> [tcp_main.c:1073]: tcpconn_new(): tcpconn_new: on port 4160, type 3<br>
> Apr 15 11:11:41 vps793907 kamailio[23122]: 13(23167) DEBUG: <core> [tcp_main.c:1382]: tcpconn_add(): tcpconn_add: hashes: 171:1857:1187, 30<br>
> Apr 15 11:11:41 vps793907 kamailio[23122]: 13(23167) DEBUG: <core> [io_wait.h:388]: io_watch_add(): DBG: io_watch_add(0xa1f240, 23, 2, 0x7f90f2438f80), fd_no=17<br>
> Apr 15 11:11:41 vps793907 kamailio[23122]: 13(23167) DEBUG: <core> [io_wait.h:610]: io_watch_del(): DBG: io_watch_del (0xa1f240, 23, -1, 0x0) fd_no=18 called<br>
> Apr 15 11:11:41 vps793907 kamailio[23122]: 13(23167) DEBUG: <core> [tcp_main.c:4219]: handle_tcpconn_ev(): tcp: DBG: sending to child, events 1<br>
> Apr 15 11:11:41 vps793907 kamailio[23122]: 13(23167) DEBUG: <core> [tcp_main.c:3902]: send2child(): selected tcp worker 1 10(23159) for activity on [tls:SBC_IP:5061], 0x7f90f2438f80<br>
> Apr 15 11:11:41 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [tcp_read.c:1507]: handle_io(): received n=8 con=0x7f90f2438f80, fd=9<br>
> Apr 15 11:11:41 vps793907 kamailio[23122]: 10(23159) DEBUG: tls [tls_server.c:184]: tls_complete_init(): Using TLS domain TLSs<default><br>
> Apr 15 11:11:41 vps793907 kamailio[23122]: 10(23159) DEBUG: tls [tls_domain.c:700]: sr_ssl_ctx_info_callback(): SSL handshake started<br>
> Apr 15 11:11:41 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [tcp_main.c:2516]: tcpconn_do_send(): tcp_send: sending...<br>
> Apr 15 11:11:41 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [tcp_main.c:2550]: tcpconn_do_send(): tcp_send: after real write: c= 0x7f90f2438f80 n=1468 fd=9<br>
> Apr 15 11:11:41 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [tcp_main.c:2551]: tcpconn_do_send(): tcp_send: buf=<br>
> Apr 15 11:11:41 vps793907 kamailio[23122]: #026#003#003<br>
> Apr 15 11:11:41 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [io_wait.h:388]: io_watch_add(): DBG: io_watch_add(0x9c1700, 9, 2, 0x7f90f2438f80), fd_no=1<br>
> Apr 15 11:11:42 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [tcp_read.c:296]: tcp_read_data(): EOF on 0x7f90f2438f80, FD 9<br>
> Apr 15 11:11:42 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [tcp_read.c:1291]: tcp_read_req(): tcp_read_req: EOF<br>
> Apr 15 11:11:42 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [io_wait.h:610]: io_watch_del(): DBG: io_watch_del (0x9c1700, 9, -1, 0x10) fd_no=2 called<br>
> Apr 15 11:11:42 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [tcp_read.c:1434]: release_tcpconn(): releasing con 0x7f90f2438f80, state -1, fd=9, id=30<br>
> Apr 15 11:11:42 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [tcp_read.c:1435]: release_tcpconn():  extra_data 0x7f90f2432b40<br>
> Apr 15 11:11:42 vps793907 kamailio[23122]: 13(23167) DEBUG: <core> [tcp_main.c:3331]: handle_tcp_child(): handle_tcp_child: reader response= 7f90f2438f80, -1 from 1<br>
> Apr 15 11:11:42 vps793907 kamailio[23122]: 13(23167) DEBUG: tls [tls_server.c:604]: tls_h_close(): Closing SSL connection 0x7f90f2432b40<br>
><br>
> I don't see any different.<br>
><br>
> I know that the module is loaded because I see:<br>
><br>
> exec: *** cfgtrace:request_route=[DEFAULT_ROUTE] c=[/etc/kamailio/kamailio.cfg] l=486 a=5 n=route<br>
><br>
> When I restart kamailio, but when I "launch" a call from Teams to my Kamailio I only see that.<br>
><br>
> To configure it, I follow <a href="https://skalatan.de/en/blog/kamailio-sbc-teams" rel="noreferrer" target="_blank">https://skalatan.de/en/blog/kamailio-sbc-teams</a>.. But I cannot make it works..<br>
><br>
> Any more thing that i can test or do??<br>
><br>
> Thanks<br>
><br>
> El jue., 16 abr. 2020 a las 14:20, Nasida Yuriy (<<a href="mailto:nasida@live.ru" target="_blank">nasida@live.ru</a>>) escribió:<br>
>><br>
>> Wow, so many people want to configure kamailio with MS. First of all i think you need to get sip debug  between kamailio and MS. Kamilio has module to save sip traces. This way you will get sip debug decrypted.<br>
>><br>
>><br>
>> ________________________________<br>
>> От: sr-users <<a href="mailto:sr-users-bounces@lists.kamailio.org" target="_blank">sr-users-bounces@lists.kamailio.org</a>> от имени sip user <<a href="mailto:sipuser404@gmail.com" target="_blank">sipuser404@gmail.com</a>><br>
>> Отправлено: 16 апреля 2020 г. 10:19<br>
>> Кому: <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a> <<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>><br>
>> Тема: [SR-Users] Kamailio like SBC with Teams<br>
>><br>
>> Hello good morning ... I am new to this list and I was starting to mess with Kamailio, mainly to set it up as SBC against Teams, in this case.<br>
>><br>
>> But I can't get it to work for me. If I launch a call from the Teams, in the Kamailio I see:<br>
>><br>
>> 1.- In syslog:<br>
>><br>
>> Apr 15 11:11:41 vps793907 kamailio[23122]: 13(23167) DEBUG: <core> [ip_addr.c:243]: print_ip(): tcpconn_new: new tcp connection: 52.114.7.24<br>
>> Apr 15 11:11:41 vps793907 kamailio[23122]: 13(23167) DEBUG: <core> [tcp_main.c:1073]: tcpconn_new(): tcpconn_new: on port 4160, type 3<br>
>> Apr 15 11:11:41 vps793907 kamailio[23122]: 13(23167) DEBUG: <core> [tcp_main.c:1382]: tcpconn_add(): tcpconn_add: hashes: 171:1857:1187, 30<br>
>> Apr 15 11:11:41 vps793907 kamailio[23122]: 13(23167) DEBUG: <core> [io_wait.h:388]: io_watch_add(): DBG: io_watch_add(0xa1f240, 23, 2, 0x7f90f2438f80), fd_no=17<br>
>> Apr 15 11:11:41 vps793907 kamailio[23122]: 13(23167) DEBUG: <core> [io_wait.h:610]: io_watch_del(): DBG: io_watch_del (0xa1f240, 23, -1, 0x0) fd_no=18 called<br>
>> Apr 15 11:11:41 vps793907 kamailio[23122]: 13(23167) DEBUG: <core> [tcp_main.c:4219]: handle_tcpconn_ev(): tcp: DBG: sending to child, events 1<br>
>> Apr 15 11:11:41 vps793907 kamailio[23122]: 13(23167) DEBUG: <core> [tcp_main.c:3902]: send2child(): selected tcp worker 1 10(23159) for activity on [tls:SBC_IP:5061], 0x7f90f2438f80<br>
>> Apr 15 11:11:41 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [tcp_read.c:1507]: handle_io(): received n=8 con=0x7f90f2438f80, fd=9<br>
>> Apr 15 11:11:41 vps793907 kamailio[23122]: 10(23159) DEBUG: tls [tls_server.c:184]: tls_complete_init(): Using TLS domain TLSs<default><br>
>> Apr 15 11:11:41 vps793907 kamailio[23122]: 10(23159) DEBUG: tls [tls_domain.c:700]: sr_ssl_ctx_info_callback(): SSL handshake started<br>
>> Apr 15 11:11:41 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [tcp_main.c:2516]: tcpconn_do_send(): tcp_send: sending...<br>
>> Apr 15 11:11:41 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [tcp_main.c:2550]: tcpconn_do_send(): tcp_send: after real write: c= 0x7f90f2438f80 n=1468 fd=9<br>
>> Apr 15 11:11:41 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [tcp_main.c:2551]: tcpconn_do_send(): tcp_send: buf=<br>
>> Apr 15 11:11:41 vps793907 kamailio[23122]: #026#003#003<br>
>> Apr 15 11:11:41 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [io_wait.h:388]: io_watch_add(): DBG: io_watch_add(0x9c1700, 9, 2, 0x7f90f2438f80), fd_no=1<br>
>> Apr 15 11:11:42 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [tcp_read.c:296]: tcp_read_data(): EOF on 0x7f90f2438f80, FD 9<br>
>> Apr 15 11:11:42 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [tcp_read.c:1291]: tcp_read_req(): tcp_read_req: EOF<br>
>> Apr 15 11:11:42 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [io_wait.h:610]: io_watch_del(): DBG: io_watch_del (0x9c1700, 9, -1, 0x10) fd_no=2 called<br>
>> Apr 15 11:11:42 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [tcp_read.c:1434]: release_tcpconn(): releasing con 0x7f90f2438f80, state -1, fd=9, id=30<br>
>> Apr 15 11:11:42 vps793907 kamailio[23122]: 10(23159) DEBUG: <core> [tcp_read.c:1435]: release_tcpconn():  extra_data 0x7f90f2432b40<br>
>> Apr 15 11:11:42 vps793907 kamailio[23122]: 13(23167) DEBUG: <core> [tcp_main.c:3331]: handle_tcp_child(): handle_tcp_child: reader response= 7f90f2438f80, -1 from 1<br>
>> Apr 15 11:11:42 vps793907 kamailio[23122]: 13(23167) DEBUG: tls [tls_server.c:604]: tls_h_close(): Closing SSL connection 0x7f90f2432b40<br>
>><br>
>> 2.- With TCPDUMP:<br>
>><br>
>> 11:13:09.311797 IP SBC_IP .1024 > SBC_IP .eu.sip-tls: Flags [S], seq 261244614, win 64240, options [mss 1440,nop,wscale 8,nop,nop,sackOK], length 0<br>
>> 11:13:09.311898 IP  SBC_IP .eu.sip-tls > 52.114.76.76.1024: Flags [S.], seq 812357247, ack 261244615, win 29200, options [mss 1460,nop,nop,sackOK,nop,wscale 7], length 0<br>
>> 11:13:09.340358 IP 52.114.76.76.1024 >  SBC_IP .eu.sip-tls: Flags [.], ack 1, win 2053, length 0<br>
>> 11:13:09.340560 IP 52.114.76.76.1024 > SBC_IP .eu.sip-tls: Flags [P.], seq 1:187, ack 1, win 2053, length 186<br>
>> 11:13:09.340578 IP SBC_IP .eu.sip-tls > 52.114.76.76.1024: Flags [.], ack 187, win 237, length 0<br>
>> 11:13:09.341361 IP SBC_IP .eu.sip-tls > 52.114.76.76.1024: Flags [P.], seq 1:1469, ack 187, win 237, length 1468<br>
>> 11:13:09.369606 IP 52.114.76.76.1024 > SBC_IP .eu.sip-tls: Flags [.], ack 1469, win 2053, length 0<br>
>> 11:13:12.451498 IP 52.114.7.24.1216 > SBC_IP .eu.sip-tls: Flags [S], seq 309084204, win 64240, options [mss 1440,nop,wscale 8,nop,nop,sackOK], length 0<br>
>> 11:13:12.451587 IP SBC_IP .eu.sip-tls > 52.114.7.24.1216: Flags [S.], seq 3275066862, ack 309084205, win 29200, options [mss 1460,nop,nop,sackOK,nop,wscale 7], length 0<br>
>> 11:13:12.707119 IP 52.114.7.24.1216 > SBC_IP .eu.sip-tls: Flags [.], ack 1, win 2053, length 0<br>
>> 11:13:12.707311 IP 52.114.7.24.1216 > SBC_IP .eu.sip-tls: Flags [P.], seq 1:187, ack 1, win 2053, length 186<br>
>> 11:13:12.707345 IP SBC_IP .eu.sip-tls > 52.114.7.24.1216: Flags [.], ack 187, win 237, length 0<br>
>> 11:13:12.708273 IP SBC_IP .eu.sip-tls > 52.114.7.24.1216: Flags [P.], seq 1:1469, ack 187, win 237, length 1468<br>
>> 11:13:12.965101 IP 52.114.7.24.1216 > SBC_IP .eu.sip-tls: Flags [.], ack 1469, win 2053, length 0<br>
>> 11:13:12.965156 IP 52.114.7.24.1216 > SBC_IP .eu.sip-tls: Flags [F.], seq 187, ack 1469, win 2053, length 0<br>
>> 11:13:12.965688 IP SBC_IP .eu.sip-tls > 52.114.7.24.1216: Flags [F.], seq 1469, ack 188, win 237, length 0<br>
>> 11:13:13.220871 IP 52.114.7.24.1216 > SBC_IP .eu.sip-tls: Flags [.], ack 1470, win 2053, length 0<br>
>><br>
>> I can't "receive" anything.<br>
>><br>
>> I have generated the certificates and configured in the tls.cfg of the Kamailio:<br>
>><br>
>> [server:default]<br>
>> method = TLSv1.2<br>
>> verify_certificate = no<br>
>> require_certificate = no<br>
>> private_key = /etc/letsencrypt/ssl/cert.key<br>
>> certificate = /etc/letsencrypt/ssl/cert.crt<br>
>> ca_list = /etc/letsencrypt/ssl/ca.crt<br>
>><br>
>> Within Kamailio itself I have it configured to return a 200 KeepAlive to Teams when it receives an OPTIONS:<br>
>><br>
>> event_route[tm:local-request] {<br>
>><br>
>>         if(is_method("OPTIONS") && $ru =~ "<a href="http://pstnhub.microsoft.com" rel="noreferrer" target="_blank">pstnhub.microsoft.com</a>") {<br>
>>                append_hf("Contact: <sip: SBC_DNS :5061;transport=tls>\r\n");<br>
>>         }<br>
>>         xlog("L_INFO", "Sent out tm request: $mb\n");<br>
>> }<br>
>><br>
>> And I have measured the record_route for this new one:<br>
>><br>
>> record_route_preset(" SBC_DNS :5061;transport=tls", " SBC_IP :5061");<br>
>><br>
>> I have created a dispatcher.list:<br>
>><br>
>> # setid(integer) destination(sip uri) flags (integer, optional), priority(int,opt), attrs (str,optional)<br>
>> 1:1:sip:<a href="http://sip.pstnhub.microsoft.com" rel="noreferrer" target="_blank">sip.pstnhub.microsoft.com</a>;transport=tls 0 3 socket=tls: SBC_IP :5061;ping_from= sip:SBC_DNS<br>
>> 2:1:sip:<a href="http://sip2.pstnhub.microsoft.com" rel="noreferrer" target="_blank">sip2.pstnhub.microsoft.com</a>;transport=tls 0 2 socket=tls: SBC_IP :5061;ping_from=sip: SBC_DNS<br>
>> 3:1:sip:<a href="http://sip3.pstnhub.microsoft.com" rel="noreferrer" target="_blank">sip3.pstnhub.microsoft.com</a>;transport=tls 0 1 socket=tls: SBC_IP :5061;ping_from=sip: SBC_DNS<br>
>> 4:1:sip:<a href="http://sip-all.pstnhub.microsoft.com" rel="noreferrer" target="_blank">sip-all.pstnhub.microsoft.com</a>;transport=tls 0 1 socket=tls: SBC_IP :5061;ping_from=sip: SBC_DNS<br>
>><br>
>> I think that one of the problems is that I do not send the OPTIONS to the Teams well, since it is on their panel, it indicates that the SBC is INACTIVE.<br>
>><br>
>> I don't know if you could help me straighten this out a bit ...<br>
>><br>
>> Thank you so much for everything..<br>
>><br>
>> a greeting<br>
>> _______________________________________________<br>
>> Kamailio (SER) - Users Mailing List<br>
>> <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
>> <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
><br>
> _______________________________________________<br>
> Kamailio (SER) - Users Mailing List<br>
> <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
> <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br>
<br>
<br>
-- <br>
VoIP Embedded, Inc.<br>
<a href="http://www.voipembedded.com" rel="noreferrer" target="_blank">http://www.voipembedded.com</a><br>
<br>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>