DID route over IAX2 to remote server

We have a remote server serviced by an IAX2 connection to the main office. DID calls are received at the main server via PRI. I need the calls for the extensions that are at the remote office to route to them over the IAX2 link. I have tried several options but none work. Has anyone done this? The IAX2 is up and working and we can dial station to station and the remote stations can dial outbound over the main server PRI.

Yes, this may be done in a number of ways. Have you had a look here:

voip-info.org/wiki/view/Aste … al+servers

Also, DUNDi is an option:

voip-info.org/wiki-Asterisk+ … ll+Routing

And another option is e164 routing:

voip-info.org/wiki-Asterisk+ … ll+Routing

Hmmmm… DUNDi is not the answer, and e164 seems to be better suited for something else. The dual server link is what I used as a template to connect them. Both systems are running A@H’

Setup in extensions_custom.conf:

[custom-did-ext]
exten => ${FROM_DID},1,Dial,IAX2/allec-peer/${FROM_DID}

call it from DID routing page in the Custom App line.

FROM_DID variables populate fine but call is dropped before connecting