Hello,

 

I would try to connect to the kamailio container and increase debug level to see what is happening on a lower level. You can also use tools like ngrep/sngrep to see if the SIP request is routed to the instance.

 

Cheers,

 

Henning

--

Henning Westerholt – https://skalatan.de/blog/

Kamailio services – https://gilawa.com

 

From: sr-users <sr-users-bounces@lists.kamailio.org> On Behalf Of Cedric Thiebault
Sent: Friday, October 15, 2021 3:37 PM
To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Subject: Re: [SR-Users] Kamailio on AWS Kubernetes with NLB

 

Adding a log in kamailio.cfg in request_route method:

xlog("L_INFO", "INFO - request_route - $rm ($fu ($si:$sp) to $tu, $ci)\n");

 

Using docker-compose I get:

24(30) INFO: {1 1 REGISTER Hotel7dIcm7DCPtmR3jACw..} <script>: INFO - request_route - REGISTER (sip:cedric@localhost:5060;transport=TCP (172.19.0.1:43696) to sip:cedric@localhost:5060;transport=TCP, Hotel7dIcm7DCPtmR3jACw..)

 

But I don't see any log message on AWS :-(

 

Cedric


From: sr-users <sr-users-bounces@lists.kamailio.org> on behalf of Cedric Thiebault <cedric.thiebault@sensefly.com>
Sent: Friday, October 15, 2021 11:52 AM
To: sr-users@lists.kamailio.org <sr-users@lists.kamailio.org>
Subject: [SR-Users] Kamailio on AWS Kubernetes with NLB

 

Hello,

 

I'm trying to deploy Kamailio on Kubernetes (AWS EKS with Network Load Balancer) but I'm not able to register using TCP.

I'm using official Docker image 5.5.0-buster. 

I did some tests with Docker Compose and it worked fine, but on K8S it does not :-(

 

Here are my logs:

 

Listening on

             udp: 127.0.0.1:5060

             udp: 172.31.4.29:5060

             udp: 172.31.0.221:5060

             tcp: 127.0.0.1:5060

             tcp: 172.31.4.29:5060

             tcp: 172.31.0.221:5060

Aliases:

             tcp: ip-172-31-0-221.eu-central-1.compute.internal:5060

             tcp: 172-31-4-29.kube-prometheus-stack-prometheus-node-exporter.infra-prometheus.svc.cluster.local:5060

             tcp: localhost4.localdomain4:5060

             tcp: localhost4:5060

             tcp: localhost.localdomain:5060

             tcp: localhost:5060

             udp: ip-172-31-0-221.eu-central-1.compute.internal:5060

             udp: 172-31-4-29.kube-prometheus-stack-kubelet.kube-system.svc.cluster.local:5060

             udp: localhost4.localdomain4:5060

             udp: localhost4:5060

             udp: localhost.localdomain:5060

             udp: localhost:5060

 

 0(1) INFO: <core> [core/tcp_main.c:4983]: init_tcp(): using epoll_lt as the io watch method (auto detected)

 0(1) INFO: rr [../outbound/api.h:52]: ob_load_api(): unable to import bind_ob - maybe module is not loaded

 0(1) INFO: rr [rr_mod.c:188]: mod_init(): outbound module not available

 0(1) INFO: <core> [main.c:3030]: main(): processes (at least): 41 - shm size: 67108864 - pkg size: 8388608

 0(1) INFO: <core> [core/udp_server.c:154]: probe_max_receive_buffer(): SO_RCVBUF is initially 212992

 0(1) INFO: <core> [core/udp_server.c:206]: probe_max_receive_buffer(): SO_RCVBUF is finally 425984

 0(1) INFO: <core> [core/udp_server.c:154]: probe_max_receive_buffer(): SO_RCVBUF is initially 212992

 0(1) INFO: <core> [core/udp_server.c:206]: probe_max_receive_buffer(): SO_RCVBUF is finally 425984

 0(1) INFO: <core> [core/udp_server.c:154]: probe_max_receive_buffer(): SO_RCVBUF is initially 212992

 0(1) INFO: <core> [core/udp_server.c:206]: probe_max_receive_buffer(): SO_RCVBUF is finally 425984

29(35) INFO: jsonrpcs [jsonrpcs_sock.c:443]: jsonrpc_dgram_process(): a new child 0/35

31(37) INFO: ctl [io_listener.c:213]: io_listen_loop(): io_listen_loop:  using epoll_lt io watch method (config)

35(41) INFO: <core> [core/parser/parse_fline.c:147]: parse_first_line(): method not followed by SP

35(41) ERROR: <core> [core/parser/parse_fline.c:271]: parse_first_line(): parse_first_line: bad message (offset: 0)

35(41) ERROR: <core> [core/parser/msg_parser.c:747]: parse_msg(): ERROR: parse_msg: message=<>

35(41) ERROR: <core> [core/receive.c:374]: receive_msg(): core parsing of SIP message failed (194.230.146.66:9055/2)

 

 

And my service:

 

apiVersion: v1

kind: Service

metadata:

  name: kamailio-tcp

  annotations:

    service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip

    service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: '*'

    service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing

    service.beta.kubernetes.io/aws-load-balancer-target-group-attributes: preserve_client_ip.enabled=true

    service.beta.kubernetes.io/aws-load-balancer-type: external

  labels:

    app.kubernetes.io/instance: test-sip

    app.kubernetes.io/name: kamailio-tcp

    app.kubernetes.io/version: 5.5.0-buster

spec:

  type: LoadBalancer

  externalTrafficPolicy: Local

  ports:

    - name: sip-tcp

      nodePort: 30567

      port: 5060

      protocol: TCP

      targetPort: 5060

  selector:

    app.kubernetes.io/instance: test-sip

    app.kubernetes.io/name: kamailio

 

 

I have a Netwok Load Balancer create with a listener for TCP 5060 but when I try to connect with Zoiper or Linphone, it does not work :-(

 

I used tcpdump on my pod and it received well some SIP commands.

Any ideas of what could be wrong here?

 

Thanks in advance!

 

Cedric