Hello. I'm trying to set up this (v 4.2 stable):
peer <--> ec2 <--kamailio+rtpengine--> asterisk
scheme

I use advertised adress for SIP and WS connections.
The problem is that on SIP I get one way audio - I can receive audio from asterisk, but I can't transmit audio there - my SIP UA tries to send data to Kamailio-s local EC2 IP. In case of WebRTC I get lot's of erros:

Jun 23 01:58:57 kamailio /usr/sbin/kamailio[18325]: WARNING: <core> [msg_translator.c:2778]: via_builder(): TCP/TLS connection (id: 0) for WebSocket could not be found
Jun 23 01:58:57 kamailio /usr/sbin/kamailio[18325]: ERROR: <core> [msg_translator.c:1996]: build_req_buf_from_sip_req(): could not create Via header
Jun 23 01:58:57 kamailio /usr/sbin/kamailio[18325]: ERROR: <core> [forward.c:584]: forward_request(): building failed
Jun 23 01:58:57 kamailio /usr/sbin/kamailio[18325]: ERROR: sl [sl_funcs.c:387]: sl_reply_error(): ERROR: sl_reply_error used: I'm terribly sorry, server error occurred (1/SL)

The call reaches Asterisk, but not vice-versa. No media is being transferred.

Rtpengine flags I use:
For SIP:  rtpengine_manage("trust-adress replace-origin replace-session-connection RTP/AVP");
For WS:  rtpengine_manage("trust-address replace-origin replace-session-connection ICE=force RTP/AVP");

Do you have any ideas how ti fix that? I also make REGFWD's to Asterisk
--
Alexandru Covalschi
ABRISS-Solutions
VoIP engineer and system administrator
phone: +37367398493
web: http://abs-telecom.com/