Anybody at the PSTN can call to my phone number, the cisco gateway answer the call and transfer it to my asterisk. Asterisk answer the call and transfer it to twilio PJSIP Trunk. My users answer the call from a web application connected to the twilio service. Everything on this scenario works properly.
My Problem is when I try to call from the WebAPP to a PSTN number, any RTP that comes from Twilio arrives to Asterisk but are not sent to cisco. The weird part is that every RTP that came from the PSTN through cisco, asterisk and then twilio arrives to the webApp.
When I receive the call from twilio, I just modify the default contexts in order to add an “Answer(500)” before the “Dial()”.
I’ll really appreciate any clue about it.
Best regards,
Carlos
This URL gives you a google document with the configurations and the call log:
After check logs and network packets captures, I noticed that the RTP packets comming from Twilio arrives to asterisk but asterisk is not using them… I don’t know why.
I’m capturing the packages using tcpdump at the same asterisk. Inside the pcap file are the RTP packets that came from twilio… in that way a firewall is discarted.
Executing “rtp set debug on” I only can see the following all the time:
[2023-09-21 18:08:41] VERBOSE[27217][C-0000001f] res_rtp_asterisk.c: Got RTP packet from 172.24.1.31:46154 (type 00, seq 046554, ts 684855816, len 000160)
[2023-09-21 18:08:41] VERBOSE[27217][C-0000001f] res_rtp_asterisk.c: Sent RTP packet to 3.122.181.108:17234 (type 00, seq 002302, ts 684855816, len 000160)
[2023-09-21 18:08:41] VERBOSE[27217][C-0000001f] res_rtp_asterisk.c: Got RTP packet from 172.24.1.31:46154 (type 00, seq 046555, ts 684855976, len 000160)
[2023-09-21 18:08:41] VERBOSE[27217][C-0000001f] res_rtp_asterisk.c: Sent RTP packet to 3.122.181.108:17234 (type 00, seq 002303, ts 684855976, len 000160)
[2023-09-21 18:08:41] VERBOSE[27217][C-0000001f] res_rtp_asterisk.c: Got RTP packet from 172.24.1.31:46154 (type 00, seq 046556, ts 684856136, len 000160)
[2023-09-21 18:08:41] VERBOSE[27217][C-0000001f] res_rtp_asterisk.c: Sent RTP packet to 3.122.181.108:17234 (type 00, seq 002304, ts 684856136, len 000160)
[2023-09-21 18:08:41] VERBOSE[27217][C-0000001f] res_rtp_asterisk.c: Got RTP packet from 172.24.1.31:46154 (type 00, seq 046557, ts 684856296, len 000160)
[2023-09-21 18:08:41] VERBOSE[27217][C-0000001f] res_rtp_asterisk.c: Sent RTP packet to 3.122.181.108:17234 (type 00, seq 002305, ts 684856296, len 000160)
[2023-09-21 18:08:41] VERBOSE[27217][C-0000001f] res_rtp_asterisk.c: Got RTP packet from 172.24.1.31:46154 (type 00, seq 046558, ts 684856456, len 000160)
[2023-09-21 18:08:41] VERBOSE[27217][C-0000001f] res_rtp_asterisk.c: Sent RTP packet to 3.122.181.108:17234 (type 00, seq 002306, ts 684856456, len 000160)
172.24.1.31 is my cisco gateway
3.122.181.108 is the twilio media server
As you can see, I only can send RTP to twilio, but asterisk is not receiving RTP packages from twilio.