Issue Routing DID Numbers

Vsharma

Premier Customer
Joined
Apr 4, 2025
Messages
2
Reaction score
1
Good day,
I've been fighting to solve this issue for some time and I cannot find an answer.

We are based in Trinidad & Tobago and our SIP provider provided us with an IP based SIP.
We requested and were given two additional DID's apart from the main SIP number, which I intend to reach two separate digital receptionists.
On the Trunk configuration, I set the default route to a users (for the main sip number, as this is a new number that customers do not know) and assigned the two DID's to the two digital receptionists.

The issue is no matter what I do, or which DID I call, the call goes through the default route of the main trunk number, to the user. Infact, the call will only be routed to whatever the default route is for the main trunk number.

Here are the steps I've taken:
1. I double checked that, in the DID page, it does show it is assigned to the right places. In addition I also tried setting the did format to every possible combination including and excluding wildcards.
2. I've used both Wireshark and 3cx's built in activity logs to see the incoming number shown and that it infact matches the DID settings. Here is an output from wireshark:
581 18.434476 192.168.41.89 192.168.58.2 SIP/SDP 1318 Request: INVITE sip:6520510;phone-context=[email protected]:5060;user=phone |

So I can see that when a call is incoming, it identifies the DID from which the incoming call is coming through.
3. I've tried it with e164 enabled and disabled.
4. I've checked the activity logs and I can see something is happening but I am new to 3cx and I'm now very lost in what to do.
I see this in the logs which seem like its skipping any rules this happens no matter which did called. :
04/05/2025 2:14:12.528 AM [CM503012]: Inbound any hours rule (unnamed) for 10000 forwards to DN:901
04/05/2025 2:14:12.528 AM Rule matched
04/05/2025 2:14:12.528 AM Checking inbound rule '': hour type = 1; cond = 4; mask = ''
04/05/2025 2:14:12.528 AM Checking inbound rule '': hour type = 2; cond = 6; mask = '6520510'
04/05/2025 2:14:12.528 AM Checking inbound rule '': hour type = 2; cond = 6; mask = '6582010'
04/05/2025 2:14:12.528 AM Checking inbound rule '': hour type = 2; cond = 6; mask = '6124570'

Please can someone help.
 
In your example of an incoming call INVITE the complete Request-Line: and the To: are missing.

The DID is searched there.

1743858508094.png
 
Last edited:
I reread your wireshark line.
581 18.434476 192.168.41.89 192.168.58.2 SIP/SDP 1318 Request: INVITE sip:6520510;phone-context=[email protected]:5060;user=phone |
This line was probably copied from the wireshark packet list. Further information is missing.

But I have one more question:
Why is the INVITE to 3CX coming from a private IPv4 address and not from the provider?

Is it possible that the provider has provided you with a local SIP device / router to which you connect the 3CX? That the 3CX doesn't log in to the provider at all but to this device?
 
In your example of an incoming call INVITE the complete Request-Line: and the To: are missing.

The DID is searched there.

View attachment 47337
Yes that is correct. The provider gave us a Fortinet gateway which our 3CX is connected to. We then had to add a static route at the Debian OS level to the actual SIP trunk.

Fortunately I was able to get the routing working, by also adding the DID as: "xxxxxxx;phone-context=local" as this is the way the incoming invite is being sent to us. Routing is now working correctly.
I think I would also reach out to the provider to ask if the sent invite could be cleaned up, however, if they can't, its not an issue as it is working as is.
In short: I had to add the DID's twice, once with the plain SIP number, for outgoing caller ID's to show properly, and once in the format above, for incoming call routing.
 
Last edited:
  • Like
Reactions: fxbastler

Latest Posts

Forum statistics

Threads
111,990
Messages
590,161
Members
164,926
Latest member
tohoken1