andrius / asterisk

Asterisk PBX in Docker on Alpine Linux. Smallest Asterisk ever! ;)
MIT License
255 stars 94 forks source link

Issue on Trunk with CUCM #11

Open ppittavi opened 4 years ago

ppittavi commented 4 years ago

Hi Andrius, thanks for your wonderful work. I'm trying to connect an asterisk for development on my laptop and i did a trunk, both side, with a Cisco Call Manager used in my office. Trunk works in both side and sip telephone register on asterisk can ring a cisco telephone resiter an CUCM and viceversa.

But when I Answer the call HangUp and in asterisk on my laptop I got this error:

   -- Channel SIP/callmanageriset-00000054 joined 'simple_bridge' basic-bridge <5d8debd7-7b17-4364-9182-26ef7eacadfb>
    -- Channel SIP/pierpa-00000053 joined 'simple_bridge' basic-bridge <5d8debd7-7b17-4364-9182-26ef7eacadfb>
[Feb  7 09:26:41] WARNING[48]: chan_sip.c:4119 retrans_pkt: Retransmission timeout reached on transmission 1498913321-5060-14@BJC.BGI.A.BFJ for seqno 81 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 6400ms with no response
[Feb  7 09:26:41] WARNING[48]: chan_sip.c:4143 retrans_pkt: Hanging up call 1498913321-5060-14@BJC.BGI.A.BFJ - no reply to our critical packet (see https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions).
    -- Channel SIP/pierpa-00000053 left 'simple_bridge' basic-bridge <5d8debd7-7b17-4364-9182-26ef7eacadfb>
    -- Channel SIP/callmanageriset-00000054 left 'simple_bridge' basic-bridge <5d8debd7-7b17-4364-9182-26ef7eacadfb>

sniffing with tcpdump and opening with wireshark i noticed that the called phone try to start rdp session with the asterisk ip inside the docker so thi is probably the resons while it fails. https://drive.google.com/open?id=1NUcHOt1FDaBl9x1jl7_Zf7iAbRFRPbMA

What i'am missing? thanks in advance Pier Paolo

ppittavi commented 4 years ago

sorry the ip problem is solved with externip= <my-laptop-ip> in general section of sip.conf.

when I call from CUCM phone to asterisk everithing works fine except cucm phone does not get HangUp from asterisk phone. When i call from asterisk phone call starts but dropped with same error after few seconds:


    -- Channel SIP/callmanageriset-00000007 joined 'simple_bridge' basic-bridge <46dcfff3-feb7-4db3-b533-e4b338464d67>
    -- Channel SIP/pierpa-00000006 joined 'simple_bridge' basic-bridge <46dcfff3-feb7-4db3-b533-e4b338464d67>
[Feb  7 10:05:35] WARNING[48]: chan_sip.c:4119 retrans_pkt: Retransmission timeout reached on transmission 14537367-5060-5@BJC.BGI.A.BFJ for seqno 41 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 6401ms with no response
[Feb  7 10:05:35] WARNING[48]: chan_sip.c:4143 retrans_pkt: Hanging up call 14537367-5060-5@BJC.BGI.A.BFJ - no reply to our critical packet (see https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions).
    -- Channel SIP/pierpa-00000006 left 'simple_bridge' basic-bridge <46dcfff3-feb7-4db3-b533-e4b338464d67>
    -- Channel SIP/callmanageriset-00000007 left 'simple_bridge' basic-bridge <46dcfff3-feb7-4db3-b533-e4b338464d67>
  == Spawn extension (phones, 243, 2) exited non-zero on 'SIP/pierpa-00000006'
andrius commented 4 years ago

try to use host networking on asterisk container, otherwise you need to port-forward quite a lot of ports (5060 and RTP ports) and set your sip.conf and rtp.conf

adamvx commented 3 years ago

@andrius Yes, I can confirm that host networking solves the issue but it works only on linux. Could you provide an example how to set it up without host network?

andrius commented 3 years ago

I will update docs, it is not so difficult but also limiting amount of open calls etc - to run asterisk within docker network, you should port-forward RTP ports. Docker is not awesome with that (there is also workarounds with iptables)

The simplest way is to expose TCP/UDP ports for 5060 and other ports you want (like AMI, etc), expose range of ports for RTP (not more than 1000-1500 ports, docker will be non-responsive with higher amount (and update rtp.conf)

Because asterisk will be behind NAT, sip.conf shall be updated too. Basically this article helps, docker setup is pretty similar to the floating IP https://andrius.mobi/2018/12/digital-ocean-floating-ip-and-voip.html