500 Server Error - Reinvite inside a reinvite

We’re getting a random issue where some calls are being dropped as soon as the receiver is picked up.
We have Grandstream GXP2160 and Cisco SPA303 phones connected on the same LAN to FreePBX installation running all behind Mikrotik router.
PCAP of affected calls is showing a 500 Internal Server Error - re-Invite inside a re-Invite.
Our upstream provider has suggested that FreePBX is not handling re-invites correctly.
As part of troubleshooting I have set SIP canreinvite to Yes - was previously set to no.
Is this the correct setting for my current setup?

Remember - FreePBX is (in large part) a GUI manager for Asterisk. They are saying that the most popular telephony application on the planet isn’t handling Reinvites correctly? Seriously?

It’s possible that something in your config is set incorrectly, but I seriously doubt that Asterisk is having a problem with this.

has some information, but Voip-Info’s veracity is often questionable (since none of it is actually maintained and may be out-of-date). This particular article is about Asterisk 1.4 (not 14, 1.4), so it may or may help you out.

IMO canreinvite is a specialty feature that should normally be set to no. If enabled, when a call is answered it attempts to set up a direct audio path between the extension and the trunk, bypassing Asterisk altogether. There are lots of reasons why this may fail. Unless you have a pressing reason, leave it off.

A common cause of a re-invite when a call is answered is codec mismatch. See whether allowing only ulaw or alaw (whichever is appropriate for your country) in the extension and trunk settings, as well as in the GXP and SPA, avoids the problem.

If you still have trouble, post a SIP trace of a failing call. Also please answer:
Are both incoming and outgoing calls affected? Approximate percentage of calls that fail? Who sends the 500 (extension to Asterisk, Asterisk to extension, Asterisk to trunk provider, trunk provider to Asterisk)? Who is sending the re-invite? What parameters (if any) are being modified (codec, IP address, port number)?

Thanks for the responses.

Dave, had found that document in my searching, thanks.

Stewart, after taking what you said on board, and Dave’s article, I’ve left canreinvite set to No.
Another few issues popped up while troubleshooting this so I’ve redone our firewall config from scratch as I think that’s where the issue may have originally been.

So far, issue seems to be resolved.
No further Internal Server Errors or other problems.

Thanks for your help.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.