Forward from one gateway trunk to provider trunk, but not all calls


i’ve setup network with:

  • a server with the asteriskNOW with Freepbx
  • a patton fxs/fxo gateway, with 2 analog extensions and 1 analog pstn line
  • 3 others extensions in the network

I already created all my extensions, trunks and rings groups and everything is working, except one thing.

Because my patton gateway extensions are connected between a trunk, every call i make to asterisk is intercepted as external call, and it activates the default inbound route. What i would like to do is:

1 - Asterisk receives call from gateway extension
1.1 - If dialed number is not registered as extension, it forwards rightful trunk
1.2 - If is registered, then it forwards it to the extension.

I know i could create an inbound route and relate each extension with the dialed number, but i would have to create one by one if i want to add more extensions. And i don’t know what to do to forward all other numbers that aren’t extensions.

Here is the config of my patton trunk:

Outbound Settings:
context=from-trunk (i already tried from-internal, but then i can’t make any call at all).

Both gateway extensions are dynamic and from-trunk (i also tried from-internal, but it didn’t make any difference).

Best regards,

PS: All my config was by freepbx interface, so i don’t know much of configuring by config files, but i can tried them anyway.