Call Forwarding

I need your help with a problem I’ve encountered.

I need to forward calls to an external number during specific hours.

I have the IVRs set up, and they all work correctly and without any issues.

I created a pjsip extension XXXX where I activated call forwarding if there’s no answer after four missed calls, and this is where my problem arises.

If I make the call from an internal extension, call forwarding works correctly. The configuration on the phone to which the call should be forwarded is (outgoing code)017600000000#

If I make the call from an external number, the IVR detects the time, transfers to the extension with the call forwarding, and I see it make the call, but then it hangs up and returns to the main IVR message.

I’ve tried a virtual extension, but it doesn’t work either; I get the same result.

I remember having this function enabled a few years ago, just like now, and it never gave me any errors. But now that I need it again, I can’t figure out why it’s not working properly.

Could someone tell me if there’s something I’m not configuring correctly?

I have 8 SIP Trucks, and they’ve been working flawlessly for 8 years.

I have about 30 Extensions, and they’ve been working flawlessly for the same amount of time.

I have several IVRs that are working correctly.

As an additional issue, I’ve noticed that sometimes when a call exceeds 20 minutes, it disconnects on its own.

If anyone can offer some guidance, I would appreciate it.

Which system initiates the disconnect? If Asterisk, do you have session timer, and did they fail to reset? Is the disconnect preceded by one way audio? If so, are you relying on a router to create a temporary port forwarding rule, and what steps are you taking to stop that rule expiring/

Thank you for all your questions, but are we talking about the first problem or the second?

If possible, let’s speak a little more slowly :slight_smile:

When you receive a phone call, whether from inside or outside the system, after about 20 minutes Asterisk silences the call. That is, it doesn’t hang up, but you stop hearing the other person even though the timer on the phone continues.

The second one (the one I quoted).

If media stops mid call, the router is likely to be the culprit. It suggests you are relying on the router to dynamically create a port forwarding rule. In which case, if the presence of traffic isn’t enough to keep it open, it is possible it is being created by SIP ALG on the router, which you should normally disable, as, more often than not, that is badly implemented. Ideally you should have static port forwarding rules covering inbound traffic for all the ports that Asterisk is configured to use for its end of the RTP.

Thanks, I’ll start by disabling the active SIP ALG and see what happens. Then I’ll check the ports, although they are already configured.

Regarding the first question, which might sound like a joke, but is more important to me than the second, you have nothing?

The first one is more specific to FreePBX, and my expertise is more in relation to Asterisk. Given that I don’t know, off the top of my head, how FreePBX might handle the cases differently, I would want to see logs of the working and failing cases, so that I can see what, in practice, the differences are.