Custom Contexts applied to a IAX2 trunk

Dear, I have a Freepbx PBX1 connected to a similar PBX2. I have created a IAX2 trunk betwwen them. For my local extensions (PBX1) I have created several custom contexts created by Custom Contexts module, applied to local extensions in order to filer outgoing calls to the PSTN through the E1 trunk.

Please, how can I applied these custom contexts to the extensions from PBX2 that make outgoing calls to the PSTN and to the PBX1 extensions? Or maybe apply the custom contexts directly to the trunk???

E1 trunk — PBX1 — IAX2 — PBX2 — PBX2 extensions 5XXX

Special thanks!!!

It’s not clear to me what you want to accomplish.
You have two PBX connected via an IAX trunk and you have your extensions in different contexts.
Now you have trouble calling from PBX to PBX?

Why do you have your extensions in different contexts?

Sorry if I was not clear…Briefly I want to apply a Custom Context created by the module in PBX1 to the VoIP calls coming from the IAX2 trunk that connects to PBX2.

I have to filter the incoming calls to PBX1 from PBX2, in order that the extensions from PBX2 just can call the IVR extension number from PBX1. Nowadays the PBX2’s extensions can call any number from PBX1, and I have to avoid this scenario.

is it possible?

Thanks a lot again!!!

In your outbound route for calls from PBX2 to PBX 1 you could only allow the call to the IVR on PBX 1, and simply not route to the other extensions

Sorry but the PBX2’s routes are managed by another VoIP administrator, so I can’t trust him. That administrator is the owner of PBX2, and ?'m from PBX1.

I need a way that let me filter the incoming calls, independently of the route settings in the PBX2 side, and send them where I want (in this case, the IVR extension).

For this reason, I’ve choosen the Custom Contexts solution, but I’ve just applied the Custom Context’s “context” parameter to the IAX2 trunk’s context option, but the calls are still coming to any extension, they are not blocked.

Thanks again, regards!!!

You would need to build a context that IAX2 from pbx2 is sent to that only includes the needed contexts, i.e. not from-internal

Sorry, can you be more specific?

I have this scenario:

extensions 7XXX — PBX1 — IAX2 Trunk — PBX2 — extensions 1XXX

When 7XXX dial 1XXX, I want all the calls to be directed to extension 1111 always.

How can I do this?

Thanks in advance!!!

Sorry, I have to say that I’m the administrator of PBX2 and all the configuration I can do is in PBX2…PBX1 is managed by another administrator out of my company.

Thanks again!!!

On PBX 1 create a Misc Application of “_1XXX” and send to local extension 111. Leading underscore is important.

If you want to control call flow on a system not under your control, that is Advanced level magic at Hogwarts.

OK thanks, but I suppose I have some options like Custom Contexts or DID/CID filtering on incoming routes to filter incoming calls coming from the IAX2 trunk, is it OK what I say???

These options haven’t worked for me yet, but maybe I don’t know to use them.

Regards.