What should be the context for an external device?

I have configured FreePBX on a VPS at service provider and added 2 extensions which are registering okay from home(behind a firewall).

Calls between the extensions don’t work and inbound DID mapped to one of the extensions does not work either. I suspect that some additional configuration is needed on the server regarding its network settings, and that the default from-internal context for the extensions is not the right one either.

The problem seemed to fix itself - I suspect Asterisk got stuck some how. There were repeated ‘The previous reload command didn’t finish yet’ messages. I suspect the configuration reloads were not working

The CLI remained open no matter how many times I tried ‘amportal restart’ until I applied a kill -9 to the asterisk process.

Things just began working without much ado after that.

PS. Does freepbx use safe_asterisk to keep asterisk restarting?

The server is on the internet with two public IPs? That does not sound good at all. I will let someone else give you the chat about the million reasons to not do that.

Focusing on the question, there are a number of ways the network might be messing you up. Can you post the output from “sip show peers” from the CLI so we can see how the server is seeing your extension? You should focus on solving this problem before tackling the DID-to-extension problem which may go away when this is solved.

If extension A cannot call extension B, and vice versa, it is predictable that any inbound calls to a DID are not going to be able to reach the extensions either. But you did not say what happens when you place a call to the DID. Is it reaching the server at all? If it is reaching the server and you have an inbound route pushing it to extension A, if A is not reachable, the call should drop into extension A’s voicemail. Is it doing that? If not, then you have a separate problem.

i am sure from-internal is right if you used freePBX to set everything up.

more likely you have network related issues. that said, it might be handy of you are a bit more precise with the symptoms: “Calls between the extensions don’t work” means what exactly? don’t ring? ring but no audio? Help us help you.

My reasoning is that the FreePBX is on a remote server at a service provider and my extensions are at home, behind a firewall, and it looks like calls are unable to come in although calls are able to go out.

The extensions cannot dial each other.

I can dial out on the extensions to the PSTN, but can’t receive incoming calls.

I am wondering whether FreePBX needs some additional configuration to know that the devices are on different networks, rather than local. The server has 2 public IPs