I have Kamailio running and connected to a PSTN gateway.

My subscribers are named ex. +442071234567 - same as their real GSM number from my PSTN gateway.

I'm using the standard kamailio.cfg which ships with version 4.3.

When I'm trying to dial SIP client to SIP client I would like to have Kamailio route the call internally if a subscriber exists with ex. +442071234567.
If no subscriber exists with ex. +442071234567 it should send it to my PSTN gateway.

As it is now it seems as if it are trying to both call "internally" and via the PSTN gateway.

How should one fix this issue the best way?