Skip to content

Instantly share code, notes, and snippets.

View seven1240's full-sized avatar

Seven Du seven1240

View GitHub Profile
freeswitch@internal> uuid_debug_audio 0d5cd5dc-2f65-4c66-b620-9f0a80505814 both on
+OK Success
freeswitch@internal> R sofia/internal/790019@115.28.17.157 b=41 115.28.17.157:21844 112.224.67.34:20000 112.224.67.34:41166 pt=103 ts=1821971474 m=0
R sofia/internal/790019@115.28.17.157 b=55 115.28.17.157:21844 112.224.67.34:20000 112.224.67.34:41166 pt=103 ts=1821972434 m=0
R sofia/internal/790019@115.28.17.157 b=56 115.28.17.157:21844 112.224.67.34:20000 112.224.67.34:41166 pt=103 ts=1821973394 m=0
R sofia/internal/790019@115.28.17.157 b=44 115.28.17.157:21844 112.224.67.34:20000 112.224.67.34:41166 pt=103 ts=1821974354 m=0
R sofia/internal/790019@115.28.17.157 b=42 115.28.17.157:21844 112.224.67.34:20000 112.224.67.34:41166 pt=103 ts=1821975314 m=0
R sofia/internal/790019@115.28.17.157 b=40 115.28.17.157:21844 112.224.67.34:20000 112.224.67.34:41166 pt=103 ts=1821976274 m=0
R sofia/internal/790019@115.28.17.157 b=41 115.28.17.157:21844 112.224.67.34:20000 112.224.67.34:41166 pt=103 ts=1821977234 m=0
{application, psqlcp, [
{description, "Postgresql connection pool with poolboy"},
{vsn, "0.1"},
{applications, [kernel, stdlib]},
{modules, [psqlcp, psqlcp_worker]},
{registered, [psqlcp]},
{mod, {psqlcp, []}},
{env, [
{pools, [
{fk, [
@seven1240
seven1240 / mod_my_dialplan.c
Created July 2, 2013 08:04
Makefile: include ../../../../build/modmake.rules
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005/2012, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
@seven1240
seven1240 / testclient.c
Created July 2, 2013 03:06
inbound event socket example
/*
<extension name="400xx">
<condition field="destination_number" expression="^400xx$">
<action application="set" data="my_callback=xx"/>
<action application="park"/>
</condition>
</extension>
<extension name="ask_number">
<condition field="destination_number" expression="^ask_number$">
@seven1240
seven1240 / dialplan.xml
Created July 1, 2013 15:03
FreeSWITCH dialplan xml_curl
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
<section name="dialplan" description="RE Dial Plan For FreeSwitch">
<context name="default">
<extension name="9196">
<condition field="destination_number" expression="^9196$">
<action application="log" data="ERR I'm from xml curl dialplan"/>
<action application="answer"/>
<action application="echo"/>
</condition>
@seven1240
seven1240 / fs_loadtest.c
Created July 1, 2013 08:39
load test example based on testclient.c
#include <stdio.h>
#include <stdlib.h>
#include <esl.h>
int main(void)
{
esl_handle_t handle = {{0}};
int i;
int rate = 20;
/*
<extension name="socket">
<condition field="destination_number" expression="^socket$">
<action application="socket" data="127.0.0.1 8084 async full"/>
</condition>
</extension>
*/
#include <stdio.h>
cid = session:getVariable("caller_id_number");
dest= session:getVariable("destination_number");
session:execute("log", "ERR cid is:" .. cid);
session:execute("log", "ERR dest is:" .. dest .. " or " .. argv[1]);
session:hangup();
freeswitch.msleep(2000);
%%%-------------------------------------------------------------------
%%% @author egobrain <egobrain@linux-ympb>
%%% @copyright (C) 2012, egobrain
%%% @doc
%%% Function for uploading files and properties,which were sent as a
%%% multipart. Files are stored in tmp_folder with random name,
%%% generated by tmp_filename function.
%%% @end
%%% Created : 25 Mar 2012 by egobrain <egobrain@linux-ympb>
%%%-------------------------------------------------------------------
-module(fsm_ivr).
-behaviour(gen_fsfsm).
-export([start/1, init/1, handle_info/3, handle_event/3, terminate/3]).
-export([welcome/2, wait_lang/2, wait_number/2, wait_hangup/2]).
-define(FS_NODE, 'freeswitch@localhost').
-define(WELCOME_SOUND, "tone_stream://%(100,1000,800);loops=1").
-define(INPUT_NUMBER_SOUND, "tone_stream://%(100,1000,800);loops=2").
-define(SELECT_LANG_SOUND, "tone_stream://%(100,1000,800);loops=3").