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
originate_retries:
This variable controls how many times the system should retry the
entire dialstring before exiting on failure (default 1)
originate_retry_sleep_ms:
This variable controls how long in milliseconds to pause between
retries (default 1000)
*NOTE* when using the , and & symbols to call sequential or simultaneous channels in conjunction with this feature,
the *entire* dialstring will be repeated as many times as you specify in ${originate_retries}
Here is an example using the bridge application to originate the call. (The feature will also work anywhere else
an origination can be made.)
<extension name="1000">
<condition field="destination_number" expression="^1000$">
<action application="set" data="originate_retries=10"/>
<action application="set" data="originate_retry_sleep_ms=1000"/>
<action application="bridge" data="sofia/$${domain}/1000@somehost.com"/>
</condition>
</extension>
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4776 d0543943-73ff-0310-b7d9-9358b9ac24b2
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
1) This commit adds the ability to override the To: header so you
can place an outbound SIP call to a paticular destination.
For instance, if you have a user registered to your machine as 'gateway' and
you want to call another extension at that machine 'foo' you can now call:
sofia/mydomain.com/gateway:foo@anydomain.com
or if you just want to call some SIP url and put an alternate To:
so you can do forwarding:
sofia/mydomain.com/1000@somwhere.com:12122551234@realdest.com
2) You can add headers to outbound SIP calls by
prefixing the string 'SIP_h_' to any channel variable:
<action application="set" data="SIP_h_X-Answer=42"/>
<action application="bridge" data="sofia/mydomain.com/1000@somehost.com"/>
3) All inbound SIP calls will install any X- headers into local variables
this means in conjunction with item 2, all X- headers will pass across
bridged calls auto-magicly.
4) The switch_ivr_transfer_variable function in switch_ivr.c has been modified so if the last arguement
'var' starts with a ~ it will copy anything that is prefixed with that string rather than an exact match.
*NOTE* you are not required to put an X- prefix in the SIP_h_ vars but
it is reccommended because most SIP devices will ignore any unknown headers that don't.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4216 d0543943-73ff-0310-b7d9-9358b9ac24b2
mod_enum can be used as a dialplan app, an api call from the console or as a dialplan interface.
Dialplan Interface:
put enum as the dialplan parameter in an endpoint module
i.e. instead of "XML" set it to "enum" or "enum,XML" for fall through.
Dialplan App:
This example will do a lookup and set the a variable that is the proper
dialstring to call all of the possible routes in order of preference according to
the lookup and the order of the routes in the enum.conf section.
<extension name="tollfree">
<condition field="destination_number" expression="^(18(0{2}|8{2}|7{2}|6{2})\d{7})$">
<action application="enum" data="$1"/>
<action application="bridge" data="${enum_auto_route}"/>
</condition>
</extension>
You can also pick an alrernate root:
<action application="enum" data="$1 myroot.org"/>
API command:
at the console you can say:
enum <number> [<root>]
The root always defaults to the one in the enum.conf section.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3494 d0543943-73ff-0310-b7d9-9358b9ac24b2
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
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
This modification makes it possible to change the media path of session in the switch on-the-fly and from the dialplan.
It adds some API interface calls usable from a remote client such as mod_event_socket or the test console.
1) media [off] <uuid>
Turns on/off the media on the call described by <uuid>
The media will be redirected as desiered either into the switch or point to point.
2) hold [off] <uuid>
Turns on/off endpoint specific hold state on the session described by <uuid>
3) broadcast <uuid> "<path>[ <timer_name>]" or "speak:<tts_engine>|<tts_voice>|<text>[|<timer_name>]" [both]
A message will be sent to the call described by uuid instructing it to play the file or speak the text indicated.
If the 'both' option is specified both ends of the call will hear the message otherwise just the uuid specified
will hear the message.
During playback when only one side is hearing the message the other end will hear silence.
If media is not flowing across the switch when the message is broadcasted, the media will be directed to the
switch for the duration of the call and then returned to it's previous state.
Also the no_media=true option in the dialplan before a bridge makes it possible to place a call while proxying the session
description from one endpoint to the other and establishing an immidiate point-to-point media connection with no media
on the switch.
<action application="set" data="no_media=true"/>
<action application="bridge" data="sofia/mydomain.com/myid@myhost.com"/>
*NOTE* when connecting two outbound legs by using the "originate" api command with an extension that has no_media=true enabled,
the media for the first leg will be engaged with the switch until the second leg has answered and the other session description
is available to establish a point to point connection at which time point-to-point mode will be enabled.
*NOTE* it is reccommended you rebuild FreeSWITCH with "make sure" as there have been some changes to the core.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3245 d0543943-73ff-0310-b7d9-9358b9ac24b2
This adds the | to the originate syntax
making it possible to put a list of urls to call and attempt
to call them one at a time until one of them is successful or there
are none of them left
The original & delimited list is valid for each step in the | separated
list
Example
sofia/test-int/3920@10.3.3.104|sofia/test-int/3910@10.3.3.104&sofia/test-int/3920@10.3.3.104
first call 1 location and if that results in a failure, try 2 at once on the next go
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2996 d0543943-73ff-0310-b7d9-9358b9ac24b2
Transfers work better when both legs of the call live in thier own channel eg bridged calls
A -> B where you want a to make B -> C
when you route a call to an IVR or playback app you are not really bridging you have
A all alone executing the script so it's hard to transfer that.
I do have it aparently working but it's goofy and you are better off
putting your IVR on it's own switch so they are all inbound calls
then you have A -> B -> IVR
now A can happily transfer B who can stay on line with IVR without stopping
the execution. You can also accomplish this by calling in a loop back to the same box
if you dont want to have 2 boxes.
Also the beginning effort at bridging calls with no media is here
set this magic variable in your dialplan to convince mod_sofia
to pass A's sdp as it's own to B and return B's sdp back to A on 200 or 183
<action application="set" data="no_media=true"/>
<action application="bridge" data="sofia/id@host.com"/>
You will need a new sofia tarball for this version
There is a bunch of other odds and ends added like a function or 2 etc
Oh,
And don't be suprised if it introduces all kinds of bugs!
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2992 d0543943-73ff-0310-b7d9-9358b9ac24b2