implement the Asterisk on the containerized Platform

My Question is How to implement the Asterisk on the containerized Platform Like Docker And Kubernetes , How to Automate the rtp , udp , and http port on the containerized Platform.

You can do that technically, but there are two complicating factors.

The first is that docker comes with its own rules for networks, i.e. you have another NAT barrier. You can also add IPv6, but that requires some addional steps. You could use host networking, but that would defeat the purpose of isolating the application from the host.

The second factor has to do with the nature of Asterisk. It’s more of a construction kit to build all kinds of telephony things and not a defined single purpose application with only a few third-party resources. The question is then what should get stuffed into the docker image. To be on the safe side, you could start with all supported databases…

Asterisk source contrib contains a dockerfile. I recently started playing with asterisk in containers. Please update if you have issues with docker’s network settings.


Dear [AustinH] ,
Thank you for your response. first i have try to use according to your docker file , but last line not working COPY (command) , and another think im already create one docker file centos7 then create a container and i have already complete the Whole setup of Docker Asterisk -container on Kubernetes (using Kubeadm cluster setup) ,

But problem is if am trying to access the rtp port but it not working …
If any other solution of access the rtp port on the kubeadm so please share with us.

1 Like

Dear EkFudrek
if You have already automate all those think so please share the solutions

But problem is if am trying to access the rtp port but it not working …

You need to provide the relevant log entries plus a SIP trace.

Actually, SIP configuration is easy. As a rule, the problems occur in interaction with other network components such as routers or firewalls and with cloud services you may not know what is between your box and the customer. While there are some configuration options, but if you don’t know how the other active network components are behaving, it’s a matter of luck. Sometimes the service providers don’t quite conform to the standard. Then it becomes rather difficult.

You will therefore not find any direct possible solutions here as long as it is not clear what is going on.

Dear FYI,
I have Setup Kubeadm cluster Locallaly Between two server both are Dell Xeon Server ,
Master Node Server Name :- pcmk230
Worker Node Server : - pcmk229
then i have created an asterisk pods on this cluster . also create pods service then allow the all port required for Asterisk just like …
UDP , RTP , and HTTP port .

for example :-
now pod running on pcmk229 Worker Node then if i’m using

Sip.conf file
externip=192.168.XXX.XXX —here i have using Master Node pcmk230 ip
bindport = 5161
nat=force_rport,comedia instead
callerid = LITE

And also set the pods service type LoadBalancer and ip is 192.168.XXX.XXX —here i have using Master Node pcmk230 ip

like this
ast-con01 LoadBalancer 10.99.XX.XX 192.168.XXX.XXX 2022:31467/TCP,5161:32043/UDP

then register the soft phone it will connected the call but not getting a vice that mens rtp not sending

Please find the attachment of log

(Attachment log-putty is missing)

1 Like

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2022.11.18 12:24:33 =~=~=~=~=~=~=~=~=~=~=~=
core set debug on

[0KUsage: core set debug [atleast] [module]
core set debug off

Sets level of debug messages to be displayed or
sets a module name to display debug messages from.
0 or off means no messages should be displayed.
Equivalent to -d[d[…]] on startup

[Kcon04-ast-74f68ddf64-626vzCLI> core set debug on [K [K [K [K [K [K [K [K [K [K [K [K [K [K [H [2Jcon04-ast-74f68ddf64-626vzCLI> cres [K [K [Kore set verbose 99

[0KConsole verbose was 777 and is now 99.

[Kcon04-ast-74f68ddf64-626vz*CLI> sip show [K [K [Ket debug on

[0KSIP Debugging enabled

<— SIP read from UDP: —>
REGISTER sip:192.168.XXX.XXX:5164 SIP/2.0
Via: SIP/2.0/UDP 192.168.XXX.XX:59224;branch=z9hG4bK-d87543-1e4b2d1f2a7b405b-1–d87543-;rport
Max-Forwards: 70
Contact: sip:4001@192.168.XXX.XX:59224;rinstance=73bf57c83e3b3788


[0K[Nov 18 06:53:34] NOTICE[126]: chan_sip.c:28570 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 4001
Really destroying SIP dialog ‘99247d5636516a66YjQ5ZGJjZDZiY2NmNmFkMTE1OGI5MDM3ZjNlNzU0ZDk.’ Method: SUBSCRIBE

<— SIP read from UDP: —>
INVITE sip:5529@192.168.XXX.XXX:5164 SIP/2.0
Via: SIP/2.0/UDP 192.168.XXX.XX:59224;branch=z9hG4bK-d87543-fe703b72b00d1159-1–d87543-;rport
Max-Forwards: 70
Contact: <sip:4001@>


[0KReally destroying SIP dialog ‘73d743f36ebd120607c3158f02e09e91@’ Method: INVITE

<— SIP read from UDP: —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.XXX.XXX:5164;branch=z9hG4bK43d78799;received=;rport=44621

I haven’t yet studied the details.

Asterisk man makes announcement: Move to PJSIP!

The old sip stack, chan_sip, or so, is obsolete. PJSIP offers finer control, especially for handling what is sometimes called “trunk”.

1 Like

Your SIP debug messages are incomplete. You’d need to show the full dialogs, but you did not show the replies. I am also a bit wondering why you need to register, but since you do it, what is the registration status?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.