Logic Machine Forum
SIP Server - Group calls - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: SIP Server - Group calls (/showthread.php?tid=4208)



SIP Server - Group calls - alexll - 31.08.2022

Hi there,

I have a building running with a Doorbird intercom connected to several indoor panels via LogicMachine SIP server.

Today a client has requested for an extra video monitor, so I need to make a call group just to receive the intercom call in both indoor panels at the same time.

Is it possible via scripting or something? Thanks in advance!


RE: SIP Server - Group calls - admin - 31.08.2022

Do you mean that both clients see the same video stream at the same time? I'm not sure if this is possible. But it should be possible for both clients to ring simultaneously with some config modifications. But only the first client that accepts the call will see the stream.


RE: SIP Server - Group calls - alexll - 31.08.2022

(31.08.2022, 12:41)admin Wrote: Do you mean that both clients see the same video stream at the same time? I'm not sure if this is possible. But it should be possible for both clients to ring simultaneously with some config modifications. But only the first client that accepts the call will see the stream.

Yeah, that's exactly what I need: ring simultaneously but only the first client that accepts the call will see the stream.

Where can I find that config? Thank you very much!


RE: SIP Server - Group calls - admin - 01.09.2022

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')



RE: SIP Server - Group calls - alexll - 02.09.2022

(01.09.2022, 10:18)admin Wrote: 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')

I have just tried it and it doesn't work. I can still call every device but they don't redirect to the other.

For testing, I have created 3 users in my LM: 151, 152 and 153.
In your script, I have changed your example for mines: sip:151@192.168.0.222 and sip:152@192.168.0.222
I'm calling from 153 to 151. It rings but not 152.

Any other idea? Thanks in advance!


RE: SIP Server - Group calls - admin - 02.09.2022

Try removing the ;transport=udp part. Depending on the client this part might not be present.


RE: SIP Server - Group calls - alexll - 02.09.2022

(02.09.2022, 07:35)admin Wrote: Try removing the ;transport=udp part. Depending on the client this part might not be present.

Success! We are definitely in love with this hardware and this forum  Heart . Thank you very much!