This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Radio Station listening for Freeswitch | |
-- File containing stations. Modify location as needed | |
-- | |
-- file format like | |
-- # Radiostation name | |
-- <ID>=<url> | |
-- | |
STATIONS_FILE = [[c:\FreeSWITCH\scripts\radiostations.txt]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%module freeswitch | |
%{ | |
#include "freeswitch_lua.h" | |
%} | |
%typemap(in, checkfn = "lua_isfunction") SWIGLUA_FN { | |
$1.L = L; | |
$1.idx = $input; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Native backend to FusionPBX database class | |
-- | |
local log = require "resources.functions.log".database | |
assert(freeswitch, "Require FreeSWITCH environment") | |
local param_pattern = "%f[%a%d:][:]([%a][%a%d_]*)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- File to conrol FusionPBX Lua services/monitors | |
-- @usage: | |
-- # stop `call_flow_subscribe` | |
-- fs_cli -x "lua fsc.lua flow shutdown" | |
local destination = assert(argv[1]) | |
local command = assert(argv[2]) | |
local event = freeswitch.Event("CUSTOM", "fusion::" .. destination .. "::" .. command); | |
event:fire() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "resources.functions.config" | |
require "resources.functions.split" | |
local log = require "resources.functions.log".fax_queue_monitor | |
local Next = require "app.fax.resources.scripts.queue.next" | |
local EventConsumer = require "resources.functions.event_consumer" | |
local pid_file = scripts_dir .. "/run/fax_queue.tmp" | |
local events = EventConsumer.new(pid_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local log = require "resources.functions.log".apply_var | |
function apply_global_var(str, t) | |
return (string.gsub(str, "$${.-}", function(key) | |
key = string.sub(key, 4, -2) | |
local var = t and t[key] or freeswitch.getGlobalVariable(key) | |
if not var then | |
log.warningf("unknown global variable: %s", key) | |
end | |
return var or '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- File to conrol FusionPBX Lua services/monitors | |
-- @usage: | |
-- # stop `call_flow_subscribe` monitor | |
-- fs_cli -x "lua service flow shutdown" | |
-- # stop `mwi_subscribe` monitor | |
-- fs_cli -x "lua service mwi shutdown" | |
require "resources.functions.config" | |
local log = require "resources.functions.log".service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZMQ Version: 4 2 0 | |
Timer recv: hello #1 | |
Timer recv: hello #2 | |
Timer recv: hello #3 | |
Timer recv: hello #4 | |
No messages ([ZMQ][EAGAIN] Resource temporarily unavailable (11)) | |
Poll recv: hello #5 | |
Poll recv: hello #6 | |
Poll recv: hello #7 | |
Poll recv: hello #8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
J = path.join | |
function dasc_target(t) | |
local DASC = LUA_EXE .. ' ' .. path.join('dynasm', 'dynasm.lua') | |
local dasc_h = {} | |
for name, args in pairs(t) do | |
local dasc = target(name .. ".h", args[1] .. ".dasc", DASC .. ' ' .. (args[2] or "") .. ' -o $(TARGET) $(DEPENDS) ') | |
table.insert(dasc_h, dasc) | |
end | |
return dasc_h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __BZMSG_H_INCLUDED__ | |
#define __BZMSG_H_INCLUDED__ | |
#include <zmq.hpp> | |
#include <vector> | |
#include <list> | |
#include <iostream> | |
#include <iomanip> | |
#include <string> |