Commit Graph

124 Commits

Author SHA1 Message Date
Anthony Minessale f40f87ebca <refactor>
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4944 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-04-16 16:53:30 +00:00
Anthony Minessale c15d7892c0 indent again
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4799 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-03-30 00:15:25 +00:00
Anthony Minessale debdfb1aab indent
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4798 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-03-30 00:13:31 +00:00
Anthony Minessale 3a54126261 spring cleaning
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4795 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-03-29 22:31:56 +00:00
Anthony Minessale 8a4406ece2 Addition of scheduler engine and a few applications to use it.
This patch adds a scheduler thread to the core and moves the heartbeat
event to use the new scheduler as an example.

Also The following features are implemented that use this scheduler:

sched_hangup dialplan application:

<action application="sched_hangup" data="+10 normal_clearing bleg"/>

** The cause code is optional and the optional bleg keyword will only hangup the
   channel the current channel is bridged to if the call is in a bridge.

sched_transfer dialplan application:

<action application="sched_transfer" data="+10 1000 XML default"/>

** The last 2 args (dialplan and context) are optional

sched_broadcast dialplan application:

<action application="sched_broadcast" data="+10 playback:/tmp/foo.wav"/>
<action application="sched_broadcast" data="+10 playback!normal_clearing:/tmp/foo.wav"/>

** The optional !<cause_code> can be added to make the channel hangup after broadcasting the file.


sched_hangup api function:

sched_hangup +10 <uuid_string> normal_clearing

** The cause code is optional

sched_transfer api function:

sched_transfer +10 <uuid_string> 1000 XML default

** The last 2 args (dialplan and context) are optional

sched_broadcast api function:

sched_broadcast +10 <uuid_str> playback:/tmp/foo.wav
sched_broadcast +10 <uuid_str> playback!normal_clearing:/tmp/foo.wav

** The optional !<cause_code> can be added to make the channel hangup after broadcasting the file.

The new C functions in the core are documented in the doxeygen.

*NOTE* This commit should satisfy at least 2 bounties on the wiki



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4785 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-03-28 23:37:12 +00:00
Anthony Minessale d9de1807ee Add state change i/o hook to the core and change some spidermonkey behaviour.
The most important thing to check is you now must create a new session with a blank constructor:
s = new Session();
then call s.originate() with all the former args that were documented to be for the constructor
this will will return true or false to indicate if the call worked.

See below this sample code demonstrates all of the changes:

////////////////////////////////////////////////////////////////////////////////
function on_hangup(hup_session)
{
    console_log("debug", "HANGUP!!!! name: " + hup_session.name + " cause: " + hup_session.cause + "\n");
	//exit here would end the script so you could cleanup and just be done
	//exit();
}

//set the on_hangup function to be called when this session is hungup
session.setHangupHook(on_hangup);

//allocate a new b_session
var b_session = new Session();

//make a call with b_session.  If this fails, all we will be able to access is the b_session.cause attr
if (b_session.originate(session, "sofia/mydomain.com/888@conference.freeswitch.org")) {
	//Inform the scripting engine to automaticly hang this session up when the script ends
    b_session.setAutoHangup(true);
	//set the on_hangup function to be called when this session is hungup
    b_session.setHangupHook(on_hangup);	
	//bridge session with b_session
    bridge(session, b_session);
} else {
    console_log("debug", "Originate Failed.. cause: " + b_session.cause + "\n");
}
////////////////////////////////////////////////////////////////////////////////






