jambonz / jambonz-feature-server

Core telephony feature server for the jambones platform
MIT License
46 stars 38 forks source link

Cannot create two numbers in jambonz which are the same but belong to different carriers #293

Open javibookline opened 1 year ago

javibookline commented 1 year ago

Suppose we have two PBX carriers that wish to send calls to jambonz.

Carrier 1 sends calls from carrier1.com and Carrier 2 sends calls from carrier2.com.

Both PBXs send calls from their extension number 210, so the SIP From header are the following

Jambonz should be able to handle differentetly these 2 incoming requests, even though they come from the "same number", as they belong to different carriers.

Currently in Jambonz we can create several accounts and carriers, but we cannot create two numbers if they are the same, event if they belong to different accounts and carriers.

davehorton commented 1 year ago

this may require changes in api-server and sbc-inbound as well

xquanluu commented 1 year ago

Hi @javibookline

It would be great if you can update me why do you have to define 2 same phone numbers if we can define multiple trunks/gateway inside of a carrier?

javibookline commented 1 year ago

Hi @xquanluu, first of all thanks for the help.

I can think of two examples where we would need to define 2 phone numbers:

  1. In the case of two completely different carriers. Even though it would be technically possible to define both gateways in a single carrier to accept calls from both trunks, from a design perspective it is not the proper way of separating calls that come from two different carriers. Moreover, we have not looked into all the possibilities that Jambonz offers, but this is a limitation if we want to serve several customers - each one with their own trunk/gateway but who might share phone numbers.
  2. In the case where each number has to be routed to a different application. Defining multiple trunks in one single carrier allows us to receive calls from both numbers having only one number defined in jambonz - BUT we cannot route each number to a specific application.
xquanluu commented 1 year ago

Thanks a lot @javibookline ,

it's clear, I'm starting to develop this new feature, I will keep you updated.

davehorton commented 1 year ago

We're going to hold on this feature for now. The implications are widespread throughout the product, and could actually break the multi-tenant dimension of jambonz. Currently, multiple accounts can use the same carrier (like twilio) but they cant of course have the same phone number/DID from twilio. Relaxing that constraint would break multitenancy and make routing of calls to applications have ambigous scenarios.