脚本代码

脚本名称:vchat.lua
调用方式: vchat.lua 1000 hello

  1. --used to send msg by verto
  2. api=freeswitch.API();
  3. domain=api:executeString("global_getvar domain");
  4. local recvNum = argv[1]
  5. local msg = argv[2]
  6. local cmd = "chat verto|Server@FS.local|" .. recvNum .. "@" .. domain .. "|" .. msg
  7. freeswitch.consoleLog("debug", argv[0] ..": start to send msg by verto, command:" .. cmd .. "\n");
  8. api:executeString(cmd)