#!/usr/bin/lua require("socket") validator = require("acf.validator") if not arg or #arg == 0 then print("Error - IP Address must be specified") return 1 end local address = arg[1] local user = arg[2] or "" if not validator.is_ipv4(address) then print("Error - Invalid IP Address") return 1 end local msg = "NOTIFY sip:"..user.."@"..address..":5060 SIP/2.0\n".. "Via: SIP/2.0/UDP 127.0.0.1\n".. "From: \n".. "To: \n".. "Event: check-sync\n".. "Date: "..os.date().."\n".. "Call-ID: "..os.time().."msgto0@"..address.."\n".. "CSeq: 102 NOTIFY\n".. "Contact: \n".. "Content-Length: 0\n\n" local s = assert(socket.udp()) assert(s:sendto(msg, address, 5060)) s:close()