Trunk between two FreePBX machines not passing the DID

Hi all. Sorry if it has been answered, couldn’t find it here and on Google.
Due to a temporary setup, I am in a situation to have two FreePBX machines connected by IAX2 trunk.
The E1 line is connected to machine A but the whole setup in reality is on machine B and the phones are registered on B.

The IAX2 trunk setup is:
PEER details:
deny=all
allow=g729&alaw
type=friend
host=x.x.x.x
qualify=yes
context=from-trunk

The USER field is empty since I am not using a user.

All the incoming calls are coming through from A to B, however it seems that the number dialed (the DID) is not passed on because all the Incoming rules on B related to specific DIDs are not working. All calls go into the “any DID” rule.

Ideally, machine B is the older one and should be replaced by A but we can’t deal with that at the moment. As a temp fix, can I do something to make the trunk pass the DID? Any help is appreciated.

I tried searching and there are many tutorials about connecting two machines but nothing related to the passing on of DIDs specifically. In case it matters the versions of FreePBX and Asterisk that the machines are running:
A: 2.9.0.12 with 1.8.7.1
B: 2.4.1.5 with 1.2.72805

I think I got it. If you change the context in the trunk settings to from-peer it seems to pass the DID as it should.