This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

SIP Server - Group calls
#4
Run this once to update the config file. Modify SIP addresses as needed. If there's a call to user 200@192.168.0.9 then user 300@192.168.0.9 will also receive it.

Code:
io.writefile('/etc/kamailio/kamailio.cfg', [[
# modules
loadmodule "/usr/lib/kamailio/modules/tm.so"
loadmodule "/usr/lib/kamailio/modules/sl.so"
loadmodule "/usr/lib/kamailio/modules_k/rr.so"
loadmodule "/usr/lib/kamailio/modules_k/maxfwd.so"
loadmodule "/usr/lib/kamailio/modules_k/usrloc.so"
loadmodule "/usr/lib/kamailio/modules_k/registrar.so"

# rr, add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)

route {
  if (!mf_process_maxfwd_header("10")) {
    sl_send_reply("483", "Too Many Hops");
    exit;
  };

  if (msg:len >= 2048) {
    sl_send_reply("513", "Message too big");
    exit;
  };

  if (method != "REGISTER") {
    record_route();
  };

  if (method == "INVITE") {
    if (uri == "sip:200@192.168.0.9;transport=udp") {
      append_branch("sip:300@192.168.0.9;transport=udp");
    };
  };

  if (loose_route()) {
    route(1);
    exit;
  };

  if (uri != myself) {
    route(1);
    exit;
  };

  if (uri == myself) {
    if (method == "REGISTER") {
      save("location");
      exit;
    };

    lookup("aliases");
    if (uri != myself) {
      route(1);
      exit;
    };

    if (!lookup("location")) {
      sl_send_reply("404", "Not Found");
      exit;
    };
  };

  route(1);
}

route[1] {
  if (!t_relay()) {
    sl_reply_error();
  };
}
]])

os.execute('/etc/init.d/kamailio restart')
Reply


Messages In This Thread
SIP Server - Group calls - by alexll - 31.08.2022, 08:30
RE: SIP Server - Group calls - by admin - 31.08.2022, 12:41
RE: SIP Server - Group calls - by alexll - 31.08.2022, 13:12
RE: SIP Server - Group calls - by admin - 01.09.2022, 10:18
RE: SIP Server - Group calls - by alexll - 02.09.2022, 06:03
RE: SIP Server - Group calls - by admin - 02.09.2022, 07:35
RE: SIP Server - Group calls - by alexll - 02.09.2022, 07:44

Forum Jump: