Change port of Keep Alive reply in Kamailio

From Integrics Wiki
Revision as of 14:51, 4 August 2021 by Vlasis (talk | contribs) (Created page with "Typically Kamailio sends the reply to a Keep Alive message to the port specified in the Contact: header. In cases where it is preferred to have the reply to the source port o...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Typically Kamailio sends the reply to a Keep Alive message to the port specified in the Contact: header.

In cases where it is preferred to have the reply to the source port of the Keep Alive message, the following part of Kamailio configuration can be changed from:

# Catch typical keep alive requests from SIP devices
if(is_method("OPTIONS") && uri==myself && $rU==$null) {
  sl_send_reply("200", "Keepalive");
  exit;
}

to

# Catch typical keep alive requests from SIP devices
if(is_method("OPTIONS") && uri==myself && $rU==$null) {
  force_rport();
  sl_send_reply("200", "Keepalive");
  exit;
}