title: No sound and RTP failure when playing back file from Asterisk Server
body: <p>I've recently installed my first Asterisk on AWS EC2 instance and experienced some minor issue, currently phones are not recieving the hang up instruction and also no sound when playing back a file from the server.</p>
  
  <p>I think the issue is to do with the public and private IP issue of the server instance, so I have a public ip of x.x.x.x and a private ip of y.y.y.y on the instance , the phones register to the server on x.x.x.x and can dial extensions and now with some NAT alterations I can hear and talk from phone to phone bu they do not hang up at end of calls, also if playing back a file from the server there is no sound and no hang up at the end of the call.</p>
  
  <p>Ive tried it with the firewall compelte off and ALL TRAFFIC ALL PORTS open on the instance so i dont think its a forewall or NAT issue as ironed these  out, I think its to do witht he internal and external IP's being different or perhaps the RTP protocal port on the instance not being set somewhere</p>
  
  <p>the handsets show that they are connecting but then the RTP protocal fails ( and it shows the y.y.y.y iternal ip as below when i expected it to show the public IP x.x.x.x </p>
  
  <pre><code>16/4/2019 15:30:06 [NOTICE] PHN: TPL: Socket 364 idle/connect timeout
  16/4/2019 15:30:10 [ERROR ] PHN: SIP: transaction_timeout udp: 1001331 (32000)
  16/4/2019 15:30:10 [ERROR ] PHN: SIP: transport error: 1001331 -&gt; udp:y.y.y.y:5060
  16/4/2019 15:30:10 [NOTICE] PHN: SIP: Add dirty host: udp:y.y.y.y:5060 (0 sec)
  16/4/2019 15:30:10 [NOTICE] PHN: SIP: final transport error: 1001331 -&gt; udp:y.y.y.y:5060
  16/4/2019 15:30:10 [ERROR ] PHN: SIP: transport error 1001331: generating fake 599
  16/4/2019 15:30:10 [NOTICE] MEDIA: MediaIpc::rtpClose: RP72
  16/4/2019 15:30:10 [NOTICE] MEDIA: MediaIpc::rtpClose: RC72
  16/4/2019 15:30:12 [WARN  ] PHN: SIP: process_registrar_packet: 401 needs 128 bit nonce
  16/4/2019 15:30:12 [NOTICE] PHN: SIP: process auth:Match challenge for user=WB001, realm=asterisk
  16/4/2019 15:30:12 [NOTICE] PHN: RTP: set_destination RP73 adr=y.y.y.y:19684
  16/4/2019 15:30:12 [WARN  ] MEDIA: CallStats: 2156890680 not found
  </code></pre>
  
  <p>The server shows the following log..</p>
  
  <pre><code>  == Using SIP RTP CoS mark 5
  -- Executing [200@LocalSets:1] Answer("SIP/WB001-00000015", "") in new stack
  -- Executing [200@LocalSets:2] Playback("SIP/WB001-00000015", "hello-world") in new stack
  -- &lt;SIP/WB001-00000015&gt; Playing 'hello-world.gsm' (language 'en')
  -- Executing [200@LocalSets:3] Hangup("SIP/WB001-00000015", "") in new stack
    == Spawn extension (LocalSets, 200, 3) exited non-zero on 'SIP/WB001-00000015'
  [Apr 16 15:30:45] WARNING[13228]: chan_sip.c:4119 retrans_pkt: 
  Retransmission timeout reached on transmission f2e6b55c11ce-zqpp4q4dbedu for seqno 2 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
  Packet timed out after 31998ms with no response
    == Using SIP RTP CoS mark 5
   -- Executing [101@LocalSets:1] Dial("SIP/WB001-00000016", "SIP/WB002") in new stack
    == Using SIP RTP CoS mark 5
  -- Called SIP/WB002
  -- SIP/WB002-00000017 is ringing
  -- SIP/WB002-00000017 is ringing
  -- SIP/WB002-00000017 answered SIP/WB001-00000016
  -- Channel SIP/WB002-00000017 joined 'simple_bridge' basic-bridge &lt;87c7a794-f9e6-4488-8957-9c0db9e0234f&gt;
  -- Channel SIP/WB001-00000016 joined 'simple_bridge' basic-bridge &lt;87c7a794-f9e6-4488-8957-9c0db9e0234f&gt;
  [Apr 16 15:32:14] WARNING[13228]: chan_sip.c:4119 retrans_pkt: Retransmission timeout reached on transmission 49e7b55c4a45-rd1is68l1q0a for seqno 2 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
  Packet timed out after 32000ms with no response
   [Apr 16 15:32:14] WARNING[13228]: chan_sip.c:4143 retrans_pkt: Hanging up call 49e7b55c4a45-rd1is68l1q0a - no reply to our critical packet (see https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions).
  -- Channel SIP/WB001-00000016 left 'native_rtp' basic-bridge &lt;87c7a794-f9e6-4488-8957-9c0db9e0234f&gt;
    == Spawn extension (LocalSets, 101, 1) exited non-zero on 'SIP/WB001-00000016'
  -- Channel SIP/WB002-00000017 left 'native_rtp' basic-bridge &lt;87c7a794-f9e6-4488-8957-9c0db9e0234f&gt;
  [Apr 16 15:32:14] WARNING[13228][C-00000011]: chan_sip.c:24312 handle_response_invite: Re-invite to non-existing call leg on other UA. SIP dialog '3ca4381a658c7f5f2cee3d8c02acb2a7@172.31.29.187:5060'. Giving up.
  </code></pre>