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: g.erl | |
-module(g). | |
-compile(export_all). | |
-behaviour(gen_server). | |
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). | |
%%------------------------------------------------------------------- | |
%% Public API |
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
% Seven changed to illustrate a problem of stored procedure | |
% run3() turns that return #result_packet and #ok_packet alternatively. | |
% | |
% ------------------------------------------------------------------------ | |
% Hello World: Minimal sample usage of emysql | |
% H. Diedrich <hd2010@eonblast.com> - Eonblast http://www.eonblast.com | |
% 11 Jun 2010 | |
% ------------------------------------------------------------------------ | |
% | |
% Instructions: |
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
server.rb | |
==== | |
require 'rubygems' | |
require 'carrot' | |
require 'sinatra' | |
get '/hi' do | |
"Hello World!" | |
end |
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(fse2). | |
-compile(export_all). | |
start() -> | |
{foo, 'freeswitch@localhost'} ! register_event_handler, | |
receive ok -> {event, 'freeswitch@localhost'} ! {event, all}, loop(0) end. | |
loop(0) -> | |
io:format("start ~p~n", [erlang:localtime()]), | |
loop(1); | |
loop(1000) -> |
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
<?php | |
$user = $_POST['user']; | |
$domain = $_POST['domain']; | |
$password = "1234"; | |
?> | |
<document type="freeswitch/xml"> | |
<section name="directory"> | |
<domain name="<?php echo $domain;?>"> | |
<params> | |
<param name="dial-string" value="{presence_id=${dialed_user}@${dialed_domain}}${sofia_contact(${dialed_user}@${dialed_domain})}"/> |
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(ivr). | |
-author("Seven Du"). | |
-export([start/0, start/1]). | |
-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(LOG(Fmt, Args), io:format("~b " ++ Fmt, [?LINE | Args])). |
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 copied from gen_fsm from Erlang release R13B01 | |
%% Modified by Seven Du <dujinfang at gmail.com> for easy handle FS messages | |
%% From FreeSWITCH through mod_erlang_event. | |
%% | |
%% %CopyrightBegin% | |
%% | |
%% Copyright Ericsson AB 1996-2010. All Rights Reserved. | |
%% | |
%% The contents of this file are subject to the Erlang Public License, | |
%% Version 1.1, (the "License"); you may not use this file except in |
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
<style> | |
#dropZone { | |
color: #555; | |
font-size: 18px; | |
text-align: center; | |
width: 400px; | |
padding: 50px 0; | |
margin: 50px auto; |
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(xcds_user_sup). | |
-behaviour(supervisor). | |
%% API | |
-export([start_link/0, start_users/0]). | |
%% Supervisor callbacks | |
-export([init/1]). |
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(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"). |
OlderNewer