git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4773 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-03-27 00:40:53 +00:00
Brian West ffde2ff0af update2
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4600 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-03-15 01:58:41 +00:00
Anthony Minessale d69cde6367 update
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4598 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-03-15 00:36:14 +00:00
Anthony Minessale 5131ee1cae add management interface and some rtp goodies
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4464 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-03-07 18:34:22 +00:00
Michael Jerris ec3fcde87d change switch_core_timer_next to return switch_status_t, update all users to new usage, add some error checking to mod_conference so that it bails out of the loops more gracefully on shutdown.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4454 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-03-05 23:18:29 +00:00
Brian West 0ddffd3ef6 fix potential naughty bug you will need 'make sure'
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4432 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-03-02 23:38:01 +00:00
Anthony Minessale ed76b25241 cleanup
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4419 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-03-01 17:23:02 +00:00
Anthony Minessale a88da36253 add heartbeat event and core uuid
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4347 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-02-22 17:38:34 +00:00
Anthony Minessale 6c0152ca2f try to pass 2833-pt across calls
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4344 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-02-21 21:46:32 +00:00
Michael Jerris 915944b7ed add pool allocated printf function switch_core_sprintf
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4339 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-02-20 21:54:23 +00:00
Michael Jerris bbf3c290d9 add switch_core_session_sprintf which allocates from the session pool
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4319 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-02-19 02:21:27 +00:00
Michael Jerris 9fc1f45ebd constify switch_core_hash functions and some of their consumers.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4304 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-02-16 23:36:10 +00:00
Michael Jerris 2b507706c9 switch_core_session_strdup now takes const char * arg.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4264 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-02-14 19:14:53 +00:00
Michael Jerris 251723ba41 fix missing strdup in switch_ivr_menu_bind_function
change most char * values in ivr_menu functions to const char *
change switch_core_strdup to get passed const char * instead of char *
change switch_xml_find_child to get passed const char * instead of char *
change the ivr dialplan application to free the xml config as soon as it is done building the xml menu and not hold it until the menu is done being run, so that you can do a reloadxml while someone is in a menu without blocking.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4260 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-02-14 17:28:42 +00:00
Michael Jerris 258e28dd11 constification for switch_core_hash_find and switch_event_create_subclass
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4251 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-02-14 03:22:43 +00:00
Anthony Minessale a62d9fd951 lord of the rings
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4230 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-02-13 15:47:15 +00:00
Michael Jerris db5557983a use const for switch_core_permanent_strdup var.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4220 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-02-13 02:31:26 +00:00
Anthony Minessale f03226debb update core
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4181 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-02-09 20:03:07 +00:00
Michael Jerris f359f847f7 fix magic emacs and vi formatting comments in the bottom of our source files to use tabs instead of spaces
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4176 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-02-09 02:36:03 +00:00
Anthony Minessale ed41805c17 improve core and basic flow
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4174 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-02-09 01:34:01 +00:00
Anthony Minessale cb587626ea timer mojo (cont)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4151 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-02-07 19:18:15 +00:00
Anthony Minessale 66feec2da5 timer mojo
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4149 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-02-07 18:44:00 +00:00
Anthony Minessale 59ed99a9a8 core framework for reverse media bugs
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4105 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-01-31 23:09:33 +00:00
Anthony Minessale d3e1f400e5 tweak core for build err and add core_get_var
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4021 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-01-22 21:59:07 +00:00
Anthony Minessale c4717f9077 fix locking and add lock debugging as a define
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3870 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-12-29 16:39:56 +00:00
Anthony Minessale 81452c2679 autodroolz
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3707 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-12-19 00:41:20 +00:00
Anthony Minessale d7400bf319 build changed
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3690 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-12-18 00:48:34 +00:00
Anthony Minessale 44cc7d5cfe build progress break everything
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3682 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-12-17 01:01:09 +00:00
Michael Jerris 44649c70b4 Add magic comments for emacs and vi in source and header files to properly format and display tabs vs. spaces in those editors:
/* For Emacs:
 * Local Variables:
 * mode:c
 * indent-tabs-mode:nil
 * tab-width:4
 * c-basic-offset:4
 * End:
 * For VIM:
 * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
 */


git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3462 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-11-27 22:30:48 +00:00
Anthony Minessale d7baa16132 Ringback (sponsored by Front Logic)
This addition lets you set artifical ringback on a channel
that is waiting for an originated call to be answered.

the syntax is 

<action application="set" data="ringback=[data]"/>

where data is either the full path to an audio file
or a teletone generation script..


syntax of teletone scripts

LEGEND:

0-9,a-d,*,# (standard dtmf tones)

variables: c,r,d,v,>,<,+,w,l,L,%

c (channels)        - Sets the number of channels.
r (rate)            - Sets the sample rate.
d (duration)        - Sets the default tone duration.
v (volume)          - Sets the default volume.
> (decrease vol)    - factor to decrease volume by per frame (0 for even decrease across duration).
< (increase vol)    - factor to increase volume by per frame (0 for even increase across duration).
+ (step)            - factor to step by used by < and >.
w (wait)            - default silence after each tone.
l (loops)           - number of times to repeat each tone in the script.
L (LOOPS)           - number of times to repeat the the whole script.
% (manual tone)     - a generic tone specified by a duration, a wait and a list of frequencies.

