FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a versatile software implementation that runs on any commodity hardware. From a Raspberry PI to a multi-core server, FreeSWITCH can unl
Go to file
Anthony Minessale c4d890e0a4 Modify XML Dialplan
BTW, forget what I said yesterday RE: the strftime app I was at McDonalds, how can I concentrate there eh? 
see below....


The Definitive Guide To XML Dialplan:

The "dialplan" section of the freeswitch.xml meta document may contain several contexts

<?xml version="1.0"?>
<document type="freeswitch/xml">
  <section name="dialplan" description="Regex/XML Dialplan">
    <!-- the default context is a safe start -->
    <context name="default">

    <!-- one or more extension tags -->

    </context>
    
    <!-- more optional contexts -->
  </section>
</document>

The important thing to remember is that the dialplan is parsed once when the call
hits the dialplan parser in the RING state.  With one pass across the XML the result
will be a complete list of instructions installed into the channel based on
 parsed <action> or <anti-action> tags.

Those accustomed to Asterisk may expect the call to follow the dialplan by executing the 
applications as it parses them allowing data obtained from one action to influence the next action.
This not the case with the exception being the %{api func} {api arg} field type where an pluggable api call from
a module may be executed as the parsing occurs but this is meant to be used to draw realtime info such as
date and time or other quickly accessible information and shold *not* be abused.


The anatomy of an <extension> tag.

Legend: 
Text wrapped in [] indicates optional and is not part of the actual code.
a '|' inside [] indicates mutiple possible values and also is not part of the code.
Text wrapped in {} indicates it's a description of the parameter in place of the param itself.

<extension name="{exten_name}" [continue="[true|false]"]> 

continue=true means even if an extension executes to continue
parsing the next extension too

The {exten_name} above may anything but if it's 
an exact match with the destination number the parser will leap to this extension
to begin the searching that does not mean it will execute the extension.

Searching will either begin at the first extension in the context or at the point
the the parser has jumped to in the case described above.

Each condition is parsed in turn first taking the 'field' param.
The parser will apply the perl regular expression to each 'field' param encountered.

If the expression matches, it will parse each existing <action> tag in turn and add 
the data from the <application> tags to the channels todo list.	

If a matched expression contains any data wrapped in () the variables
$1,$2..$N will be valid and expanded in any of 'data' params from the subsequent action tags.

If the expression does NOT match, it will parse each <anti-action> tag in turn and add 
the data from the <application> tags to the channels todo list.
*NOTE* since there was no match the () feature is not availabe in anti-actions

The 'break' param indicates how to behave in relation to matching:
*) 'on-true'  - stop searching conditions after the first successful match.
*) 'on-false' - stop searching after the first unsuccessful match.
*) 'always'   - stop at this conditon regardless of a match or non-match.
*) 'never'    - continue searching regardless of a match or non-match.

<condition field="[{field name}|${variable name}|%{api func} {api arg}]" expression="{expression}" break="[on-true|on-false|always|never]">
  <action application="{app name}" data="{app arg}"/>
  <anti-action application="{app name}" data="{app arg}"/>
</condition>

  <!-- any number of condition tags may follow where the same rules apply -->
</extension>




