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
calling_card = session:getVariable("calling_card_ivr") | |
cause = session:getVariable("originate_disposition") | |
cause2=session:getVariable("bridge_hangup_cause") | |
if cause == nil then cause="none" end | |
session:execute("log", "DEBUG Hangup cause: "..cause); | |
if cause2 == nil then cause2="none" end | |
session:execute("log", "DEBUG bridge hangup cause: "..cause2); |
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
#!/bin/bash | |
# | |
# pcap2wav | |
# Original Author: Michael Collins <msc@freeswitch.org> | |
#Standard disclaimer: batteries not included, your mileage may vary... | |
# Updated by Avi Marcus <avi@bestfone.com> | |
# | |
# Accepts arg of pcap file w/only 2 RTP streams | |
# Creates a .<codec> file and a .wav file | |
# For codecs other than PCMA and PCMU the script calls fs_cli and does a little recording to create the wav file(s) |
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
nodejs-deps: | |
pkg.installed: | |
- names: | |
- g++ | |
- curl | |
- libssl-dev | |
- apache2-utils | |
require: | |
- pkg: git |
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
import Toastify from 'toastify-js'; //https://github.com/apvarun/toastify-js/blob/master/README.md | |
import "toastify-js/src/toastify.css"; | |
//To use: | |
//import toast from '../web_toast.js'; | |
//toast(message,class(optional), options) | |
//My default is that the toast stays open until dismissed and defaults to bootstrap's "bg-info" if no class is specified. | |
//NOTE: In an SPA, you'll need to clear any persistent toasts on page switch | |
//use import {closeAll as clearToasts} from './web_toast.js'; |
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
<script> | |
export let params={}; | |
export let service=null; | |
export let id=null; | |
import Fa from 'svelte-fa' | |
import { faEdit, faPlus, faTrash } from '@fortawesome/free-solid-svg-icons'; | |
import feathers from '../web_feathers.js'; | |
const rest = feathers.service('logs'); |
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
function upsert(table, data, update){ | |
if(!update) update=data; | |
var insert = knex(table).insert(data).toString(); | |
var update = knex(table).update(update).toString().replace(/^update .* set /i, ''); | |
return knex.raw(insert + ' on duplicate key update ' + update); | |
} | |
function replace(table, data){ | |
var insert = knex(table).insert(data).toString().replace(/^INSERT/i, 'REPLACE'); | |
return knex.raw(insert); |
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
/*License: MIT*/ | |
function isracardCheck(num) {//algorithm explanation: https://web.archive.org/web/20140227235803/http://povolotski.me/2013/09/24/isracard-credit-card-number-validation-2/ | |
if(typeof num !== 'number') num=''+num; | |
if(num.length < 8 || num.length > 9) return false; | |
var sum=0; | |
num.split('').forEach(function(val,key){ | |
sum+=parseInt(val,10)*(num.length-key); | |
}) | |
return sum % 11 == 0; | |
} |
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
#! /usr/bin/node | |
var nodemailer = require("nodemailer"); | |
var transport = nodemailer.createTransport("sendmail"); | |
function fix_len(num, len){ | |
if(len<=5) return ("00000" + num).slice(-len); | |
else { | |
var seed="0000000000"; | |
while(seed.length<len) seed+=seed; |
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
Sample 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
This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. | |
In jurisdictions that recognize copyright laws, the author or authors | |
of this software dedicate any and all copyright interest in the | |
software to the public domain. We make this dedication for the benefit |
NewerOlder