Feature #1604
Send redirect when UAC tries to register to port 5060
| Status: | Feedback | Start date: | 07/17/2013 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | lee | % Done: | 0% | |
| Category: | - | Spent time: | - | |
| Target version: | - | |||
| Component: |
Description
Jitsi in particular will try to register to port 5060 by default. This is perfectly legal but not what we want. I'm looking into a redirection technique in Kamailio if the UAC sends an initial REGISTER to port 5060.
SIP ref: https://www.ietf.org/mail-archive/web/sip/current/msg09405.html
SL module: http://kamailio.org/docs/modules/4.0.x/modules/sl.html#sl.overview
History
#1 Updated by lee over 4 years ago
Looks like all I have to do is change the request URI and send a redirect
http://www.mail-archive.com/sr-users@lists.sip-router.org/msg10653.html
#2 Updated by lee over 4 years ago
Kamailio has many many many variables for a SIP dialog
http://www.kamailio.org/wiki/cookbooks/4.0.x/pseudovariables
#3 Updated by lee over 4 years ago
- Status changed from In Progress to Feedback
This is untested Kamailio code.
# if the destination port is 5060 and the request method is REGISTER, redirect.
if ($rp == "5060" && $rm == "REGISTER") {
# set request port to 5061 in redirect
$rp = "5061";
send_reply(302, "Redirected");
}
Unfortunately, I don't think this solves the problem since the client transport must be changed to use TLS for any subsequent SIP methods to be secure. Boo :(
#4 Updated by lee over 4 years ago
I probably could work around this on the server but I don't think that's a good use of time since the problem is only related to client settings.
The code would look something like this
# if the destination port is 5060 and the request method is REGISTER, redirect.
if ($rp == "5060") {
# set request port to 5061 in redirect
$rp = "5061";
# set request URI to force TLS
$ru = "sips:$ru@$rd:$rp"
send_reply(302, "Redirected");
}