- https://kamailio.org/docs/modules/5.8.x/modules/nathelper.html#nathelper.f.a... This add_contact_alias() function changes only the first Contact address in a REGISTER request, even though it's normal (RFC3261, 10.2) for a REGISTER to have multiple Contact addresses.
This seems to me to be a kamailio bug. For example, a user might remove one binding while adding a second, in a REGISTER request. If kamailio relays this while adding an alias to only the expires=0 binding, then the new binding may be stored incorrectly in the registrar.
James
On 13.03.25 11:16, James Browne via sr-users wrote:
This add_contact_alias() function changes only the first Contact address in a REGISTER request, even though it's normal (RFC3261, 10.2) for a REGISTER to have multiple Contact addresses.
This seems to me to be a kamailio bug. For example, a user might remove one binding while adding a second, in a REGISTER request. If kamailio relays this while adding an alias to only the expires=0 binding, then the new binding may be stored incorrectly in the registrar.
The functions for contact alias were designed for INVITEs/calls, where only one contact is expected.
Normally, for REGISTER, the fix_nated_register() should be used if that instance is the registrar server, or, in case of an intermediary proxy, the Path headers (see path module) should be added.
On the other hand, it would be fine for me if someone wants to extend the contact alias functions to handle more than one header.
Cheers, Daniel
Thanks, Daniel I looked at the source code and I don't have the skill to modify it. Regardless, I understand it better now and I can probably work around it. Thanks. I've an intermediate proxy in front of the registrar. Using the Path module does not help because that controls which socket the proxy will use, not the address and port of the UA.
Thanks for the quick reply.
James
On Thu, 13 Mar 2025 at 10:30, Daniel-Constantin Mierla miconda@gmail.com wrote:
On 13.03.25 11:16, James Browne via sr-users wrote:
This add_contact_alias() function changes only the first Contact address in a REGISTER request, even though it's normal (RFC3261, 10.2) for a REGISTER to have multiple Contact addresses.
This seems to me to be a kamailio bug. For example, a user might remove one binding while adding a second, in a REGISTER request. If kamailio relays this while adding an alias to only the expires=0 binding, then the new binding may be stored incorrectly in the registrar.
The functions for contact alias were designed for INVITEs/calls, where only one contact is expected.
Normally, for REGISTER, the fix_nated_register() should be used if that instance is the registrar server, or, in case of an intermediary proxy, the Path headers (see path module) should be added.
On the other hand, it would be fine for me if someone wants to extend the contact alias functions to handle more than one header.
Cheers, Daniel
-- Daniel-Constantin Mierla (@ asipto.com) twitter.com/miconda -- linkedin.com/in/miconda Kamailio Consultancy, Training and Development Services -- asipto.com Kamailio Advanced Training, March 24-28, 2025 -- asipto.com Kamailio World Conference, May 12-13, 2025, Berlin -- kamailioworld.com
Hello,
there is also a function in the path module that adds the "received" details, which reflect the (nat) address of the UA.
Cheers, Daniel
On 13.03.25 14:05, James Browne wrote:
Thanks, Daniel I looked at the source code and I don't have the skill to modify it. Regardless, I understand it better now and I can probably work around it. Thanks. I've an intermediate proxy in front of the registrar. Using the Path module does not help because that controls which socket the proxy will use, not the address and port of the UA.
Thanks for the quick reply.
James
On Thu, 13 Mar 2025 at 10:30, Daniel-Constantin Mierla miconda@gmail.com wrote:
On 13.03.25 11:16, James Browne via sr-users wrote:
This add_contact_alias() function changes only the first Contact address in a REGISTER request, even though it's normal (RFC3261, 10.2) for a REGISTER to have multiple Contact addresses.
This seems to me to be a kamailio bug. For example, a user might remove one binding while adding a second, in a REGISTER request. If kamailio relays this while adding an alias to only the expires=0 binding, then the new binding may be stored incorrectly in the registrar.
The functions for contact alias were designed for INVITEs/calls, where only one contact is expected.
Normally, for REGISTER, the fix_nated_register() should be used if that instance is the registrar server, or, in case of an intermediary proxy, the Path headers (see path module) should be added.
On the other hand, it would be fine for me if someone wants to extend the contact alias functions to handle more than one header.
Cheers, Daniel
-- Daniel-Constantin Mierla (@ asipto.com) twitter.com/miconda -- linkedin.com/in/miconda Kamailio Consultancy, Training and Development Services -- asipto.com Kamailio Advanced Training, March 24-28, 2025 -- asipto.com Kamailio World Conference, May 12-13, 2025, Berlin -- kamailioworld.com
I was wrong ("not the address and port of the UA"). I've read the Path-module doc before, and I never noticed that one. That may well be exactly what I'm looking for. Thanks for sending that follow-up.
James
On Thu, 13 Mar 2025 at 17:22, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
there is also a function in the path module that adds the "received" details, which reflect the (nat) address of the UA.
Cheers, Daniel
On 13.03.25 14:05, James Browne wrote:
Thanks, Daniel I looked at the source code and I don't have the skill to modify it. Regardless, I understand it better now and I can probably work around it. Thanks. I've an intermediate proxy in front of the registrar. Using the Path module does not help because that controls which socket the proxy will use, not the address and port of the UA.
Thanks for the quick reply.
James
On Thu, 13 Mar 2025 at 10:30, Daniel-Constantin Mierla miconda@gmail.com wrote:
On 13.03.25 11:16, James Browne via sr-users wrote:
This add_contact_alias() function changes only the first Contact address in a REGISTER request, even though it's normal (RFC3261, 10.2) for a REGISTER to have multiple Contact addresses.
This seems to me to be a kamailio bug. For example, a user might remove one binding while adding a second, in a REGISTER request. If kamailio relays this while adding an alias to only the expires=0 binding, then the new binding may be stored incorrectly in the registrar.
The functions for contact alias were designed for INVITEs/calls, where only one contact is expected.
Normally, for REGISTER, the fix_nated_register() should be used if that instance is the registrar server, or, in case of an intermediary proxy, the Path headers (see path module) should be added.
On the other hand, it would be fine for me if someone wants to extend the contact alias functions to handle more than one header.
Cheers, Daniel
-- Daniel-Constantin Mierla (@ asipto.com) twitter.com/miconda -- linkedin.com/in/miconda Kamailio Consultancy, Training and Development Services -- asipto.com Kamailio Advanced Training, March 24-28, 2025 -- asipto.com Kamailio World Conference, May 12-13, 2025, Berlin -- kamailioworld.com
-- Daniel-Constantin Mierla (@ asipto.com) twitter.com/miconda -- linkedin.com/in/miconda Kamailio Consultancy, Training and Development Services -- asipto.com Kamailio Advanced Training, March 24-28, 2025 -- asipto.com Kamailio World Conference, May 12-13, 2025, Berlin -- kamailioworld.com