Hi
I am using the dispatcher module with Kamailio as a front-end Registrar/LB in front of a cluster of Asterisk boxes. I have come across an issue with SUBSCRIBE messages not getting routed to the correct server in the event that the phone endpoint's dispatch set is changed. It will still go to the old server until such time as the phone is rebooted.
The reason this is happening is because the 200 OK in the response from the Asterisk server has Contact set to its own IP:port and subsequent in-dialog reSUBSCRIBE are sent with the original Asterisk ip:port in the RURI. When Kamailio receives these reSUBSCRIBE it does not change the RURI even though ds_select_dst is being called in the [WITHIN_DIALOG] route.
My feeling is I have two choices - either alter the Contact in the reply from Asterisk, or, change the RURI manually on receipt of an in-dialog SUBSCRIBE.
Has anyone else come across this, or have advice on the best way to handle this?
Thanks
Hello,
have you changed the value for the force_dst modparam for dispatcher module?
* https://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#dispatc...
Also not, iirc, in the older versions the value was 0.
Cheers, Daniel
On 08.04.21 11:58, Barry Flanagan wrote:
Hi
I am using the dispatcher module with Kamailio as a front-end Registrar/LB in front of a cluster of Asterisk boxes. I have come across an issue with SUBSCRIBE messages not getting routed to the correct server in the event that the phone endpoint's dispatch set is changed. It will still go to the old server until such time as the phone is rebooted.
The reason this is happening is because the 200 OK in the response from the Asterisk server has Contact set to its own IP:port and subsequent in-dialog reSUBSCRIBE are sent with the original Asterisk ip:port in the RURI. When Kamailio receives these reSUBSCRIBE it does not change the RURI even though ds_select_dst is being called in the [WITHIN_DIALOG] route.
My feeling is I have two choices - either alter the Contact in the reply from Asterisk, or, change the RURI manually on receipt of an in-dialog SUBSCRIBE.
Has anyone else come across this, or have advice on the best way to handle this?
Thanks
--
-Barry
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
On 08/04/2021 11:37, Daniel-Constantin Mierla wrote:
Hello,
have you changed the value for the force_dst modparam for dispatcher module?
* https://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#dispatc...
Also not, iirc, in the older versions the value was 0.
Thanks Daniel, this was not explicitly set and is currently running an old 4.4 so I will set it and see if it helps, although the docs say it defaults to 1.
-Barry
Cheers, Daniel
On 08.04.21 11:58, Barry Flanagan wrote:
Hi
I am using the dispatcher module with Kamailio as a front-end Registrar/LB in front of a cluster of Asterisk boxes. I have come across an issue with SUBSCRIBE messages not getting routed to the correct server in the event that the phone endpoint's dispatch set is changed. It will still go to the old server until such time as the phone is rebooted.
The reason this is happening is because the 200 OK in the response from the Asterisk server has Contact set to its own IP:port and subsequent in-dialog reSUBSCRIBE are sent with the original Asterisk ip:port in the RURI. When Kamailio receives these reSUBSCRIBE it does not change the RURI even though ds_select_dst is being called in the [WITHIN_DIALOG] route.
My feeling is I have two choices - either alter the Contact in the reply from Asterisk, or, change the RURI manually on receipt of an in-dialog SUBSCRIBE.
Has anyone else come across this, or have advice on the best way to handle this?
Thanks
--
-Barry
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla --www.asipto.com www.twitter.com/miconda --www.linkedin.com/in/miconda Kamailio Advanced Training - Online May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone) *https://www.asipto.com/sw/kamailio-advanced-training-online/
On 08.04.21 12:46, Barry Flanagan wrote:
On 08/04/2021 11:37, Daniel-Constantin Mierla wrote:
Hello,
have you changed the value for the force_dst modparam for dispatcher module?
* https://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#dispatc...
Also not, iirc, in the older versions the value was 0.
Thanks Daniel, this was not explicitly set and is currently running an old 4.4 so I will set it and see if it helps, although the docs say it defaults to 1.
Then maybe you overwrite the dst uri with other functions in config -- do you use loose_route() after dispatcher function?
Cheers, Daniel
On 08/04/2021 12:04, Daniel-Constantin Mierla wrote:
On 08.04.21 12:46, Barry Flanagan wrote:
On 08/04/2021 11:37, Daniel-Constantin Mierla wrote:
Hello,
have you changed the value for the force_dst modparam for dispatcher module?
* https://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#dispatc...
Also not, iirc, in the older versions the value was 0.
Thanks Daniel, this was not explicitly set and is currently running an old 4.4 so I will set it and see if it helps, although the docs say it defaults to 1.
Then maybe you overwrite the dst uri with other functions in config -- do you use loose_route() after dispatcher function?
No, not overwriting it. I am not using loose_route though. I call record_route() only. Is it advisable to call loose_route after all ds_select_dst?
-Barry
On 08.04.21 13:26, Barry Flanagan wrote:
On 08/04/2021 12:04, Daniel-Constantin Mierla wrote:
On 08.04.21 12:46, Barry Flanagan wrote:
On 08/04/2021 11:37, Daniel-Constantin Mierla wrote:
Hello,
have you changed the value for the force_dst modparam for dispatcher module?
* https://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#dispatc...
Also not, iirc, in the older versions the value was 0.
Thanks Daniel, this was not explicitly set and is currently running an old 4.4 so I will set it and see if it helps, although the docs say it defaults to 1.
Then maybe you overwrite the dst uri with other functions in config -- do you use loose_route() after dispatcher function?
No, not overwriting it. I am not using loose_route though. I call record_route() only. Is it advisable to call loose_route after all ds_select_dst?
Normally one should do loose_route() for requests within dialog if record_route is done for initial requests in a SIP proxy, in order to consume the Route headers. If you know that next hop is an endpoint and its routing is not influenced by Route headers, probably you can skip loose_route(), but I would do it to be proper SIP processing, or at least remove the Route header with remove_hf().
On the other hand, I just noticed in your first message that you wanted to update R-URI, and that is done by ds_select_domain(). The ds_select_dst() update dst uri (outbound proxy address).
Cheers, Daniel
On 08/04/2021 13:07, Daniel-Constantin Mierla wrote:
Normally one should do loose_route() for requests within dialog if record_route is done for initial requests in a SIP proxy, in order to consume the Route headers. If you know that next hop is an endpoint and its routing is not influenced by Route headers, probably you can skip loose_route(), but I would do it to be proper SIP processing, or at least remove the Route header with remove_hf().
On the other hand, I just noticed in your first message that you wanted to update R-URI, and that is done by ds_select_domain(). The ds_select_dst() update dst uri (outbound proxy address).
Thanks, I'll try ds_select_domain.
-Barry