standard tones can have custom duration per use with the () modifier
7(1000, 500) to generate DTMF 7 for 1 second then pause .5 seconds

EXAMPLES

UK Ring Tone [400+450 hz on for 400ms off for 200ms then 400+450 hz on for 400ms off for 2200ms]
%(400,200,400,450);%(400,2200,400,450)

US Ring Tone [440+480 hz on for 2000ms off for 4000ms]
%(2000,4000,440,480)

ATT BONG [volume level 4000, even decay, step by 2, # key for 60ms with no wait, volume level 2000, 350+440hz {us dialtone} for 940ms
v=4000;>=0;+=2;#(60,0);v=2000;%(940,0,350,440)

SIT Tone 913.8 hz for 274 ms with no wait, 1370.6 hz for 274 ms with no wait, 1776.7 hz for 380ms with no wait
%(274,0,913.8);%(274,0,1370.6);%(380,0,1776.7)

ATTN TONE (phone's off the hook!) 1400+2060+2450+2600 hz for 100ms with 100ms wait
%(100,100,1400,2060,2450,2600)



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3408 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-11-19 01:05:06 +00:00
Anthony Minessale 89989bc34f vg mode
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3388 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-11-16 19:43:25 +00:00
Anthony Minessale eb1bafe567 dox
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3313 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-11-11 17:36:44 +00:00
Anthony Minessale 44fc26f7d4 Finalization of speech detect interface and API
This changes the core to have the necessary tools to create
a speech detection interface.

It also changes the code in javascript (mod_spidermonkey)
there are a few api changes in how it handles callbacks

It also adds grammars as a system dir to store asr grammars




git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3291 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-11-09 05:39:04 +00:00
Anthony Minessale 70bfba5b63 Christmas Presence
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3083 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-10-18 22:57:35 +00:00
Anthony Minessale ba46200539 refactoring and general improvement (do a make sure)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3035 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-10-12 00:59:09 +00:00
Anthony Minessale 6a96670267 refine code
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3006 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-10-09 02:24:43 +00:00
Anthony Minessale fa5767ebf7 fixes
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2781 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-09-22 15:22:31 +00:00
Anthony Minessale 90815616cc small core refactoring use -hp arg to gain high priority mode, add fsctl command USAGE: fsctl [hupall|pause|resume|shutdown]
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2765 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-09-20 20:25:26 +00:00
Anthony Minessale 19446804c7 pull down stack size another 128k, make the sql use mem cache and add session count to the status command
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2747 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-09-18 22:22:25 +00:00
Anthony Minessale 56827bc9ec enhance timers and make rtp use it that way
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2669 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-09-12 22:23:45 +00:00
Anthony Minessale 95249aff5c dox
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2590 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-09-09 03:50:04 +00:00
Anthony Minessale 5e575f143c dox
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2589 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-09-09 03:47:56 +00:00
Anthony Minessale ae9d56e288 Adding bugs to the core
This is the primary commit to add bugs to the core (media bugs that is)
Media bugs are kind of like what ChanSpy is in Asterisk only cooler (I wrote ChanSpy too so I can say that)

Here is an example of using them to record a call by the higher level switch_ivr functionality passed
up to the dialplan via mod_playback.

The call will be recorded while the some.wav plays then stop for the rest of the call (when some_other.wav plays)

The bugs may have bugs since this is 1 day's work so happy hunting ......

<extension name="42">
  <condition field="destination_number" expression="^42$">
   <action application="set" data="RECORD_TITLE=recording test"/>
   <action application="set" data="RECORD_ARTIST=FreeSWITCH"/>
    <action application="record_session" data="/tmp/rtest.wav"/>
    <action application="playback" data="/tmp/some.wav"/>
    <action application="stop_record_session" data="/tmp/rtest.wav"/>
    <action application="playback" data="/tmp/some_other.wav"/>
  </condition>
</extension>



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2588 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-09-09 03:39:28 +00:00
Anthony Minessale 086676f6e9 what comes up must come down
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2555 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-09-07 15:15:39 +00:00
Anthony Minessale a4c778a00c fix namespace
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2548 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-09-07 14:23:31 +00:00