Multiple contexts served from one IAX trunk

I am trying to serve multiple contexts from one IAX trunk and am having difficulty.

The intention is to provide 3 seperate pbxs on one asterisk box, seperating each virtual pbx by using different contexts.

all of the incoming numbers come into the asterisk box using one iax trunk from one provider.

Each of the number ranges and there associated vPBX all work fine, when the context in the IAX.conf file is set to the one they use, but as soon as I try to introduce more contexts the whole lot fails.

I have tried:


and also tried

but both ways do not work for me.

what am I doing wrong please?


And Asterisk should guess which context to use? :smile:
Try creating 3 contexts for the 3 virtual PBXes and 1 for the trunk. Then in the new context you can match the dialed number and jump to another context using Goto().