emiago / diago

Short of Dialog + GO. Library/Framework for building VOIP solutions in GO
Mozilla Public License 2.0
66 stars 3 forks source link

Preserve To field #3

Open SilvaMendes opened 2 days ago

SilvaMendes commented 2 days ago

Hello, I would like to suggest adding it to diego.go, to preserve the To field, in situations where a b2b receives the request from a different domain but the To realm is different. example: Change_From_To

emiago commented 2 days ago

Hi @SilvaMendes thanks for reporting. This could be yes and no. I guess this needs to be proven more is it worth. I think this is not even default behavior for asterisk. (Correct me if I am wrong).

Still passing custom headers is possible (yes content type and from is added always). So you can pass your own (TO header)

Anyway I would like to see some reference todo this change. I know cases where you do not want to share your internal domains or just letting endpoint to accept requested domain.

SilvaMendes commented 1 day ago

Hello @emiago , it is common to use the to field with a realm different from the ruri, in opensips we work with multi-domain from To, considering that the request can come from a CNAME type bind. ex: https://opensips.org/docs/modules/3.4.x/uac.html#func_uac_replace_from

emiago commented 1 day ago

Hi @SilvaMendes so we are probably speaking some multi tenant setup. So yes I could see here some sense to have that default. Yeah per RFC nothing is wrong here, just I want to weight is this something should be default behavior. Like topology hidding. Anyway I think I will accept this feedback, but I need to add more logic in order to increase flexiblity