Routing incoming DDI to another trunk

I have setup an outgoing sip trunk to a FXO interface box which links to an old pbx. The outgoing route for this trunk is 2XXX. We also have some local extension on FreePBX in the 2XXX range. Dialing 2xxx from a local extension works exactly as I wanted ie if the dialled extension is local the call routes correctly, and if there is no local extension 2xxx then the call routes correctly via the sip FXO trunk to the other pbx.

The problem I have is I have now setup a IVR on another incoming trunk linked to a particular incoming DDI. This IVR allows dialling to extension. This works for any local extensions but as soon as you try and dial an extension which is on other old pbx the call fails. I suspect this is because of the context of the IVR not allowing it to dial out over a trunk. So I assume I need to add a custom context to allow the IVR to dial 2XXX and rout this via the outgoing FXO trunk. Being quite new to FreePBX and Asterisk I’m not sure what to do next, so any help/pointers would be very gratefully received.
I should point out that I cant change any extension numbers, they all have to be in the format 2XXX on both systems. This is actually to allow the two systems to work side by side and allow a slow migration of users from old to new pbx over a period of time.

I’m running FreePBX from distro version 5.211.65-20