git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2167 d0543943-73ff-0310-b7d9-9358b9ac24b2
2006-07-26 20:12:49 +00:00
build make script work on solaris 2006-05-08 04:10:21 +00:00
conf Add mod_event_socket remote client module and sample client. 2006-07-22 21:49:52 +00:00
docs dox 2006-05-10 20:02:01 +00:00
libs Not used yet. 2006-07-25 04:24:11 +00:00
mac/xcode $(HOME) instead of hard coded path. 2006-07-26 18:48:58 +00:00
scripts Change the socket protocol and the sample client to use multiline input 2006-07-25 14:14:07 +00:00
src Modify XML Dialplan 2006-07-26 20:12:49 +00:00
w32 update to new libs for msvc build. 2006-07-25 17:30:28 +00:00
.indent.pro fix oops (svn merge -r 418:417 http://svn.freeswitch.org/svn/freeswitch/trunk) 2006-01-20 15:05:05 +00:00
AUTHORS Initial merge of mod_cdr. Big thanks to Yossi Neiman for this huge contribution. Please note that this is still somewhat a work in progress, but it works. 2006-07-24 15:19:05 +00:00
COPYING fix oops (svn merge -r 418:417 http://svn.freeswitch.org/svn/freeswitch/trunk) 2006-01-20 15:05:05 +00:00
ChangeLog hi 2005-11-12 21:27:19 +00:00
INSTALL autotools cleanup and revert an oops. 2006-03-30 14:54:34 +00:00
Makefile.am move unix builds to apr 1.2.7, sqlite 3.3.6 and libsndfile 1.0.16 2006-07-25 15:11:15 +00:00
Makefile.in move unix builds to apr 1.2.7, sqlite 3.3.6 and libsndfile 1.0.16 2006-07-25 15:11:15 +00:00
NEWS hi 2005-11-12 21:27:19 +00:00
README Fix some warnings in MSVC (no more deprecated warnings again), fixed g729 build in msvc broken when the files in the lib moved when it was autotooled. Add details in readme about msvc requirements when using VC++ express 2005. 2006-01-09 02:36:00 +00:00
aclocal.m4 fixup custom event stuff 2006-07-24 15:45:36 +00:00
build.sh change build.sh to ensure gnu make 2006-02-08 21:32:03 +00:00
configure fixup custom event stuff 2006-07-24 15:45:36 +00:00
configure.in autoconf crap 2006-07-22 01:02:36 +00:00
generic_mod.mk ok this is just being picky but on darwin and mac we really should call it .dylib instead of .so but this also gave me a chance to get better with the build system. /b 2006-03-05 23:44:04 +00:00
indent_options.sh fix oops (svn merge -r 418:417 http://svn.freeswitch.org/svn/freeswitch/trunk) 2006-01-20 15:05:05 +00:00
mkinstalldirs hi 2005-11-12 21:27:19 +00:00
modules.conf.in Add mod_event_socket remote client module and sample client. 2006-07-22 21:49:52 +00:00

README

Freeswitch depends on several out of tree libraries.  All of freeswitch depends on APR, and mod_exosip depends on osip, exosip, jtrhead, and jrtplib.  
Download locations and links for details can be found below.

Apr info available at: http://apr.apache.org

Download Locations:
apr: http://apache.mirrors.versehost.com/apr/apr-1.2.2.tar.gz

Backup Download Locations:
apr: http://www.sofaswitch.org/mikej/apr-1.2.2.tar.gz


Exosip\Osip info available at: http://www.antisip.com/

Download Locations:
osip: http://www.antisip.com/download/libosip2-2.2.1.tar.gz
exosip: http://www.antisip.com/download/libeXosip-0.9.0.tar.gz

Backup Download Locations:
osip: http://www.sofaswitch.org/mikej/libosip2-2.2.1.tar.gz
exosip: http://www.sofaswitch.org/mikej/libeXosip-0.9.0.tar.gz


Jthread\Jrtplib info available at: http://research.edm.luc.ac.be/jori/page.html

Download Locations:
jthread: http://research.edm.luc.ac.be/jori/jthread/jthread-1.1.2.tar.gz
jrtplib: http://research.edm.luc.ac.be/jori/jrtplib/jrtplib-3.3.0.tar.gz

Backup Download Locations:
jthread: http://www.sofaswitch.org/mikej/jthread-1.1.2.tar.gz
jrtplib: http://www.sofaswitch.org/mikej/jrtplib-3.3.0.tar.gz

MSVC Notes:
Freeswitch will compile and run from Microsoft Visual Studio 2005.  
If using the Visual C++ Express edition, please make sure that the location of the include and lib directories are propperly set in the file
C:\Program Files\Microsoft Visual Studio 8\VC\vcpackages\VCProjectEngine.Dll.Express.Config.  
The automated build process for te dependecy libraries will not work without these settings.