Score:0

asterisk not recognizing answer from sip trunk

cn flag

I have an Asterisk server (15.5, FreePBX) with three SIP trunks from different providers configured, two of them are working fine while the third for every call keep sendind the invite despite the correct answer from the trunk.

The trunk was working well until we had some NAT problem with a change of configuration in the firewall, but I solved this issue and now I can see that the server connects to the trunk with the right ip and I can also see the answers coming to the right interface, whit sngrep this is what a call looks like:

sngrep dump of call

After the invite the trunk reply with 100, but then the server resends the invite and never responds to trunk's messages. The call is correctly placed (and billed) by the provider but we are unable to talk as RTP channel is never opened. What could be the reason for this behavior?

Nikita Kipriyanov avatar
za flag
A combination of NAT and SIP is the very popular and reliable way to shoot yourself in the foot. So, which changes to the NAT you did, or better, *how exactly* it is configured now? This is very important information and it must present in the question. Also, try to capture and analyze traffic, `tcpdump` and `wireshark` are your best friends when debugging a telephony.
Spuria avatar
cn flag
Hi, I discovered this absolute truth :) I have a pfsense firewall, the internal ip is configured to use the gateway that has the public subnet assigned, there is an outgoing NAT rule that translates the internal ip with the public ip and some inbound NAT for specific ports on the wan interface, including the sip port. If i try e.g. curl https://ifconfig.me the answer is correct
Spuria avatar
cn flag
I'm planning to change the configuration, but can't right now
Nikita Kipriyanov avatar
za flag
You need to DNAT not only the SIP port, but also a range of RTP ports configured in Asterisk (see common SIP settings, usually 10000-20000). And, I suspect you have a SIP ALG enabled on the NAT box, which could easily confuse things; better don't use that.
Spuria avatar
cn flag
yep, 10000-20000 are forwarded too, I looked for SIP ALG and it seems that pfsense does not have it
Spuria avatar
cn flag
also, here the problem is before the RTP connection, as my asterisk does never send an ACK to the 100 response
Nikita Kipriyanov avatar
za flag
Then it seems you have to read "full" log.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.