asterisk / asterisk-feature-requests

A place to submit feature and improvement requests for the Asterisk project. Contains no code.
2 stars 1 forks source link

[improvement]: Asterisk As Microsoft Teams Gateway #30

Open Eulnono76 opened 7 months ago

Eulnono76 commented 7 months ago

Improvement Description

Hi,

Today I use Asterisk as a Gateway to Microsoft Teams with success. To achieve this result, I statically modify the res_pjsip_nat.c file by replacing : ast_sockaddr_stringify_host(&transport_state->external_signaling_address) with the FQDN of my server :

In function static pj_status_t nat_on_tx_message(pjsip_tx_data *tdata)

replace this line pj_strdup2(tdata->pool, &uri->host, ast_sockaddr_stringify_host(&transport_state->external_signaling_address));

with this line pj_strdup2(tdata->pool, &uri->host, "<your asterisk FQDN>");

 and this line pj_strdup2(tdata->pool, &via->sent_by.host, ast_sockaddr_stringify_host(&transport_state->external_signaling_address));
with this line pj_strdup2(tdata->pool, &via->sent_by.host, "<your asterisk FQDN>");

The FQDN is in fact used by Microsoft within the SIP:TLS frame to identify the client (Microsoft Tenant) in Teams direct routing use. The problem is that it is defined statically, compiled, and only valid for one Microsoft 365 Tenant.

Multi-Tenant is therefore not supported.

Would it be possible via the pjsip.conf configuration file to prevent the resolution of the FQDN, or specified manualy a client domain name, in certain desired cases?

jcolp commented 7 months ago

It would be possible. I've moved this to the feature requests repo.