Hi, is it possible to reply with a different expires for a REGISTER depending on some condition like the User-Agent? I am thinking maybe I can use: $ulc(profile=>expires) = 600 (but my kamailio dev machine is out of service and I cannot test this right now).
On Mon, Feb 03, 2020 at 07:17:42AM +0900, mayamatakeshi wrote:
is it possible to reply with a different expires for a REGISTER depending on some condition like the User-Agent? I am thinking maybe I can use: $ulc(profile=>expires) = 600
Expiration is ultimately in the hands of the registrar, and the registrar is free to reply with an expiration different to what the registrant has requested.
Expiration policy is generally controlled by:
https://kamailio.org/docs/modules/5.3.x/modules/registrar.html#registrar.p.m...
https://kamailio.org/docs/modules/5.3.x/modules/registrar.html#registrar.p.m...
and some related modparams near the top.
As far as I am aware, there is no way to override the expiration decisions of the registrar in a custom way.
-- Alex
On Mon, Feb 3, 2020 at 7:24 AM Alex Balashov abalashov@evaristesys.com wrote:
On Mon, Feb 03, 2020 at 07:17:42AM +0900, mayamatakeshi wrote:
is it possible to reply with a different expires for a REGISTER depending on some condition like the User-Agent? I am thinking maybe I can use: $ulc(profile=>expires) = 600
Expiration is ultimately in the hands of the registrar, and the registrar is free to reply with an expiration different to what the registrant has requested.
Expiration policy is generally controlled by:
https://kamailio.org/docs/modules/5.3.x/modules/registrar.html#registrar.p.m...
https://kamailio.org/docs/modules/5.3.x/modules/registrar.html#registrar.p.m...
and some related modparams near the top.
As far as I am aware, there is no way to override the expiration decisions of the registrar in a custom way.
I think you are right. I will try a different approach that is to enlarge the allowed registrar expires range using the above parameter and then change the value of the Expires in the REGISTER message before passing it to registrar module. Thanks.
I wonder whether changing the expire value constantly will impact all expires, as opposed to just the one you’re trying to set it to. If, say you lower it for a register, will that expire all existing registers?
On Sat, 8 Feb 2020 at 18:12, mayamatakeshi mayamatakeshi@gmail.com wrote:
On Mon, Feb 3, 2020 at 7:24 AM Alex Balashov abalashov@evaristesys.com wrote:
On Mon, Feb 03, 2020 at 07:17:42AM +0900, mayamatakeshi wrote:
is it possible to reply with a different expires for a REGISTER
depending
on some condition like the User-Agent? I am thinking maybe I can use: $ulc(profile=>expires) = 600
Expiration is ultimately in the hands of the registrar, and the registrar is free to reply with an expiration different to what the registrant has requested.
Expiration policy is generally controlled by:
https://kamailio.org/docs/modules/5.3.x/modules/registrar.html#registrar.p.m...
https://kamailio.org/docs/modules/5.3.x/modules/registrar.html#registrar.p.m...
and some related modparams near the top.
As far as I am aware, there is no way to override the expiration decisions of the registrar in a custom way.
I think you are right. I will try a different approach that is to enlarge the allowed registrar expires range using the above parameter and then change the value of the Expires in the REGISTER message before passing it to registrar module. Thanks. _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
On Sun, Feb 9, 2020 at 8:49 AM David Villasmil < david.villasmil.work@gmail.com> wrote:
I wonder whether changing the expire value constantly will impact all expires, as opposed to just the one you’re trying to set it to. If, say you lower it for a register, will that expire all existing registers?
Actually, my idea was to do something like this before handing the REGISTER to registrar save() function: remove_hf("Expires"); append_hf("Expires: 200\r\n"); However, this didn't work (or at least, it doesn't work with kamailio 4.3.7 which is the one I use).
But I found a solution for my problem: Starting from kamailio 5.0, registrar function save() supports this new flag: * 0x08 - Do not apply expires_range or default_expires_range to this registration.*
https://kamailio.org/docs/modules/5.0.x/modules/registrar.html#registrar.f.s... I actually don't need to specify an Expires value in the REGISTER reply. I just need to allow a higher Expires value for some UACs (actually SIP servers registering with Kamailio). I have not tested it yet but based on the description, it should work.
On Tue, Feb 11, 2020 at 08:03:29AM +0900, mayamatakeshi wrote:
Actually, my idea was to do something like this before handing the REGISTER to registrar save() function: remove_hf("Expires"); append_hf("Expires: 200\r\n"); However, this didn't work (or at least, it doesn't work with kamailio 4.3.7 which is the one I use).
These changes aren't applied to the processing of the current message until you call msg_apply_changes().
Try adding and see if it works.
On Tue, Feb 11, 2020 at 7:48 PM Daniel Tryba d.tryba@pocos.nl wrote:
On Tue, Feb 11, 2020 at 08:03:29AM +0900, mayamatakeshi wrote:
Actually, my idea was to do something like this before handing the
REGISTER
to registrar save() function: remove_hf("Expires"); append_hf("Expires: 200\r\n"); However, this didn't work (or at least, it doesn't work with kamailio
4.3.7
which is the one I use).
These changes aren't applied to the processing of the current message until you call msg_apply_changes().
Try adding and see if it works.
Indeed. This worked: remove_hf("Expires"); append_hf("Expires: 200\r\n"); msg_apply_changes(); Thanks!
But you will see those changes in the pcap even without apply_message_changes It is highly recommended to not use this function as it parses all message again.
On Tue, 11 Feb 2020, 12:29 mayamatakeshi, mayamatakeshi@gmail.com wrote:
On Tue, Feb 11, 2020 at 7:48 PM Daniel Tryba d.tryba@pocos.nl wrote:
On Tue, Feb 11, 2020 at 08:03:29AM +0900, mayamatakeshi wrote:
Actually, my idea was to do something like this before handing the
REGISTER
to registrar save() function: remove_hf("Expires"); append_hf("Expires: 200\r\n"); However, this didn't work (or at least, it doesn't work with kamailio
4.3.7
which is the one I use).
These changes aren't applied to the processing of the current message until you call msg_apply_changes().
Try adding and see if it works.
Indeed. This worked: remove_hf("Expires"); append_hf("Expires: 200\r\n"); msg_apply_changes(); Thanks! _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Thank to pointing that out. I'm not sure about all the implications but yes, I think it is better to go with kamailio v. 5 save() flag approach. However, the guys at my company might want this change soon so I might need to go with kamailio v. 4. Of course, I always run load test before releasing.
On Tue, Feb 11, 2020 at 8:43 PM Yuriy Gorlichenko ovoshlook@gmail.com wrote
But you will see those changes in the pcap even without apply_message_changes It is highly recommended to not use this function as it parses all message again.
On Tue, 11 Feb 2020, 12:29 mayamatakeshi, mayamatakeshi@gmail.com wrote:
On Tue, Feb 11, 2020 at 7:48 PM Daniel Tryba d.tryba@pocos.nl wrote:
On Tue, Feb 11, 2020 at 08:03:29AM +0900, mayamatakeshi wrote:
Actually, my idea was to do something like this before handing the
REGISTER
to registrar save() function: remove_hf("Expires"); append_hf("Expires: 200\r\n"); However, this didn't work (or at least, it doesn't work with kamailio
4.3.7
which is the one I use).
These changes aren't applied to the processing of the current message until you call msg_apply_changes().
Try adding and see if it works.
Indeed. This worked: remove_hf("Expires"); append_hf("Expires: 200\r\n"); msg_apply_changes(); Thanks! _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users