<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[Freeswitch-trunk][15314] </title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<div id="header">FreeSWITCH Subversion</div>
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://fisheye.freeswitch.org/changelog/FreeSWITCH?cs=15314">15314</a></dd>
<dt>Author</dt> <dd>joshrivers</dd>
<dt>Date</dt> <dd>2009-11-02 04:10:22 -0600 (Mon, 02 Nov 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merged trunk into branch to bring up to date.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorCMakeListstxt">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/CMakeLists.txt</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorFreeswitch2005unsupportedsln">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/Freeswitch.2005.unsupported.sln</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorFreeswitch2008expresssln">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/Freeswitch.2008.express.sln</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorFreeswitch2008sln">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/Freeswitch.2008.sln</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorMakefileam">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/Makefile.am</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorbootstrapsh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/bootstrap.sh</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorbuildmodulesconfin">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/build/modules.conf.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconfautoload_configscidlookupconfxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/cidlookup.conf.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconfautoload_configsfifoconfxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/fifo.conf.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconfautoload_configsmodulesconfxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/modules.conf.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconfautoload_configssyslogconfxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/syslog.conf.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconfautoload_configsxml_curlconfxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/xml_curl.conf.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconfdialplandefaultxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/dialplan/default.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangenenxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/en.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangenvmsoundsxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/vm/sounds.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangfrfrxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/fr/fr.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconfsip_profilesinternalxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/sip_profiles/internal.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconfigurein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/configure.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribcparkermod_xml_radiusmod_xml_radiusc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/cparker/mod_xml_radius/mod_xml_radius.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdschreibermod_nibblebillmod_nibblebillc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/dschreiber/mod_nibblebill/mod_nibblebill.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledesl2agiesl2agic">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/esl2agi/esl2agi.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledesl2agiesl2agih">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/esl2agi/esl2agi.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlconfigurationpost_load_modulesconfphp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/post_load_modules.conf.php</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlconfigurationvoicemailconfphp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/voicemail.conf.php</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlconfigurationxml_cdrconfphp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/xml_cdr.conf.php</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlfs_configurationphp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/fs_configuration.php</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlfs_curlphp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/fs_curl.php</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlfs_directoryphp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/fs_directory.php</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlglobal_definesphp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/global_defines.php</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_sockfs_sockphp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_sock/fs_sock.php</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribjtregunnamod_fastsmsmod_fastsmsc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/jtregunna/mod_fastsms/mod_fastsms.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_odbc_querymod_odbc_queryc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_odbc_query/mod_odbc_query.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribmodxml_intmod_xml_odbcmod_xml_odbcc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/mod/xml_int/mod_xml_odbc/mod_xml_odbc.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribtrixterREADME">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/trixter/README</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactordebiancontrol">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/control</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactordebianfreeswitchinstall">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch.install</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactordebianrules">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/rules</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactordocsChangeLog">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/docs/ChangeLog</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactordocsphrasephrase_enxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/docs/phrase/phrase_en.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactordocsphrasephrase_frxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/docs/phrase/phrase_fr.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorfreeswitchspec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/freeswitch.spec</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibseslphpMakefile">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/esl/php/Makefile</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibseslsrcesl_eventc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/esl/src/esl_event.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibseslsrcincludeesl_eventh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/esl/src/include/esl_event.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibssofiasiplibsofiasipuanuanua_sessionc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspupdate">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/.update</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspconfigureac">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/configure.ac</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspspandspfaxtestsdtd">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/spandsp/fax-tests.dtd</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspspandspsimline_modelc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/spandsp-sim/line_model.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspspandspsimmake_line_modelsc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/spandsp-sim/make_line_models.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspspandspsimspandspline_modelh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/spandsp-sim/spandsp/line_model.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcMakefileam">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/Makefile.am</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcat_interpreterc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/at_interpreter.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcechoc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/echo.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcfaxc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/fax.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcfax_modemsc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/fax_modems.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcfilter_toolsc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/filter_tools.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrclibspandsp2005vcproj">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/libspandsp.2005.vcproj</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrclibspandsp2008vcproj">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/libspandsp.2008.vcproj</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrclibspandspdsp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/libspandsp.dsp</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcmake_at_dictionaryc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/make_at_dictionary.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcmake_modem_filterc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/make_modem_filter.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcmodem_echoc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/modem_echo.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcmsvcspandsph">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/msvc/spandsp.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcsig_tonec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/sig_tone.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcsilence_genc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/silence_gen.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspechoh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/echo.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspexposeh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/expose.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspfast_converth">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/fast_convert.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspmodem_echoh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/modem_echo.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspprivatefax_modemsh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/fax_modems.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspprivatesig_toneh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/sig_tone.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspprivatet30h">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/t30.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspsig_toneh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/sig_tone.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspsilence_genh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/silence_gen.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspt30h">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/t30.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandsptimingh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/timing.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspversionh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/version.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandsphin">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp.h.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrct30c">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/t30.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrct31c">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/t31.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrct38_non_ecm_bufferc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/t38_non_ecm_buffer.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrct38_terminalc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/t38_terminal.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandsptestsMakefileam">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/Makefile.am</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandsptestsfax_decodec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/fax_decode.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandsptestsline_model_testsc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/line_model_tests.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandsptestsregression_testssh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/regression_tests.sh</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandsptestssig_tone_testsc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/sig_tone_tests.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382update">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/.update</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382Makefileam">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/Makefile.am</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382configmkinstalldirs">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/config/mkinstalldirs</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382libtifftif_fax3c">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/libtiff/tif_fax3.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcincludeswitch_bufferh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_buffer.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcincludeswitch_callerh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_caller.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcincludeswitch_channelh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_channel.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcincludeswitch_coreh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_core.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcincludeswitch_cpph">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_cpp.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcincludeswitch_ivrh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_ivr.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcincludeswitch_loadable_moduleh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_loadable_module.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcincludeswitch_typesh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_types.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcincludeswitch_utilsh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_utils.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_cidlookupmod_cidlookupc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_cidlookup/mod_cidlookup.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_commandsmod_commandsc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_commands/mod_commands.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_conferencemod_conferencec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_conference/mod_conference.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_curlmod_curlc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_curl/mod_curl.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_dptoolsmod_dptoolsc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_dptools/mod_dptools.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_easyroutemod_easyroutec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_easyroute/mod_easyroute.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_enummod_enumc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_enum/mod_enum.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_esfmod_esfc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_esf/mod_esf.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_exprmod_exprc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_expr/mod_expr.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_faxmod_faxc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_fax/mod_fax.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_fifomod_fifoc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_fifo/mod_fifo.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_lcrmod_lcrc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_lcr/mod_lcr.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_limitmod_limitc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_limit/mod_limit.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_memcachemod_memcachec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_memcache/mod_memcache.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_nibblebillmod_nibblebillc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_nibblebill/mod_nibblebill.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_rssmod_rssc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_rss/mod_rss.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_soundtouchmod_soundtouchcpp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_spymod_spyc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_spy/mod_spy.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_stressmod_stresscpp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_stress/mod_stress.cpp</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_vmdmod_vmdc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_vmd/mod_vmd.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_voicemailmod_voicemailc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_voicemail/mod_voicemail.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodasr_ttsmod_cepstralmod_cepstralc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/asr_tts/mod_cepstral/mod_cepstral.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodasr_ttsmod_pocketsphinxmod_pocketsphinxc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodasr_ttsmod_tts_commandlinemod_tts_commandlinec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/asr_tts/mod_tts_commandline/mod_tts_commandline.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodasr_ttsmod_unimrcpmod_unimrcpc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodcodecsmod_celtMakefile">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_celt/Makefile</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodcodecsmod_celtmod_celtc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_celt/mod_celt.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodcodecsmod_voipcodecsMakefile">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_voipcodecs/Makefile</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodcodecsmod_voipcodecsmod_voipcodecs2008vcproj">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.2008.vcproj</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodcodecsmod_voipcodecsmod_voipcodecsc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodcodecsmod_voipcodecsmod_voipcodecsvcproj">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.vcproj</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmoddialplansmod_dialplan_asteriskmod_dialplan_asteriskc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmoddialplansmod_dialplan_xmlmod_dialplan_xmlc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_alsamod_alsac">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_alsa/mod_alsa.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_dingalingmod_dingalingc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_dingaling/mod_dingaling.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_iaxmod_iaxc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_iax/mod_iax.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_loopbackmod_loopbackc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_loopback/mod_loopback.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_portaudiomod_portaudioc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_portaudio/mod_portaudio.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_skypiaxconfigsdefaultxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_skypiax/configs/default.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_skypiaxmod_skypiaxc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_skypiax/mod_skypiax.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_sofiamod_sofiac">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/mod_sofia.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_sofiamod_sofiah">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/mod_sofia.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_sofiasofiac">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/sofia.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_sofiasofia_gluec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/sofia_glue.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_sofiasofia_presencec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/sofia_presence.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_sofiasofia_regc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/sofia_reg.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodevent_handlersmod_cdr_csvmod_cdr_csvc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodevent_handlersmod_erlang_eventei_helpersc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/ei_helpers.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodevent_handlersmod_erlang_eventerlang_eventconfxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/erlang_event.conf.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodevent_handlersmod_erlang_eventhandle_msgc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/handle_msg.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodevent_handlersmod_erlang_eventmod_erlang_eventc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodevent_handlersmod_erlang_eventmod_erlang_eventh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodevent_handlersmod_event_socketmod_event_socketc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_event_socket/mod_event_socket.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodevent_handlersmod_radius_cdrmod_radius_cdrc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodformatsmod_local_streammod_local_streamc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/formats/mod_local_stream/mod_local_stream.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodformatsmod_native_filemod_native_filec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/formats/mod_native_file/mod_native_file.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodformatsmod_portaudio_streammod_portaudio_streamc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/formats/mod_portaudio_stream/mod_portaudio_stream.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_javasrcorgfreeswitchswigCoreSessionjava">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_javasrcorgfreeswitchswigfreeswitchJNIjava">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_javaswitch_swig_wrapcpp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_java/switch_swig_wrap.cpp</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_luafreeswitch_luacpp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_lua/freeswitch_lua.cpp</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_luamod_luacpp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_lua/mod_lua.cpp</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_luamod_lua_wrapcpp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_lua/mod_lua_wrap.cpp</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_managedfreeswitch_wrapcxx">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_managed/freeswitch_wrap.cxx</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_managedmanagedFreeSWITCHManageddll">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_managed/managed/FreeSWITCH.Managed.dll</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_managedmanagedFreeSWITCHManagedpdb">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_managed/managed/FreeSWITCH.Managed.pdb</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_managedmanagedswigcs">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_managed/managed/swig.cs</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_managedmod_managedcpp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_managed/mod_managed.cpp</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_perlfreeswitchpm">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_perl/freeswitch.pm</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_perlmod_perlc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_perl/mod_perl.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_perlmod_perl_wrapcpp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_perl/mod_perl_wrap.cpp</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_pythonfreeswitchpy">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_python/freeswitch.py</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_pythonmod_pythonc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_python/mod_python.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_pythonmod_python_wrapcpp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_python/mod_python_wrap.cpp</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_spidermonkeymod_spidermonkeyc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_spidermonkey_curlmod_spidermonkey_curlc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_spidermonkey_curl/mod_spidermonkey_curl.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_spidermonkey_odbcmod_spidermonkey_odbcc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_yamlmod_yamlc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_yaml/mod_yaml.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodloggersmod_consolemod_consolec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/loggers/mod_console/mod_console.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodloggersmod_logfilemod_logfilec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/loggers/mod_logfile/mod_logfile.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodloggersmod_syslogmod_syslogc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/loggers/mod_syslog/mod_syslog.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodxml_intmod_xml_cdrmod_xml_cdrc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodxml_intmod_xml_curlmod_xml_curlc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodxml_intmod_xml_ldapmod_xml_ldapc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodxml_intmod_xml_ldapmod_xml_ldapv2c">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_ldap/mod_xml_ldapv2.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodxml_intmod_xml_rpcmod_xml_rpcc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitchc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_bufferc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_buffer.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_callerc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_caller.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_channelc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_channel.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_consolec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_console.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_corec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_asrc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_asr.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_codecc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_codec.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_filec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_file.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_hashc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_hash.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_ioc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_io.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_media_bugc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_media_bug.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_memoryc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_memory.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_sessionc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_session.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_speechc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_speech.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_sqldbc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_sqldb.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_state_machinec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_state_machine.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_timerc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_timer.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_cppcpp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_cpp.cpp</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_eventc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_event.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_ivrc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_ivr_asyncc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_async.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_ivr_bridgec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_bridge.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_ivr_menuc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_menu.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_ivr_originatec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_originate.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_ivr_play_sayc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_play_say.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_loadable_modulec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_loadable_module.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_logc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_log.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_natc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_nat.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_odbcc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_odbc.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_pcmc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_pcm.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_rtpc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_rtp.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_schedulerc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_scheduler.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_swigc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_swig.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_timec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_time.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_utilsc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_utils.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_xmlc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_xml.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_xml_configc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_xml_config.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsupportdfscore_pb">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/support-d/fscore_pb</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconfautoload_configsdirectoryconfxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/directory.conf.xml</a></li>
<li>freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/dir/</li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangendirsoundsxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/dir/sounds.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangendirttsxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/dir/tts.xml</a></li>
<li>freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/fr/dir/</li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangfrdirsoundsxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/fr/dir/sounds.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangfrdirttsxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/fr/dir/tts.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribDelphiWorlddialplanrecordingxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/DelphiWorld/dialplan/recording.xml</a></li>
<li>freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr/</li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubycdrcdrrb">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr/cdr.rb</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubycdrcreate_tablerb">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr/create_table.rb</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubycdrdatabaserb">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr/database.rb</a></li>
<li>freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/prepaid/</li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubyprepaidserverrb">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/prepaid/server.rb</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpcheckphp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/check.php</a></li>
<li>freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/</li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214COPYING">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/COPYING</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214README">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/README</a></li>
<li>freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/</li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsCHANGELOG">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CHANGELOG</a></li>
<li>freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/</li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsCVSEntries">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/Entries</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsCVSRepository">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/Repository</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsCVSRoot">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/Root</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsREADMEphpagi">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/README.phpagi</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsREADMEphpagiasmanager">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/README.phpagi-asmanager</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsREADMEphpagifastagi">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/README.phpagi-fastagi</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsfastagixinetd">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/fastagi.xinetd</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsphpagiexampleconf">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/phpagi.example.conf</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214mkdocsphp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/mkdocs.php</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214phpagiasmanagerphp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/phpagi-asmanager.php</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214phpagifastagiphp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/phpagi-fastagi.php</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214phpagiphp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/phpagi.php</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribhunmonkluasupport_functions_databaselua">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/hunmonk/lua/support_functions_database.lua</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlconfigurationeasyrouteconfphp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/easyroute.conf.php</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlconfigurationlcrconfphp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/lcr.conf.php</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlsqlpostgres84sql">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/sql/postgres-8.4.sql</a></li>
<li>freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/</li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_pcliMakefile">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/Makefile</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_pclimod_pclic">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/mod_pcli.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_pclipcliconfxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/pcli.conf.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_pclipclistructuremysql">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/pcli.structure.mysql</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribtrixterscheduled_eventlua">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/trixter/scheduled_event.lua</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactordebianfreeswitchlangruconffiles">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-lang-ru.conffiles</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactordebianfreeswitchlangruinstall">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-lang-ru.install</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactordebianfreeswitchsoundsenuscallie48000install">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-en-us-callie-48000.install</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactordebianfreeswitchsoundsruruelena16000install">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-ru-ru-elena-16000.install</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactordebianfreeswitchsoundsruruelena32000install">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-ru-ru-elena-32000.install</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactordebianfreeswitchsoundsruruelena48000install">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-ru-ru-elena-48000.install</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactordebianfreeswitchsoundsruruelena8000install">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-ru-ru-elena-8000.install</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspprivateechoh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/echo.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspprivatemodem_echoh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/modem_echo.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspprivateswept_toneh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/swept_tone.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspswept_toneh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/swept_tone.h</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcswept_tonec">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/swept_tone.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandsptestsswept_tone_testsc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/swept_tone_tests.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382acincludem4">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/acinclude.m4</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorpatchesmod_portaudio_snow_leoparddiff">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/patches/mod_portaudio_snow_leopard.diff</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorscriptsperlwplookupcgi">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/scripts/perl/wplookup.cgi</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_directoryMakefile">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_directory/Makefile</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_directorymod_directory2008vcproj">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_directory/mod_directory.2008.vcproj</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_directorymod_directoryc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_directory/mod_directory.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_directorymod_directoryvcproj">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_directory/mod_directory.vcproj</a></li>
<li>freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_snapshot/</li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_snapshotmod_snapshot2008vcproj">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_snapshot/mod_snapshot.2008.vcproj</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_snapshotmod_snapshotc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_snapshot/mod_snapshot.c</a></li>
<li>freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_valet_parking/</li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_valet_parkingmod_valet_parking2008vcproj">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_valet_parking/mod_valet_parking.2008.vcproj</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_valet_parkingmod_valet_parkingc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_valet_parking/mod_valet_parking.c</a></li>
<li>freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/</li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323Makefile">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/Makefile</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323bugs">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/bugs</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323changestxt">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/changes.txt</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323h323confxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/h323.conf.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323mod_h323cpp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/mod_h323.cpp</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323mod_h323h">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/mod_h323.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangendirsoundsxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/dir/sounds.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangendirttsxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/dir/tts.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangfrdirsoundsxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/fr/dir/sounds.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangfrdirttsxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/fr/dir/tts.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubycallcardREADMEmd">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/callcard/README.md</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubycallcardTODO">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/callcard/TODO</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubycdrcdrrb">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr/cdr.rb</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubycdrcreate_tablerb">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr/create_table.rb</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubycdrdatabaserb">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr/database.rb</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubyprepaidserverrb">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/prepaid/server.rb</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214COPYING">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/COPYING</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214README">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/README</a></li>
<li>freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/</li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsCHANGELOG">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CHANGELOG</a></li>
<li>freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/</li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsCVSEntries">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/Entries</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsCVSRepository">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/Repository</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsCVSRoot">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/Root</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsREADMEphpagi">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/README.phpagi</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsREADMEphpagiasmanager">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/README.phpagi-asmanager</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsREADMEphpagifastagi">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/README.phpagi-fastagi</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsfastagixinetd">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/fastagi.xinetd</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsphpagiexampleconf">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/phpagi.example.conf</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214mkdocsphp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/mkdocs.php</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214phpagiasmanagerphp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/phpagi-asmanager.php</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214phpagifastagiphp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/phpagi-fastagi.php</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214phpagiphp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/phpagi.php</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_pcliMakefile">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/Makefile</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_pclimod_pclic">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/mod_pcli.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_pclipcliconfxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/pcli.conf.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_pclipclistructuremysql">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/pcli.structure.mysql</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382Makefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382aclocalm4">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/aclocal.m4</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382configconfigguess">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/config/config.guess</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382configconfigsub">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/config/config.sub</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382configltmainsh">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/config/ltmain.sh</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382configure">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/configure</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribacornMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/acorn/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribaddtiffoMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/addtiffo/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribdbsMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/dbs/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribdbsxtiffMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/dbs/xtiff/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribiptcutilMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/iptcutil/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribmaccwMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/mac-cw/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribmacmpwMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/mac-mpw/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribmfsMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/mfs/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribojpegMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/ojpeg/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribpdsMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/pds/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribrasMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/ras/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribstreamMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/stream/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribtagsMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/tags/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribwin_dibMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/win_dib/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382htmlMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/html/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382htmlimagesMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/html/images/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382htmlmanMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/html/man/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382libtiffMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/libtiff/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382libtifftif_confighin">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/libtiff/tif_config.h.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382m4acincludem4">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/m4/acinclude.m4</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382m4libtoolm4">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/m4/libtool.m4</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382m4ltoptionsm4">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/m4/ltoptions.m4</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382m4ltsugarm4">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/m4/ltsugar.m4</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382m4ltversionm4">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/m4/ltversion.m4</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382manMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/man/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382portMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/port/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382testMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/test/Makefile.in</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382toolsMakefilein">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/tools/Makefile.in</a></li>
<li>freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/voipcodecs/</li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibswin32DownloadTIFF2008vcproj">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/win32/Download TIFF.2008.vcproj</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_snapshotmod_snapshot2008vcproj">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_snapshot/mod_snapshot.2008.vcproj</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_snapshotmod_snapshotc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_snapshot/mod_snapshot.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_valet_parkingmod_valet_parking2008vcproj">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_valet_parking/mod_valet_parking.2008.vcproj</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_valet_parkingmod_valet_parkingc">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_valet_parking/mod_valet_parking.c</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323Makefile">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/Makefile</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323bugs">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/bugs</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323changestxt">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/changes.txt</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323h323confxml">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/h323.conf.xml</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323mod_h323cpp">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/mod_h323.cpp</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323mod_h323h">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/mod_h323.h</a></li>
</ul>
<h3>Property Changed</h3>
<ul>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactor">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382config">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/config/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contrib">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribacorn">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/acorn/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribaddtiffo">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/addtiffo/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribdbs">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/dbs/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribdbsxtiff">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/dbs/xtiff/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribiptcutil">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/iptcutil/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribmaccw">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/mac-cw/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribmacmpw">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/mac-mpw/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribmfs">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/mfs/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribojpeg">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/ojpeg/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribpds">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/pds/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribras">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/ras/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribstream">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/stream/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribtags">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/tags/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribwin_dib">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/win_dib/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382html">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/html/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382htmlimages">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/html/images/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382htmlman">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/html/man/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382libtiff">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/libtiff/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382man">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/man/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382port">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/port/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382test">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/test/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382tools">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/tools/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsunimrcppluginsmrcpflite">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/unimrcp/plugins/mrcp-flite/</a></li>
<li><a href="#freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsunimrcppluginsmrcppocketsphinx">freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/unimrcp/plugins/mrcp-pocketsphinx/</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactor"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - freeswitch-sounds-*.tar.gz
</span><span class="cx">.deps
</span><span class="cx">Makefile
</span><span class="cx">config.status
</span><span class="cx">modules.conf
</span><span class="cx">libtool
</span><span class="cx">quiet_libtool
</span><span class="cx">config.log
</span><span class="cx">.version
</span><span class="cx">.libs
</span><span class="cx">autom4te.cache
</span><span class="cx">freeswitch
</span><span class="cx">core.*
</span><span class="cx">debug
</span><span class="cx">release
</span><span class="cx">*.ncb
</span><span class="cx">*.suo
</span><span class="cx">*.bak
</span><span class="cx">.noversion
</span><span class="cx">testmode
</span><span class="cx">.complete
</span><span class="cx">*.c
</span><span class="cx">*.patch
</span><span class="cx">*.tmp
</span><span class="cx">wtf
</span><span class="cx">cc-mode-*
</span><span class="cx">config.cache
</span><span class="cx">Makefile.in
</span><span class="cx">AUTHORS
</span><span class="cx">COPYING
</span><span class="cx">NEWS
</span><span class="cx">ChangeLog
</span><span class="cx">configure
</span><span class="cx">README
</span><span class="cx">aclocal.m4
</span><span class="cx">debug static
</span><span class="cx">release static
</span><span class="cx">Debug
</span><span class="cx">Debug Static
</span><span class="cx">Release
</span><span class="cx">Freeswitch.2008cache.dat
</span><span class="cx">Freeswitchcache.dat
</span><span class="cx">Release Static
</span><span class="cx">bin
</span><span class="cx">*.diff
</span><span class="cx">*.pdb
</span><span class="cx">cmake.test
</span><span class="cx">All
</span><span class="cx">x64
</span><span class="cx">spandsp.h
</span><span class="cx">Release_CLR
</span><span class="cx">fs_cli
</span><span class="cx">fs_ivrd
</span><span class="cx">.
</span><span class="cx">status
</span><span class="cx"> + freeswitch-sounds-*.tar.gz
</span><span class="cx">.deps
</span><span class="cx">Makefile
</span><span class="cx">config.status
</span><span class="cx">modules.conf
</span><span class="cx">libtool
</span><span class="cx">quiet_libtool
</span><span class="cx">config.log
</span><span class="cx">.version
</span><span class="cx">.libs
</span><span class="cx">autom4te.cache
</span><span class="cx">freeswitch
</span><span class="cx">core.*
</span><span class="cx">debug
</span><span class="cx">release
</span><span class="cx">*.ncb
</span><span class="cx">*.suo
</span><span class="cx">*.bak
</span><span class="cx">.noversion
</span><span class="cx">testmode
</span><span class="cx">.complete
</span><span class="cx">*.c
</span><span class="cx">*.patch
</span><span class="cx">*.tmp
</span><span class="cx">wtf
</span><span class="cx">cc-mode-*
</span><span class="cx">config.cache
</span><span class="cx">Makefile.in
</span><span class="cx">AUTHORS
</span><span class="cx">COPYING
</span><span class="cx">NEWS
</span><span class="cx">ChangeLog
</span><span class="cx">configure
</span><span class="cx">README
</span><span class="cx">aclocal.m4
</span><span class="cx">debug static
</span><span class="cx">release static
</span><span class="cx">Debug
</span><span class="cx">Debug Static
</span><span class="cx">Release
</span><span class="cx">Freeswitch.2008cache.dat
</span><span class="cx">Freeswitchcache.dat
</span><span class="cx">Release Static
</span><span class="cx">bin
</span><span class="cx">*.diff
</span><span class="cx">*.pdb
</span><span class="cx">cmake.test
</span><span class="cx">All
</span><span class="cx">x64
</span><span class="cx">spandsp.h
</span><span class="cx">Release_CLR
</span><span class="cx">fs_cli
</span><span class="cx">fs_ivrd
</span><span class="cx">.
</span><span class="cx">status
</span><span class="cx">ignore.txt
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorCMakeListstxt"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/CMakeLists.txt (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/CMakeLists.txt        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/CMakeLists.txt        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -1,6 +1,8 @@
</span><span class="cx"> # FREESWITCH CMAKE BUILD
</span><span class="cx"> # Created by SHANE BURRELL 2009 (supjigator)
</span><span class="cx">
</span><ins>+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
</ins><span class="cx"> PROJECT (freeswitch)
</span><span class="cx">
</span><span class="cx"> #GETSVN VERSION
</span><span class="lines">@@ -29,8 +31,6 @@
</span><span class="cx"> INCLUDE (CheckTypeSize)
</span><span class="cx"> INCLUDE (CheckCXXSourceCompiles)
</span><span class="cx">
</span><del>-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-
</del><span class="cx"> MESSAGE( STATUS )
</span><span class="cx"> MESSAGE( STATUS "FREESWITCH CMAKE Build-----------------------------------------" )
</span><span class="cx"> MESSAGE( STATUS "BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}" )
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorFreeswitch2005unsupportedsln"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/Freeswitch.2005.unsupported.sln (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/Freeswitch.2005.unsupported.sln        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/Freeswitch.2005.unsupported.sln        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -184,6 +184,9 @@
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><span class="cx"> Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Libraries", "_Libraries", "{EB910B0D-F27D-4B62-B67B-DE834C99AC5B}"
</span><ins>+        ProjectSection(SolutionItems) = preProject
+                libs\spandsp\src\msvc\make_modem_filter.2005.vcproj = libs\spandsp\src\msvc\make_modem_filter.2005.vcproj
+        EndProjectSection
</ins><span class="cx"> EndProject
</span><span class="cx"> Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdingaling", "libs\libdingaling\libdingaling.vcproj", "{1906D736-08BD-4EE1-924F-B536249B9A54}"
</span><span class="cx">         ProjectSection(ProjectDependencies) = postProject
</span><span class="lines">@@ -762,12 +765,11 @@
</span><span class="cx">                 {89385C74-5860-4174-9CAF-A39E7C48909C} = {89385C74-5860-4174-9CAF-A39E7C48909C}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><del>-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvoipcodecs", "libs\voipcodecs\libvoipcodecs.vcproj", "{CF70F278-3364-4395-A2E1-23501C9B8AD2}"
-EndProject
</del><span class="cx"> Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_voipcodecs", "src\mod\codecs\mod_voipcodecs\mod_voipcodecs.vcproj", "{9EED03C8-8315-4214-8D13-8FF5FA46D93C}"
</span><span class="cx">         ProjectSection(ProjectDependencies) = postProject
</span><ins>+                {401A40CD-5DB4-4E34-AC68-FA99E9FAC014} = {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}
+                {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}
</ins><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><del>-                {CF70F278-3364-4395-A2E1-23501C9B8AD2} = {CF70F278-3364-4395-A2E1-23501C9B8AD2}
</del><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><span class="cx"> Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_spidermonkey_curl", "src\mod\languages\mod_spidermonkey_curl\mod_spidermonkey_curl.vcproj", "{2CCED6DC-26FF-40F2-9585-E9E1049A4599}"
</span><span class="lines">@@ -812,544 +814,854 @@
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><ins>+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtiff", "libs\spandsp\src\libtiff.2005.vcproj", "{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspandsp", "libs\spandsp\src\libspandsp.2005.vcproj", "{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}"
+        ProjectSection(ProjectDependencies) = postProject
+                {329A6FA0-0FCC-4435-A950-E670AEFA9838} = {329A6FA0-0FCC-4435-A950-E670AEFA9838}
+                {DEE932AB-5911-4700-9EEB-8C7090A0A330} = {DEE932AB-5911-4700-9EEB-8C7090A0A330}
+                {401A40CD-5DB4-4E34-AC68-FA99E9FAC014} = {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}
+        EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_at_dictionary", "libs\spandsp\src\msvc\make_at_dictionary.2005.vcproj", "{DEE932AB-5911-4700-9EEB-8C7090A0A330}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_modem_filter", "libs\spandsp\src\msvc\make_modem_filter.2005.vcproj", "{329A6FA0-0FCC-4435-A950-E670AEFA9838}"
+EndProject
</ins><span class="cx"> Global
</span><span class="cx">         GlobalSection(SolutionConfigurationPlatforms) = preSolution
</span><ins>+                All|Win32 = All|Win32
+                All|x64 = All|x64
</ins><span class="cx">                 Debug|Win32 = Debug|Win32
</span><span class="cx">                 Debug|x64 = Debug|x64
</span><span class="cx">                 Release|Win32 = Release|Win32
</span><span class="cx">                 Release|x64 = Release|x64
</span><span class="cx">         EndGlobalSection
</span><span class="cx">         GlobalSection(ProjectConfigurationPlatforms) = postSolution
</span><ins>+                {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.All|Win32.ActiveCfg = Release|Win32
+                {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.All|Win32.Build.0 = Release|Win32
+                {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {1AF3A893-F7BE-43DD-B697-8AB2397C0D67}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.All|Win32.ActiveCfg = Release|Win32
+                {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.All|Win32.Build.0 = Release|Win32
+                {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.All|Win32.ActiveCfg = Release Passthrough|Win32
+                {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.All|Win32.Build.0 = Release Passthrough|Win32
+                {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.All|x64.ActiveCfg = Release Passthrough|Win32
</ins><span class="cx">                 {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32
</span><span class="cx">                 {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|Win32.Build.0 = Debug Passthrough|Win32
</span><span class="cx">                 {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Win32.ActiveCfg = Release Passthrough|Win32
</span><span class="cx">                 {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|Win32.Build.0 = Release Passthrough|Win32
</span><span class="cx">                 {1D95CD95-0DE2-48C3-AC23-D5C7D1C9C0F0}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.All|Win32.ActiveCfg = Release|Win32
+                {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.All|Win32.Build.0 = Release|Win32
+                {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {3A5B9131-F20C-4A85-9447-6C1610941CEE}.All|Win32.ActiveCfg = Release|Win32
+                {3A5B9131-F20C-4A85-9447-6C1610941CEE}.All|Win32.Build.0 = Release|Win32
+                {3A5B9131-F20C-4A85-9447-6C1610941CEE}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {3A5B9131-F20C-4A85-9447-6C1610941CEE}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.All|Win32.ActiveCfg = Release|Win32
+                {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.All|Win32.Build.0 = Release|Win32
+                {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {5FD31A25-5D83-4794-8BEE-904DAD84CE71}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {5580D60E-0F77-4716-9CD4-B8E5986FA375}.All|Win32.ActiveCfg = Release|Win32
+                {5580D60E-0F77-4716-9CD4-B8E5986FA375}.All|Win32.Build.0 = Release|Win32
+                {5580D60E-0F77-4716-9CD4-B8E5986FA375}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {5580D60E-0F77-4716-9CD4-B8E5986FA375}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {1A1FF289-4FD6-4285-A422-D31DD67A4723}.All|Win32.ActiveCfg = Release|Win32
+                {1A1FF289-4FD6-4285-A422-D31DD67A4723}.All|Win32.Build.0 = Release|Win32
+                {1A1FF289-4FD6-4285-A422-D31DD67A4723}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {1A1FF289-4FD6-4285-A422-D31DD67A4723}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {07113B25-D3AF-4E04-BA77-4CD1171F022C}.All|Win32.ActiveCfg = Release|Win32
+                {07113B25-D3AF-4E04-BA77-4CD1171F022C}.All|Win32.Build.0 = Release|Win32
+                {07113B25-D3AF-4E04-BA77-4CD1171F022C}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {07113B25-D3AF-4E04-BA77-4CD1171F022C}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {B17FFBE6-A942-4056-8346-B624FB5D995B}.All|Win32.ActiveCfg = Release with MySql
+                {B17FFBE6-A942-4056-8346-B624FB5D995B}.All|Win32.Build.0 = Release with MySql
+                {B17FFBE6-A942-4056-8346-B624FB5D995B}.All|x64.ActiveCfg = Release with MySql
+                {B17FFBE6-A942-4056-8346-B624FB5D995B}.All|x64.Build.0 = Release with MySql
</ins><span class="cx">                 {B17FFBE6-A942-4056-8346-B624FB5D995B}.Debug|Win32.ActiveCfg = Debug
</span><span class="cx">                 {B17FFBE6-A942-4056-8346-B624FB5D995B}.Debug|x64.ActiveCfg = Debug with MySql
</span><span class="cx">                 {B17FFBE6-A942-4056-8346-B624FB5D995B}.Debug|x64.Build.0 = Debug with MySql
</span><span class="cx">                 {B17FFBE6-A942-4056-8346-B624FB5D995B}.Release|Win32.ActiveCfg = Release
</span><span class="cx">                 {B17FFBE6-A942-4056-8346-B624FB5D995B}.Release|x64.ActiveCfg = Release with MySql
</span><span class="cx">                 {B17FFBE6-A942-4056-8346-B624FB5D995B}.Release|x64.Build.0 = Release with MySql
</span><ins>+                {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.All|Win32.ActiveCfg = Release MS-LDAP|Win32
+                {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.All|Win32.Build.0 = Release MS-LDAP|Win32
+                {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.All|x64.ActiveCfg = Release MS-LDAP|Win32
</ins><span class="cx">                 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Win32.ActiveCfg = Debug MS-LDAP|Win32
</span><span class="cx">                 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|Win32.Build.0 = Debug MS-LDAP|Win32
</span><span class="cx">                 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|Win32.ActiveCfg = Release MS-LDAP|Win32
</span><span class="cx">                 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|Win32.Build.0 = Release MS-LDAP|Win32
</span><span class="cx">                 {EC3E5C7F-EE09-47E2-80FE-546363D14A98}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {A27CCA23-1541-4337-81A4-F0A6413078A0}.All|Win32.ActiveCfg = Release|Win32
+                {A27CCA23-1541-4337-81A4-F0A6413078A0}.All|Win32.Build.0 = Release|Win32
+                {A27CCA23-1541-4337-81A4-F0A6413078A0}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {A27CCA23-1541-4337-81A4-F0A6413078A0}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {A27CCA23-1541-4337-81A4-F0A6413078A0}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {C7705DC4-2088-493E-AF8D-65BC6D65C125}.All|Win32.ActiveCfg = Release|Win32
+                {C7705DC4-2088-493E-AF8D-65BC6D65C125}.All|Win32.Build.0 = Release|Win32
+                {C7705DC4-2088-493E-AF8D-65BC6D65C125}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {C7705DC4-2088-493E-AF8D-65BC6D65C125}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {784113EF-44D9-4949-835D-7065D3C7AD08}.All|Win32.ActiveCfg = Release|Win32
+                {784113EF-44D9-4949-835D-7065D3C7AD08}.All|Win32.Build.0 = Release|Win32
+                {784113EF-44D9-4949-835D-7065D3C7AD08}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {784113EF-44D9-4949-835D-7065D3C7AD08}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {784113EF-44D9-4949-835D-7065D3C7AD08}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {784113EF-44D9-4949-835D-7065D3C7AD08}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {784113EF-44D9-4949-835D-7065D3C7AD08}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {89385C74-5860-4174-9CAF-A39E7C48909C}.All|Win32.ActiveCfg = Release|Win32
+                {89385C74-5860-4174-9CAF-A39E7C48909C}.All|Win32.Build.0 = Release|Win32
+                {89385C74-5860-4174-9CAF-A39E7C48909C}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {89385C74-5860-4174-9CAF-A39E7C48909C}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {89385C74-5860-4174-9CAF-A39E7C48909C}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {89385C74-5860-4174-9CAF-A39E7C48909C}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {89385C74-5860-4174-9CAF-A39E7C48909C}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.All|Win32.ActiveCfg = Release|Win32
+                {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.All|Win32.Build.0 = Release|Win32
+                {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {692F6330-4D87-4C82-81DF-40DB5892636E}.All|Win32.ActiveCfg = Release|Win32
+                {692F6330-4D87-4C82-81DF-40DB5892636E}.All|Win32.Build.0 = Release|Win32
+                {692F6330-4D87-4C82-81DF-40DB5892636E}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {692F6330-4D87-4C82-81DF-40DB5892636E}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {692F6330-4D87-4C82-81DF-40DB5892636E}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {692F6330-4D87-4C82-81DF-40DB5892636E}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {D3EC0AFF-76FC-4210-A825-9A17410660A3}.All|Win32.ActiveCfg = Release|Win32
+                {D3EC0AFF-76FC-4210-A825-9A17410660A3}.All|Win32.Build.0 = Release|Win32
+                {D3EC0AFF-76FC-4210-A825-9A17410660A3}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {D3EC0AFF-76FC-4210-A825-9A17410660A3}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.All|Win32.ActiveCfg = Release|Win32
+                {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.All|Win32.Build.0 = Release|Win32
+                {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {FFAA4C52-3A53-4F99-90C1-D59D1F0427F3}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.All|Win32.ActiveCfg = Release|Win32
+                {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.All|Win32.Build.0 = Release|Win32
+                {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {30A5B29C-983E-4580-9FD0-D647CCDCC7EB}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {1C453396-D912-4213-89FD-9B489162B7B5}.All|Win32.ActiveCfg = Release|Win32
+                {1C453396-D912-4213-89FD-9B489162B7B5}.All|Win32.Build.0 = Release|Win32
+                {1C453396-D912-4213-89FD-9B489162B7B5}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {1C453396-D912-4213-89FD-9B489162B7B5}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {1C453396-D912-4213-89FD-9B489162B7B5}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {1C453396-D912-4213-89FD-9B489162B7B5}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {1C453396-D912-4213-89FD-9B489162B7B5}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {1C453396-D912-4213-89FD-9B489162B7B5}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.All|Win32.ActiveCfg = Release|Win32
+                {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.All|Win32.Build.0 = Release|Win32
+                {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {CBEC7225-0C21-4DA8-978E-1F158F8AD950}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.All|Win32.ActiveCfg = Release|Win32
+                {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.All|Win32.Build.0 = Release|Win32
+                {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {B69247FA-ECD6-40ED-8E44-5CA6C3BAF9A4}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {C24FB505-05D7-4319-8485-7540B44C8603}.All|Win32.ActiveCfg = Release|Win32
+                {C24FB505-05D7-4319-8485-7540B44C8603}.All|Win32.Build.0 = Release|Win32
+                {C24FB505-05D7-4319-8485-7540B44C8603}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {C24FB505-05D7-4319-8485-7540B44C8603}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {C24FB505-05D7-4319-8485-7540B44C8603}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {C24FB505-05D7-4319-8485-7540B44C8603}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {C24FB505-05D7-4319-8485-7540B44C8603}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {C24FB505-05D7-4319-8485-7540B44C8603}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {C24FB505-05D7-4319-8485-7540B44C8603}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {B5881A85-FE70-4F64-8607-2CAAE52669C6}.All|Win32.ActiveCfg = Release|Win32
+                {B5881A85-FE70-4F64-8607-2CAAE52669C6}.All|Win32.Build.0 = Release|Win32
+                {B5881A85-FE70-4F64-8607-2CAAE52669C6}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {B5881A85-FE70-4F64-8607-2CAAE52669C6}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {05515420-16DE-4E63-BE73-85BE85BA5142}.All|Win32.ActiveCfg = Release|Win32
+                {05515420-16DE-4E63-BE73-85BE85BA5142}.All|Win32.Build.0 = Release|Win32
+                {05515420-16DE-4E63-BE73-85BE85BA5142}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {05515420-16DE-4E63-BE73-85BE85BA5142}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {05515420-16DE-4E63-BE73-85BE85BA5142}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {05515420-16DE-4E63-BE73-85BE85BA5142}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {1906D736-08BD-4EE1-924F-B536249B9A54}.All|Win32.ActiveCfg = Release DLL|Win32
+                {1906D736-08BD-4EE1-924F-B536249B9A54}.All|Win32.Build.0 = Release DLL|Win32
+                {1906D736-08BD-4EE1-924F-B536249B9A54}.All|x64.ActiveCfg = Release DLL|Win32
</ins><span class="cx">                 {1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {1906D736-08BD-4EE1-924F-B536249B9A54}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {1906D736-08BD-4EE1-924F-B536249B9A54}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {1906D736-08BD-4EE1-924F-B536249B9A54}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {1906D736-08BD-4EE1-924F-B536249B9A54}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {EEF031CB-FED8-451E-A471-91EC8D4F6750}.All|Win32.ActiveCfg = Release Dll|Win32
+                {EEF031CB-FED8-451E-A471-91EC8D4F6750}.All|Win32.Build.0 = Release Dll|Win32
+                {EEF031CB-FED8-451E-A471-91EC8D4F6750}.All|x64.ActiveCfg = Release Dll|Win32
</ins><span class="cx">                 {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {EEF031CB-FED8-451E-A471-91EC8D4F6750}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.All|Win32.ActiveCfg = Release DLL|Win32
+                {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.All|Win32.Build.0 = Release DLL|Win32
+                {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.All|x64.ActiveCfg = Release DLL|Win32
</ins><span class="cx">                 {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {6EDFEFD5-3596-4FA9-8EBA-B331547B35A3}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {8D04B550-D240-4A44-8A18-35DA3F7038D9}.All|Win32.ActiveCfg = Release DLL|Win32
+                {8D04B550-D240-4A44-8A18-35DA3F7038D9}.All|Win32.Build.0 = Release DLL|Win32
+                {8D04B550-D240-4A44-8A18-35DA3F7038D9}.All|x64.ActiveCfg = Release DLL|Win32
</ins><span class="cx">                 {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {8D04B550-D240-4A44-8A18-35DA3F7038D9}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {1CED5987-A529-46DC-B30F-870D85FF9C94}.All|Win32.ActiveCfg = Release|Win32
+                {1CED5987-A529-46DC-B30F-870D85FF9C94}.All|Win32.Build.0 = Release|Win32
+                {1CED5987-A529-46DC-B30F-870D85FF9C94}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {1CED5987-A529-46DC-B30F-870D85FF9C94}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.All|Win32.ActiveCfg = Release|Win32
+                {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.All|Win32.Build.0 = Release|Win32
+                {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {F057DA7F-79E5-4B00-845C-EF446EF055E3}.All|Win32.ActiveCfg = Release|Win32
+                {F057DA7F-79E5-4B00-845C-EF446EF055E3}.All|Win32.Build.0 = Release|Win32
+                {F057DA7F-79E5-4B00-845C-EF446EF055E3}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {F057DA7F-79E5-4B00-845C-EF446EF055E3}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {E727E8F6-935D-46FE-8B0E-37834748A0E3}.All|Win32.ActiveCfg = Release|Win32
+                {E727E8F6-935D-46FE-8B0E-37834748A0E3}.All|Win32.Build.0 = Release|Win32
+                {E727E8F6-935D-46FE-8B0E-37834748A0E3}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {E727E8F6-935D-46FE-8B0E-37834748A0E3}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {5927104D-C14C-4AC8-925C-4AB681762E75}.All|Win32.ActiveCfg = Release|Win32
+                {5927104D-C14C-4AC8-925C-4AB681762E75}.All|Win32.Build.0 = Release|Win32
+                {5927104D-C14C-4AC8-925C-4AB681762E75}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {5927104D-C14C-4AC8-925C-4AB681762E75}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {5927104D-C14C-4AC8-925C-4AB681762E75}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {5927104D-C14C-4AC8-925C-4AB681762E75}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {5927104D-C14C-4AC8-925C-4AB681762E75}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {5927104D-C14C-4AC8-925C-4AB681762E75}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {5927104D-C14C-4AC8-925C-4AB681762E75}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.All|Win32.ActiveCfg = Release|Win32
+                {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.All|Win32.Build.0 = Release|Win32
+                {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {0D826AF5-0506-4C50-BB8B-7DB019AC21AE}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {49C34584-B6DA-448F-83CF-27584DC9FC90}.All|Win32.ActiveCfg = Release|Win32
+                {49C34584-B6DA-448F-83CF-27584DC9FC90}.All|Win32.Build.0 = Release|Win32
+                {49C34584-B6DA-448F-83CF-27584DC9FC90}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {49C34584-B6DA-448F-83CF-27584DC9FC90}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {49C34584-B6DA-448F-83CF-27584DC9FC90}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {49C34584-B6DA-448F-83CF-27584DC9FC90}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {49C34584-B6DA-448F-83CF-27584DC9FC90}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {49C34584-B6DA-448F-83CF-27584DC9FC90}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {49C34584-B6DA-448F-83CF-27584DC9FC90}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {3D0370CA-BED2-4657-A475-32375CBCB6E4}.All|Win32.ActiveCfg = Release|Win32
+                {3D0370CA-BED2-4657-A475-32375CBCB6E4}.All|Win32.Build.0 = Release|Win32
+                {3D0370CA-BED2-4657-A475-32375CBCB6E4}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {3D0370CA-BED2-4657-A475-32375CBCB6E4}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {87EE9DA4-DE1E-4448-8324-183C98DCA588}.All|Win32.ActiveCfg = Debug|Win32
+                {87EE9DA4-DE1E-4448-8324-183C98DCA588}.All|Win32.Build.0 = Debug|Win32
+                {87EE9DA4-DE1E-4448-8324-183C98DCA588}.All|x64.ActiveCfg = Debug|Win32
</ins><span class="cx">                 {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {87EE9DA4-DE1E-4448-8324-183C98DCA588}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.All|Win32.ActiveCfg = Debug|Win32
+                {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.All|Win32.Build.0 = Debug|Win32
+                {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.All|x64.ActiveCfg = Debug|Win32
</ins><span class="cx">                 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {155844C3-EC5F-407F-97A4-A2DDADED9B2F}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {204FA0DE-305D-4414-AE2E-F195A23F390D}.All|Win32.ActiveCfg = Debug|Win32
+                {204FA0DE-305D-4414-AE2E-F195A23F390D}.All|Win32.Build.0 = Debug|Win32
+                {204FA0DE-305D-4414-AE2E-F195A23F390D}.All|x64.ActiveCfg = Debug|Win32
</ins><span class="cx">                 {204FA0DE-305D-4414-AE2E-F195A23F390D}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {204FA0DE-305D-4414-AE2E-F195A23F390D}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {204FA0DE-305D-4414-AE2E-F195A23F390D}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {204FA0DE-305D-4414-AE2E-F195A23F390D}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {0DF3ABD0-DDC0-4265-B778-07C66780979B}.All|Win32.ActiveCfg = Release|Win32
+                {0DF3ABD0-DDC0-4265-B778-07C66780979B}.All|Win32.Build.0 = Release|Win32
+                {0DF3ABD0-DDC0-4265-B778-07C66780979B}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {0DF3ABD0-DDC0-4265-B778-07C66780979B}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.All|Win32.ActiveCfg = Release|Win32
+                {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.All|Win32.Build.0 = Release|Win32
+                {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {70A49BC2-7500-41D0-B75D-EDCC5BE987A0}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.All|Win32.ActiveCfg = Release|Win32
+                {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.All|Win32.Build.0 = Release|Win32
+                {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.All|Win32.ActiveCfg = Release DLL|Win32
+                {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.All|Win32.Build.0 = Release DLL|Win32
+                {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.All|x64.ActiveCfg = Release DLL|Win32
</ins><span class="cx">                 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.ActiveCfg = Debug DLL|Win32
</span><span class="cx">                 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.Build.0 = Debug DLL|Win32
</span><span class="cx">                 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|x64.ActiveCfg = Debug DLL|Win32
</span><span class="cx">                 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Win32.ActiveCfg = Release DLL|Win32
</span><span class="cx">                 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Win32.Build.0 = Release DLL|Win32
</span><span class="cx">                 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.All|Win32.ActiveCfg = Release Passthrough|Win32
+                {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.All|Win32.Build.0 = Release Passthrough|Win32
+                {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.All|x64.ActiveCfg = Release Passthrough|Win32
</ins><span class="cx">                 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32
</span><span class="cx">                 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Win32.Build.0 = Debug Passthrough|Win32
</span><span class="cx">                 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Win32.ActiveCfg = Release Passthrough|Win32
</span><span class="cx">                 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|Win32.Build.0 = Release Passthrough|Win32
</span><span class="cx">                 {FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.All|Win32.ActiveCfg = Release|Win32
+                {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.All|Win32.Build.0 = Release|Win32
+                {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {9254C4B0-6F60-42B6-BB3A-36D63FC001C7}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.All|Win32.ActiveCfg = Release|Win32
+                {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.All|Win32.Build.0 = Release|Win32
+                {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {ACFFF684-4D19-4D48-AF12-88EA1D778BDF}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {8F992C49-6C51-412F-B2A3-34EAB708EB65}.All|Win32.ActiveCfg = Release|Win32
+                {8F992C49-6C51-412F-B2A3-34EAB708EB65}.All|Win32.Build.0 = Release|Win32
+                {8F992C49-6C51-412F-B2A3-34EAB708EB65}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {8F992C49-6C51-412F-B2A3-34EAB708EB65}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.All|Win32.ActiveCfg = Release|Win32
+                {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.All|Win32.Build.0 = Release|Win32
+                {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {4043FC6A-9A30-4577-8AD5-9B233C9575D8}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.All|Win32.ActiveCfg = Release|Win32
+                {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.All|Win32.Build.0 = Release|Win32
+                {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {71A967D5-0E99-4CEF-A587-98836EE6F2EF}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.All|Win32.ActiveCfg = Release|Win32
+                {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.All|Win32.Build.0 = Release|Win32
+                {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {0A6B5EA5-6E9B-4A51-931F-ED25AA87B4DF}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.All|Win32.ActiveCfg = Release|Win32
+                {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.All|Win32.Build.0 = Release|Win32
+                {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {AB91A099-7690-4ECF-8994-E458F4EA1ED4}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {988CACF7-3FCB-4992-BE69-77872AE67DC8}.All|Win32.ActiveCfg = Release|Win32
+                {988CACF7-3FCB-4992-BE69-77872AE67DC8}.All|Win32.Build.0 = Release|Win32
+                {988CACF7-3FCB-4992-BE69-77872AE67DC8}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {988CACF7-3FCB-4992-BE69-77872AE67DC8}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {0A18A071-125E-442F-AFF7-A3F68ABECF99}.All|Win32.ActiveCfg = Release DirectSound|Win32
+                {0A18A071-125E-442F-AFF7-A3F68ABECF99}.All|Win32.Build.0 = Release DirectSound|Win32
+                {0A18A071-125E-442F-AFF7-A3F68ABECF99}.All|x64.ActiveCfg = Release DirectSound|Win32
</ins><span class="cx">                 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.All|Win32.ActiveCfg = Release|Win32
+                {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.All|Win32.Build.0 = Release|Win32
+                {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {08DAD348-9E0A-4A2E-97F1-F1E7E24A7836}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {8DEB383C-4091-4F42-A56F-C9E46D552D79}.All|Win32.ActiveCfg = Release Passthrough|Win32
+                {8DEB383C-4091-4F42-A56F-C9E46D552D79}.All|Win32.Build.0 = Release Passthrough|Win32
+                {8DEB383C-4091-4F42-A56F-C9E46D552D79}.All|x64.ActiveCfg = Release Passthrough|Win32
</ins><span class="cx">                 {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32
</span><span class="cx">                 {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|Win32.Build.0 = Debug Passthrough|Win32
</span><span class="cx">                 {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|Win32.ActiveCfg = Release Passthrough|Win32
</span><span class="cx">                 {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|Win32.Build.0 = Release Passthrough|Win32
</span><span class="cx">                 {8DEB383C-4091-4F42-A56F-C9E46D552D79}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {2C3C2423-234B-4772-8899-D3B137E5CA35}.All|Win32.ActiveCfg = Release|Win32
+                {2C3C2423-234B-4772-8899-D3B137E5CA35}.All|Win32.Build.0 = Release|Win32
+                {2C3C2423-234B-4772-8899-D3B137E5CA35}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {2C3C2423-234B-4772-8899-D3B137E5CA35}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {2C3C2423-234B-4772-8899-D3B137E5CA35}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {3850D93A-5F24-4922-BC1C-74D08C37C256}.All|Win32.ActiveCfg = Release|Win32
+                {3850D93A-5F24-4922-BC1C-74D08C37C256}.All|Win32.Build.0 = Release|Win32
+                {3850D93A-5F24-4922-BC1C-74D08C37C256}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {3850D93A-5F24-4922-BC1C-74D08C37C256}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {3850D93A-5F24-4922-BC1C-74D08C37C256}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.All|Win32.ActiveCfg = Release|Win32
+                {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.All|Win32.Build.0 = Release|Win32
+                {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {2CA40887-1622-46A1-A7F9-17FD7E7E545B}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {028C7278-05D7-4E18-82FE-BE231B844F41}.All|Win32.ActiveCfg = Release|Win32
+                {028C7278-05D7-4E18-82FE-BE231B844F41}.All|Win32.Build.0 = Release|Win32
+                {028C7278-05D7-4E18-82FE-BE231B844F41}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {028C7278-05D7-4E18-82FE-BE231B844F41}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {028C7278-05D7-4E18-82FE-BE231B844F41}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {028C7278-05D7-4E18-82FE-BE231B844F41}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {028C7278-05D7-4E18-82FE-BE231B844F41}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {D7F1E3F2-A3F4-474C-8555-15122571AF52}.All|Win32.ActiveCfg = Release|Win32
+                {D7F1E3F2-A3F4-474C-8555-15122571AF52}.All|Win32.Build.0 = Release|Win32
+                {D7F1E3F2-A3F4-474C-8555-15122571AF52}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {D7F1E3F2-A3F4-474C-8555-15122571AF52}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.All|Win32.ActiveCfg = Release|Win32
+                {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.All|Win32.Build.0 = Release|Win32
+                {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {5BC072DB-3826-48EA-AF34-FE32AA01E83B}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.All|Win32.ActiveCfg = Release|Win32
+                {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.All|Win32.Build.0 = Release|Win32
+                {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {FA429E98-8B03-45E6-A096-A4BC5E821DE4}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {06E3A538-AB32-44F2-B477-755FF9CB5D37}.All|Win32.ActiveCfg = Release|Win32
+                {06E3A538-AB32-44F2-B477-755FF9CB5D37}.All|Win32.Build.0 = Release|Win32
+                {06E3A538-AB32-44F2-B477-755FF9CB5D37}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {06E3A538-AB32-44F2-B477-755FF9CB5D37}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.All|Win32.ActiveCfg = Release|Win32
+                {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.All|Win32.Build.0 = Release|Win32
+                {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.All|Win32.ActiveCfg = Release|Win32
+                {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.All|Win32.Build.0 = Release|Win32
+                {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {A4B122CF-5196-476B-8C0E-D8BD59AC3C14}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.All|Win32.ActiveCfg = Release|Win32
+                {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.All|Win32.Build.0 = Release|Win32
+                {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {F6A33240-8F29-48BD-98F0-826995911799}.All|Win32.ActiveCfg = Release|Win32
+                {F6A33240-8F29-48BD-98F0-826995911799}.All|Win32.Build.0 = Release|Win32
+                {F6A33240-8F29-48BD-98F0-826995911799}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {F6A33240-8F29-48BD-98F0-826995911799}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {F6A33240-8F29-48BD-98F0-826995911799}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {F6A33240-8F29-48BD-98F0-826995911799}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {F6A33240-8F29-48BD-98F0-826995911799}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {F6A33240-8F29-48BD-98F0-826995911799}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {F6A33240-8F29-48BD-98F0-826995911799}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {65A6273D-FCAB-4C55-B09E-65100141A5D4}.All|Win32.ActiveCfg = Release|Win32
+                {65A6273D-FCAB-4C55-B09E-65100141A5D4}.All|Win32.Build.0 = Release|Win32
+                {65A6273D-FCAB-4C55-B09E-65100141A5D4}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {65A6273D-FCAB-4C55-B09E-65100141A5D4}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.All|Win32.ActiveCfg = Release|Win32
+                {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.All|Win32.Build.0 = Release|Win32
+                {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.All|Win32.ActiveCfg = Release|Win32
+                {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.All|Win32.Build.0 = Release|Win32
+                {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {D0BCAC02-D94B-46B8-9B49-CDDCC2BD7909}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.All|Win32.ActiveCfg = Release|Win32
+                {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.All|Win32.Build.0 = Release|Win32
+                {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {44D7DEAF-FDA5-495E-8B9D-1439E4F4C21E}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {1A789A98-71EF-4EBD-8007-FC9ED585D32E}.All|Win32.ActiveCfg = Release|Win32
+                {1A789A98-71EF-4EBD-8007-FC9ED585D32E}.All|Win32.Build.0 = Release|Win32
+                {1A789A98-71EF-4EBD-8007-FC9ED585D32E}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {1A789A98-71EF-4EBD-8007-FC9ED585D32E}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {1A789A98-71EF-4EBD-8007-FC9ED585D32E}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {1A789A98-71EF-4EBD-8007-FC9ED585D32E}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {1A789A98-71EF-4EBD-8007-FC9ED585D32E}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {1A789A98-71EF-4EBD-8007-FC9ED585D32E}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {1A789A98-71EF-4EBD-8007-FC9ED585D32E}.Release|x64.ActiveCfg = Release|Win32
</span><del>-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|Win32.ActiveCfg = Debug|Win32
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|Win32.Build.0 = Debug|Win32
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|x64.ActiveCfg = Debug|Win32
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|Win32.ActiveCfg = Release|Win32
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|Win32.Build.0 = Release|Win32
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|x64.ActiveCfg = Release|Win32
</del><ins>+                {9EED03C8-8315-4214-8D13-8FF5FA46D93C}.All|Win32.ActiveCfg = Release|Win32
+                {9EED03C8-8315-4214-8D13-8FF5FA46D93C}.All|Win32.Build.0 = Release|Win32
+                {9EED03C8-8315-4214-8D13-8FF5FA46D93C}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {9EED03C8-8315-4214-8D13-8FF5FA46D93C}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {9EED03C8-8315-4214-8D13-8FF5FA46D93C}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {9EED03C8-8315-4214-8D13-8FF5FA46D93C}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {9EED03C8-8315-4214-8D13-8FF5FA46D93C}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {9EED03C8-8315-4214-8D13-8FF5FA46D93C}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {9EED03C8-8315-4214-8D13-8FF5FA46D93C}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {2CCED6DC-26FF-40F2-9585-E9E1049A4599}.All|Win32.ActiveCfg = Release|Win32
+                {2CCED6DC-26FF-40F2-9585-E9E1049A4599}.All|Win32.Build.0 = Release|Win32
+                {2CCED6DC-26FF-40F2-9585-E9E1049A4599}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {2CCED6DC-26FF-40F2-9585-E9E1049A4599}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {2CCED6DC-26FF-40F2-9585-E9E1049A4599}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {2CCED6DC-26FF-40F2-9585-E9E1049A4599}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {2CCED6DC-26FF-40F2-9585-E9E1049A4599}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {2CCED6DC-26FF-40F2-9585-E9E1049A4599}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {2CCED6DC-26FF-40F2-9585-E9E1049A4599}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {4AE157CF-F2DD-4B5D-A1EE-4AC173B4F9AC}.All|Win32.ActiveCfg = Release|Win32
+                {4AE157CF-F2DD-4B5D-A1EE-4AC173B4F9AC}.All|Win32.Build.0 = Release|Win32
+                {4AE157CF-F2DD-4B5D-A1EE-4AC173B4F9AC}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {4AE157CF-F2DD-4B5D-A1EE-4AC173B4F9AC}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {4AE157CF-F2DD-4B5D-A1EE-4AC173B4F9AC}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {4AE157CF-F2DD-4B5D-A1EE-4AC173B4F9AC}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {4AE157CF-F2DD-4B5D-A1EE-4AC173B4F9AC}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {4AE157CF-F2DD-4B5D-A1EE-4AC173B4F9AC}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {4AE157CF-F2DD-4B5D-A1EE-4AC173B4F9AC}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.All|Win32.ActiveCfg = Release|Win32
+                {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.All|Win32.Build.0 = Release|Win32
+                {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {7B077E7F-1BE7-4291-AB86-55E527B25CAC}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.All|Win32.ActiveCfg = Release|Win32
+                {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.All|Win32.Build.0 = Release|Win32
+                {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {B535402E-38D2-4D54-8360-423ACBD17192}.All|Win32.ActiveCfg = Release|Win32
+                {B535402E-38D2-4D54-8360-423ACBD17192}.All|Win32.Build.0 = Release|Win32
+                {B535402E-38D2-4D54-8360-423ACBD17192}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {B535402E-38D2-4D54-8360-423ACBD17192}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {B535402E-38D2-4D54-8360-423ACBD17192}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {B535402E-38D2-4D54-8360-423ACBD17192}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {B535402E-38D2-4D54-8360-423ACBD17192}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {B535402E-38D2-4D54-8360-423ACBD17192}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {B535402E-38D2-4D54-8360-423ACBD17192}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.All|Win32.ActiveCfg = Release|Win32
+                {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.All|Win32.Build.0 = Release|Win32
+                {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {0D108721-EAE8-4BAF-8102-D8960EC93647}.All|Win32.ActiveCfg = Debug|Win32
+                {0D108721-EAE8-4BAF-8102-D8960EC93647}.All|Win32.Build.0 = Debug|Win32
+                {0D108721-EAE8-4BAF-8102-D8960EC93647}.All|x64.ActiveCfg = Debug|Win32
</ins><span class="cx">                 {0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {0D108721-EAE8-4BAF-8102-D8960EC93647}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {0D108721-EAE8-4BAF-8102-D8960EC93647}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {426B1369-FDB7-4B18-A7EF-9C6A9097A130}.All|Win32.ActiveCfg = Release|Win32
+                {426B1369-FDB7-4B18-A7EF-9C6A9097A130}.All|Win32.Build.0 = Release|Win32
+                {426B1369-FDB7-4B18-A7EF-9C6A9097A130}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {426B1369-FDB7-4B18-A7EF-9C6A9097A130}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {426B1369-FDB7-4B18-A7EF-9C6A9097A130}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {426B1369-FDB7-4B18-A7EF-9C6A9097A130}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {426B1369-FDB7-4B18-A7EF-9C6A9097A130}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {426B1369-FDB7-4B18-A7EF-9C6A9097A130}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {426B1369-FDB7-4B18-A7EF-9C6A9097A130}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {E972C52F-9E85-4D65-B19C-031E511E9DB4}.All|Win32.ActiveCfg = Release_Dynamic_SSE|Win32
+                {E972C52F-9E85-4D65-B19C-031E511E9DB4}.All|Win32.Build.0 = Release_Dynamic_SSE|Win32
+                {E972C52F-9E85-4D65-B19C-031E511E9DB4}.All|x64.ActiveCfg = Release_Dynamic_SSE|Win32
</ins><span class="cx">                 {E972C52F-9E85-4D65-B19C-031E511E9DB4}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {E972C52F-9E85-4D65-B19C-031E511E9DB4}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {E972C52F-9E85-4D65-B19C-031E511E9DB4}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {E972C52F-9E85-4D65-B19C-031E511E9DB4}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {E972C52F-9E85-4D65-B19C-031E511E9DB4}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {E972C52F-9E85-4D65-B19C-031E511E9DB4}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {E42FDC95-7243-4219-9EA4-ACCE4AB97197}.All|Win32.ActiveCfg = Release_Dynamic_SSE|Win32
+                {E42FDC95-7243-4219-9EA4-ACCE4AB97197}.All|Win32.Build.0 = Release_Dynamic_SSE|Win32
+                {E42FDC95-7243-4219-9EA4-ACCE4AB97197}.All|x64.ActiveCfg = Release_Dynamic_SSE|Win32
</ins><span class="cx">                 {E42FDC95-7243-4219-9EA4-ACCE4AB97197}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {E42FDC95-7243-4219-9EA4-ACCE4AB97197}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {E42FDC95-7243-4219-9EA4-ACCE4AB97197}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {E42FDC95-7243-4219-9EA4-ACCE4AB97197}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {E42FDC95-7243-4219-9EA4-ACCE4AB97197}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {E42FDC95-7243-4219-9EA4-ACCE4AB97197}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {7C43DBD8-6893-4CD2-B7C0-D2E51F8B1FD3}.All|Win32.ActiveCfg = Release|Win32
+                {7C43DBD8-6893-4CD2-B7C0-D2E51F8B1FD3}.All|Win32.Build.0 = Release|Win32
+                {7C43DBD8-6893-4CD2-B7C0-D2E51F8B1FD3}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {7C43DBD8-6893-4CD2-B7C0-D2E51F8B1FD3}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {7C43DBD8-6893-4CD2-B7C0-D2E51F8B1FD3}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {7C43DBD8-6893-4CD2-B7C0-D2E51F8B1FD3}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {7C43DBD8-6893-4CD2-B7C0-D2E51F8B1FD3}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {7C43DBD8-6893-4CD2-B7C0-D2E51F8B1FD3}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {7C43DBD8-6893-4CD2-B7C0-D2E51F8B1FD3}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {D0B36172-CD76-454A-9B89-990025266C2A}.All|Win32.ActiveCfg = Release|Win32
+                {D0B36172-CD76-454A-9B89-990025266C2A}.All|Win32.Build.0 = Release|Win32
+                {D0B36172-CD76-454A-9B89-990025266C2A}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {D0B36172-CD76-454A-9B89-990025266C2A}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {D0B36172-CD76-454A-9B89-990025266C2A}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {D0B36172-CD76-454A-9B89-990025266C2A}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {D0B36172-CD76-454A-9B89-990025266C2A}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {D0B36172-CD76-454A-9B89-990025266C2A}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {D0B36172-CD76-454A-9B89-990025266C2A}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {AEE5D1F8-3386-4CB2-A336-0125C4C7EAEE}.All|Win32.ActiveCfg = Release|Win32
+                {AEE5D1F8-3386-4CB2-A336-0125C4C7EAEE}.All|Win32.Build.0 = Release|Win32
+                {AEE5D1F8-3386-4CB2-A336-0125C4C7EAEE}.All|x64.ActiveCfg = Release|Win32
</ins><span class="cx">                 {AEE5D1F8-3386-4CB2-A336-0125C4C7EAEE}.Debug|Win32.ActiveCfg = Debug|Win32
</span><span class="cx">                 {AEE5D1F8-3386-4CB2-A336-0125C4C7EAEE}.Debug|Win32.Build.0 = Debug|Win32
</span><span class="cx">                 {AEE5D1F8-3386-4CB2-A336-0125C4C7EAEE}.Debug|x64.ActiveCfg = Debug|Win32
</span><span class="cx">                 {AEE5D1F8-3386-4CB2-A336-0125C4C7EAEE}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {AEE5D1F8-3386-4CB2-A336-0125C4C7EAEE}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {AEE5D1F8-3386-4CB2-A336-0125C4C7EAEE}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.All|Win32.ActiveCfg = Release|Win32
+                {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.All|Win32.Build.0 = Release|Win32
+                {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.All|x64.ActiveCfg = Release|Win32
+                {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|Win32.ActiveCfg = Debug|Win32
+                {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|Win32.Build.0 = Debug|Win32
+                {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|x64.ActiveCfg = Debug|Win32
+                {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|Win32.ActiveCfg = Release|Win32
+                {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|Win32.Build.0 = Release|Win32
+                {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|x64.ActiveCfg = Release|Win32
+                {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.All|Win32.ActiveCfg = Release|Win32
+                {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.All|Win32.Build.0 = Release|Win32
+                {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.All|x64.ActiveCfg = Release|Win32
+                {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|Win32.ActiveCfg = Debug|Win32
+                {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|Win32.Build.0 = Debug|Win32
+                {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|x64.ActiveCfg = Debug|Win32
+                {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|Win32.ActiveCfg = Release|Win32
+                {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|Win32.Build.0 = Release|Win32
+                {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|x64.ActiveCfg = Release|Win32
+                {DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|Win32.ActiveCfg = All|Win32
+                {DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|Win32.Build.0 = All|Win32
+                {DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|x64.ActiveCfg = All|Win32
+                {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|Win32.ActiveCfg = All|Win32
+                {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|Win32.Build.0 = All|Win32
+                {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|x64.ActiveCfg = All|Win32
+                {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Release|Win32.ActiveCfg = All|Win32
+                {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Release|Win32.Build.0 = All|Win32
+                {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Release|x64.ActiveCfg = All|Win32
+                {329A6FA0-0FCC-4435-A950-E670AEFA9838}.All|Win32.ActiveCfg = All|Win32
+                {329A6FA0-0FCC-4435-A950-E670AEFA9838}.All|Win32.Build.0 = All|Win32
+                {329A6FA0-0FCC-4435-A950-E670AEFA9838}.All|x64.ActiveCfg = All|Win32
+                {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|Win32.ActiveCfg = All|Win32
+                {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|Win32.Build.0 = All|Win32
+                {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|x64.ActiveCfg = All|Win32
+                {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Release|Win32.ActiveCfg = All|Win32
+                {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Release|Win32.Build.0 = All|Win32
+                {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Release|x64.ActiveCfg = All|Win32
</ins><span class="cx">         EndGlobalSection
</span><span class="cx">         GlobalSection(SolutionProperties) = preSolution
</span><span class="cx">                 HideSolutionNode = FALSE
</span><span class="lines">@@ -1410,7 +1722,6 @@
</span><span class="cx">                 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
</span><span class="cx">                 {4043FC6A-9A30-4577-8AD5-9B233C9575D8} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
</span><span class="cx">                 {0A18A071-125E-442F-AFF7-A3F68ABECF99} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
</span><del>-                {CF70F278-3364-4395-A2E1-23501C9B8AD2} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
</del><span class="cx">                 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
</span><span class="cx">                 {B535402E-38D2-4D54-8360-423ACBD17192} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
</span><span class="cx">                 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
</span><span class="lines">@@ -1419,6 +1730,10 @@
</span><span class="cx">                 {E42FDC95-7243-4219-9EA4-ACCE4AB97197} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
</span><span class="cx">                 {7C43DBD8-6893-4CD2-B7C0-D2E51F8B1FD3} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
</span><span class="cx">                 {D0B36172-CD76-454A-9B89-990025266C2A} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
</span><ins>+                {401A40CD-5DB4-4E34-AC68-FA99E9FAC014} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+                {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+                {DEE932AB-5911-4700-9EEB-8C7090A0A330} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
+                {329A6FA0-0FCC-4435-A950-E670AEFA9838} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
</ins><span class="cx">                 {1AD3F51E-BBB6-4090-BA39-9DFAB1EF1F5F} = {0C808854-54D1-4230-BFF5-77B5FD905000}
</span><span class="cx">                 {ACFFF684-4D19-4D48-AF12-88EA1D778BDF} = {0C808854-54D1-4230-BFF5-77B5FD905000}
</span><span class="cx">                 {8F992C49-6C51-412F-B2A3-34EAB708EB65} = {0C808854-54D1-4230-BFF5-77B5FD905000}
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorFreeswitch2008expresssln"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/Freeswitch.2008.express.sln (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/Freeswitch.2008.express.sln        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/Freeswitch.2008.express.sln        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -384,12 +384,11 @@
</span><span class="cx">                 {89385C74-5860-4174-9CAF-A39E7C48909C} = {89385C74-5860-4174-9CAF-A39E7C48909C}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><del>-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvoipcodecs", "libs\voipcodecs\libvoipcodecs.2008.vcproj", "{CF70F278-3364-4395-A2E1-23501C9B8AD2}"
-EndProject
</del><span class="cx"> Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_voipcodecs", "src\mod\codecs\mod_voipcodecs\mod_voipcodecs.2008.vcproj", "{42B6C2E3-7D5F-4204-A1F6-C0376B86C315}"
</span><span class="cx">         ProjectSection(ProjectDependencies) = postProject
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><del>-                {CF70F278-3364-4395-A2E1-23501C9B8AD2} = {CF70F278-3364-4395-A2E1-23501C9B8AD2}
</del><ins>+                {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}
+                {401A40CD-5DB4-4E34-AC68-FA99E9FAC014} = {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}
</ins><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><span class="cx"> Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_fsv", "src\mod\applications\mod_fsv\mod_fsv.2008.vcproj", "{E3246D17-E29B-4AB5-962A-C69B0C5837BB}"
</span><span class="lines">@@ -636,6 +635,11 @@
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><ins>+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_valet_parking", "src\mod\applications\mod_valet_parking\mod_valet_parking.2008.vcproj", "{432DB165-1EB2-4781-A9C0-71E62610B20A}"
+        ProjectSection(ProjectDependencies) = postProject
+                {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+        EndProjectSection
+EndProject
</ins><span class="cx"> Global
</span><span class="cx">         GlobalSection(SolutionConfigurationPlatforms) = preSolution
</span><span class="cx">                 All|Win32 = All|Win32
</span><span class="lines">@@ -1441,17 +1445,6 @@
</span><span class="cx">                 {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|x64.ActiveCfg = Release|x64
</span><span class="cx">                 {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|x64.Build.0 = Release|x64
</span><del>-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.All|Win32.ActiveCfg = Release|x64
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.All|x64.ActiveCfg = Release|x64
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.All|x64.Build.0 = Release|x64
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|Win32.ActiveCfg = Debug|Win32
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|Win32.Build.0 = Debug|Win32
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|x64.ActiveCfg = Debug|Win32
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|x64.Build.0 = Debug|Win32
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|Win32.ActiveCfg = Release|Win32
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|Win32.Build.0 = Release|Win32
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|x64.ActiveCfg = Release|x64
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|x64.Build.0 = Release|x64
</del><span class="cx">                 {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.All|Win32.ActiveCfg = Release|x64
</span><span class="cx">                 {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.All|x64.ActiveCfg = Release|x64
</span><span class="cx">                 {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.All|x64.Build.0 = Release|x64
</span><span class="lines">@@ -2081,6 +2074,16 @@
</span><span class="cx">                 {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|Win32.ActiveCfg = Release|Win32
</span><span class="cx">                 {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}.Release|x64.ActiveCfg = Release|Win32
</span><ins>+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.All|Win32.ActiveCfg = Release|x64
+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.All|x64.ActiveCfg = Release|x64
+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.Debug|Win32.ActiveCfg = Debug|Win32
+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.Debug|Win32.Build.0 = Debug|Win32
+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.Debug|x64.ActiveCfg = Debug|x64
+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.Debug|x64.Build.0 = Debug|x64
+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.Release|Win32.ActiveCfg = Release|Win32
+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.Release|Win32.Build.0 = Release|Win32
+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.Release|x64.ActiveCfg = Release|x64
+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.Release|x64.Build.0 = Release|x64
</ins><span class="cx">         EndGlobalSection
</span><span class="cx">         GlobalSection(SolutionProperties) = preSolution
</span><span class="cx">                 HideSolutionNode = FALSE
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorFreeswitch2008sln"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/Freeswitch.2008.sln (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/Freeswitch.2008.sln        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/Freeswitch.2008.sln        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -757,12 +757,11 @@
</span><span class="cx">                 {89385C74-5860-4174-9CAF-A39E7C48909C} = {89385C74-5860-4174-9CAF-A39E7C48909C}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><del>-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvoipcodecs", "libs\voipcodecs\libvoipcodecs.2008.vcproj", "{CF70F278-3364-4395-A2E1-23501C9B8AD2}"
-EndProject
</del><span class="cx"> Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_voipcodecs", "src\mod\codecs\mod_voipcodecs\mod_voipcodecs.2008.vcproj", "{42B6C2E3-7D5F-4204-A1F6-C0376B86C315}"
</span><span class="cx">         ProjectSection(ProjectDependencies) = postProject
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><del>-                {CF70F278-3364-4395-A2E1-23501C9B8AD2} = {CF70F278-3364-4395-A2E1-23501C9B8AD2}
</del><ins>+                {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}
+                {401A40CD-5DB4-4E34-AC68-FA99E9FAC014} = {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}
</ins><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><span class="cx"> Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_fsv", "src\mod\applications\mod_fsv\mod_fsv.2008.vcproj", "{E3246D17-E29B-4AB5-962A-C69B0C5837BB}"
</span><span class="lines">@@ -1028,6 +1027,11 @@
</span><span class="cx">                 {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
</span><span class="cx">         EndProjectSection
</span><span class="cx"> EndProject
</span><ins>+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_valet_parking", "src\mod\applications\mod_valet_parking\mod_valet_parking.2008.vcproj", "{432DB165-1EB2-4781-A9C0-71E62610B20A}"
+        ProjectSection(ProjectDependencies) = postProject
+                {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}
+        EndProjectSection
+EndProject
</ins><span class="cx"> Global
</span><span class="cx">         GlobalSection(SolutionConfigurationPlatforms) = preSolution
</span><span class="cx">                 All|Win32 = All|Win32
</span><span class="lines">@@ -1832,17 +1836,6 @@
</span><span class="cx">                 {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|x64.ActiveCfg = Release|x64
</span><span class="cx">                 {6FF941AC-82C5-429F-AA4C-AD2FB9E5DA52}.Release|x64.Build.0 = Release|x64
</span><del>-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.All|Win32.ActiveCfg = Release|x64
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.All|x64.ActiveCfg = Release|x64
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.All|x64.Build.0 = Release|x64
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|Win32.ActiveCfg = Debug|Win32
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|Win32.Build.0 = Debug|Win32
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|x64.ActiveCfg = Debug|x64
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Debug|x64.Build.0 = Debug|x64
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|Win32.ActiveCfg = Release|Win32
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|Win32.Build.0 = Release|Win32
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|x64.ActiveCfg = Release|x64
-                {CF70F278-3364-4395-A2E1-23501C9B8AD2}.Release|x64.Build.0 = Release|x64
</del><span class="cx">                 {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.All|Win32.ActiveCfg = Release|x64
</span><span class="cx">                 {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.All|x64.ActiveCfg = Release|x64
</span><span class="cx">                 {42B6C2E3-7D5F-4204-A1F6-C0376B86C315}.All|x64.Build.0 = Release|x64
</span><span class="lines">@@ -2507,6 +2500,16 @@
</span><span class="cx">                 {0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.Release|Win32.Build.0 = Release|Win32
</span><span class="cx">                 {0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.Release|x64.ActiveCfg = Release|x64
</span><span class="cx">                 {0382E8FD-CFDC-41C0-8B03-792C7C84FC31}.Release|x64.Build.0 = Release|x64
</span><ins>+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.All|Win32.ActiveCfg = Release|x64
+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.All|x64.ActiveCfg = Release|x64
+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.Debug|Win32.ActiveCfg = Debug|Win32
+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.Debug|Win32.Build.0 = Debug|Win32
+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.Debug|x64.ActiveCfg = Debug|x64
+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.Debug|x64.Build.0 = Debug|x64
+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.Release|Win32.ActiveCfg = Release|Win32
+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.Release|Win32.Build.0 = Release|Win32
+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.Release|x64.ActiveCfg = Release|x64
+                {432DB165-1EB2-4781-A9C0-71E62610B20A}.Release|x64.Build.0 = Release|x64
</ins><span class="cx">         EndGlobalSection
</span><span class="cx">         GlobalSection(SolutionProperties) = preSolution
</span><span class="cx">                 HideSolutionNode = FALSE
</span><span class="lines">@@ -2545,6 +2548,7 @@
</span><span class="cx">                 {7877EFC8-4807-484B-B573-D7B7FD058FAA} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
</span><span class="cx">                 {11C9BC3D-45E9-46E3-BE84-B8CEE4685E39} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
</span><span class="cx">                 {3C977801-FE88-48F2-83D3-FA2EBFF6688E} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
</span><ins>+                {432DB165-1EB2-4781-A9C0-71E62610B20A} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
</ins><span class="cx">                 {07113B25-D3AF-4E04-BA77-4CD1171F022C} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}
</span><span class="cx">                 {A27CCA23-1541-4337-81A4-F0A6413078A0} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}
</span><span class="cx">                 {E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}
</span><span class="lines">@@ -2596,7 +2600,6 @@
</span><span class="cx">                 {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
</span><span class="cx">                 {4043FC6A-9A30-4577-8AD5-9B233C9575D8} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
</span><span class="cx">                 {0A18A071-125E-442F-AFF7-A3F68ABECF99} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
</span><del>-                {CF70F278-3364-4395-A2E1-23501C9B8AD2} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
</del><span class="cx">                 {D2396DD7-7D38-473A-ABB7-6F96D65AE1B9} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
</span><span class="cx">                 {CEE544A9-0303-44C2-8ECE-EFA7D7BCBBBA} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
</span><span class="cx">                 {0D108721-EAE8-4BAF-8102-D8960EC93647} = {EB910B0D-F27D-4B62-B67B-DE834C99AC5B}
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorMakefileam"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/Makefile.am (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/Makefile.am        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/Makefile.am        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -299,7 +299,17 @@
</span><span class="cx">          fi ; \
</span><span class="cx">         fi ;
</span><span class="cx">
</span><del>-update:
</del><ins>+is-svn:
+        @if [ ! -d .svn ] ; then \
+                echo ; echo ; \
+                echo "**************************************************************************************************" ; \
+                echo "You can not update a release tarball or without a svn working copy, please checkout fresh from svn" ; \
+                echo "**************************************************************************************************" ; \
+                echo ; echo ; \
+                exit 1; \
+        fi
+
+update: is-svn
</ins><span class="cx">         @if test -d .svn ; then \
</span><span class="cx">          test ! -f .version || rm -f .version ; \
</span><span class="cx">          echo Updating... ; \
</span><span class="lines">@@ -357,17 +367,17 @@
</span><span class="cx">
</span><span class="cx"> everything: install
</span><span class="cx">
</span><del>-up: clean
</del><ins>+up: is-svn clean
</ins><span class="cx">         svn update
</span><span class="cx">         $(MAKE) -j core
</span><span class="cx">         $(MAKE) -j modules
</span><span class="cx">         $(MAKE) install
</span><span class="cx">
</span><del>-sync:
</del><ins>+sync: is-svn
</ins><span class="cx">         svn update
</span><span class="cx">         $(MAKE) install
</span><span class="cx">
</span><del>-speedy-sync:
</del><ins>+speedy-sync: is-svn
</ins><span class="cx">         svn update
</span><span class="cx">         $(MAKE) -j install
</span><span class="cx">
</span><span class="lines">@@ -386,7 +396,7 @@
</span><span class="cx">         @echo reswigging all
</span><span class="cx">         sh ./build/swigall.sh
</span><span class="cx">
</span><del>-sure: update-clean all
</del><ins>+sure: current
</ins><span class="cx">
</span><span class="cx"> speedy-sure: update-clean
</span><span class="cx">         $(MAKE) -j core
</span><span class="lines">@@ -398,6 +408,13 @@
</span><span class="cx">         cd libs/speex && ./config.status --recheck
</span><span class="cx">         cd libs/speex && ./config.status
</span><span class="cx">
</span><ins>+tiff-reconf:
+        cd libs/tiff-3.8.2 && autoreconf -fi
+        cd libs/tiff-3.8.2 && sh ./configure.gnu
+        cd libs/spandsp && autoreconf -fi
+        cd libs/spandsp && sh ./configure.gnu
+        make mod_voipcodecs-clean
+
</ins><span class="cx"> python-reconf:
</span><span class="cx">         rm -f src/mod/languages/mod_python/Makefile
</span><span class="cx">         ./config.status
</span><span class="lines">@@ -424,14 +441,14 @@
</span><span class="cx">         cd libs/sofia-sip && $(MAKE) clean
</span><span class="cx">         cd libs/sofia-sip && ./configure --prefix=$(PREFIX) --with-pic --with-glib=no --disable-shared
</span><span class="cx">
</span><del>-current: update-clean
</del><ins>+current: is-svn update-clean
</ins><span class="cx">         svn update
</span><span class="cx">         $(MAKE) all
</span><span class="cx">         $(MAKE) install
</span><span class="cx">
</span><span class="cx"> installall: current
</span><span class="cx">
</span><del>-speedy-current: update-clean
</del><ins>+speedy-current: is-svn update-clean
</ins><span class="cx">         svn update
</span><span class="cx">         $(MAKE) speedy-sure
</span><span class="cx">         $(MAKE) install
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorbootstrapsh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/bootstrap.sh (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/bootstrap.sh        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/bootstrap.sh        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -3,11 +3,9 @@
</span><span class="cx">
</span><span class="cx"> BASEDIR=`pwd`;
</span><span class="cx"> LIBDIR=${BASEDIR}/libs;
</span><del>-SUBDIRS="ilbc curl iksemel voipcodecs \
- js js/nsprpub libdingaling libedit libsndfile pcre sofia-sip \
- speex sqlite srtp openzap spandsp libg722_1 portaudio unimrcp";
</del><ins>+SUBDIRS="ilbc curl iksemel js js/nsprpub libdingaling libedit libsndfile pcre sofia-sip \
+ speex sqlite srtp openzap spandsp libg722_1 portaudio unimrcp tiff-3.8.2";
</ins><span class="cx">
</span><del>-
</del><span class="cx"> if [ ! -f modules.conf ]; then
</span><span class="cx"> cp build/modules.conf.in modules.conf
</span><span class="cx"> fi
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorbuildmodulesconfin"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/build/modules.conf.in (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/build/modules.conf.in        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/build/modules.conf.in        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -10,6 +10,7 @@
</span><span class="cx"> #applications/mod_fax
</span><span class="cx"> #applications/mod_curl
</span><span class="cx"> applications/mod_voicemail
</span><ins>+#applications/mod_directory
</ins><span class="cx"> #applications/mod_lcr
</span><span class="cx"> applications/mod_limit
</span><span class="cx"> applications/mod_expr
</span><span class="lines">@@ -24,6 +25,7 @@
</span><span class="cx"> #applications/mod_memcache
</span><span class="cx"> #applications/mod_spy
</span><span class="cx"> applications/mod_cluechoo
</span><ins>+applications/mod_valet_parking
</ins><span class="cx"> codecs/mod_g723_1
</span><span class="cx"> codecs/mod_amr
</span><span class="cx"> #codecs/mod_amrwb
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconfautoload_configscidlookupconfxml"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/cidlookup.conf.xml (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/cidlookup.conf.xml        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/cidlookup.conf.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -3,6 +3,10 @@
</span><span class="cx"> <!-- comment out url to not setup a url based lookup -->
</span><span class="cx"> <param name="url" value="http://query.voipcnam.com/query.php?api_key=MYAPIKEY&number=${caller_id_number}"/>
</span><span class="cx">
</span><ins>+ <!-- comment out whitepages-apikey to not use whitepages.com, you must
+ get an API key from http://developer.whitepages.com/ -->
+ <param name="whitepages-apikey" value="MYAPIKEY"/>
+
</ins><span class="cx"> <!-- set to false to not cache (in memcache) results from the url query -->
</span><span class="cx"> <param name="cache" value="true"/>
</span><span class="cx"> <!-- expire is in seconds -->
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconfautoload_configsdirectoryconfxmlfromrev15313freeswitchtrunkconfautoload_configsdirectoryconfxml"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/directory.conf.xml (from rev 15313, freeswitch/trunk/conf/autoload_configs/directory.conf.xml) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/directory.conf.xml         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/directory.conf.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+<configuration name="directory.conf" description="Directory">
+ <settings>
+ </settings>
+ <profiles>
+ <profile name="default">
+ <param name="max-menu-attempts" value="3"/>
+ <param name="min-search-digits" value="3"/>
+ <param name="terminator-key" value="#"/>
+ <param name="digit-timeout" value="3000"/>
+ <param name="max-result" value="5"/>
+ <param name="next-key" value="6"/>
+ <param name="prev-key" value="4"/>
+ <param name="switch-order-key" value="*"/>
+ <param name="select-name-key" value="1"/>
+ <param name="new-search-key" value="3"/>
+ <param name="search-order" value="last_name"/>
+ </profile>
+ </profiles>
+</configuration>
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconfautoload_configsfifoconfxml"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/fifo.conf.xml (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/fifo.conf.xml        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/fifo.conf.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -1,4 +1,7 @@
</span><span class="cx"> <configuration name="fifo.conf" description="FIFO Configuration">
</span><ins>+ <settings>
+ <param name="delete-all-outbound-member-on-startup" value="false"/>
+ </settings>
</ins><span class="cx"> <fifos>
</span><span class="cx"> <fifo name="cool_fifo@$${domain}" importance="0">
</span><span class="cx"> <!--<member timeout="60" simo="1" lag="20">{member_wait=nowait}user/1005@$${domain}</member>-->
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconfautoload_configsmodulesconfxml"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/modules.conf.xml (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/modules.conf.xml        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/modules.conf.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -44,12 +44,14 @@
</span><span class="cx"> <load module="mod_expr"/>
</span><span class="cx"> <load module="mod_fifo"/>
</span><span class="cx"> <load module="mod_voicemail"/>
</span><ins>+ <!--<load module="mod_directory"/>-->
</ins><span class="cx"> <!--<load module="mod_fax"/>-->
</span><span class="cx"> <!--<load module="mod_lcr"/>-->
</span><span class="cx"> <load module="mod_limit"/>
</span><span class="cx"> <load module="mod_esf"/>
</span><span class="cx"> <load module="mod_fsv"/>
</span><span class="cx"> <load module="mod_cluechoo"/>
</span><ins>+ <load module="mod_valet_parking"/>
</ins><span class="cx"> <!--<load module="mod_spy"/>-->
</span><span class="cx">
</span><span class="cx"> <!-- SNOM Module -->
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconfautoload_configssyslogconfxml"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/syslog.conf.xml (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/syslog.conf.xml        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/syslog.conf.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -9,6 +9,7 @@
</span><span class="cx"> <!-- info - informational message -->
</span><span class="cx"> <!-- debug - debug-level message -->
</span><span class="cx"> <settings>
</span><ins>+ <param name="facility" value="user"/>
</ins><span class="cx"> <param name="ident" value="freeswitch"/>
</span><span class="cx"> <param name="loglevel" value="warning"/>
</span><span class="cx"> </settings>
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconfautoload_configsxml_curlconfxml"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/xml_curl.conf.xml (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/xml_curl.conf.xml        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/autoload_configs/xml_curl.conf.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -8,6 +8,7 @@
</span><span class="cx"> <!-- <param name="gateway-url" value="http://www.freeswitch.org/gateway.xml" bindings="dialplan"/> -->
</span><span class="cx"> <!-- set this to provide authentication credentials to the server -->
</span><span class="cx"> <!--<param name="gateway-credentials" value="muser:mypass"/>-->
</span><ins>+ <!--<param name="auth-scheme" value="basic"/>-->
</ins><span class="cx"> <!-- set to true to disable Expect: 100-continue lighttpd requires this setting -->
</span><span class="cx"> <!--<param name="disable-100-continue" value="true"/>-->
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconfdialplandefaultxml"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/dialplan/default.xml (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/dialplan/default.xml        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/dialplan/default.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx">
</span><span class="cx"> Authenticated users will use the user_context variable on the user to determine what context
</span><span class="cx"> they can access. You can also add a user in the directory with the cidr= attribute acl.conf.xml
</span><del>- will build the domains acl using this value.
</del><ins>+ will build the domains ACL using this value.
</ins><span class="cx"> -->
</span><span class="cx"> <!-- http://wiki.freeswitch.org/wiki/Dialplan_XML -->
</span><span class="cx"> <include>
</span><span class="lines">@@ -110,7 +110,7 @@
</span><span class="cx"> </extension>
</span><span class="cx"> -->
</span><span class="cx"> <!--
</span><del>-        snom button demo, call 9000 to make button 2 mapped to transfer the current call to a conference
</del><ins>+        Snom button demo, call 9000 to make button 2 mapped to transfer the current call to a conference
</ins><span class="cx"> -->
</span><span class="cx">
</span><span class="cx"> <extension name="snom-demo-2">
</span><span class="lines">@@ -296,7 +296,7 @@
</span><span class="cx"> </condition>
</span><span class="cx"> </extension>
</span><span class="cx">
</span><del>- <!-- dial the freeswitch conference via SIP-->
</del><ins>+ <!-- dial the FreeSWITCH conference via SIP-->
</ins><span class="cx"> <extension name="freeswitch_public_conf_via_sip">
</span><span class="cx"> <condition field="destination_number" expression="^9(888|1616|3232)$">
</span><span class="cx">         <action application="export" data="hold_music=silence"/>
</span><span class="lines">@@ -406,8 +406,32 @@
</span><span class="cx"> </condition>
</span><span class="cx"> </extension>
</span><span class="cx">
</span><ins>+ <!--
+         Valet park retrieval, works with valet_park extension below.
+         Retrieve a valet parked call by dialing 6000 + park number + #
+ -->
+ <extension name="valet_park">
+ <condition field="destination_number" expression="^(6000)$">
+        <action application="answer"/>
+        <action application="valet_park" data="valet_parking_lot ask 1 11 10000 ivr/ivr-enter_ext_pound.wav"/>
+ </condition>
+ </extension>
+
+ <!--
+         Valet park 6001-6099. Blind x-fer to 6001, 6002, etc. to valet park the call.
+         Dial 6001, 6002, etc. to retrieve a call that is already valet parked.
+         After call is retrieved, park extension is free for another call.
+ -->
+ <extension name="valet_park">
+ <condition field="destination_number" expression="^(60\d[1-9])$">
+        <action application="answer"/>
+        <action application="valet_park" data="valet_parking_lot $1"/>
+ </condition>
+ </extension>
+
+
</ins><span class="cx"> <!--
</span><del>-        This extension is used with snom phones.
</del><ins>+        This extension is used with Snom phones.
</ins><span class="cx">         
</span><span class="cx">         Set a function key to park+lot (lot being a number or name.)
</span><span class="cx">         Set type to Park+Orbit. You can then park and pickup using
</span><span class="lines">@@ -433,7 +457,7 @@
</span><span class="cx"> </extension>
</span><span class="cx">
</span><span class="cx"> <!--
</span><del>- This extension is used with linksys phones.
</del><ins>+ This extension is used with Linksys phones.
</ins><span class="cx">
</span><span class="cx"> Set a Phone tab option Call Park Serv to yes. You can park and
</span><span class="cx"> pickup using soft keys "park" and "unpark" found during
</span><span class="lines">@@ -450,7 +474,7 @@
</span><span class="cx"> </extension>
</span><span class="cx">
</span><span class="cx"> <!--
</span><del>- This extension is used with linksys phones.
</del><ins>+ This extension is used with Linksys phones.
</ins><span class="cx">
</span><span class="cx"> The extension is parking pickup with a to param of the fifo
</span><span class="cx"> we are calling. Linksys sends orbit=<parkingslotnumber>
</span><span class="lines">@@ -549,8 +573,8 @@
</span><span class="cx">
</span><span class="cx"> <extension name="ClueCon">
</span><span class="cx"> <condition field="destination_number" expression="^9991$">
</span><del>- <action application="set" data="effective_caller_id_name=ClueCon"/>
- <action application="bridge" data="sofia/$${domain}/brian@bkw.org"/>
</del><ins>+ <action application="set" data="effective_caller_id_name=ClueCon IVR"/>
+ <action application="bridge" data="sofia/$${domain}/2000@bkw.org"/>
</ins><span class="cx"> </condition>
</span><span class="cx"> </extension>
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangendirfromrev15313freeswitchtrunkconflangendir"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/dir (from rev 15313, freeswitch/trunk/conf/lang/en/dir)</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangendirsoundsxml"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/dir/sounds.xml</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangendirsoundsxmlfromrev15313freeswitchtrunkconflangendirsoundsxml"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/dir/sounds.xml (from rev 15313, freeswitch/trunk/conf/lang/en/dir/sounds.xml) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/dir/sounds.xml         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/dir/sounds.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,121 @@
</span><ins>+<include><!--This line will be ignored it's here to validate the xml and is optional -->
+        <macro name="directory_intro">
+                <input pattern="^(last_name)" break_on_match="false">
+                        <match>
+                                <action function="play-file" data="directory/dir-enter-person.wav"/>
+                                <action function="play-file" data="directory/dir-last_name.wav"/>
+                        </match>
+                </input>
+                <input pattern="^(first_name)" break_on_match="false">
+                        <match>
+ <action function="play-file" data="directory/dir-enter-person.wav"/>
+ <action function="play-file" data="directory/dir-first_name.wav"/>
+                        </match>
+                </input>
+                <input pattern="^(last_name):([0-9#*])$" break_on_match="false">
+                        <match>
+                                <action function="play-file" data="directory/dir-to_search_by.wav"/>
+                                <action function="play-file" data="directory/dir-first_name.wav"/>
+                                <action function="play-file" data="directory/dir-press.wav"/>
+                                <action function="say" data="$2" method="pronounced" type="name_spelled"/>
+                        </match>
+                </input>
+                <input pattern="^(first_name):([0-9#*])$" break_on_match="false">
+                        <match>
+                                <action function="play-file" data="directory/dir-to_search_by.wav"/>
+                                <action function="play-file" data="directory/dir-last_name.wav"/>
+                                <action function="play-file" data="directory/dir-press.wav"/>
+                                <action function="say" data="$2" method="pronounced" type="name_spelled"/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_min_search_digits">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="play-file" data="directory/dir-specify_mininum_first.wav"/>
+                                <action function="say" data="$1" method="pronounced" type="items"/>
+                                <action function="play-file" data="directory/dir-letters_of_person_name.wav"/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_result_count">
+                <input pattern="^0$" break_on_match="true">
+                        <match>
+                                <action function="play-file" data="directory/dir-no_match_entry.wav"/>
+                        </match>
+                </input>
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="say" data="$1" method="pronounced" type="items"/>
+                                <action function="play-file" data="directory/dir-result_match.wav"/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_result_count_too_large">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="play-file" data="directory/dir-to_many_result.wav"/>
+                        </match>
+                </input>
+
+        </macro>
+
+        <macro name="directory_result_last">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="play-file" data="directory/dir-no_more_result.wav"/>
+                        </match>
+                </input>
+
+        </macro>
+
+        <macro name="directory_result_item">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="play-file" data="directory/dir-result_number.wav"/>
+                                <action function="say" data="$1" method="pronounced" type="items"/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_result_at">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="play-file" data="directory/dir-at_extension.wav"/>
+                                <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_result_menu">
+                <input pattern="^([0-9#*]),([0-9#*]),([0-9#*]),([0-9#*])$">
+                        <match>
+                                <action function="play-file" data="directory/dir-to_select_entry.wav"/>
+                                <action function="play-file" data="directory/dir-press.wav"/>
+                                <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+                                <action function="play-file" data="directory/dir-for_next.wav"/>
+                                <action function="play-file" data="directory/dir-press.wav"/>
+                                <action function="say" data="$2" method="pronounced" type="name_spelled"/>
+                                <action function="play-file" data="directory/dir-for_prev.wav"/>
+                                <action function="play-file" data="directory/dir-press.wav"/>
+                                <action function="say" data="$3" method="pronounced" type="name_spelled"/>
+                                <action function="play-file" data="directory/dir-to_make_new_search.wav"/>
+                                <action function="play-file" data="directory/dir-press.wav"/>
+                                <action function="say" data="$4" method="pronounced" type="name_spelled"/>
+
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_result_say_name">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+                        </match>
+                </input>
+        </macro>
+
+</include><!--This line will be ignored it's here to validate the xml and is optional -->
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangendirttsxml"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/dir/tts.xml</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangendirttsxmlfromrev15313freeswitchtrunkconflangendirttsxml"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/dir/tts.xml (from rev 15313, freeswitch/trunk/conf/lang/en/dir/tts.xml) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/dir/tts.xml         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/dir/tts.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,96 @@
</span><ins>+<include><!--This line will be ignored it's here to validate the xml and is optional -->
+
+        <macro name="directory_intro">
+                <input pattern="^(last_name)" break_on_match="false">
+                        <match>
+                                <action function="speak-text" data="Please enter the first few digit of the person last name"/>
+                        </match>
+                </input>
+                <input pattern="^(first_name)" break_on_match="false">
+                        <match>
+                                <action function="speak-text" data="Please enter the first few digit of the person first name"/>
+                        </match>
+                </input>
+                <input pattern="^(last_name):([0-9#*])$" break_on_match="false">
+                        <match>
+                                <action function="speak-text" data="to search by first name, press $2"/>
+                        </match>
+                </input>
+                <input pattern="^(first_name):([0-9#*])$" break_on_match="false">
+                        <match>
+                                <action function="speak-text" data="to search by last name, press $2"/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_min_search_digits">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="speak-text" data="You need to specify a minimum the first $1 letters of the person name, try again."/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_result_count">
+                <input pattern="^0$" break_on_match="true">
+                        <match>
+                                <action function="speak-text" data="Your search match no user on this system, try again."/>
+                        </match>
+                </input>
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="speak-text" data="$1 result match your search"/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_result_count_too_large">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="speak-text" data="Your search returned too many result, please try again"/>
+                        </match>
+                </input>
+
+        </macro>
+
+        <macro name="directory_result_last">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="speak-text" data="No more result"/>
+                        </match>
+                </input>
+
+        </macro>
+
+        <macro name="directory_result_item">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="speak-text" data="Result number $1"/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_result_menu">
+                <input pattern="^([0-9#*]),([0-9#*]),([0-9#*]),([0-9#*])$">
+                        <match>
+                                <action function="speak-text" data="To select this entry press $1, for the next entry press $2, for the previous entry press $3, to make a new search press $4"/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_result_at">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="speak-text" data="at extension $1"/>
+                        </match>
+                </input>
+        </macro>
+        <macro name="directory_result_say_name">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="speak-text" data="$1"/>
+                        </match>
+                </input>
+        </macro>
+
+</include><!--This line will be ignored it's here to validate the xml and is optional -->
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangenenxml"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/en.xml (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/en.xml        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/en.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -3,5 +3,6 @@
</span><span class="cx"> <X-PRE-PROCESS cmd="include" data="demo/*.xml"/> <!-- Note: this now grabs whole subdir, previously grabbed only demo.xml -->
</span><span class="cx"> <!--voicemail_en_tts is purely implemented with tts, we have the files based one that is the default. -->
</span><span class="cx"> <X-PRE-PROCESS cmd="include" data="vm/sounds.xml"/> <!-- vm/tts.xml if you want to use tts and have cepstral -->
</span><ins>+ <X-PRE-PROCESS cmd="include" data="dir/sounds.xml"/> <!-- dir/tts.xml if you want to use tts and have cepstral -->
</ins><span class="cx"> </language>
</span><span class="cx"> </include>
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangenvmsoundsxml"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/vm/sounds.xml (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/vm/sounds.xml        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/en/vm/sounds.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -340,5 +340,30 @@
</span><span class="cx"> </input>
</span><span class="cx"> </macro>
</span><span class="cx">
</span><ins>+ <macro name="valet_announce_ext">
+ <input pattern="^([^\:]+):(.*)$">
+ <match>
+ <action function="say" data="$2" method="pronounced" type="name_spelled"/>
+ </match>
+ </input>
+ </macro>
</ins><span class="cx">
</span><ins>+ <macro name="valet_lot_full">
+ <input pattern="^(.*)$">
+ <match>
+ <action function="play-file" data="tone_stream://%(275,10,600);%(275,100,300)"/>
+ </match>
+ </input>
+ </macro>
+
+ <macro name="valet_lot_empty">
+ <input pattern="^(.*)$">
+ <match>
+ <action function="play-file" data="tone_stream://%(275,10,600);%(275,100,300)"/>
+ </match>
+ </input>
+ </macro>
+
+
+
</ins><span class="cx"> </include><!--This line will be ignored it's here to validate the xml and is optional -->
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangfrdirfromrev15313freeswitchtrunkconflangfrdir"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/fr/dir (from rev 15313, freeswitch/trunk/conf/lang/fr/dir)</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangfrdirsoundsxml"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/fr/dir/sounds.xml</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangfrdirsoundsxmlfromrev15313freeswitchtrunkconflangfrdirsoundsxml"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/fr/dir/sounds.xml (from rev 15313, freeswitch/trunk/conf/lang/fr/dir/sounds.xml) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/fr/dir/sounds.xml         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/fr/dir/sounds.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,121 @@
</span><ins>+<include><!--This line will be ignored it's here to validate the xml and is optional -->
+        <macro name="directory_intro">
+                <input pattern="^(last_name)" break_on_match="false">
+                        <match>
+                                <action function="play-file" data="directory/dir-enter-person.wav"/>
+                                <action function="play-file" data="directory/dir-last_name.wav"/>
+                        </match>
+                </input>
+                <input pattern="^(first_name)" break_on_match="false">
+                        <match>
+ <action function="play-file" data="directory/dir-enter-person.wav"/>
+ <action function="play-file" data="directory/dir-first_name.wav"/>
+                        </match>
+                </input>
+                <input pattern="^(last_name):([0-9#*])$" break_on_match="false">
+                        <match>
+                                <action function="play-file" data="directory/dir-to_search_by.wav"/>
+                                <action function="play-file" data="directory/dir-first_name.wav"/>
+                                <action function="play-file" data="directory/dir-press.wav"/>
+                                <action function="say" data="$2" method="pronounced" type="name_spelled"/>
+                        </match>
+                </input>
+                <input pattern="^(first_name):([0-9#*])$" break_on_match="false">
+                        <match>
+                                <action function="play-file" data="directory/dir-to_search_by.wav"/>
+                                <action function="play-file" data="directory/dir-last_name.wav"/>
+                                <action function="play-file" data="directory/dir-press.wav"/>
+                                <action function="say" data="$2" method="pronounced" type="name_spelled"/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_min_search_digits">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="play-file" data="directory/dir-specify_mininum_first.wav"/>
+                                <action function="say" data="$1" method="pronounced" type="items"/>
+                                <action function="play-file" data="directory/dir-letters_of_person_name.wav"/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_result_count">
+                <input pattern="^0$" break_on_match="true">
+                        <match>
+                                <action function="play-file" data="directory/dir-no_match_entry.wav"/>
+                        </match>
+                </input>
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="say" data="$1" method="pronounced" type="items"/>
+                                <action function="play-file" data="directory/dir-result_match.wav"/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_result_count_too_large">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="play-file" data="directory/dir-to_many_result.wav"/>
+                        </match>
+                </input>
+
+        </macro>
+
+        <macro name="directory_result_last">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="play-file" data="directory/dir-no_more_result.wav"/>
+                        </match>
+                </input>
+
+        </macro>
+
+        <macro name="directory_result_item">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="play-file" data="directory/dir-result_number.wav"/>
+                                <action function="say" data="$1" method="pronounced" type="items"/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_result_at">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="play-file" data="directory/dir-at_extension.wav"/>
+                                <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_result_menu">
+                <input pattern="^([0-9#*]),([0-9#*]),([0-9#*]),([0-9#*])$">
+                        <match>
+                                <action function="play-file" data="directory/dir-to_select_entry.wav"/>
+                                <action function="play-file" data="directory/dir-press.wav"/>
+                                <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+                                <action function="play-file" data="directory/dir-for_next.wav"/>
+                                <action function="play-file" data="directory/dir-press.wav"/>
+                                <action function="say" data="$2" method="pronounced" type="name_spelled"/>
+                                <action function="play-file" data="directory/dir-for_prev.wav"/>
+                                <action function="play-file" data="directory/dir-press.wav"/>
+                                <action function="say" data="$3" method="pronounced" type="name_spelled"/>
+                                <action function="play-file" data="directory/dir-to_make_new_search.wav"/>
+                                <action function="play-file" data="directory/dir-press.wav"/>
+                                <action function="say" data="$4" method="pronounced" type="name_spelled"/>
+
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_result_say_name">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+                        </match>
+                </input>
+        </macro>
+
+</include><!--This line will be ignored it's here to validate the xml and is optional -->
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangfrdirttsxml"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/fr/dir/tts.xml</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangfrdirttsxmlfromrev15313freeswitchtrunkconflangfrdirttsxml"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/fr/dir/tts.xml (from rev 15313, freeswitch/trunk/conf/lang/fr/dir/tts.xml) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/fr/dir/tts.xml         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/fr/dir/tts.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,101 @@
</span><ins>+<include><!--This line will be ignored it's here to validate the xml and is optional -->
+
+        <macro name="directory_intro">
+                <input pattern="^(last_name)" break_on_match="false">
+                        <match>
+                                <action function="speak-text" data="Veuillez entrer les premiere lettre du nom de famille"/>
+                        </match>
+                </input>
+                <input pattern="^(first_name)" break_on_match="false">
+                        <match>
+                                <action function="speak-text" data="Veuillez entrer les premiere lettre du prénom"/>
+                        </match>
+                </input>
+                <input pattern="^(last_name):([0-9#*])$" break_on_match="false">
+                        <match>
+                                <action function="speak-text" data="pour chercher par prénom, appuyer sur le $2"/>
+                        </match>
+                </input>
+                <input pattern="^(first_name):([0-9#*])$" break_on_match="false">
+                        <match>
+                                <action function="speak-text" data="pour chercher par nom de famille, appuyer sur le $2"/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_min_search_digits">
+                <input pattern="^(1)$">
+                        <match>
+                                <action function="speak-text" data="Vous devez entré au minimum une lettre du nom de la personne, essayer de nouveaux"/>
+                        </match>
+                </input>
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="speak-text" data="Vous devez entré au minimum $1 lettre du nom de la personne, essayer de nouveaux"/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_result_count">
+                <input pattern="^0$" break_on_match="true">
+                        <match>
+                                <action function="speak-text" data="Votre recherche a retourner aucune résultat, essayer de nouveaux"/>
+                        </match>
+                </input>
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="speak-text" data="$1 résultats correspond a votre recherche"/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_result_count_too_large">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="speak-text" data="Votre recherche retourne trop de résultat, essayer de nouveaux."/>
+                        </match>
+                </input>
+
+        </macro>
+
+        <macro name="directory_result_last">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="speak-text" data="Fin des résultats."/>
+                        </match>
+                </input>
+
+        </macro>
+
+        <macro name="directory_result_item">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="speak-text" data="Résultat numéro $1"/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_result_menu">
+                <input pattern="^([0-9#*]),([0-9#*]),([0-9#*]),([0-9#*])$">
+                        <match>
+                                <action function="speak-text" data="Pour selectionner ce nom appuyer sur le $1, pour le nom suivant appuyer sur le $2, pour le nom précédent appuyer sur le $3 ou pour faire une nouvelle recherche appuyer sur le $4"/>
+                        </match>
+                </input>
+        </macro>
+
+        <macro name="directory_result_at">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="speak-text" data="aux poste $1"/>
+                        </match>
+                </input>
+        </macro>
+        <macro name="directory_result_say_name">
+                <input pattern="^(.*)$">
+                        <match>
+                                <action function="speak-text" data="$1"/>
+                        </match>
+                </input>
+        </macro>
+
+</include><!--This line will be ignored it's here to validate the xml and is optional -->
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconflangfrfrxml"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/fr/fr.xml (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/fr/fr.xml        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/lang/fr/fr.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -2,6 +2,7 @@
</span><span class="cx"> <language name="fr" sound-path="/snds" tts-engine="cepstral" tts-voice="david">
</span><span class="cx"> <X-PRE-PROCESS cmd="include" data="demo/demo.xml"/>
</span><span class="cx"> <!--voicemail_fr_tts is purely implemented with tts, we need a files based implementation too -->
</span><del>- <X-PRE-PROCESS cmd="include" data="vm/sounds.xml"/>
</del><ins>+        <X-PRE-PROCESS cmd="include" data="vm/sounds.xml"/>
+        <X-PRE-PROCESS cmd="include" data="dir/sounds.xml"/> <!-- dir/tts.xml if you want to use tts and have cepstral -->
</ins><span class="cx"> </language>
</span><span class="cx"> </include>
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconfsip_profilesinternalxml"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/sip_profiles/internal.xml (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/sip_profiles/internal.xml        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/conf/sip_profiles/internal.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -75,7 +75,8 @@
</span><span class="cx"> <param name="local-network-acl" value="localnet.auto"/>
</span><span class="cx"> <!--<param name="apply-register-acl" value="domains"/>-->
</span><span class="cx"> <!--<param name="dtmf-type" value="info"/>-->
</span><del>- <param name="record-template" value="$${base_dir}/recordings/${caller_id_number}.${target_domain}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
</del><ins>+ <param name="record-path" value="$${base_dir}/recordings"/>
+ <param name="record-template" value="${caller_id_number}.${target_domain}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
</ins><span class="cx"> <!--enable to use presence -->
</span><span class="cx"> <param name="manage-presence" value="true"/>
</span><span class="cx"> <!--<param name="manage-shared-appearance" value="true"/>-->
</span><span class="lines">@@ -159,12 +160,16 @@
</span><span class="cx"> <param name="inbound-reg-force-matching-username" value="true"/>
</span><span class="cx"> <!-- on authed calls, authenticate *all* the packets not just invite -->
</span><span class="cx"> <param name="auth-all-packets" value="false"/>
</span><del>- <!--
-        Possible options for ext-rtp-ip or ext-sip-ip
-
-        auto - Use guessed ip.
-        auto-nat - Use ip learned from NAT-PMP or UPNP
- -->
</del><ins>+
+ <!-- external_sip_ip
+ Used as the public IP address for SDP.
+ Can be an one of:
+ ip address - "12.34.56.78"
+ a stun server lookup - "stun:stun.server.com"
+ a DNS name - "host:host.server.com"
+ auto - Use guessed ip.
+ auto-nat - Use ip learned from NAT-PMP or UPNP
+ -->
</ins><span class="cx"> <param name="ext-rtp-ip" value="auto-nat"/>
</span><span class="cx"> <param name="ext-sip-ip" value="auto-nat"/>
</span><span class="cx">
</span><span class="lines">@@ -225,6 +230,9 @@
</span><span class="cx"> <!-- set to false disable this feature -->
</span><span class="cx"> <!--<param name="rtp-autofix-timing" value="false"/>-->
</span><span class="cx">
</span><ins>+ <!-- set this param to false if your gateway for some reason hates X- headers that it is supposed to ignore-->
+ <!--<param name="pass-callee-id" value="false"/>-->
+
</ins><span class="cx"> <!-- clear clears them all or supply the name to add or the name prefixed with ~ to remove
</span><span class="cx">          valid values:
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorconfigurein"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/configure.in (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/configure.in        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/configure.in        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -826,7 +826,6 @@
</span><span class="cx"> AC_CONFIG_SUBDIRS(libs/pcre)
</span><span class="cx"> AC_CONFIG_SUBDIRS(libs/apr)
</span><span class="cx"> AC_CONFIG_SUBDIRS(libs/apr-util)
</span><del>-AC_CONFIG_SUBDIRS(libs/voipcodecs)
</del><span class="cx"> AC_CONFIG_SUBDIRS(libs/ilbc)
</span><span class="cx"> AC_CONFIG_SUBDIRS(libs/curl)
</span><span class="cx"> AC_CONFIG_SUBDIRS(libs/iksemel)
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribDelphiWorlddialplanrecordingxmlfromrev15313freeswitchtrunkcontribDelphiWorlddialplanrecordingxml"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/DelphiWorld/dialplan/recording.xml (from rev 15313, freeswitch/trunk/contrib/DelphiWorld/dialplan/recording.xml) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/DelphiWorld/dialplan/recording.xml         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/DelphiWorld/dialplan/recording.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+<!-- recording / playback extension -->
+<!-- thank to rupa for the help -->
+<include>
+<extension name="recording">
+ <condition field="destination_number" expression="^(2020)$">
+<action application="answer"/>
+<action application="set" data="playback_terminators=#"/>
+<action application="record" data="/tmp/recorded.wav 20 200"/>
+ </condition>
+</extension>
+<extension name="playback">
+ <condition field="destination_number" expression="^(2021)$">
+<action application="answer"/>
+<action application="set" data="playback_terminators=#"/>
+<action application="playback" data="/tmp/recorded.wav"/>
+ </condition>
+</extension>
+</include>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribcparkermod_xml_radiusmod_xml_radiusc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/cparker/mod_xml_radius/mod_xml_radius.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/cparker/mod_xml_radius/mod_xml_radius.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/cparker/mod_xml_radius/mod_xml_radius.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 goto usage;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -188,7 +188,7 @@
</span><span class="cx"> switch_xml_t xml_in_tmp = NULL;
</span><span class="cx"> int i;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(xml_out->name)) {
</del><ins>+        if (zstr(xml_out->name)) {
</ins><span class="cx">                 xml_out->name = strdup(xml_in->name);
</span><span class="cx">         } else if (!(xml_out = switch_xml_add_child_d(xml_out, xml_in->name, *off++))) {
</span><span class="cx"> return SWITCH_STATUS_FALSE;
</span><span class="lines">@@ -540,7 +540,7 @@
</span><span class="cx">                 binding->bindings = strdup(bname);
</span><span class="cx">
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Binding [%s] XML RADIUS Fetch Function [%s]\n",
</span><del>-                        switch_strlen_zero(bname) ? "N/A" : bname, binding->bindings ? binding->bindings : "all");
</del><ins>+                        zstr(bname) ? "N/A" : bname, binding->bindings ? binding->bindings : "all");
</ins><span class="cx">                 switch_xml_bind_search_function(xml_radius_search, switch_xml_parse_section_string(bname), binding);
</span><span class="cx">                 binding = NULL;
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubycallcardREADMEmd"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/callcard/README.md</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubycallcardTODO"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/callcard/TODO</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubycdrfromrev15313freeswitchtrunkcontribdiegoviolarubycdr"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr (from rev 15313, freeswitch/trunk/contrib/diegoviola/ruby/cdr)</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubycdrcdrrb"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr/cdr.rb</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubycdrcdrrbfromrev15313freeswitchtrunkcontribdiegoviolarubycdrcdrrb"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr/cdr.rb (from rev 15313, freeswitch/trunk/contrib/diegoviola/ruby/cdr/cdr.rb) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr/cdr.rb         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr/cdr.rb        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+#!/usr/bin/env ruby
+
+require 'rubygems'
+require 'fsr'
+require 'fsr/listener/inbound'
+require 'database.rb'
+
+def custom_channel_hangup_handler(event)
+ DB[:cdr].insert(
+ :caller_caller_id_name => event.content[:caller_caller_id_name],
+ :caller_caller_id_number => event.content[:caller_caller_id_number],
+ :caller_destination_number => event.content[:caller_destination_number],
+ :caller_context => event.content[:caller_context],
+ :variable_start_stamp => event.content[:variable_start_stamp],
+ :variable_answer_stamp => event.content[:variable_answer_stamp],
+ :variable_end_stamp => event.content[:variable_end_stamp],
+ :variable_duration => event.content[:variable_duration],
+ :variable_billsec => event.content[:variable_billsec],
+ :variable_hangup_cause => event.content[:variable_hangup_cause],
+ :unique_id => event.content[:unique_id],
+ :core_uuid => event.content[:core_uuid],
+ :variable_accountcode => event.content[:variable_accountcode],
+ :channel_read_codec_name => event.content[:channel_read_codec_name],
+ :variable_write_codec => event.content[:variable_write_codec])
+end
+
+FSL::Inbound.add_event_hook(:CHANNEL_HANGUP_COMPLETE) {|event| custom_channel_hangup_handler(event) }
+
+FSR.start_ies!(FSL::Inbound, :host => "localhost", :port => 8021)
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubycdrcreate_tablerb"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr/create_table.rb</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubycdrcreate_tablerbfromrev15313freeswitchtrunkcontribdiegoviolarubycdrcreate_tablerb"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr/create_table.rb (from rev 15313, freeswitch/trunk/contrib/diegoviola/ruby/cdr/create_table.rb) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr/create_table.rb         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr/create_table.rb        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+#!/usr/bin/env ruby
+
+require 'rubygems'
+require 'database.rb'
+
+DB.create_table :cdr do
+ primary_key :id
+ String :caller_caller_id_name
+ String :caller_caller_id_number
+ String :caller_destination_number
+ String :caller_context
+ String :variable_start_stamp
+ String :variable_answer_stamp
+ String :variable_end_stamp
+ String :variable_duration
+ String :variable_billsec
+ String :variable_hangup_cause
+ String :unique_id
+ String :core_uuid
+ String :variable_accountcode
+ String :channel_read_codec_name
+ String :variable_write_codec
+end
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubycdrdatabaserb"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr/database.rb</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubycdrdatabaserbfromrev15313freeswitchtrunkcontribdiegoviolarubycdrdatabaserb"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr/database.rb (from rev 15313, freeswitch/trunk/contrib/diegoviola/ruby/cdr/database.rb) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr/database.rb         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/cdr/database.rb        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+require 'sequel'
+
+DB = Sequel.connect('mysql://root@localhost/freeswitch')
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubyprepaidfromrev15313freeswitchtrunkcontribdiegoviolarubyprepaid"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/prepaid (from rev 15313, freeswitch/trunk/contrib/diegoviola/ruby/prepaid)</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubyprepaidserverrb"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/prepaid/server.rb</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdiegoviolarubyprepaidserverrbfromrev15313freeswitchtrunkcontribdiegoviolarubyprepaidserverrb"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/prepaid/server.rb (from rev 15313, freeswitch/trunk/contrib/diegoviola/ruby/prepaid/server.rb) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/prepaid/server.rb         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/diegoviola/ruby/prepaid/server.rb        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+#!/usr/bin/env ruby
+
+require 'rubygems'
+require 'fsr'
+require 'fsr/listener/inbound'
+require 'fsr/listener/outbound'
+require 'sequel'
+
+DB = Sequel.connect('mysql://root@localhost/freeswitch')
+
+class Rate < Sequel::Model
+end
+
+module Prepaid
+ def update_balance
+ @@timer = EM::PeriodicTimer.new(1){ puts "hello world" }
+ end
+end
+
+class Inbound < FSL::Inbound
+ include Prepaid
+
+ add_event_hook(:CHANNEL_HANGUP) {|event| custom_channel_hangup_handler(event) }
+ def self.custom_channel_hangup_handler(event)
+ @@timer.cancel
+ end
+end
+
+class Outbound < FSR::Listener::Outbound
+ include Prepaid
+
+ def session_initiated
+ update_balance
+ end
+end
+
+EM.run do
+ EM.connect "0.0.0.0", 8021, Inbound
+ EM.start_server "0.0.0.0", 8084, Outbound
+end
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribdschreibermod_nibblebillmod_nibblebillc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/dschreiber/mod_nibblebill/mod_nibblebill.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/dschreiber/mod_nibblebill/mod_nibblebill.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/dschreiber/mod_nibblebill/mod_nibblebill.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -191,22 +191,22 @@
</span><span class="cx">         
</span><span class="cx"> /* Set defaults for any variables still not set */
</span><span class="cx"> setdefaults:
</span><del>-        if (switch_strlen_zero(globals.db_username)) {
</del><ins>+        if (zstr(globals.db_username)) {
</ins><span class="cx">                 set_global_db_username("bandwidth.com");
</span><span class="cx">         }
</span><del>-        if (switch_strlen_zero(globals.db_password)) {
</del><ins>+        if (zstr(globals.db_password)) {
</ins><span class="cx">                 set_global_db_password("dev");
</span><span class="cx">         }
</span><del>-        if (switch_strlen_zero(globals.db_dsn)) {
</del><ins>+        if (zstr(globals.db_dsn)) {
</ins><span class="cx">                 set_global_db_dsn("bandwidth.com");
</span><span class="cx">         }
</span><del>-        if (switch_strlen_zero(globals.percall_action)) {
</del><ins>+        if (zstr(globals.percall_action)) {
</ins><span class="cx">                 set_global_percall_action("hangup");
</span><span class="cx">         }
</span><del>-        if (switch_strlen_zero(globals.lowbal_action)) {
</del><ins>+        if (zstr(globals.lowbal_action)) {
</ins><span class="cx">                 set_global_lowbal_action("play ding");
</span><span class="cx">         }
</span><del>-        if (switch_strlen_zero(globals.nobal_action)) {
</del><ins>+        if (zstr(globals.nobal_action)) {
</ins><span class="cx">                 set_global_nobal_action("hangup");
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -719,7 +719,7 @@
</span><span class="cx">         char *lbuf = NULL;
</span><span class="cx">         char *argv[3] = { 0 };
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
</del><ins>+        if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
</ins><span class="cx">                 && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
</span><span class="cx">                 if (!strcasecmp(argv[0], "adjust") && argc == 2) {
</span><span class="cx">                         nibblebill_adjust(session, atof(argv[1]));
</span><span class="lines">@@ -748,9 +748,9 @@
</span><span class="cx">         char *mycmd = NULL, *argv[3] = { 0 };
</span><span class="cx">         int argc = 0;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><del>-                if ((argc == 2 || argc == 3) && !switch_strlen_zero(argv[0])) {
</del><ins>+                if ((argc == 2 || argc == 3) && !zstr(argv[0])) {
</ins><span class="cx">                         char *uuid = argv[0];
</span><span class="cx">                         if ((psession = switch_core_session_locate(uuid))) {
</span><span class="cx">                                 switch_channel_t *channel;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledesl2agiesl2agic"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/esl2agi/esl2agi.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/esl2agi/esl2agi.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/esl2agi/esl2agi.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -37,6 +37,22 @@
</span><span class="cx">
</span><span class="cx"> #include "esl2agi.h"
</span><span class="cx">
</span><ins>+static command_binding_t bindings[_MAX_CMD] = {
+        { {"ANSWER" , NULL}, handle_answer },
+        { {"HANGUP" , NULL}, handle_hangup },
+        { {"STREAM", "FILE" , NULL}, handle_streamfile },
+        { {"SET", "CALLERID" , NULL}, handle_set_caller_id },
+        { {"SET", "VARIABLE" , NULL}, handle_set_variable },
+        { {"EXEC", NULL}, handle_exec },
+        { {"GET", "DATA", NULL}, handle_getdata },
+};
+
+static command_binding_t exec_bindings[_MAX_CMD] = {
+        { {"DIAL" , NULL}, handle_dial },
+        { {"SET" , NULL}, handle_set_variable },
+        { {"SIPADDHEADER",NULL}, handle_sipaddheader },
+};
+
</ins><span class="cx"> /*
</span><span class="cx"> * Translator thread entry point
</span><span class="cx"> */
</span><span class="lines">@@ -47,7 +63,7 @@
</span><span class="cx"> esl_handle_t eslC = {{0}};
</span><span class="cx">
</span><span class="cx"> char script_path[1024] = "\0";
</span><del>- const char *buf;
</del><ins>+ char *buf;
</ins><span class="cx">         int pid;
</span><span class="cx">         int thread_running;
</span><span class="cx">
</span><span class="lines">@@ -94,6 +110,7 @@
</span><span class="cx">                 close(pipes.socket[1]);
</span><span class="cx">                 close(pipes.script[0]);
</span><span class="cx">                 close(esl_req.client_sock);
</span><ins>+                close(STDERR_FILENO);
</ins><span class="cx">
</span><span class="cx">          dup2(pipes.socket[0], STDIN_FILENO);
</span><span class="cx">         dup2(pipes.script[1], STDOUT_FILENO);
</span><span class="lines">@@ -114,19 +131,16 @@
</span><span class="cx">
</span><span class="cx">                 signal(SIGCHLD, SIG_IGN);
</span><span class="cx">                 signal(SIGPIPE, SIG_IGN);
</span><del>-
</del><ins>+                // fprintf(stderr,"New call, handling setup...\n");
</ins><span class="cx">                 handle_setup_env(pipes.socket[1],&eslC);
</span><span class="cx">
</span><span class="cx">                 /* TODO: check status */
</span><span class="cx">                 status = esl_send(&eslC,"myevents");
</span><del>-                eslC.async_execute = 0;
</del><ins>+                eslC.async_execute = 1;
</ins><span class="cx">                 while ( eslC.connected && thread_running) {
</span><span class="cx">                         int r , nfds = 0;
</span><span class="cx">                         fd_set rd;
</span><span class="cx">
</span><del>-                        /* As we are in sync mode, we should NOT care about socket there,
-                         * there is a binding of esl_execute to find command results
-                         */
</del><span class="cx">                         FD_ZERO(&rd);
</span><span class="cx">                         FD_SET(pipes.script[0], &rd);
</span><span class="cx">                         nfds = MAX(nfds,pipes.script[0]);
</span><span class="lines">@@ -135,7 +149,6 @@
</span><span class="cx">                         if (r == -1 )
</span><span class="cx">                                 break;
</span><span class="cx">                         else if (FD_ISSET(pipes.script[0],&rd) ) { /* AGI has something to say */
</span><del>-                                bzero(&sbuf,2047);
</del><span class="cx">                                 r = read(pipes.script[0],&sbuf,2047);
</span><span class="cx">                                 if (r<0)
</span><span class="cx">                                         goto end;
</span><span class="lines">@@ -182,8 +195,7 @@
</span><span class="cx"> * Copyright (c) 2009, Anthony Minessale II
</span><span class="cx"> * TODO:        - add mod_dialplan_asterisk lookup and load if not present.
</span><span class="cx"> */
</span><del>-int main(int argc, char *argv[])
-{
</del><ins>+int main(int argc, char *argv[]) {
</ins><span class="cx">         int i;
</span><span class="cx">         char *ip = NULL;
</span><span class="cx">         int port = 0;
</span><span class="lines">@@ -199,7 +211,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         if (!(ip && port)) {
</span><del>-                fprintf(stderr, "Usage %s -h <host> -p <port>\n", argv[0]);
</del><ins>+                // fprintf(stderr, "Usage %s -h <host> -p <port>\n", argv[0]);
</ins><span class="cx">                 return -1;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -210,175 +222,134 @@
</span><span class="cx">         return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static int safe_int_snprintf_buffer(char **buf,const char *format, int ret) {
+        int size;
+        size = 2 + strlen(format); // Max 2 digits in int
+        if (*buf != NULL)
+                *buf = realloc(*buf,size+1);
+        else
+                *buf = malloc(size +1);
+        memset(*buf,0,size+1);
+        size = snprintf(*buf,size+1,format,ret);
+        return size;
+}
+
+/*
+ * Return malloc'd buf containing header value specified with %format
+ */
+static int fill_buffer_from_header(esl_event_t *event,char **buf,char *header,const char *format) {
+        int size=0;
+        char *sbuf;
+        sbuf = esl_event_get_header(event, header);
+        if (sbuf) {
+                size = strlen(sbuf) + strlen(format);
+                if (*buf == NULL)
+                        *buf = malloc(size+1);
+                else
+                        *buf = realloc(*buf,size+1);
+                memset(*buf,0,size+1);
+                size = snprintf(*buf,size,format,sbuf);
+        }
+        return size;
+}
+
</ins><span class="cx"> /* Setup env
</span><del>- * TODO:        - correct parameters
- *                - add a generic routine instead of blindly repeating code
</del><ins>+ * TODO:        - check size, if no header found we should not block
</ins><span class="cx"> */
</span><span class="cx"> static int handle_setup_env(int fd,esl_handle_t *eslC) {
</span><del>-        char buf[1024];
-        char *sbuf;
</del><ins>+        char *sbuf=NULL;
+        int size;
</ins><span class="cx">
</span><span class="cx">         /* Setup Env for AGI scripts */
</span><del>-        if ( (sbuf = esl_event_get_header(eslC->info_event, "variable_ivr_path")) ) {
-                sprintf(buf,"agi_request: %s\n",sbuf);
-                if ( write(fd, buf,strlen(buf) ) < 0)
</del><ins>+        if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"variable_ivr_path","agi_request: %s\n") ) > 0) {
+                if ( write(fd,sbuf,size) < 0)
</ins><span class="cx">                         return -1;
</span><span class="cx">         }
</span><span class="cx">         else
</span><del>-                return -1;
</del><ins>+                        return -1;
</ins><span class="cx">
</span><del>-        if ( (sbuf = esl_event_get_header(eslC->info_event, "variable_channel_name")) ) {
-                sprintf(buf,"agi_channel: %s\n",sbuf);
-                if ( write(fd, buf,strlen(buf) ) < 0)
</del><ins>+        if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"variable_channel_name","agi_channel: %s\n") ) > 0) {
+                if ( write(fd,sbuf,size) < 0)
</ins><span class="cx">                         return -1;
</span><span class="cx">         }
</span><span class="cx">         else
</span><del>-                return -1;
</del><ins>+                        return -1;
</ins><span class="cx">
</span><del>-        if ( write(fd, "agi_language: en\n",18) < 0 )
</del><ins>+        if ( write(fd, "agi_language: en\n",strlen("agi_language: en\n") ) < 0 )
</ins><span class="cx">                 return -1;
</span><span class="cx">
</span><del>-        if ( (sbuf = esl_event_get_header(eslC->info_event, "Channel-Source")) ) {
-                sprintf(buf, "agi_type: %s\n", sbuf);
-                if ( write(fd, buf,strlen(buf) ) < 0)
</del><ins>+        if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"Channel-Source","agi_type: %s\n") ) > 0) {
+                if ( write(fd,sbuf,size) < 0)
</ins><span class="cx">                         return -1;
</span><span class="cx">         }
</span><span class="cx">         else
</span><del>-                return -1;
</del><ins>+                        return -1;
</ins><span class="cx">
</span><del>-        if ( (sbuf = esl_event_get_header(eslC->info_event, "Channel-Unique-ID")) ) {
-                sprintf(buf, "agi_uniqueid: %s\n", sbuf);
-                if ( write(fd, buf,strlen(buf) ) < 0)
</del><ins>+        if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"Channel-Unique-ID","agi_uniqueid: %s\n") ) > 0) {
+                if ( write(fd,sbuf,size) < 0)
</ins><span class="cx">                         return -1;
</span><span class="cx">         }
</span><span class="cx">         else
</span><del>-                return -1;
</del><ins>+                        return -1;
</ins><span class="cx">
</span><del>-        /* ANI/DNIS */
-        if ( (sbuf = esl_event_get_header(eslC->info_event, "Channel-Caller-ID-Number")) ) {
-                sprintf(buf, "agi_callerid: %s\n", sbuf);
-                if ( write(fd, buf,strlen(buf) ) < 0)
</del><ins>+        if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"Channel-Caller-ID-Number","agi_callerid: %s\n") ) > 0) {
+                if ( write(fd,sbuf,size) < 0)
</ins><span class="cx">                         return -1;
</span><span class="cx">         }
</span><del>-        else {
-                sprintf(buf, "agi_callerid: %s\n", "unknown");
-                if ( write(fd, buf,strlen(buf) ) < 0)
</del><ins>+        else
</ins><span class="cx">                         return -1;
</span><del>-        }
-        if ( (sbuf = esl_event_get_header(eslC->info_event, "Channel-Caller-ID-Name")) ) {
-                sprintf(buf, "agi_calleridname: %s\n", sbuf);
-                if ( write(fd, buf,strlen(buf) ) < 0)
</del><ins>+
+        if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"Channel-Caller-ID-Name","agi_calleridname: %s\n") ) > 0) {
+                if ( write(fd,sbuf,size) < 0)
</ins><span class="cx">                         return -1;
</span><span class="cx">         }
</span><del>-        else {
-                sprintf(buf, "agi_calleridname: %s\n", "unknown");
-                if ( write(fd, buf,strlen(buf) ) < 0)
</del><ins>+        else
</ins><span class="cx">                         return -1;
</span><del>-        }
</del><span class="cx">
</span><del>-        if ( (sbuf = esl_event_get_header(eslC->info_event, "Channel-Screen-Bit")) ) {
-                sprintf(buf, "agi_callingpres: %s\n", sbuf);
-                if ( write(fd, buf,strlen(buf) ) < 0)
</del><ins>+        if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"Channel-Screen-Bit","agi_callingpres: %s\n") ) > 0) {
+                if ( write(fd,sbuf,size) < 0)
</ins><span class="cx">                         return -1;
</span><span class="cx">         }
</span><del>-        else {
-                sprintf(buf, "agi_callingpres: %s\n", "unknown");
-                if ( write(fd, buf,strlen(buf) ) < 0)
</del><ins>+        else
</ins><span class="cx">                         return -1;
</span><del>-        }
-        /* TODO */
-        if ( (sbuf = esl_event_get_header(eslC->info_event, "Caller-Caller-ID-Number")) ) {
-                sprintf(buf, "agi_callingani2: %s\n", sbuf);
-                if ( write(fd, buf,strlen(buf) ) < 0)
-                        return -1;
-        }
-        else {
-                sprintf(buf, "agi_callingani2: %s\n", "unknown");
-                if ( write(fd, buf,strlen(buf) ) < 0)
-                        return -1;
-        }
-        /* TODO */
-        if ( (sbuf = esl_event_get_header(eslC->info_event, "Caller-Caller-ID-Number")) ) {
-                sprintf(buf, "agi_callington: %s\n", sbuf);
-                if ( write(fd, buf,strlen(buf) ) < 0)
-                        return -1;
-        }
-        else {
-                sprintf(buf, "agi_callington: %s\n", "unknown");
-                if ( write(fd, buf,strlen(buf) ) < 0)
-                        return -1;
-        }
-        if ( (sbuf = esl_event_get_header(eslC->info_event, "Caller-Destination-Number")) ) {
-                sprintf(buf, "agi_dnid: %s\n", sbuf);
-                if ( write(fd, buf,strlen(buf) ) < 0)
-                        return -1;
-        }
-        else {
-                sprintf(buf, "agi_dnid: %s\n", "unknown");
-                if ( write(fd, buf,strlen(buf) ) < 0)
-                        return -1;
-        }
-        /* TODO */
-        if ( (sbuf = esl_event_get_header(eslC->info_event, "Caller-Destination-Number")) ) {
-                sprintf(buf, "agi_callingtns: %s\n", sbuf);
-                if ( write(fd, buf,strlen(buf) ) < 0)
-                        return -1;
-        }
-        else {
-                sprintf(buf, "agi_callingtns: %s\n", "unknown");
-                if ( write(fd, buf,strlen(buf) ) < 0)
-                        return -1;
-        }
</del><span class="cx">
</span><del>-        /* TODO: correct info */
-        if ( (sbuf = esl_event_get_header(eslC->info_event, "Caller-Destination-Number")) ) {
-                sprintf(buf, "agi_rdnis: %s\n", sbuf);
-                if ( write(fd, buf,strlen(buf) ) < 0)
</del><ins>+        if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"Caller-Destination-Number","agi_dnid: %s\n") ) > 0) {
+                if ( write(fd,sbuf,size) < 0)
</ins><span class="cx">                         return -1;
</span><span class="cx">         }
</span><del>-        else {
-                sprintf(buf, "agi_rdnis: %s\n", "unknown");
-                if ( write(fd, buf,strlen(buf) ) < 0)
</del><ins>+        else
</ins><span class="cx">                         return -1;
</span><del>-        }
-        if ( (sbuf = esl_event_get_header(eslC->info_event, "Channel-Context")) ) {
-                sprintf(buf, "agi_context: %s\n", sbuf);
-                if ( write(fd, buf,strlen(buf) ) < 0)
-                        return -1;
-        }
-        else {
-                sprintf(buf, "agi_context: %s\n", "unknown");
-                if ( write(fd, buf,strlen(buf) ) < 0)
-                        return -1;
-        }
</del><span class="cx">
</span><del>-        if ( (sbuf = esl_event_get_header(eslC->info_event, "Channel-Destination-Number")) ) {
-                sprintf(buf, "agi_extension: %s\n", sbuf);
-                if ( write(fd, buf,strlen(buf) ) < 0)
</del><ins>+        if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"Channel-Context","agi_context: %s\n") ) > 0) {
+                if ( write(fd,sbuf,size) < 0)
</ins><span class="cx">                         return -1;
</span><span class="cx">         }
</span><del>-        else {
-                sprintf(buf, "agi_extension: %s\n", "unknown");
-                if ( write(fd, buf,strlen(buf) ) < 0)
</del><ins>+        else
</ins><span class="cx">                         return -1;
</span><del>-        }
</del><span class="cx">
</span><del>-        /* TODO: correct info */
-        if ( (sbuf = esl_event_get_header(eslC->info_event, "Channel-State-Number")) ) {
-                sprintf(buf, "agi_priority: %s\n", sbuf);
-                if ( write(fd, buf,strlen(buf) ) < 0)
</del><ins>+        if ( (size = fill_buffer_from_header(eslC->info_event,&sbuf,"Channel-Destination-Number","agi_extension: %s\n") ) > 0) {
+                if ( write(fd,sbuf,size) < 0)
</ins><span class="cx">                         return -1;
</span><span class="cx">         }
</span><del>-        else {
-                sprintf(buf, "agi_priority: %s\n", "unknown");
-                if ( write(fd, buf,strlen(buf) ) < 0)
</del><ins>+        else
</ins><span class="cx">                         return -1;
</span><del>-        }
</del><span class="cx">
</span><del>-        if ( write(fd, "agi_enhanced: 0.0\n", 19) < 0 )
</del><ins>+        /* TODO
+         * agi_callingani2
+ * agi_callington
+         * agi_callingtns
+ * agi_rdnis
+         * agi_priority
+ */
+
+        if ( write(fd, "agi_enhanced: 0.0\n", strlen("agi_enhanced: 0.0\n") ) < 0 )
</ins><span class="cx">                 return -1;
</span><del>-        if ( write(fd, "agi_accountcode: \n\n", 21) < 0 )
</del><ins>+        if ( write(fd, "agi_accountcode: \n", strlen("agi_accountcode: \n") ) < 0 )
</ins><span class="cx">                 return -1;
</span><ins>+
+        if ( write(fd, "\n\n", 2 ) < 0 )
+                return -1;
+
</ins><span class="cx">         return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -393,7 +364,7 @@
</span><span class="cx">         if ( esl_execute(eslC,cmd,args,uuid) != ESL_FAIL) {
</span><span class="cx">                 while (!done && eslC->connected) {
</span><span class="cx">                         if (esl_recv_event(eslC,1,NULL) == ESL_FAIL)
</span><del>-                                return -1;
</del><ins>+                                return -1; // Maybe point of failure
</ins><span class="cx">                         else if (eslC->last_ievent) {
</span><span class="cx">                                 if (eslC->last_ievent->event_id == ESL_EVENT_CHANNEL_EXECUTE_COMPLETE ) {
</span><span class="cx">                                         if (! strcasecmp(cmd,esl_event_get_header(eslC->last_ievent,"Application") ) )
</span><span class="lines">@@ -410,91 +381,297 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /*
</span><ins>+ * Answer AGI cmd
+ * TODO: Why is there an A on the AGI side ?
+ */
+static int handle_answer(esl_handle_t *eslC,int fd,int *argc, char *argv[]) {
+        int res;
+        int size;
+        char *buf=NULL;
+        res = do_execute(eslC,"answer",NULL,NULL,NULL);
+
+        size = safe_int_snprintf_buffer(&buf,"200 result=%d\n\n",res);
+
+        res = write(fd,buf,size);
+        free(buf);
+        return res;
+}
+
+/*
+ * SIPADDHEADER(header=value)
+ * TODO: split on = and set the sip_h_header var
+ */
+static int handle_sipaddheader(esl_handle_t *eslC,int fd,int *argc, char *argv[]) {
+        int res;
+        int size;
+        char *buf=NULL;
+
+        res = -1;
+        size = safe_int_snprintf_buffer(&buf,"200 result=%d\n\n",res);
+
+        res = write(fd,buf,size);
+        free(buf);
+        return res;
+}
+
+/*
</ins><span class="cx"> * Hangup AGI cmd
</span><span class="cx"> * TODO:        - Add arg support to know which channel we want to hangup.
</span><span class="cx"> */
</span><span class="cx"> static int handle_hangup(esl_handle_t *eslC,int fd,int *argc, char *argv[]) {
</span><del>-        if (do_execute(eslC,"hangup",NULL,NULL,NULL) < 0 ) {
-                if ( write(fd,"200 result=-1\n\n",128) < 0 )
-                        return -1;
</del><ins>+        int res;
+        int size;
+        char *buf=NULL;
+
+        res = do_execute(eslC,"hangup",NULL,NULL,NULL);
+
+        size = safe_int_snprintf_buffer(&buf,"200 result=%d\n\n",res);
+
+        res = write(fd,buf,size);
+        free(buf);
+        return res;
+}
+
+/*
+ * EXEC command, will search exec_bindings for an entry.
+ */
+static int handle_exec(esl_handle_t *eslC,int fd,int *argc, char *args[]) {
+        int res;
+        int i;
+        char *argv[_MAX_CMD_ARGS];
+
+        for (i = 1;i<=*argc;i++)
+                argv[i-1] = args[i];
+
+        res = find_and_exec_app(eslC,fd,*argc, argv);
+
+        return res;
+}
+
+/*
+ * SET CALLERID
+ */
+static int handle_set_caller_id(esl_handle_t *eslC,int fd,int *argc, char *argv[]) {
+        int res;
+        int size;
+        char *buf=NULL;
+
+        if (*argc < 3 && *argc > 4) {
+                res = -1;
+                goto end;
</ins><span class="cx">         }
</span><ins>+
+        if (argv[2]) {
+                size = strlen(argv[2]) + 30;
+                buf = malloc(size + 1);
+                snprintf(buf,size +1 ,"origination_caller_id_number=%s",argv[2]);
+        }
</ins><span class="cx">         else {
</span><del>-                if ( write(fd,"200 result=0\n\n",128) < 0 )
-                        return -1;
</del><ins>+                res = -1;
+                goto end;
</ins><span class="cx">         }
</span><ins>+
+        res = do_execute(eslC,"set",buf,NULL,NULL);
+
+end:
+        size = safe_int_snprintf_buffer(&buf,"200 result=%d\n\n",res);
+
+        res = write(fd,buf,size);
+        free(buf);
+        return res;
+}
+
+/*
+ * DIAL command
+ * TODO: implement heh
+ * DIAL string is SIP/endpoint/user|timeout|options|url
+ * we should write our own binding as mod_dialplan_asterisk does not seem to support options
+ */
+static int handle_dial(esl_handle_t *eslC,int fd,int *argc, char *argv[]) {
</ins><span class="cx">         return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /*
</span><del>- * Answer AGI cmd
</del><ins>+ * SET VARIABLE
+ * TODO: - verify support for exec('SET','var=value').
+         - add support for exec('SET','FUNC(param)=value')
</ins><span class="cx"> */
</span><del>-static int handle_answer(esl_handle_t *eslC,int fd,int *argc, char *argv[]) {
-        if (do_execute(eslC,"answer",NULL,NULL,NULL) < 0 ) {
-                if ( write(fd,"200 result=-1\n\n",128) < 0 )
-                        return -1;
</del><ins>+static int handle_set_variable(esl_handle_t *eslC,int fd,int *argc, char *argv[]) {
+        int res;
+        int size;
+        char *buf=NULL;
+
+        if (*argc < 2 && *argc > 3) { /* SET VARIABLE var value or SET var=value */
+                res = -1;
+                goto end;
</ins><span class="cx">         }
</span><ins>+
+        if ( (strstr("=",argv[1])) != NULL ) { /* Support for exec set var=value*/
+                if (strstr("(",argv[1]) != NULL && strstr(")",argv[1]) != NULL ) {
+                        /* TODO implement * func(param)=value */
+                        res = -1;
+                        goto end;
+                }
+                else {
+                        size = strlen(argv[1]);
+                        buf = malloc(size + 1);
+                        snprintf(buf,size+1,"%s",argv[1]);
+                }
+        }
+        else if (argv[2] && argv[3]) {
+                size = strlen(argv[2]) + strlen(argv[3]) + 1;
+                buf = malloc(size + 1);
+                snprintf(buf,size +1 ,"%s=%s",argv[2],argv[3]);
+        }
</ins><span class="cx">         else {
</span><del>-                if ( write(fd,"200 result=0\n\n",128) < 0 )
-                        return -1;
</del><ins>+                res = -1;
+                goto end;
</ins><span class="cx">         }
</span><del>-        return 0;
</del><ins>+
+        res = do_execute(eslC,"set",buf,NULL,NULL);
+end:
+        size = safe_int_snprintf_buffer(&buf,"200 result=%d\n\n",res);
+
+        res = write(fd,buf,size);
+        free(buf);
+        return res;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+/*
+ * GET DATA filetoplay timeout maxdigits
+ * will execute the play_and_get_digits app ( <min> <max> <tries> <timeout> <terminators> <file> <invalid_file> <var_name> <regexp> )
+ */
+
+static int handle_getdata(esl_handle_t *eslC,int fd,int *argc, char *argv[]) {
+        char *buf;
+        char *args;
+        int res=0;
+        int size;
+        esl_event_t *reply=NULL;
+
+        if (*argc > 5 && *argc < 3 ) {
+                res = -1;
+                goto end;
+        }
+
+        args = malloc(1024);
+        snprintf(args,1024,"1 %s 1 %s # %s invalid.wav play_get_digits_values \\d+",argv[4] ? argv[4] : "9999", argv[3] ? argv[3] : "2000", argv[2]);
+
+        if (do_execute(eslC,"play_and_get_digits",args,NULL,&reply) < 0 ) {
+                res = -1;
+                goto end;
+        }
+        else {
+                if (reply) {
+                        res = fill_buffer_from_header(reply,&args,"variable_play_get_digits_values","%s");
+                }
+                else {
+                        res = -1;
+                        goto end;
+                }
+
+        }
+
+end:
+        if (args)
+                free(args);
+        if (res < 0) {
+                size = safe_int_snprintf_buffer(&buf,"200 result=%d\n\n",res);
+        }
+        else {
+                size = strlen(args) + 10;
+                buf = malloc(size + 1);
+                snprintf(buf,size + 1,"200 result=%s",args);
+        }
+
+        res = write(fd,buf,size);
+        free(buf);
+
+        return res;
+}
+
+/*
+ * STREAM FILE agi cmd
+ */
</ins><span class="cx"> static int handle_streamfile(esl_handle_t *eslC,int fd,int *argc, char *argv[]) {
</span><del>-        char buf[1024];
-        char *sbuf;
</del><ins>+        char *buf;
</ins><span class="cx">         int offset=0;
</span><del>-        int dtmf=0;
</del><ins>+        char dtmf[2]={"0"};
+        int res;
+
</ins><span class="cx">         esl_event_t *reply=NULL;
</span><span class="cx">
</span><del>-        if (*argc < 3 || *argc > 5)
-                return -1;
-
-        if (argv[3]) {
</del><ins>+        if (*argc < 3 || *argc > 5) {
+                offset=-1;
+                goto end;
+        }
+        
+        if (argv[3] && strncasecmp("\"\"",argv[3],2) ) {
</ins><span class="cx">                 /* We should set playback_terminators var there */
</span><del>-                sprintf(buf,"playback_terminators=%s",argv[3]);
</del><ins>+                buf = malloc(strlen(argv[3])+22);
+                memset(buf,0,strlen(argv[3])+22);
+                snprintf(buf,22,"playback_terminators=%s",argv[3]);
</ins><span class="cx">                 do_execute(eslC,"set",buf,NULL,NULL);
</span><ins>+                free(buf);
</ins><span class="cx">         }
</span><del>-        bzero(&buf,1023);
</del><span class="cx">
</span><span class="cx">         if (argv[4]) {
</span><span class="cx">                 offset = atoi(argv[4]);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (offset > 0)
-                sprintf(buf,"%s@@%d",argv[2],offset);
</del><ins>+        buf = malloc(strlen(argv[2]) + 1);
+        memset(buf,0,strlen(argv[2])+1);
+
+        if (offset > 0) {
+                buf = realloc(buf,strlen(argv[2]) + strlen(argv[4]) + 3);
+                snprintf(buf,strlen(argv[2]) + strlen(argv[4]) + 3,"%s@@%d",argv[2],offset);
+
+        }
</ins><span class="cx">         else
</span><del>-                sprintf(buf,"%s",argv[2]);
</del><ins>+                snprintf(buf,strlen(argv[2]) + 1,"%s",argv[2]);
+
</ins><span class="cx">         offset = 0;
</span><del>-        if ( do_execute(eslC,"playback",buf,NULL,&reply) < 0 ) /* We should write about NON success there instead of returning stock */
-                return -1;
</del><ins>+        if ( do_execute(eslC,"playback",buf,NULL,&reply) < 0 ) { /* We should write about NON success there instead of returning stock */
+                offset = -1;
+        }
</ins><span class="cx">         else {
</span><del>-                bzero(&buf,1023);
-                /* We should check playback_samples var to return offset, sent in the CHANNEL_EXECUTE_COMPLETE and
-                variable_playback_terminator_used to get the DTMF we had */
</del><ins>+                free(buf);
+                buf=NULL;
</ins><span class="cx">                 if (reply) {
</span><del>-                        if (! (sbuf = esl_event_get_header(reply, "variable_playback_samples")) )
-                                        offset = -1;
-                        else {
-                                offset = atoi(sbuf);
-                        }
-                        if (! (sbuf = esl_event_get_header(reply, "variable_playback_terminator_used")) )
-                                        dtmf = 0;
-                        else {
-                                dtmf = atoi(sbuf);
-                        }
</del><ins>+                        res = fill_buffer_from_header(reply,&buf,"variable_playback_samples","%s");
+                        if ( res <= 0 )
+                                offset = 0;
+                        else
+                                offset = atoi(buf);
+
+                        res = fill_buffer_from_header(reply,&buf,"variable_playback_terminator_used","%s");
+                        // sbuf = esl_event_get_header(reply, "variable_playback_terminator_used");
+                        if (res > 0)
+                                snprintf((char *)&dtmf,2,"%s",buf);
</ins><span class="cx">                 }
</span><ins>+                else {
+                        offset=-1;
+                }
</ins><span class="cx">         }
</span><ins>+        if (buf != NULL)
+                free(buf);
+
+end:
</ins><span class="cx">         if (offset < 0) {
</span><del>-                if ( write(fd,"200 result=-1 endpos=0\n\n",128) < 0 )
</del><ins>+                if ( write(fd,"200 result=-1 endpos=0\n\n",128) < 0 ) {
</ins><span class="cx">                         return -1;
</span><ins>+                }
</ins><span class="cx">         }
</span><span class="cx">         else {
</span><del>-                sprintf(buf,"200 result=%d endpos=%d\n\n",dtmf,offset);
-                if ( write(fd,buf,128) < 0 )
</del><ins>+                buf=malloc(65);
+                memset(buf,0,65);
+                snprintf(buf,64,"200 result=%s endpos=%d\n\n",dtmf,offset);
+                if ( write(fd,buf,64) < 0 ) {
+                        free(buf);
</ins><span class="cx">                         return -1;
</span><ins>+                }
+                free(buf);
</ins><span class="cx">         }
</span><del>-
</del><span class="cx">         return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -550,13 +727,6 @@
</span><span class="cx">         return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static command_binding_t bindings[_MAX_CMD] = {
-        { {"ANSWER" , NULL}, handle_answer },
-        { {"HANGUP" , NULL}, handle_hangup },
-        { {"STREAM", "FILE" , NULL}, handle_streamfile },
-};
-
-
</del><span class="cx"> static command_binding_t *find_binding(char *cmd[]) {
</span><span class="cx">         int x,y,match=0;
</span><span class="cx">
</span><span class="lines">@@ -580,6 +750,29 @@
</span><span class="cx">         return NULL;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static command_binding_t *find_app_binding(char *cmd[]) {
+        int x,y,match=0;
+
+        for (x=0; x < sizeof(exec_bindings); x++) {
+                if ( ! exec_bindings[x].cmd[0] ) {
+                        break;
+                }
+                match = 1;
+
+                for (y=0; match && cmd[y]; y++) {
+                        if (!exec_bindings[x].cmd[y]) /* Is the next part existing ?*/
+                                break;
+                        if ( strncasecmp(exec_bindings[x].cmd[y],cmd[y], MAX(strlen(exec_bindings[x].cmd[y]),strlen(cmd[y]) ) ) )
+                                match=0;
+                }
+                if (exec_bindings[x].cmd[y]) /* There's a word missing in cmd */
+                        match=0;
+                if (match)
+                        return &exec_bindings[x];
+        }
+        return NULL;
+}
+
</ins><span class="cx"> static int find_and_exec_command(esl_handle_t *eslC,int fd,char *buf) {
</span><span class="cx">         char *argv[1024];
</span><span class="cx">         int argc = 0;
</span><span class="lines">@@ -595,3 +788,13 @@
</span><span class="cx">         return r;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static int find_and_exec_app(esl_handle_t *eslC,int fd,int argc,char *argv[]) {
+        int r = -1;
+        command_binding_t *bind;
+
+        bind = find_app_binding(argv);
+        if (bind) {
+                r = bind->handler(eslC,fd,&argc,argv);
+        }
+        return r;
+}
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledesl2agiesl2agih"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/esl2agi/esl2agi.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/esl2agi/esl2agi.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/esl2agi/esl2agi.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -61,6 +61,7 @@
</span><span class="cx"> #define ESL_A_TO_VOID(v)        ((void*)(v))
</span><span class="cx"> #define VOID_TO_ESL_A(p)        ((esl_accept_t*)(p))
</span><span class="cx"> #define MAX(x,y)                ((x) > (y) ? (x) : (y))
</span><ins>+#define MIN(x,y)                ((x) < (y) ? (x) : (y))
</ins><span class="cx">
</span><span class="cx"> /*
</span><span class="cx"> * Struct Section
</span><span class="lines">@@ -88,49 +89,53 @@
</span><span class="cx">
</span><span class="cx"> static void *esl2agi_thread(void *data);
</span><span class="cx">
</span><del>-/*
- * - EXEC application OPTIONS
- * - GET DATA filetoplay timeout maxdigits
- * - GET VARIABLE variablename
- * - HANGUP 'channelname'
- * - RECORD FILE filename format escapedigits timeout offsetsamples BEEP s=silence
- * - SAY DIGITS
- * - set autohangup time
- * - set music on|off class
- * - set variable
- * - stream file filename <escape digits> [sample offset]
- * - wait for digit timeout
- */
-
</del><span class="cx"> static int handle_setup_env(int fd,esl_handle_t *eslC);
</span><span class="cx">
</span><span class="cx"> static void parse_args(char *buf,int *argc,char *argv[_MAX_CMD_ARGS]);
</span><span class="cx">
</span><span class="cx"> static command_binding_t *find_binding(char *cmd[]);
</span><span class="cx">
</span><del>-static int handle_hangup(esl_handle_t *eslC,int fd,int *argc, char *argv[_MAX_CMD_ARGS]);
</del><ins>+static command_binding_t *find_app_binding(char *cmd[]);
</ins><span class="cx">
</span><del>-static int handle_answer(esl_handle_t *eslC,int fd, int *argc, char *argv[_MAX_CMD_ARGS]);
-
</del><span class="cx"> static int find_and_exec_command(esl_handle_t *eslC,int fd,char *buf);
</span><span class="cx">
</span><ins>+static int find_and_exec_app(esl_handle_t *eslC,int fd,int argc,char *argv[]);
+
+static int do_execute(esl_handle_t *eslC,char *cmd,char *args,char *uuid,esl_event_t **save_reply);
+
</ins><span class="cx"> /*
</span><ins>+ * ported agi commands
+ */
+static int handle_hangup(esl_handle_t *eslC,int fd,int *argc, char *argv[_MAX_CMD_ARGS]);
</ins><span class="cx">
</span><del>-static int handle_exec(esl_handle_t *eslC,int fd,char *args);
</del><ins>+static int handle_answer(esl_handle_t *eslC,int fd, int *argc, char *argv[_MAX_CMD_ARGS]);
</ins><span class="cx">
</span><del>-static int handle_getdata(esl_handle_t *eslC,int fd,char *args);
</del><ins>+static int handle_streamfile(esl_handle_t *eslC,int fd,int *argc, char *argv[_MAX_CMD_ARGS]);
</ins><span class="cx">
</span><del>-static int handle_getvar(esl_handle_t *eslC,int fd,char *args);
</del><ins>+static int handle_getdata(esl_handle_t *eslC,int fd,int *argc, char *argv[_MAX_CMD_ARGS]);
</ins><span class="cx">
</span><del>-static int handle_record(esl_handle_t *eslC,int fd,char *args);
</del><ins>+static int handle_set_caller_id(esl_handle_t *eslC,int fd,int *argc, char *argv[_MAX_CMD_ARGS]);
</ins><span class="cx">
</span><del>-static int handle_say(esl_handle_t *eslC,int fd,char *args);
</del><ins>+static int handle_set_variable(esl_handle_t *eslC,int fd,int *argc, char *argv[_MAX_CMD_ARGS]);
</ins><span class="cx">
</span><del>-static int handle_setvar(esl_handle_t *eslC,int fd,char *args);
</del><ins>+static int handle_exec(esl_handle_t *eslC,int fd,int *argc, char *argv[_MAX_CMD_ARGS]);
</ins><span class="cx">
</span><del>-static int handle_set(esl_handle_t *eslC,int fd,char *args);
</del><ins>+static int handle_dial(esl_handle_t *eslC,int fd,int *argc, char *argv[]);
</ins><span class="cx">
</span><del>-static int handle_streamfile(esl_handle_t *eslC,int fd,char *args);
</del><ins>+static int handle_sipaddheader(esl_handle_t *eslC,int fd,int *argc, char *argv[]);
</ins><span class="cx">
</span><del>-static int handle_waitdigits(esl_handle_t *eslC,int fd,char *args);
-*/
</del><ins>+/* TODO
+ * - ANSWER : OK
+ * - EXEC application OPTIONS: OK, now will need to add more bindings
+ * - GET DATA filetoplay timeout maxdigits
+ * - GET VARIABLE variablename
+ * - HANGUP 'channelname' : TODO channel name to hangup
+ * - RECORD FILE filename format escapedigits timeout offsetsamples BEEP s=silence
+ * - SAY DIGITS
+ * - set autohangup time
+ * - set music on|off class
+ * - set variable: should be OK ( untested )
+ * - set callerid: should be OK ( untested )
+ * - stream file filename <escape digits> [sample offset] : OK ( check when using offset todo )
+ * - wait for digit timeout
+ */
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpcheckphpfromrev15313freeswitchtrunkcontribgledphpcheckphp"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/check.php (from rev 15313, freeswitch/trunk/contrib/gled/php/check.php) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/check.php         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/check.php        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+#!/usr/bin/php -q
+<?php
+require_once('phpagi-2.14/phpagi.php');
+
+$agi = new AGI();
+logthis("New call incoming");
+
+$agi->answer();
+
+logthis("Answered");
+
+$res = $agi->stream_file('/telephony/freeswitch/sounds/en/us/callie/ivr/8000/ivr-you_have_dialed_an_invalid_extension.wav',"*");
+
+logthis("Stream_file res:".print_r($res,true));
+
+$agi->hangup();
+
+?>
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214fromrev15313freeswitchtrunkcontribgledphpphpagi214"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14 (from rev 15313, freeswitch/trunk/contrib/gled/php/phpagi-2.14)</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214COPYING"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/COPYING</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214COPYINGfromrev15313freeswitchtrunkcontribgledphpphpagi214COPYING"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/COPYING (from rev 15313, freeswitch/trunk/contrib/gled/php/phpagi-2.14/COPYING) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/COPYING         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/COPYING        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,458 @@
</span><ins>+                 GNU LESSER GENERAL PUBLIC LICENSE
+                 Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                         Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+                 GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                         NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                 END OF TERMS AND CONDITIONS
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214README"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/README</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214READMEfromrev15313freeswitchtrunkcontribgledphpphpagi214README"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/README (from rev 15313, freeswitch/trunk/contrib/gled/php/phpagi-2.14/README) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/README         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/README        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+PHPAGI README
+ $Id: README,v 1.4 2005/05/19 13:19:37 pinhole Exp $
+---------------------------------------
+
+Welcome to PHPAGI.
+
+phpagi is a set of PHP classes for use in developing applications with
+the Asterisk Gateway Interface, and is licensed under the GNU Lesser
+General Public License (see COPYING for terms).
+
+This release (version 2) of the phpagi classes is a significant overhaul
+from the old version 1 library. API functions have been renamed and
+restructured.
+
+Version 1 of phpagi is no longer supported, but will continue to be
+available for historical purposes. We strongly encourage you to migrate
+to this new version.
+
+If you have developed software based around phpagi, we'd like to hear from
+you! Drop us a note, and indicate whether you'd like us to list your
+application on our website.
+
+FILES
+-----
+ phpagi.php - The main phpagi class.
+ phpagi-asmanager.php - The Asterisk Manager class.
+ phpagi-fastagi.php - FastAGI class.
+ phpagi_1.php - Compatability class for 1.12 release
+
+ docs/ - README files for the classes.
+ api-docs/ - API Documentation (html)
+
+DOCS
+----
+ README.phpagi - The main phpagi README
+ README.phpagi-asmanager - The phpagi asterisk manager README
+ README.phpagi-fastagi - phpagi fastagi README
+
+ CHANGELOG - Change Log.
+
+ phpagi.conf - An example configuration file for phpagi.
+ fastagi.xinetd - xinetd.conf sample configuration for fastagi
+
+
+SUPPORT
+-------
+
+Support for phpagi is available from the project website.
+
+ * http://phpagi.sourceforge.net
+ * http://sourceforge.net/projects/phpagi/
+
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsfromrev15313freeswitchtrunkcontribgledphpphpagi214docs"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs (from rev 15313, freeswitch/trunk/contrib/gled/php/phpagi-2.14/docs)</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsCHANGELOG"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CHANGELOG</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsCHANGELOGfromrev15313freeswitchtrunkcontribgledphpphpagi214docsCHANGELOG"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CHANGELOG (from rev 15313, freeswitch/trunk/contrib/gled/php/phpagi-2.14/docs/CHANGELOG) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CHANGELOG         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CHANGELOG        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,159 @@
</span><ins>+----------
+CHANGES
+----------
+
+May 25, 2005 - David Eder
+        * Added fastpass support.
+
+May 18, 2005 - David Eder
+        * Added phpagi_1.php as a wrapper class for 1.12 compatibility.
+
+March 25, 2005 - David Eder
+        * Changed the way text2wave and swift are executed for better compatibility.
+        * Added caching to text2wav and swift.
+
+March 12, 2005 - David Eder
+        * fixed autohangup in phpagi-asmanager.php, renamed to set_autohangup.
+        * Added more documentation to phpagi-asmanager.php.
+        * Added weather example.
+
+March 4, 2005 - David Eder
+        * FastAGI via xinetd
+
+February 17, 2005 - David Eder
+        * Fixed bugs with error handler.
+
+February 16, 2005 - David Eder
+        * Added Cepstral swift TTS patch from C. Arbusti of Soluzioni Vocali ( http://soluzionivocali.it ).
+        * Extended swift TTS functionality.
+        * Moved tempdir from [festival] to [phpagi] so that it can be shared with other extensions.
+
+February 2, 2005 - David Eder
+        * More documentation.
+        * Reworked and reintegrated AGI_AsteriskManager class.
+
+January 21, 2005 - David Eder
+        * Added exec_dial($type, $identifier, $timeout=NULL, $options=NULL, $url=NULL).
+ * Added exec_goto($a, $b=NULL, $c=NULL).
+        * Fixed bugs in evaluate, better support of multiline and closed input and output.
+        * Fixed bugs in config initialization.
+
+January 19, 2005 - David Eder
+ * SUMMARY:
+        * Massive restructuring!
+ * Updated to use more PHP internal functions.
+ * Updated function arguments to represent their AGI function's arguments.
+ * Functions now return a consistent result array.
+ * Added phpdoc documentation.
+ * Removed functions that can be done with internal PHP or AGI functions.
+ * Enhanced error handler.
+        *
+        * Goals of changes:
+        *
+        * It is important for a language API to not wander too far from the general
+        * API. Functions that are named differently have been updated. Function
+        * arguments that do not match the AGI API have been updated. Underscores
+        * have been substituted for spaces to make them compatible with PHP function
+        * names. Optional arguments in AGI should remain optional if possible. Return
+        * values should be consistent. Functions need to be better documented.
+        *
+        * Result:
+        *
+        * The return from most functions is now
+        * array('code'=>$code, 'result'=>$result, 'data'=>$data)
+        * ['data'] still needs some work.
+        *
+        * removed class variables:
+        * $response - It was no longer used with the new return structure.
+        *
+        * removed functions:
+        * agi_is_error($retarr) - It was no longer used with the new return
+        * structure. Each function has it's own result that must be evalutated
+        * by the programmer, as the return values are often specific to the function.
+        * agi_readresult($str=FALSE) - It was no longer used with the new return structure.
+        * agi_response_code() - It was no longer used with the new return structure.
+        * agi_response_result() - It was no longer used with the new return structure.
+        * agi_response_data() - It was no longer used with the new return structure.
+        * agi_response_var($var) - It was no longer used with the new return structure.
+        * agi_response_is_error() - see agi_is_error
+        * agi_read() - It was deprecated
+        * con_print_r($arr,$label='',$lvl=0) - Use print_r($arr, true) in conjunction with conlog
+        * agi_getdtmf($len,$timeout,$terminator=FALSE,$prompt=FALSE) - use get_data
+        * agi_dtmf2text($len,$timeout,$terminator=FALSE,$prompt=FALSE) - use text_input
+        * arr2str($arr) - use PHP function join
+        * config_load($file) - use PHP function parse_ini_file
+        * enum_lookup($telnumber,$rDNS="e164.org") - use exec_enumlookup
+        * enum_txtlookup($telnumber,$rDNS="e164.org") - use exec_enumlookup
+        *
+        * added functions:
+        * answer()
+        * autohangup($time=0)
+        * exec($application, $options)
+        * get_data($filename, $timeout=NULL, $max_digits=NULL)
+        * receive_char($timeout=-1)
+        * say_phonetic($text, $escape_digits='')
+        * set_context($context)
+        * set_extension($extension)
+        * set_priority($priority)
+        * tdd_mode($setting)
+        * wait_for_digit($timeout=-1)
+        * database_deltree($family, $keytree='')
+        * noop()
+        * set_music($enabled=true, $class='')
+        * exec_absolutetimeout($seconds=0)
+        * exec_agi($command, $args)
+        * exec_enumlookup($exten)
+        * text_input($mode='NUMERIC')
+        * say_punctuation($text, $escape_digits='', $frequency=8000)
+        * which($cmd, $checkpath=NULL)
+        * make_folder($folder, $perms=0755)
+        * updated functions:
+        * agi_exec($str) -> evaluate($command) - exec is an AGI function
+        * agi_verbose($str,$vbl=1) -> verbose($message, $level=1) - consistency with AGI
+        * db_get($family,$key) -> database_get($family, $key) - consistency with AGI
+        * db_put($family,$key,$val) -> database_put($family, $key, $value) - consistency with AGI
+        * db_del($family,$key) -> database_del($family, $key) - consistency with AGI
+        * get_var($var) -> get_variable($variable) - consistency with AGI
+        * set_var($var,$val) -> set_variable($variable, $value) - consistency with AGI
+        * agi_hangup() -> hangup($channel='') - consistency with AGI
+        * agi_channel_status($channel) -> channel_status($channel='') - consistency with AGI
+        * agi_recordfile($file,$format,$timeout=5000,$prompt=FALSE) -> record_file($file, $format, $escape_digits='', $timeout=-1, $beep=false, $silence=NULL) - consistency with AGI
+        * agi_play($file) -> stream_file($filename, $escape_digits='', $offset=0) - consistency with AGI
+        * agi_goto($con,$ext='s',$pri=1) -> goto($context, $extension='s', $priority=1) - consistency with AGI
+        * agi_saydigits($digits) -> say_digits($digits, $escape_digits='') - consistency with AGI
+        * agi_saynumber($number) -> say_number($number, $escape_digits='') - consistency with AGI
+        * agi_saytime($time="") -> say_time($time=NULL, $escape_digits='') - consistency with AGI
+        * agi_setlanguage($language="en") -> exec_setlanguage($language='en') - consistency with AGI
+        * text2wav($text) -> text2wav($text, $escape_digits='', $frequency=8000) - consistency with AGI
+        * phpagi_error_handler($errno, $errstr, $errfile, $errline) -> phpagi_error_handler($level, $message, $file, $line, $context) - I needed better error handling
+
+August 29, 2004 -
+        * Fixed db_get now returns a value
+        * Fixed db_put now stores a value
+        * Added enum_lookup, requires external "dig" utility.
+        * Tweak con_print_r now dumps arrays, displays variable type.
+        * Added enum_txtlookup, requires external "dig" utility".
+        * Added parse_callerid, thanks to http://www.sbuehl.com/projects/asterisk/asterisk-howto-3.html
+
+August 26, 2004 -
+        * Added agi_verbose
+        * Added debug config-option to shut conlog up
+        * Added agi_saydigits, agi_saynumber, agi_saytime, agi_setlanguage
+
+April 8, 2004 - v1.5 internal
+ * Added agi_goto - David Croft
+ * Added this changelog (maintain it eh?) - Matthew Asham
+ * Added quote fixing to conlog - David Croft
+ * Added new parameter to AGI constructor, $configopt array - Matthew Asham
+ - Added phpagi_error_handler - David Croft
+
+
+
+March 20, 2004 - v1.5
+        * Fixed buffering bugs - David Croft
+        * added demo app. - Matthew Asham
+        * misc stuff. - Matthew Asham
+
+November 2003
+        * Initial version
+        
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsCVSfromrev15313freeswitchtrunkcontribgledphpphpagi214docsCVS"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS (from rev 15313, freeswitch/trunk/contrib/gled/php/phpagi-2.14/docs/CVS)</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsCVSEntries"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/Entries</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsCVSEntriesfromrev15313freeswitchtrunkcontribgledphpphpagi214docsCVSEntries"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/Entries (from rev 15313, freeswitch/trunk/contrib/gled/php/phpagi-2.14/docs/CVS/Entries) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/Entries         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/Entries        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+/CHANGELOG/1.4/Wed May 25 18:43:57 2005//
+/README.phpagi/1.1/Mon Mar 14 19:38:20 2005//
+/README.phpagi-asmanager/1.1/Mon Mar 14 19:38:20 2005//
+/README.phpagi-fastagi/1.1/Mon Mar 14 19:38:20 2005//
+/fastagi.xinetd/1.1/Mon Mar 14 19:38:20 2005//
+/phpagi.example.conf/1.1/Mon Mar 14 19:38:20 2005//
+D
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsCVSRepository"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/Repository</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsCVSRepositoryfromrev15313freeswitchtrunkcontribgledphpphpagi214docsCVSRepository"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/Repository (from rev 15313, freeswitch/trunk/contrib/gled/php/phpagi-2.14/docs/CVS/Repository) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/Repository         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/Repository        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+phpagi/docs
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsCVSRoot"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/Root</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsCVSRootfromrev15313freeswitchtrunkcontribgledphpphpagi214docsCVSRoot"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/Root (from rev 15313, freeswitch/trunk/contrib/gled/php/phpagi-2.14/docs/CVS/Root) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/Root         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/CVS/Root        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+:ext:masham@cvs.sourceforge.net:/cvsroot/phpagi
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsREADMEphpagi"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/README.phpagi</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsREADMEphpagifromrev15313freeswitchtrunkcontribgledphpphpagi214docsREADMEphpagi"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/README.phpagi (from rev 15313, freeswitch/trunk/contrib/gled/php/phpagi-2.14/docs/README.phpagi) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/README.phpagi         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/README.phpagi        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,94 @@
</span><ins>+phpagi: an AGI class written in PHP
+
+ Matthew Asham <matthewa@bcwireless.net>
+ http://phpagi.sourceforge.net
+
+Contributions by:
+ Florian Overkamp <florian@speakup.nl>
+ David Eder <david@eder.us>
+
+OVERVIEW
+--------
+
+Include it:
+
+require 'phpagi.php';
+
+Construct it:
+
+$agi = new AGI();
+
+This creates a new AGI object with all the agi vars read in, you're now ready
+to rock and roll.
+
+Answer the line.
+
+$agi->answer();
+
+Play a file.
+
+$agi->stream_file('somefile.gsm');
+
+Record a file.
+
+$agi->record_file($file, $format, $escape_digits='', $timeout=-1, $beep=false, $silence=NULL)
+
+There's more, read the class or refer to the PHPAGI website for more information.
+
+ This README is seriousley lacking.
+
+CONFIGURATION
+-------------
+
+phpagi supports an ini style configuration file, and run time configuration.
+
+By default the class reads in the contents of /etc/asterisk/phpagi.conf into
+$this->config. The format of the ini file is as follows:
+
+[examplesection]
+foo=bar
+bar=dew
+dew=pale ale
+
+This is read into $this->config as:
+
+$this->config['examplesection']['foo']='bar';
+$this->config['examplesection']['bar]='dew';
+$this->config['examplesection']['dew']='pale ale';
+
+
+Run time configuration is also supported. Pass an array of variables and values as the
+second parameter to the AGI constructor, these fields are stored in $this->config['phpagi'].
+
+ie:
+
+$myconfig=array(
+        "error_handler"="true"
+);
+
+        $agi=new AGI("/etc/asterisk/phpagi.conf",$myconfig);
+
+
+The following run-time configuration options are used by the phpagi class to change behaviour. They
+are all contained in the $this->config['phpagi'] array.
+
+ * error_handler - set to "true" (string) to enable php debugging
+
+        
+EXAMPLE APPLICATION
+-------------------
+
+ping.php is an example phpagi application. it asks for an IP address to be
+entered, and reads back the results of a "ping" summary.
+
+to use it, you'll need festival installed. see http://www.voip-info.org/tiki-index.php?page=Asterisk+festival+installation
+for all the groovy bits to get festival working with asterisk, then configure
+phpagi to use it too:
+
+in /etc/asterisk/phpagi.conf:
+
+[festival]
+text2wave=/usr/src/festival/bin/text2wave
+tempdir=/var/lib/asterisk/sounds/tmp/
+
+
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsREADMEphpagiasmanager"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/README.phpagi-asmanager</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsREADMEphpagiasmanagerfromrev15313freeswitchtrunkcontribgledphpphpagi214docsREADMEphpagiasmanager"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/README.phpagi-asmanager (from rev 15313, freeswitch/trunk/contrib/gled/php/phpagi-2.14/docs/README.phpagi-asmanager) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/README.phpagi-asmanager         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/README.phpagi-asmanager        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,218 @@
</span><ins>+phpagi-asmanager: an Asterisk Manager class written in PHP
+
+ Matthew Asham <matthewa@bcwireless.net>
+ http://phpagi.sourceforge.net
+------------------------------------------------------------------------------
+
+------------------------------------------------------------------------------
+SECURITY
+------------------------------------------------------------------------------
+
+Validation:
+
+******If asterisk is running as root, the manager interface may allow the
+execution of arbitrary shell commands as root. If the user can update any
+configuration file that can execute arbitrary command (like the dialplan),
+the system may be compromised.
+
+Also, look out for command injection. Consider the following example:
+
+        $as->Events($_POST['events_status']);
+
+We expect either 'on' or 'off', but the attacker uses:
+
+        "\r\n\r\nAction: Command\r\nCommand: database put forward 54321 19005551212";
+
+
+Validation is a *must* for all user data.
+
+
+Username and Secret:
+
+Storing the username and secret in the config file will isolate them from your
+code.
+
+Isolation of username and secret in the config file does not mean that the
+script cannot simple read the config file. The config file must be readable
+by the script.
+
+
+CREATING A NEW INSTANCE OF THE CLASS
+------------------------------------------------------------------------------
+
+The class can be created standalone of phpagi.php, or through phpagi.
+
+STANDALONE:
+
+require "phpagi-asmanager.php";
+
+$as = new AGI_AsteriskManager();
+
+FROM PHPAGI:
+
+require "phpagi.php";
+
+$agi = new AGI();
+$as = $agi->new_AsteriskManager();
+
+Notes:
+
+* If the class is created using $agi->new_AsteriskManager(),
+ AGI_AsteriskManager will use the parent phpagi for logging to the Asterisk
+ console.
+
+* phpagi.php will include phpagi-asmanager.php by itself.
+ * If phpagi-asmanager.php is included _before_ phpagi.php, phpagi.php will
+ not attempt to re-include it.
+ * If phpagi.php tries to include phpagi-asmanager.php but is unable to do
+ so, an error will be echoed to the asterisk console and the script will
+ continue running normally. in this case the return value of
+ new_AsteriskManager() will be FALSE.
+
+------------------------------------------------------------------------------
+CONFIGURATION
+------------------------------------------------------------------------------
+
+phpagi-asmanager uses the same configuration file as phpagi.conf (usually
+/etc/asterisk/phpagi.conf). All configuration information specific to
+phpagi-asmanager is contained in the [asmanager] section of the .conf file.
+
+supported directives:
+
+[asmanager]
+# server to connect to
+server=localhost
+
+# default manager port
+port=5038
+
+#username for login
+username=me_and_only_me
+
+#password for login
+secret=i_am_not_telling
+
+
+
+------------------------------------------------------------------------------
+CONNECTING
+------------------------------------------------------------------------------
+
+        $res = $as->connect("localhost", "username", "password");
+        if($res == FALSE) {
+                echo "Connection failed.\n";
+        }
+        elseif($res == TRUE){
+                echo "Connection established.\n";
+        }
+
+A port can also be specified for the hostname. eg:
+
+        $res = $as->connect("my.asterisk.server:1234", "username", "port");
+
+If the no parameters are specified, the defaults from the config will be used.
+
+
+------------------------------------------------------------------------------
+DISCONNECTING
+------------------------------------------------------------------------------
+
+ $as->disconnect();
+
+------------------------------------------------------------------------------
+SENDING REQUESTS
+------------------------------------------------------------------------------
+
+        $as->send_request($eventname, $arrayofparameterstopass);
+
+send_request() calls wait_request and returns an array of returned data from
+the manager. If something went wrong, it returns false.
+
+wait_request() shouldn't need to be called from a script directly unless you
+are implementing merely an event listener.
+
+wait_request() will also detect events and dispatch any registered event
+handlers for the event.
+
+examples:
+
+        $res = $as->send_request('EventName',
+ array('Channel'=>'Zap/1/16045551212',
+ 'SomeParameter'=>'data'));
+        echo "Dump of returned data:\n";
+        foreach($res as $var=>$val)
+         echo "$var = $val\n";
+
+
+$res['Response'] will generally be 'Success' on success and 'Error' on
+failure. But this is not always true. If $res['Response'] == 'Follows', a
+multi-line response will be stored in $res['data'].
+
+Several manager commands have been aliased for convenience. See below.
+
+------------------------------------------------------------------------------
+EVENTS
+------------------------------------------------------------------------------
+
+TODO: non-blocking socket i/o.
+
+The class uses event callbacks to process events received from the manager.
+
+The event callback prototype looks like:
+
+        function dump_event($ecode, $data, $server, $port)
+        {
+         echo "received event '$ecode' from $server:$port\n";
+         print_r($data);
+        }
+
+To register an event call back:
+
+        $as->add_event_handler('eventname', 'eventfunction');
+
+eg:
+
+        $as->add_event_handler('registry', 'dump_event');
+
+
+The special eventname "*" can also be registered. any eventname not
+specifically registered will be handled by the "*" handler. If no "*" handler
+is defined, the event will be silently ignored.
+
+
+------------------------------------------------------------------------------
+PRECANNED FUNCTIONS
+------------------------------------------------------------------------------
+
+The following Manager functions have been aliased for convenience:
+
+AbsoluteTimeout
+ChangeMonitor
+Command
+Events
+ExtensionState
+GetVar
+Hangup
+IAXPeers
+ListCommands
+Logoff
+MailboxCount
+MailboxStatus
+Monitor
+Originate
+ParkedCalls
+Ping
+Queues
+QueueStatus
+Redirect
+SetCDRUserField
+SetVar
+SIPpeers
+Status
+StopMontor
+ZapDialOffhook
+ZapDNDoff
+ZapDNDon
+ZapHangup
+ZapTransfer
+
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsREADMEphpagifastagi"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/README.phpagi-fastagi</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsREADMEphpagifastagifromrev15313freeswitchtrunkcontribgledphpphpagi214docsREADMEphpagifastagi"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/README.phpagi-fastagi (from rev 15313, freeswitch/trunk/contrib/gled/php/phpagi-2.14/docs/README.phpagi-fastagi) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/README.phpagi-fastagi         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/README.phpagi-fastagi        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+First, in /etc/services, at this line:
+
+fastagi 4573/tcp # Asterisk AGI
+
+
+
+Second, create /etc/xnetd.d/fastagi with:
+
+# default: off
+# description: fastagi is a remote AGI interface
+service fastagi
+{
+ socket_type = stream
+ user = root
+ group = nobody
+ server = <path to phpagi-fastagi.php>
+ wait = no
+ protocol = tcp
+ bind = 127.0.0.1
+ disable = no
+}
+
+Make sure you set the path to the phpagi-fastagi.php script. Set the user
+and group to a non-root user if none of your scripts need root access. You
+might consider using posix_setuid and friends to reduce privileges. Change
+the bind address to your outbound IP address or to 0.0.0.0 to allow anyone
+to connect. Be sure to read up about xinetd and take advantage of security
+features it provides. Fast AGI doesn't provide authentification. It's up
+to you to keep unwanted visitors from extracting information from your AGI
+implementation.
+
+
+Third, write your code.
+
+Take special notice of how fastagi.php works:
+
+        1. $fastagi is initialized as a new AGI.
+        2. The script determines which script was requested.
+        3. The script is called using
+         reqire_once($fastagi->request['agi_request']).
+        4. Your script takes over. You must not create a new AGI, but
+         insead use the $fastagi instance that has already been created.
+
+In your dialplan:
+
+exten => 5551212, 1, Agi(agi://127.0.0.1/myscript.php)
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsfastagixinetd"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/fastagi.xinetd</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsfastagixinetdfromrev15313freeswitchtrunkcontribgledphpphpagi214docsfastagixinetd"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/fastagi.xinetd (from rev 15313, freeswitch/trunk/contrib/gled/php/phpagi-2.14/docs/fastagi.xinetd) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/fastagi.xinetd         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/fastagi.xinetd        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+# default: off
+# description: fastagi is a remote AGI interface
+service fastagi
+{
+ socket_type = stream
+ user = root
+ group = nobody
+ server = /var/lib/asterisk/agi-bin/phpagi/phpagi-fastagi.php
+ wait = no
+ protocol = tcp
+ bind = 127.0.0.1
+ disable = no
+}
+
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsphpagiexampleconf"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/phpagi.example.conf</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214docsphpagiexampleconffromrev15313freeswitchtrunkcontribgledphpphpagi214docsphpagiexampleconf"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/phpagi.example.conf (from rev 15313, freeswitch/trunk/contrib/gled/php/phpagi-2.14/docs/phpagi.example.conf) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/phpagi.example.conf         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/docs/phpagi.example.conf        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+; example phpagi.conf
+
+[phpagi]
+debug=true                                enable debuging
+error_handler=true                        use internal error handler
+admin=errors@mydomain.com                mail errors to
+hostname=sip.mydomain.com                host name of this server
+tempdir=/var/spool/asterisk/tmp/        temporary directory for storing temporary output
+
+[asmanager]
+server=localhost                        server to connect to
+port=5038                                default manager port
+username=me_and_only_me                        username for login
+secret=i_am_not_telling                        password for login
+
+[fastagi]
+setuid=true                                drop privileges to owner of script
+basedir=/var/lib/asterisk/agi-bin/        path to script folder
+
+[festival]                                text to speech engine
+text2wave=/usr/bin/text2wave                path to text2wave binary
+
+[cepstral]                                alternate text to speech engine
+swift=/opt/swift/bin/swift                path to switft binary
+voice=David                                default voice
+
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214mkdocsphp"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/mkdocs.php</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214mkdocsphpfromrev15313freeswitchtrunkcontribgledphpphpagi214mkdocsphp"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/mkdocs.php (from rev 15313, freeswitch/trunk/contrib/gled/php/phpagi-2.14/mkdocs.php) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/mkdocs.php         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/mkdocs.php        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+#!/usr/local/bin/php -q
+<?php
+ $cwd = getcwd();
+ passthru("phpdoc -t \"$cwd/api-docs\" -f \"$cwd/phpagi.php,$cwd/phpagi-asmanager.php,$cwd/phpagi-fastagi.php,$cwd/phpagi_1.php\" -pp on -ti \"phpAGI\" -o HTML:frames:earthli -s on");
+?>
+
+
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214phpagiasmanagerphp"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/phpagi-asmanager.php</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214phpagiasmanagerphpfromrev15313freeswitchtrunkcontribgledphpphpagi214phpagiasmanagerphp"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/phpagi-asmanager.php (from rev 15313, freeswitch/trunk/contrib/gled/php/phpagi-2.14/phpagi-asmanager.php) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/phpagi-asmanager.php         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/phpagi-asmanager.php        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,818 @@
</span><ins>+<?php
+ /**
+ * phpagi-asmanager.php : PHP Asterisk Manager functions
+ * Website: http://phpagi.sourceforge.net
+ *
+ * $Id: phpagi-asmanager.php,v 1.10 2005/05/25 18:43:48 pinhole Exp $
+ *
+ * Copyright (c) 2004, 2005 Matthew Asham <matthewa@bcwireless.net>, David Eder <david@eder.us>
+ * All Rights Reserved.
+ *
+ * This software is released under the terms of the GNU Lesser General Public License v2.1
+ * A copy of which is available from http://www.gnu.org/copyleft/lesser.html
+ *
+ * We would be happy to list your phpagi based application on the phpagi
+ * website. Drop me an Email if you'd like us to list your program.
+ *
+ * @package phpAGI
+ * @version 2.0
+ */
+
+
+ /**
+ * Written for PHP 4.3.4, should work with older PHP 4.x versions.
+ * Please submit bug reports, patches, etc to http://sourceforge.net/projects/phpagi/
+ * Gracias. :)
+ *
+ */
+
+ if(!class_exists('AGI'))
+ {
+ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'phpagi.php');
+ }
+
+ /**
+ * Asterisk Manager class
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+config+manager.conf
+ * @link http://www.voip-info.org/wiki-Asterisk+manager+API
+ * @example examples/sip_show_peer.php Get information about a sip peer
+ * @package phpAGI
+ */
+ class AGI_AsteriskManager
+ {
+ /**
+ * Config variables
+ *
+ * @var array
+ * @access public
+ */
+ var $config;
+
+ /**
+ * Socket
+ *
+ * @access public
+ */
+ var $socket = NULL;
+
+ /**
+ * Server we are connected to
+ *
+ * @access public
+ * @var string
+ */
+ var $server;
+
+ /**
+ * Port on the server we are connected to
+ *
+ * @access public
+ * @var integer
+ */
+ var $port;
+
+ /**
+ * Parent AGI
+ *
+ * @access private
+ * @var AGI
+ */
+ var $pagi;
+
+ /**
+ * Event Handlers
+ *
+ * @access private
+ * @var array
+ */
+ var $event_handlers;
+
+ /**
+ * Constructor
+ *
+ * @param string $config is the name of the config file to parse or a parent agi from which to read the config
+ * @param array $optconfig is an array of configuration vars and vals, stuffed into $this->config['asmanager']
+ */
+ function AGI_AsteriskManager($config=NULL, $optconfig=array())
+ {
+ // load config
+ if(!is_null($config) && file_exists($config))
+ $this->config = parse_ini_file($config, true);
+ elseif(file_exists(DEFAULT_PHPAGI_CONFIG))
+ $this->config = parse_ini_file(DEFAULT_PHPAGI_CONFIG, true);
+
+ // If optconfig is specified, stuff vals and vars into 'asmanager' config array.
+ foreach($optconfig as $var=>$val)
+ $this->config['asmanager'][$var] = $val;
+
+ // add default values to config for uninitialized values
+ if(!isset($this->config['asmanager']['server'])) $this->config['asmanager']['server'] = 'localhost';
+ if(!isset($this->config['asmanager']['port'])) $this->config['asmanager']['port'] = 5038;
+ if(!isset($this->config['asmanager']['username'])) $this->config['asmanager']['username'] = 'placecalls';
+ if(!isset($this->config['asmanager']['secret'])) $this->config['asmanager']['secret'] = 'asecret';
+ }
+
+ /**
+ * Send a request
+ *
+ * @param string $action
+ * @param array $parameters
+ * @return array of parameters
+ */
+ function send_request($action, $parameters=array())
+ {
+ $req = "Action: $action\r\n";
+ foreach($parameters as $var=>$val)
+ $req .= "$var: $val\r\n";
+ $req .= "\r\n";
+ fwrite($this->socket, $req);
+ return $this->wait_response();
+ }
+
+ /**
+ * Wait for a response
+ *
+ * If a request was just sent, this will return the response.
+ * Otherwise, it will loop forever, handling events.
+ *
+ * @param boolean $allow_timeout if the socket times out, return an empty array
+ * @return array of parameters, empty on timeout
+ */
+ function wait_response($allow_timeout=false)
+ {
+ $timeout = false;
+ do
+ {
+ $type = NULL;
+ $parameters = array();
+
+ $buffer = trim(fgets($this->socket, 4096));
+ while($buffer != '')
+ {
+ $a = strpos($buffer, ':');
+ if($a)
+ {
+ if(!count($parameters)) // first line in a response?
+ {
+ $type = strtolower(substr($buffer, 0, $a));
+ if(substr($buffer, $a + 2) == 'Follows')
+ {
+ // A follows response means there is a miltiline field that follows.
+ $parameters['data'] = '';
+ $buff = fgets($this->socket, 4096);
+ while(substr($buff, 0, 6) != '--END ')
+ {
+ $parameters['data'] .= $buff;
+ $buff = fgets($this->socket, 4096);
+ }
+ }
+ }
+
+ // store parameter in $parameters
+ $parameters[substr($buffer, 0, $a)] = substr($buffer, $a + 2);
+ }
+ $buffer = trim(fgets($this->socket, 4096));
+ }
+
+ // process response
+ switch($type)
+ {
+ case '': // timeout occured
+ $timeout = $allow_timeout;
+ break;
+ case 'event':
+ $this->process_event($parameters);
+ break;
+ case 'response':
+ break;
+ default:
+ $this->log('Unhandled response packet from Manager: ' . print_r($parameters, true));
+ break;
+ }
+ } while($type != 'response' && !$timeout);
+ return $parameters;
+ }
+
+ /**
+ * Connect to Asterisk
+ *
+ * @example examples/sip_show_peer.php Get information about a sip peer
+ *
+ * @param string $server
+ * @param string $username
+ * @param string $secret
+ * @return boolean true on success
+ */
+ function connect($server=NULL, $username=NULL, $secret=NULL)
+ {
+ // use config if not specified
+ if(is_null($server)) $server = $this->config['asmanager']['server'];
+ if(is_null($username)) $username = $this->config['asmanager']['username'];
+ if(is_null($secret)) $secret = $this->config['asmanager']['secret'];
+
+ // get port from server if specified
+ if(strpos($server, ':') !== false)
+ {
+ $c = explode(':', $server);
+ $this->server = $c[0];
+ $this->port = $c[1];
+ }
+ else
+ {
+ $this->server = $server;
+ $this->port = $this->config['asmanager']['port'];
+ }
+
+ // connect the socket
+ $errno = $errstr = NULL;
+ $this->socket = @fsockopen($this->server, $this->port, $errno, $errstr);
+ if($this->socket == false)
+ {
+ $this->log("Unable to connect to manager {$this->server}:{$this->port} ($errno): $errstr");
+ return false;
+ }
+
+ // read the header
+ $str = fgets($this->socket);
+ if($str == false)
+ {
+ // a problem.
+ $this->log("Asterisk Manager header not received.");
+ return false;
+ }
+ else
+ {
+ // note: don't $this->log($str) until someone looks to see why it mangles the logging
+ }
+
+ // login
+ $res = $this->send_request('login', array('Username'=>$username, 'Secret'=>$secret, 'Events' => 'off'));
+ if($res['Response'] != 'Success')
+ {
+ $this->log("Failed to login.");
+ $this->disconnect();
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Disconnect
+ *
+ * @example examples/sip_show_peer.php Get information about a sip peer
+ */
+ function disconnect()
+ {
+ $this->logoff();
+ fclose($this->socket);
+ }
+
+ // *********************************************************************************************************
+ // ** COMMANDS **
+ // *********************************************************************************************************
+
+ /**
+ * Set Absolute Timeout
+ *
+ * Hangup a channel after a certain time.
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+AbsoluteTimeout
+ * @param string $channel Channel name to hangup
+ * @param integer $timeout Maximum duration of the call (sec)
+ */
+ function AbsoluteTimeout($channel, $timeout)
+ {
+ return $this->send_request('AbsoluteTimeout', array('Channel'=>$channel, 'Timeout'=>$timeout));
+ }
+
+ /**
+ * Change monitoring filename of a channel
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+ChangeMonitor
+ * @param string $channel the channel to record.
+ * @param string $file the new name of the file created in the monitor spool directory.
+ */
+ function ChangeMonitor($channel, $file)
+ {
+ return $this->send_request('ChangeMontior', array('Channel'=>$channel, 'File'=>$file));
+ }
+
+ /**
+ * Execute Command
+ *
+ * @example examples/sip_show_peer.php Get information about a sip peer
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+Command
+ * @link http://www.voip-info.org/wiki-Asterisk+CLI
+ * @param string $command
+ * @param string $actionid message matching variable
+ */
+ function Command($command, $actionid=NULL)
+ {
+ $parameters = array('Command'=>$command);
+ if($actionid) $parameters['ActionID'] = $actionid;
+ return $this->send_request('Command', $parameters);
+ }
+
+ /**
+ * Enable/Disable sending of events to this manager
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+Events
+ * @param string $eventmask is either 'on', 'off', or 'system,call,log'
+ */
+ function Events($eventmask)
+ {
+ return $this->send_request('Events', array('EventMask'=>$eventmask));
+ }
+
+ /**
+ * Check Extension Status
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+ExtensionState
+ * @param string $exten Extension to check state on
+ * @param string $context Context for extension
+ * @param string $actionid message matching variable
+ */
+ function ExtensionState($exten, $context, $actionid=NULL)
+ {
+ $parameters = array('Exten'=>$exten, 'Context'=>$context);
+ if($actionid) $parameters['ActionID'] = $actionid;
+ return $this->send_request('ExtensionState', $parameters);
+ }
+
+ /**
+ * Gets a Channel Variable
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+GetVar
+ * @link http://www.voip-info.org/wiki-Asterisk+variables
+ * @param string $channel Channel to read variable from
+ * @param string $variable
+ * @param string $actionid message matching variable
+ */
+ function GetVar($channel, $variable, $actionid=NULL)
+ {
+ $parameters = array('Channel'=>$channel, 'Variable'=>$variable);
+ if($actionid) $parameters['ActionID'] = $actionid;
+ return $this->send_request('GetVar', $parameters);
+ }
+
+ /**
+ * Hangup Channel
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+Hangup
+ * @param string $channel The channel name to be hungup
+ */
+ function Hangup($channel)
+ {
+ return $this->send_request('Hangup', array('Channel'=>$channel));
+ }
+
+ /**
+ * List IAX Peers
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+IAXpeers
+ */
+ function IAXPeers()
+ {
+ return $this->send_request('IAXPeers');
+ }
+
+ /**
+ * List available manager commands
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+ListCommands
+ * @param string $actionid message matching variable
+ */
+ function ListCommands($actionid=NULL)
+ {
+ if($actionid)
+ return $this->send_request('ListCommands', array('ActionID'=>$actionid));
+ else
+ return $this->send_request('ListCommands');
+ }
+
+ /**
+ * Logoff Manager
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+Logoff
+ */
+ function Logoff()
+ {
+ return $this->send_request('Logoff');
+ }
+
+ /**
+ * Check Mailbox Message Count
+ *
+ * Returns number of new and old messages.
+ * Message: Mailbox Message Count
+ * Mailbox: <mailboxid>
+ * NewMessages: <count>
+ * OldMessages: <count>
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+MailboxCount
+ * @param string $mailbox Full mailbox ID <mailbox>@<vm-context>
+ * @param string $actionid message matching variable
+ */
+ function MailboxCount($mailbox, $actionid=NULL)
+ {
+ $parameters = array('Mailbox'=>$mailbox);
+ if($actionid) $parameters['ActionID'] = $actionid;
+ return $this->send_request('MailboxCount', $parameters);
+ }
+
+ /**
+ * Check Mailbox
+ *
+ * Returns number of messages.
+ * Message: Mailbox Status
+ * Mailbox: <mailboxid>
+ * Waiting: <count>
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+MailboxStatus
+ * @param string $mailbox Full mailbox ID <mailbox>@<vm-context>
+ * @param string $actionid message matching variable
+ */
+ function MailboxStatus($mailbox, $actionid=NULL)
+ {        
+ $parameters = array('Mailbox'=>$mailbox);
+ if($actionid) $parameters['ActionID'] = $actionid;
+ return $this->send_request('MailboxStatus', $parameters);
+ }
+
+ /**
+ * Monitor a channel
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+Monitor
+ * @param string $channel
+ * @param string $file
+ * @param string $format
+ * @param boolean $mix
+ */
+ function Monitor($channel, $file=NULL, $format=NULL, $mix=NULL)
+ {
+ $parameters = array('Channel'=>$channel);
+ if($file) $parameters['File'] = $file;
+ if($format) $parameters['Format'] = $format;
+ if(!is_null($file)) $parameters['Mix'] = ($mix) ? 'true' : 'false';
+ return $this->send_request('Monitor', $parameters);
+ }
+
+ /**
+ * Originate Call
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+Originate
+ * @param string $channel Channel name to call
+ * @param string $exten Extension to use (requires 'Context' and 'Priority')
+ * @param string $context Context to use (requires 'Exten' and 'Priority')
+ * @param string $priority Priority to use (requires 'Exten' and 'Context')
+ * @param string $application Application to use
+ * @param string $data Data to use (requires 'Application')
+ * @param integer $timeout How long to wait for call to be answered (in ms)
+ * @param string $callerid Caller ID to be set on the outgoing channel
+ * @param string $variable Channel variable to set (VAR1=value1|VAR2=value2)
+ * @param string $account Account code
+ * @param boolean $async true fast origination
+ * @param string $actionid message matching variable
+ */
+ function Originate($channel,
+ $exten=NULL, $context=NULL, $priority=NULL,
+ $application=NULL, $data=NULL,
+ $timeout=NULL, $callerid=NULL, $variable=NULL, $account=NULL, $async=NULL, $actionid=NULL)
+ {
+ $parameters = array('Channel'=>$channel);
+
+ if($exten) $parameters['Exten'] = $exten;
+ if($context) $parameters['Context'] = $context;
+ if($priority) $parameters['Priority'] = $priority;
+
+ if($application) $parameters['Application'] = $application;
+ if($data) $parameters['Data'] = $data;
+
+ if($timeout) $parameters['Timeout'] = $timeout;
+ if($callerid) $parameters['CallerID'] = $callerid;
+ if($variable) $parameters['Variable'] = $variable;
+ if($account) $parameters['Account'] = $account;
+ if(!is_null($async)) $parameters['Async'] = ($async) ? 'true' : 'false';
+ if($actionid) $parameters['ActionID'] = $actionid;
+
+ return $this->send_request('Originate', $parameters);
+ }        
+
+ /**
+ * List parked calls
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+ParkedCalls
+ * @param string $actionid message matching variable
+ */
+ function ParkedCalls($actionid=NULL)
+ {
+ if($actionid)
+ return $this->send_request('ParkedCalls', array('ActionID'=>$actionid));
+ else
+ return $this->send_request('ParkedCalls');
+ }
+
+ /**
+ * Ping
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+Ping
+ */
+ function Ping()
+ {
+ return $this->send_request('Ping');
+ }
+
+ /**
+ * Queue Add
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+QueueAdd
+ * @param string $queue
+ * @param string $interface
+ * @param integer $penalty
+ */
+ function QueueAdd($queue, $interface, $penalty=0)
+ {
+ $parameters = array('Queue'=>$queue, 'Interface'=>$interface);
+ if($penalty) $parameters['Penalty'] = $penalty;
+ return $this->send_request('QueueAdd', $parameters);
+ }
+
+ /**
+ * Queue Remove
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+QueueRemove
+ * @param string $queue
+ * @param string $interface
+ */
+ function QueueRemove($queue, $interface)
+ {
+ return $this->send_request('QueueRemove', array('Queue'=>$queue, 'Interface'=>$interface));
+ }
+
+ /**
+ * Queues
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+Queues
+ */
+ function Queues()
+ {
+ return $this->send_request('Queues');
+ }
+
+ /**
+ * Queue Status
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+QueueStatus
+ * @param string $actionid message matching variable
+ */
+ function QueueStatus($actionid=NULL)
+ {
+ if($actionid)
+ return $this->send_request('QueueStatus', array('ActionID'=>$actionid));
+ else
+ return $this->send_request('QueueStatus');
+ }
+
+ /**
+ * Redirect
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+Redirect
+ * @param string $channel
+ * @param string $extrachannel
+ * @param string $exten
+ * @param string $context
+ * @param string $priority
+ */
+ function Redirect($channel, $extrachannel, $exten, $context, $priority)
+ {
+ return $this->send_request('Redirect', array('Channel'=>$channel, 'ExtraChannel'=>$extrachannel, 'Exten'=>$exten,
+ 'Context'=>$context, 'Priority'=>$priority));
+ }
+
+ /**
+ * Set the CDR UserField
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+SetCDRUserField
+ * @param string $userfield
+ * @param string $channel
+ * @param string $append
+ */
+ function SetCDRUserField($userfield, $channel, $append=NULL)
+ {
+ $parameters = array('UserField'=>$userfield, 'Channel'=>$channel);
+ if($append) $parameters['Append'] = $append;
+ return $this->send_request('SetCDRUserField', $parameters);
+ }
+
+ /**
+ * Set Channel Variable
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+SetVar
+ * @param string $channel Channel to set variable for
+ * @param string $variable name
+ * @param string $value
+ */
+ function SetVar($channel, $variable, $value)
+ {
+ return $this->send_request('SetVar', array('Channel'=>$channel, 'Variable'=>$variable, 'Value'=>$value));
+ }
+
+ /**
+ * Channel Status
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+Status
+ * @param string $channel
+ * @param string $actionid message matching variable
+ */
+ function Status($channel=NULL, $actionid=NULL)
+ {
+ if ($channel) {
+ $parameters = array('Channel'=>$channel);
+ }
+ else {
+ $parameters = array();
+ }
+ if($actionid) $parameters['ActionID'] = $actionid;
+ return $this->send_request('Status', $parameters);
+ }
+
+ /**
+ * Stop monitoring a channel
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+StopMonitor
+ * @param string $channel
+ */
+ function StopMontor($channel)
+ {
+ return $this->send_request('StopMonitor', array('Channel'=>$channel));
+ }
+
+ /**
+ * Dial over Zap channel while offhook
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+ZapDialOffhook
+ * @param string $zapchannel
+ * @param string $number
+ */
+ function ZapDialOffhook($zapchannel, $number)
+ {
+ return $this->send_request('ZapDialOffhook', array('ZapChannel'=>$zapchannel, 'Number'=>$number));
+ }
+
+ /**
+ * Toggle Zap channel Do Not Disturb status OFF
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+ZapDNDoff
+ * @param string $zapchannel
+ */
+ function ZapDNDoff($zapchannel)
+ {
+ return $this->send_request('ZapDNDoff', array('ZapChannel'=>$zapchannel));
+ }
+
+ /**
+ * Toggle Zap channel Do Not Disturb status ON
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+ZapDNDon
+ * @param string $zapchannel
+ */
+ function ZapDNDon($zapchannel)
+ {
+ return $this->send_request('ZapDNDon', array('ZapChannel'=>$zapchannel));
+ }
+
+ /**
+ * Hangup Zap Channel
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+ZapHangup
+ * @param string $zapchannel
+ */
+ function ZapHangup($zapchannel)
+ {
+ return $this->send_request('ZapHangup', array('ZapChannel'=>$zapchannel));
+ }
+
+ /**
+ * Transfer Zap Channel
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+ZapTransfer
+ * @param string $zapchannel
+ */
+ function ZapTransfer($zapchannel)
+ {
+ return $this->send_request('ZapTransfer', array('ZapChannel'=>$zapchannel));
+ }
+
+ /**
+ * Zap Show Channels
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+Manager+API+Action+ZapShowChannels
+ * @param string $actionid message matching variable
+ */
+ function ZapShowChannels($actionid=NULL)
+ {
+ if($actionid)
+ return $this->send_request('ZapShowChannels', array('ActionID'=>$actionid));
+ else
+ return $this->send_request('ZapShowChannels');
+ }
+
+ // *********************************************************************************************************
+ // ** MISC **
+ // *********************************************************************************************************
+
+ /*
+ * Log a message
+ *
+ * @param string $message
+ * @param integer $level from 1 to 4
+ */
+ function log($message, $level=1)
+ {
+ if($this->pagi != false)
+ $this->pagi->conlog($message, $level);
+ else
+ error_log(date('r') . ' - ' . $message);
+ }
+
+ /**
+ * Add event handler
+ *
+ * Known Events include ( http://www.voip-info.org/wiki-asterisk+manager+events )
+ * Link - Fired when two voice channels are linked together and voice data exchange commences.
+ * Unlink - Fired when a link between two voice channels is discontinued, for example, just before call completion.
+ * Newexten -
+ * Hangup -
+ * Newchannel -
+ * Newstate -
+ * Reload - Fired when the "RELOAD" console command is executed.
+ * Shutdown -
+ * ExtensionStatus -
+ * Rename -
+ * Newcallerid -
+ * Alarm -
+ * AlarmClear -
+ * Agentcallbacklogoff -
+ * Agentcallbacklogin -
+ * Agentlogoff -
+ * MeetmeJoin -
+ * MessageWaiting -
+ * join -
+ * leave -
+ * AgentCalled -
+ * ParkedCall - Fired after ParkedCalls
+ * Cdr -
+ * ParkedCallsComplete -
+ * QueueParams -
+ * QueueMember -
+ * QueueStatusEnd -
+ * Status -
+ * StatusComplete -
+ * ZapShowChannels - Fired after ZapShowChannels
+ * ZapShowChannelsComplete -
+ *
+ * @param string $event type or * for default handler
+ * @param string $callback function
+ * @return boolean sucess
+ */
+ function add_event_handler($event, $callback)
+ {
+ $event = strtolower($event);
+ if(isset($this->event_handlers[$event]))
+ {
+ $this->log("$event handler is already defined, not over-writing.");
+ return false;
+ }
+ $this->event_handlers[$event] = $callback;
+ return true;
+ }
+
+ /**
+ * Process event
+ *
+ * @access private
+ * @param array $parameters
+ * @return mixed result of event handler or false if no handler was found
+ */
+ function process_event($parameters)
+ {
+ $ret = false;
+ $e = strtolower($parameters['Event']);
+ // $this->log("Got event.. $e");                
+
+ $handler = '';
+ if(isset($this->event_handlers[$e])) $handler = $this->event_handlers[$e];
+ elseif(isset($this->event_handlers['*'])) $handler = $this->event_handlers['*'];
+
+ if(function_exists($handler))
+ {
+ // $this->log("Execute handler $handler");
+ $ret = $handler($e, $parameters, $this->server, $this->port);
+ }
+ else
+ $this->log("No event handler for event '$e'");
+ return $ret;
+ }
+ }
+?>
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214phpagifastagiphp"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/phpagi-fastagi.php</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214phpagifastagiphpfromrev15313freeswitchtrunkcontribgledphpphpagi214phpagifastagiphp"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/phpagi-fastagi.php (from rev 15313, freeswitch/trunk/contrib/gled/php/phpagi-2.14/phpagi-fastagi.php) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/phpagi-fastagi.php         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/phpagi-fastagi.php        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+#!/usr/local/bin/php -q
+<?php
+ /**
+ * phpagi-fastagi.php : PHP FastAGI bootstrap
+ * Website: http://phpagi.sourceforge.net
+ *
+ * $Id: phpagi-fastagi.php,v 1.2 2005/05/25 18:43:48 pinhole Exp $
+ *
+ * Copyright (c) 2004, 2005 Matthew Asham <matthewa@bcwireless.net>, David Eder <david@eder.us>
+ * All Rights Reserved.
+ *
+ * This software is released under the terms of the GNU Lesser General Public License v2.1
+ * A copy of which is available from http://www.gnu.org/copyleft/lesser.html
+ *
+ * We would be happy to list your phpagi based application on the phpagi
+ * website. Drop me an Email if you'd like us to list your program.
+ *
+ * @package phpAGI
+ * @version 2.0
+ * @example docs/fastagi.xinetd Example xinetd config file
+ */
+
+ /**
+ * Written for PHP 4.3.4, should work with older PHP 4.x versions.
+ * Please submit bug reports, patches, etc to http://sourceforge.net/projects/phpagi/
+ * Gracias. :)
+ *
+ */
+
+ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'phpagi.php');
+
+ $fastagi = new AGI();
+
+ $fastagi->verbose(print_r($fastagi, true));
+
+ if(!isset($fastagi->config['fastagi']['basedir']))
+ $fastagi->config['fastagi']['basedir'] = dirname(__FILE__);
+
+ // perform some security checks
+
+ $script = $fastagi->config['fastagi']['basedir'] . DIRECTORY_SEPARATOR . $fastagi->request['agi_network_script'];
+
+ // in the same directory (or subdirectory)
+ $mydir = dirname($fastagi->config['fastagi']['basedir']) . DIRECTORY_SEPARATOR;
+ $dir = dirname($script) . DIRECTORY_SEPARATOR;
+ if(substr($dir, 0, strlen($mydir)) != $mydir)
+ {
+ $fastagi->conlog("$script is not allowed to execute.");
+ exit;
+ }
+
+ // make sure it exists
+ if(!file_exists($script))
+ {
+ $fastagi->conlog("$script does not exist.");
+ exit;
+ }
+
+ // drop privileges
+ if(isset($fastagi->config['fastagi']['setuid']) && $fastagi->config['fastagi']['setuid'])
+ {
+ $owner = fileowner($script);
+ $group = filegroup($script);
+ if(!posix_setgid($group) || !posix_setegid($group) || !posix_setuid($owner) || !posix_seteuid($owner))
+ {
+ $fastagi->conlog("failed to lower privileges.");
+ exit;
+ }
+ }
+
+ // make sure script is still readable
+ if(!is_readable($script))
+ {
+ $fastagi->conlog("$script is not readable.");
+ exit;
+ }
+
+ require_once($script);
+?>
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214phpagiphp"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/phpagi.php</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribgledphpphpagi214phpagiphpfromrev15313freeswitchtrunkcontribgledphpphpagi214phpagiphp"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/phpagi.php (from rev 15313, freeswitch/trunk/contrib/gled/php/phpagi-2.14/phpagi.php) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/phpagi.php         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/gled/php/phpagi-2.14/phpagi.php        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,1753 @@
</span><ins>+<?php
+
+ /**
+ * phpagi.php : PHP AGI Functions for Asterisk
+ * Website: http://phpagi.sourceforge.net/
+ *
+ * $Id: phpagi.php,v 2.14 2005/05/25 20:30:46 pinhole Exp $
+ *
+ * Copyright (c) 2003, 2004, 2005 Matthew Asham <matthewa@bcwireless.net>, David Eder <david@eder.us>
+ * All Rights Reserved.
+ *
+ * This software is released under the terms of the GNU Lesser General Public License v2.1
+ * A copy of which is available from http://www.gnu.org/copyleft/lesser.html
+ *
+ * We would be happy to list your phpagi based application on the phpagi
+ * website. Drop me an Email if you'd like us to list your program.
+ *
+ *
+ * Written for PHP 4.3.4, should work with older PHP 4.x versions.
+ *
+ * Please submit bug reports, patches, etc to http://sourceforge.net/projects/phpagi/
+ * Gracias. :)
+ *
+ *
+ * @package phpAGI
+ * @version 2.0
+ */
+
+/*
+ PATCH
+*/
+
+ function logthis($str) {
+ file_put_contents('/telephony/freeswitch/log/ivr.log',date("Y-m-d H:i:s").": $str\n",FILE_APPEND);
+ }
+
+ /**
+ */
+
+ if(!class_exists('AGI_AsteriskManager'))
+ {
+ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'phpagi-asmanager.php');
+ }
+
+ define('AST_CONFIG_DIR', '/pstn/confs/asterisk');
+ define('AST_SPOOL_DIR', '/pstn/system/var/spool/asterisk/');
+ define('AST_TMP_DIR', AST_SPOOL_DIR . '/tmp/');
+ define('DEFAULT_PHPAGI_CONFIG', AST_CONFIG_DIR . '/phpagi.conf');
+
+ define('AST_DIGIT_ANY', '0123456789#*');
+
+ define('AGIRES_OK', 200);
+
+ define('AST_STATE_DOWN', 0);
+ define('AST_STATE_RESERVED', 1);
+ define('AST_STATE_OFFHOOK', 2);
+ define('AST_STATE_DIALING', 3);
+ define('AST_STATE_RING', 4);
+ define('AST_STATE_RINGING', 5);
+ define('AST_STATE_UP', 6);
+ define('AST_STATE_BUSY', 7);
+ define('AST_STATE_DIALING_OFFHOOK', 8);
+ define('AST_STATE_PRERING', 9);
+
+ define('AUDIO_FILENO', 3); // STDERR_FILENO + 1
+
+ /**
+ * AGI class
+ *
+ * @package phpAGI
+ * @link http://www.voip-info.org/wiki-Asterisk+agi
+ * @example examples/dtmf.php Get DTMF tones from the user and say the digits
+ * @example examples/input.php Get text input from the user and say it back
+ * @example examples/ping.php Ping an IP address
+ */
+ class AGI
+ {
+ /**
+ * Request variables read in on initialization.
+ *
+ * Often contains any/all of the following:
+ * agi_request - name of agi script
+ * agi_channel - current channel
+ * agi_language - current language
+ * agi_type - channel type (SIP, ZAP, IAX, ...)
+ * agi_uniqueid - unique id based on unix time
+ * agi_callerid - callerID string
+ * agi_dnid - dialed number id
+ * agi_rdnis - referring DNIS number
+ * agi_context - current context
+ * agi_extension - extension dialed
+ * agi_priority - current priority
+ * agi_enhanced - value is 1.0 if started as an EAGI script
+ * agi_accountcode - set by SetAccount in the dialplan
+ * agi_network - value is yes if this is a fastagi
+ * agi_network_script - name of the script to execute
+ *
+ * NOTE: program arguments are still in $_SERVER['argv'].
+ *
+ * @var array
+ * @access public
+ */
+ var $request;
+
+ /**
+ * Config variables
+ *
+ * @var array
+ * @access public
+ */
+ var $config;
+
+ /**
+ * Asterisk Manager
+ *
+ * @var AGI_AsteriskManager
+ * @access public
+ */
+ var $asmanager;
+
+ /**
+ * Input Stream
+ *
+ * @access private
+ */
+ var $in = NULL;
+
+ /**
+ * Output Stream
+ *
+ * @access private
+ */
+ var $out = NULL;
+
+ /**
+ * Audio Stream
+ *
+ * @access public
+ */
+ var $audio = NULL;
+
+ /**
+ * Constructor
+ *
+ * @param string $config is the name of the config file to parse
+ * @param array $optconfig is an array of configuration vars and vals, stuffed into $this->config['phpagi']
+ */
+ function AGI($config=NULL, $optconfig=array())
+ {
+ // load config
+ if(!is_null($config) && file_exists($config))
+ $this->config = parse_ini_file($config, true);
+ elseif(file_exists(DEFAULT_PHPAGI_CONFIG))
+ $this->config = parse_ini_file(DEFAULT_PHPAGI_CONFIG, true);
+
+ // If optconfig is specified, stuff vals and vars into 'phpagi' config array.
+ foreach($optconfig as $var=>$val)
+ $this->config['phpagi'][$var] = $val;
+
+ // add default values to config for uninitialized values
+ if(!isset($this->config['phpagi']['error_handler'])) $this->config['phpagi']['error_handler'] = true;
+ if(!isset($this->config['phpagi']['debug'])) $this->config['phpagi']['debug'] = false;
+ if(!isset($this->config['phpagi']['admin'])) $this->config['phpagi']['admin'] = NULL;
+ if(!isset($this->config['phpagi']['tempdir'])) $this->config['phpagi']['tempdir'] = AST_TMP_DIR;
+
+ // festival TTS config
+ if(!isset($this->config['festival']['text2wave'])) $this->config['festival']['text2wave'] = $this->which('text2wave');
+
+ // swift TTS config
+ if(!isset($this->config['cepstral']['swift'])) $this->config['cepstral']['swift'] = $this->which('swift');
+
+ ob_implicit_flush(true);
+
+ // open stdin & stdout
+ $this->in = defined('STDIN') ? STDIN : fopen('php://stdin', 'r');
+ $this->out = defined('STDOUT') ? STDOUT : fopen('php://stdout', 'w');
+
+ // initialize error handler
+ if($this->config['phpagi']['error_handler'] == true)
+ {
+ set_error_handler('phpagi_error_handler');
+ global $phpagi_error_handler_email;
+ $phpagi_error_handler_email = $this->config['phpagi']['admin'];
+ error_reporting(E_ALL);
+ }
+
+ // make sure temp folder exists
+ $this->make_folder($this->config['phpagi']['tempdir']);
+
+ // read the request
+ $str = fgets($this->in);
+ while($str != "\n")
+ {
+ $this->request[substr($str, 0, strpos($str, ':'))] = trim(substr($str, strpos($str, ':') + 1));
+ $str = fgets($this->in);
+ }
+
+ // open audio if eagi detected
+ if($this->request['agi_enhanced'] == '1.0')
+ {
+ if(file_exists('/proc/' . getmypid() . '/fd/3'))
+ $this->audio = fopen('/proc/' . getmypid() . '/fd/3', 'r');
+ elseif(file_exists('/dev/fd/3'))
+ {
+ // may need to mount fdescfs
+ $this->audio = fopen('/dev/fd/3', 'r');
+ }
+ else
+ $this->conlog('Unable to open audio stream');
+
+ if($this->audio) stream_set_blocking($this->audio, 0);
+ }
+
+// $this->conlog('AGI Request:');
+// $this->conlog(print_r($this->request, true));
+// $this->conlog('PHPAGI internal configuration:');
+// $this->conlog(print_r($this->config, true));
+ }
+
+ // *********************************************************************************************************
+ // ** COMMANDS **
+ // *********************************************************************************************************
+
+ /**
+ * Answer channel if not already in answer state.
+ *
+ * @link http://www.voip-info.org/wiki-answer
+ * @example examples/dtmf.php Get DTMF tones from the user and say the digits
+ * @example examples/input.php Get text input from the user and say it back
+ * @example examples/ping.php Ping an IP address
+ *
+ * @return array, see evaluate for return information. ['result'] is 0 on success, -1 on failure.
+ */
+ function answer()
+ {
+ return $this->evaluate('ANSWER');
+ }
+
+ /**
+ * Get the status of the specified channel. If no channel name is specified, return the status of the current channel.
+ *
+ * @link http://www.voip-info.org/wiki-channel+status
+ * @param string $channel
+ * @return array, see evaluate for return information. ['data'] contains description.
+ */
+ function channel_status($channel='')
+ {
+ $ret = $this->evaluate("CHANNEL STATUS $channel");
+ switch($ret['result'])
+ {
+ case -1: $ret['data'] = trim("There is no channel that matches $channel"); break;
+ case AST_STATE_DOWN: $ret['data'] = 'Channel is down and available'; break;
+ case AST_STATE_RESERVED: $ret['data'] = 'Channel is down, but reserved'; break;
+ case AST_STATE_OFFHOOK: $ret['data'] = 'Channel is off hook'; break;
+ case AST_STATE_DIALING: $ret['data'] = 'Digits (or equivalent) have been dialed'; break;
+ case AST_STATE_RING: $ret['data'] = 'Line is ringing'; break;
+ case AST_STATE_RINGING: $ret['data'] = 'Remote end is ringing'; break;
+ case AST_STATE_UP: $ret['data'] = 'Line is up'; break;
+ case AST_STATE_BUSY: $ret['data'] = 'Line is busy'; break;
+ case AST_STATE_DIALING_OFFHOOK: $ret['data'] = 'Digits (or equivalent) have been dialed while offhook'; break;
+ case AST_STATE_PRERING: $ret['data'] = 'Channel has detected an incoming call and is waiting for ring'; break;
+ default: $ret['data'] = "Unknown ({$ret['result']})"; break;
+ }
+ return $ret;
+ }
+
+ /**
+ * Deletes an entry in the Asterisk database for a given family and key.
+ *
+ * @link http://www.voip-info.org/wiki-database+del
+ * @param string $family
+ * @param string $key
+ * @return array, see evaluate for return information. ['result'] is 1 on sucess, 0 otherwise.
+ */
+ function database_del($family, $key)
+ {
+ return $this->evaluate("DATABASE DEL \"$family\" \"$key\"");
+ }
+
+ /**
+ * Deletes a family or specific keytree within a family in the Asterisk database.
+ *
+ * @link http://www.voip-info.org/wiki-database+deltree
+ * @param string $family
+ * @param string $keytree
+ * @return array, see evaluate for return information. ['result'] is 1 on sucess, 0 otherwise.
+ */
+ function database_deltree($family, $keytree='')
+ {
+ $cmd = "DATABASE DELTREE \"$family\"";
+ if($keytree != '') $cmd .= " \"$keytree\"";
+ return $this->evaluate($cmd);
+ }
+
+ /**
+ * Retrieves an entry in the Asterisk database for a given family and key.
+ *
+ * @link http://www.voip-info.org/wiki-database+get
+ * @param string $family
+ * @param string $key
+ * @return array, see evaluate for return information. ['result'] is 1 on sucess, 0 failure. ['data'] holds the value
+ */
+ function database_get($family, $key)
+ {
+ return $this->evaluate("DATABASE GET \"$family\ \"$key\"");
+ }
+
+ /**
+ * Adds or updates an entry in the Asterisk database for a given family, key, and value.
+ *
+ * @param string $family
+ * @param string $key
+ * @param string $value
+ * @return array, see evaluate for return information. ['result'] is 1 on sucess, 0 otherwise
+ */
+ function database_put($family, $key, $value)
+ {
+ $value = str_replace("\n", '\n', addslashes($value));
+ return $this->evaluate("DATABASE PUT \"$family\" \"$key\" \"$value\"");
+ }
+
+ /**
+ * Executes the specified Asterisk application with given options.
+ *
+ * @link http://www.voip-info.org/wiki-exec
+ * @link http://www.voip-info.org/wiki-Asterisk+-+documentation+of+application+commands
+ * @param string $application
+ * @param mixed $options
+ * @return array, see evaluate for return information. ['result'] is whatever the application returns, or -2 on failure to find application
+ */
+ function exec($application, $options='')
+ {
+ if(is_array($options)) $options = join('|', $options);
+ return $this->evaluate("EXEC $application $options");
+ }
+
+ /**
+ * Plays the given file and receives DTMF data.
+ *
+ * This is similar to STREAM FILE, but this command can accept and return many DTMF digits,
+ * while STREAM FILE returns immediately after the first DTMF digit is detected.
+ *
+ * Asterisk looks for the file to play in /var/lib/asterisk/sounds by default.
+ *
+ * If the user doesn't press any keys when the message plays, there is $timeout milliseconds
+ * of silence then the command ends.
+ *
+ * The user has the opportunity to press a key at any time during the message or the
+ * post-message silence. If the user presses a key while the message is playing, the
+ * message stops playing. When the first key is pressed a timer starts counting for
+ * $timeout milliseconds. Every time the user presses another key the timer is restarted.
+ * The command ends when the counter goes to zero or the maximum number of digits is entered,
+ * whichever happens first.
+ *
+ * If you don't specify a time out then a default timeout of 2000 is used following a pressed
+ * digit. If no digits are pressed then 6 seconds of silence follow the message.
+ *
+ * If you don't specify $max_digits then the user can enter as many digits as they want.
+ *
+ * Pressing the # key has the same effect as the timer running out: the command ends and
+ * any previously keyed digits are returned. A side effect of this is that there is no
+ * way to read a # key using this command.
+ *
+ * @example examples/ping.php Ping an IP address
+ *
+ * @link http://www.voip-info.org/wiki-get+data
+ * @param string $filename file to play. Do not include file extension.
+ * @param integer $timeout milliseconds
+ * @param integer $max_digits
+ * @return array, see evaluate for return information. ['result'] holds the digits and ['data'] holds the timeout if present.
+ *
+ * This differs from other commands with return DTMF as numbers representing ASCII characters.
+ */
+ function get_data($filename, $timeout=NULL, $max_digits=NULL)
+ {
+ return $this->evaluate(rtrim("GET DATA $filename $timeout $max_digits"));
+ }
+
+ /**
+ * Fetch the value of a variable.
+ *
+ * Does not work with global variables. Does not work with some variables that are generated by modules.
+ *
+ * @link http://www.voip-info.org/wiki-get+variable
+ * @link http://www.voip-info.org/wiki-Asterisk+variables
+ * @param string $variable name
+ * @return array, see evaluate for return information. ['result'] is 0 if variable hasn't been set, 1 if it has. ['data'] holds the value.
+ */
+ function get_variable($variable)
+ {
+ return $this->evaluate("GET VARIABLE $variable");
+ }
+
+ /**
+ * Hangup the specified channel. If no channel name is given, hang up the current channel.
+ *
+ * With power comes responsibility. Hanging up channels other than your own isn't something
+ * that is done routinely. If you are not sure why you are doing so, then don't.
+ *
+ * @link http://www.voip-info.org/wiki-hangup
+ * @example examples/dtmf.php Get DTMF tones from the user and say the digits
+ * @example examples/input.php Get text input from the user and say it back
+ * @example examples/ping.php Ping an IP address
+ *
+ * @param string $channel
+ * @return array, see evaluate for return information. ['result'] is 1 on success, -1 on failure.
+ */
+ function hangup($channel='')
+ {
+ return $this->evaluate("HANGUP $channel");
+ }
+
+ /**
+ * Does nothing.
+ *
+ * @link http://www.voip-info.org/wiki-noop
+ * @return array, see evaluate for return information.
+ */
+ function noop()
+ {
+ return $this->evaluate('NOOP');
+ }
+
+ /**
+ * Receive a character of text from a connected channel. Waits up to $timeout milliseconds for
+ * a character to arrive, or infinitely if $timeout is zero.
+ *
+ * @link http://www.voip-info.org/wiki-receive+char
+ * @param integer $timeout milliseconds
+ * @return array, see evaluate for return information. ['result'] is 0 on timeout or not supported, -1 on failure. Otherwise
+ * it is the decimal value of the DTMF tone. Use chr() to convert to ASCII.
+ */
+ function receive_char($timeout=-1)
+ {
+ return $this->evaluate("RECEIVE CHAR $timeout");
+ }
+
+ /**
+ * Record sound to a file until an acceptable DTMF digit is received or a specified amount of
+ * time has passed. Optionally the file BEEP is played before recording begins.
+ *
+ * @link http://www.voip-info.org/wiki-record+file
+ * @param string $file to record, without extension, often created in /var/lib/asterisk/sounds
+ * @param string $format of the file. GSM and WAV are commonly used formats. MP3 is read-only and thus cannot be used.
+ * @param string $escape_digits
+ * @param integer $timeout is the maximum record time in milliseconds, or -1 for no timeout.
+ * @param integer $offset to seek to without exceeding the end of the file.
+ * @param boolean $beep
+ * @param integer $silence number of seconds of silence allowed before the function returns despite the
+ * lack of dtmf digits or reaching timeout.
+ * @return array, see evaluate for return information. ['result'] is -1 on error, 0 on hangup, otherwise a decimal value of the
+ * DTMF tone. Use chr() to convert to ASCII.
+ */
+ function record_file($file, $format, $escape_digits='', $timeout=-1, $offset=NULL, $beep=false, $silence=NULL)
+ {
+ $cmd = trim("RECORD FILE $file $format \"$escape_digits\" $timeout $offset");
+ if($beep) $cmd .= ' BEEP';
+ if(!is_null($silence)) $cmd .= " s=$silence";
+ return $this->evaluate($cmd);
+ }
+
+ /**
+ * Say the given digit string, returning early if any of the given DTMF escape digits are received on the channel.
+ *
+ * @link http://www.voip-info.org/wiki-say+digits
+ * @param integer $digits
+ * @param string $escape_digits
+ * @return array, see evaluate for return information. ['result'] is -1 on hangup or error, 0 if playback completes with no
+ * digit received, otherwise a decimal value of the DTMF tone. Use chr() to convert to ASCII.
+ */
+ function say_digits($digits, $escape_digits='')
+ {
+ return $this->evaluate("SAY DIGITS $digits \"$escape_digits\"");
+ }
+
+ /**
+ * Say the given number, returning early if any of the given DTMF escape digits are received on the channel.
+ *
+ * @link http://www.voip-info.org/wiki-say+number
+ * @param integer $number
+ * @param string $escape_digits
+ * @return array, see evaluate for return information. ['result'] is -1 on hangup or error, 0 if playback completes with no
+ * digit received, otherwise a decimal value of the DTMF tone. Use chr() to convert to ASCII.
+ */
+ function say_number($number, $escape_digits='')
+ {
+ return $this->evaluate("SAY NUMBER $number \"$escape_digits\"");
+ }
+
+ /**
+ * Say the given character string, returning early if any of the given DTMF escape digits are received on the channel.
+ *
+ * @link http://www.voip-info.org/wiki-say+phonetic
+ * @param string $text
+ * @param string $escape_digits
+ * @return array, see evaluate for return information. ['result'] is -1 on hangup or error, 0 if playback completes with no
+ * digit received, otherwise a decimal value of the DTMF tone. Use chr() to convert to ASCII.
+ */
+ function say_phonetic($text, $escape_digits='')
+ {
+ return $this->evaluate("SAY PHONETIC $text \"$escape_digits\"");
+ }
+
+ /**
+ * Say a given time, returning early if any of the given DTMF escape digits are received on the channel.
+ *
+ * @link http://www.voip-info.org/wiki-say+time
+ * @param integer $time number of seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC).
+ * @param string $escape_digits
+ * @return array, see evaluate for return information. ['result'] is -1 on hangup or error, 0 if playback completes with no
+ * digit received, otherwise a decimal value of the DTMF tone. Use chr() to convert to ASCII.
+ */
+ function say_time($time=NULL, $escape_digits='')
+ {
+ if(is_null($time)) $time = time();
+ return $this->evaluate("SAY TIME $time \"$escape_digits\"");
+ }
+
+ /**
+ * Send the specified image on a channel.
+ *
+ * Most channels do not support the transmission of images.
+ *
+ * @link http://www.voip-info.org/wiki-send+image
+ * @param string $image without extension, often in /var/lib/asterisk/images
+ * @return array, see evaluate for return information. ['result'] is -1 on hangup or error, 0 if the image is sent or
+ * channel does not support image transmission.
+ */
+ function send_image($image)
+ {
+ return $this->evaluate("SEND IMAGE $image");
+ }
+
+ /**
+ * Send the given text to the connected channel.
+ *
+ * Most channels do not support transmission of text.
+ *
+ * @link http://www.voip-info.org/wiki-send+text
+ * @param $text
+ * @return array, see evaluate for return information. ['result'] is -1 on hangup or error, 0 if the text is sent or
+ * channel does not support text transmission.
+ */
+ function send_text($text)
+ {
+ return $this->evaluate("SEND TEXT \"$text\"");
+ }
+
+ /**
+ * Cause the channel to automatically hangup at $time seconds in the future.
+ * If $time is 0 then the autohangup feature is disabled on this channel.
+ *
+ * If the channel is hungup prior to $time seconds, this setting has no effect.
+ *
+ * @link http://www.voip-info.org/wiki-set+autohangup
+ * @param integer $time until automatic hangup
+ * @return array, see evaluate for return information.
+ */
+ function set_autohangup($time=0)
+ {
+ return $this->evaluate("SET AUTOHANGUP $time");
+ }
+
+ /**
+ * Changes the caller ID of the current channel.
+ *
+ * @link http://www.voip-info.org/wiki-set+callerid
+ * @param string $cid example: "John Smith"<1234567>
+ * This command will let you take liberties with the <caller ID specification> but the format shown in the example above works
+ * well: the name enclosed in double quotes followed immediately by the number inside angle brackets. If there is no name then
+ * you can omit it. If the name contains no spaces you can omit the double quotes around it. The number must follow the name
+ * immediately; don't put a space between them. The angle brackets around the number are necessary; if you omit them the
+ * number will be considered to be part of the name.
+ * @return array, see evaluate for return information.
+ */
+ function set_callerid($cid)
+ {
+ return $this->evaluate("SET CALLERID $cid");
+ }
+
+ /**
+ * Sets the context for continuation upon exiting the application.
+ *
+ * Setting the context does NOT automatically reset the extension and the priority; if you want to start at the top of the new
+ * context you should set extension and priority yourself.
+ *
+ * If you specify a non-existent context you receive no error indication (['result'] is still 0) but you do get a
+ * warning message on the Asterisk console.
+ *
+ * @link http://www.voip-info.org/wiki-set+context
+ * @param string $context
+ * @return array, see evaluate for return information.
+ */
+ function set_context($context)
+ {
+ return $this->evaluate("SET CONTEXT $context");
+ }
+
+ /**
+ * Set the extension to be used for continuation upon exiting the application.
+ *
+ * Setting the extension does NOT automatically reset the priority. If you want to start with the first priority of the
+ * extension you should set the priority yourself.
+ *
+ * If you specify a non-existent extension you receive no error indication (['result'] is still 0) but you do
+ * get a warning message on the Asterisk console.
+ *
+ * @link http://www.voip-info.org/wiki-set+extension
+ * @param string $extension
+ * @return array, see evaluate for return information.
+ */
+ function set_extension($extension)
+ {
+ return $this->evaluate("SET EXTENSION $extension");
+ }
+
+ /**
+ * Enable/Disable Music on hold generator.
+ *
+ * @link http://www.voip-info.org/wiki-set+music
+ * @param boolean $enabled
+ * @param string $class
+ * @return array, see evaluate for return information.
+ */
+ function set_music($enabled=true, $class='')
+ {
+ $enabled = ($enabled) ? 'ON' : 'OFF';
+ return $this->evaluate("SET MUSIC $enabled $class");
+ }
+
+ /**
+ * Set the priority to be used for continuation upon exiting the application.
+ *
+ * If you specify a non-existent priority you receive no error indication (['result'] is still 0)
+ * and no warning is issued on the Asterisk console.
+ *
+ * @link http://www.voip-info.org/wiki-set+priority
+ * @param integer $priority
+ * @return array, see evaluate for return information.
+ */
+ function set_priority($priority)
+ {
+ return $this->evaluate("SET PRIORITY $priority");
+ }
+
+ /**
+ * Sets a variable to the specified value. The variables so created can later be used by later using ${<variablename>}
+ * in the dialplan.
+ *
+ * These variables live in the channel Asterisk creates when you pickup a phone and as such they are both local and temporary.
+ * Variables created in one channel can not be accessed by another channel. When you hang up the phone, the channel is deleted
+ * and any variables in that channel are deleted as well.
+ *
+ * @link http://www.voip-info.org/wiki-set+variable
+ * @param string $variable is case sensitive
+ * @param string $value
+ * @return array, see evaluate for return information.
+ */
+ function set_variable($variable, $value)
+ {
+ $value = str_replace("\n", '\n', addslashes($value));
+ return $this->evaluate("SET VARIABLE $variable \"$value\"");
+ }
+
+ /**
+ * Play the given audio file, allowing playback to be interrupted by a DTMF digit. This command is similar to the GET DATA
+ * command but this command returns after the first DTMF digit has been pressed while GET DATA can accumulated any number of
+ * digits before returning.
+ *
+ * @example examples/ping.php Ping an IP address
+ *
+ * @link http://www.voip-info.org/wiki-stream+file
+ * @param string $filename without extension, often in /var/lib/asterisk/sounds
+ * @param string $escape_digits
+ * @param integer $offset
+ * @return array, see evaluate for return information. ['result'] is -1 on hangup or error, 0 if playback completes with no
+ * digit received, otherwise a decimal value of the DTMF tone. Use chr() to convert to ASCII.
+ */
+ function stream_file($filename, $escape_digits='', $offset=0)
+ {
+ return $this->evaluate("STREAM FILE $filename \"$escape_digits\" $offset");
+ }
+
+ /**
+ * Enable or disable TDD transmission/reception on the current channel.
+ *
+ * @link http://www.voip-info.org/wiki-tdd+mode
+ * @param string $setting can be on, off or mate
+ * @return array, see evaluate for return information. ['result'] is 1 on sucess, 0 if the channel is not TDD capable.
+ */
+ function tdd_mode($setting)
+ {
+ return $this->evaluate("TDD MODE $setting");
+ }
+
+ /**
+ * Sends $message to the Asterisk console via the 'verbose' message system.
+ *
+ * If the Asterisk verbosity level is $level or greater, send $message to the console.
+ *
+ * The Asterisk verbosity system works as follows. The Asterisk user gets to set the desired verbosity at startup time or later
+ * using the console 'set verbose' command. Messages are displayed on the console if their verbose level is less than or equal
+ * to desired verbosity set by the user. More important messages should have a low verbose level; less important messages
+ * should have a high verbose level.
+ *
+ * @link http://www.voip-info.org/wiki-verbose
+ * @param string $message
+ * @param integer $level from 1 to 4
+ * @return array, see evaluate for return information.
+ */
+ function verbose($message, $level=1)
+ {
+ foreach(explode("\n", str_replace("\r\n", "\n", print_r($message, true))) as $msg)
+ {
+ @syslog(LOG_WARNING, $msg);
+ $ret = $this->evaluate("VERBOSE \"$msg\" $level");
+ }
+ return $ret;
+ }
+
+ /**
+ * Waits up to $timeout milliseconds for channel to receive a DTMF digit.
+ *
+ * @link http://www.voip-info.org/wiki-wait+for+digit
+ * @param integer $timeout in millisecons. Use -1 for the timeout value if you want the call to wait indefinitely.
+ * @return array, see evaluate for return information. ['result'] is 0 if wait completes with no
+ * digit received, otherwise a decimal value of the DTMF tone. Use chr() to convert to ASCII.
+ */
+ function wait_for_digit($timeout=-1)
+ {
+ return $this->evaluate("WAIT FOR DIGIT $timeout");
+ }
+
+
+ // *********************************************************************************************************
+ // ** APPLICATIONS **
+ // *********************************************************************************************************
+
+ /**
+ * Set absolute maximum time of call.
+ *
+ * Note that the timeout is set from the current time forward, not counting the number of seconds the call has already been up.
+ * Each time you call AbsoluteTimeout(), all previous absolute timeouts are cancelled.
+ * Will return the call to the T extension so that you can playback an explanatory note to the calling party (the called party
+ * will not hear that)
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+-+documentation+of+application+commands
+ * @link http://www.dynx.net/ASTERISK/AGI/ccard/agi-ccard.agi
+ * @param $seconds allowed, 0 disables timeout
+ * @return array, see evaluate for return information.
+ */
+ function exec_absolutetimeout($seconds=0)
+ {
+ return $this->exec('AbsoluteTimeout', $seconds);
+ }
+
+ /**
+ * Executes an AGI compliant application.
+ *
+ * @param string $command
+ * @return array, see evaluate for return information. ['result'] is -1 on hangup or if application requested hangup, or 0 on non-hangup exit.
+ * @param string $args
+ */
+ function exec_agi($command, $args)
+ {
+ return $this->exec("AGI $command", $args);
+ }
+
+ /**
+ * Set Language.
+ *
+ * @param string $language code
+ * @return array, see evaluate for return information.
+ */
+ function exec_setlanguage($language='en')
+ {
+ return $this->exec('SetLanguage', $language);
+ }
+
+ /**
+ * Do ENUM Lookup.
+ *
+ * Note: to retrieve the result, use
+ * get_variable('ENUM');
+ *
+ * @param $exten
+ * @return array, see evaluate for return information.
+ */
+ function exec_enumlookup($exten)
+ {
+ return $this->exec('EnumLookup', $exten);
+ }
+
+ /**
+ * Dial.
+ *
+ * Dial takes input from ${VXML_URL} to send XML Url to Cisco 7960
+ * Dial takes input from ${ALERT_INFO} to set ring cadence for Cisco phones
+ * Dial returns ${CAUSECODE}: If the dial failed, this is the errormessage.
+ * Dial returns ${DIALSTATUS}: Text code returning status of last dial attempt.
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+cmd+Dial
+ * @param string $type
+ * @param string $identifier
+ * @param integer $timeout
+ * @param string $options
+ * @param string $url
+ * @return array, see evaluate for return information.
+ */
+ function exec_dial($type, $identifier, $timeout=NULL, $options=NULL, $url=NULL)
+ {
+ return $this->exec('Dial', trim("$type/$identifier|$timeout|$options|$url", '|'));
+ }
+
+ /**
+ * Goto.
+ *
+ * This function takes three arguments: context,extension, and priority, but the leading arguments
+ * are optional, not the trailing arguments. Thuse goto($z) sets the priority to $z.
+ *
+ * @param string $a
+ * @param string $b;
+ * @param string $c;
+ * @return array, see evaluate for return information.
+ */
+ function exec_goto($a, $b=NULL, $c=NULL)
+ {
+ return $this->exec('Goto', trim("$a|$b|$c", '|'));
+ }
+
+
+ // *********************************************************************************************************
+ // ** FAST PASSING **
+ // *********************************************************************************************************
+
+ /**
+ * Say the given digit string, returning early if any of the given DTMF escape digits are received on the channel.
+ * Return early if $buffer is adequate for request.
+ *
+ * @link http://www.voip-info.org/wiki-say+digits
+ * @param string $buffer
+ * @param integer $digits
+ * @param string $escape_digits
+ * @return array, see evaluate for return information. ['result'] is -1 on hangup or error, 0 if playback completes with no
+ * digit received, otherwise a decimal value of the DTMF tone. Use chr() to convert to ASCII.
+ */
+ function fastpass_say_digits(&$buffer, $digits, $escape_digits='')
+ {
+ $proceed = false;
+ if($escape_digits != '' && $buffer != '')
+ {
+ if(!strpos(chr(255) . $escape_digits, $buffer{strlen($buffer)-1}))
+ $proceed = true;
+ }
+ if($buffer == '' || $proceed)
+ {
+ $res = $this->say_digits($digits, $escape_digits);
+ if($res['code'] == AGIRES_OK && $res['result'] > 0)
+ $buffer .= chr($res['result']);
+ return $res;
+ }
+ return array('code'=>AGIRES_OK, 'result'=>ord($buffer{strlen($buffer)-1}));
+ }
+
+ /**
+ * Say the given number, returning early if any of the given DTMF escape digits are received on the channel.
+ * Return early if $buffer is adequate for request.
+ *
+ * @link http://www.voip-info.org/wiki-say+number
+ * @param string $buffer
+ * @param integer $number
+ * @param string $escape_digits
+ * @return array, see evaluate for return information. ['result'] is -1 on hangup or error, 0 if playback completes with no
+ * digit received, otherwise a decimal value of the DTMF tone. Use chr() to convert to ASCII.
+ */
+ function fastpass_say_number(&$buffer, $number, $escape_digits='')
+ {
+ $proceed = false;
+ if($escape_digits != '' && $buffer != '')
+ {
+ if(!strpos(chr(255) . $escape_digits, $buffer{strlen($buffer)-1}))
+ $proceed = true;
+ }
+ if($buffer == '' || $proceed)
+ {
+ $res = $this->say_number($number, $escape_digits);
+ if($res['code'] == AGIRES_OK && $res['result'] > 0)
+ $buffer .= chr($res['result']);
+ return $res;
+ }
+ return array('code'=>AGIRES_OK, 'result'=>ord($buffer{strlen($buffer)-1}));
+ }
+
+ /**
+ * Say the given character string, returning early if any of the given DTMF escape digits are received on the channel.
+ * Return early if $buffer is adequate for request.
+ *
+ * @link http://www.voip-info.org/wiki-say+phonetic
+ * @param string $buffer
+ * @param string $text
+ * @param string $escape_digits
+ * @return array, see evaluate for return information. ['result'] is -1 on hangup or error, 0 if playback completes with no
+ * digit received, otherwise a decimal value of the DTMF tone. Use chr() to convert to ASCII.
+ */
+ function fastpass_say_phonetic(&$buffer, $text, $escape_digits='')
+ {
+ $proceed = false;
+ if($escape_digits != '' && $buffer != '')
+ {
+ if(!strpos(chr(255) . $escape_digits, $buffer{strlen($buffer)-1}))
+ $proceed = true;
+ }
+ if($buffer == '' || $proceed)
+ {
+ $res = $this->say_phonetic($text, $escape_digits);
+ if($res['code'] == AGIRES_OK && $res['result'] > 0)
+ $buffer .= chr($res['result']);
+ return $res;
+ }
+ return array('code'=>AGIRES_OK, 'result'=>ord($buffer{strlen($buffer)-1}));
+ }
+
+ /**
+ * Say a given time, returning early if any of the given DTMF escape digits are received on the channel.
+ * Return early if $buffer is adequate for request.
+ *
+ * @link http://www.voip-info.org/wiki-say+time
+ * @param string $buffer
+ * @param integer $time number of seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC).
+ * @param string $escape_digits
+ * @return array, see evaluate for return information. ['result'] is -1 on hangup or error, 0 if playback completes with no
+ * digit received, otherwise a decimal value of the DTMF tone. Use chr() to convert to ASCII.
+ */
+ function fastpass_say_time(&$buffer, $time=NULL, $escape_digits='')
+ {
+ $proceed = false;
+ if($escape_digits != '' && $buffer != '')
+ {
+ if(!strpos(chr(255) . $escape_digits, $buffer{strlen($buffer)-1}))
+ $proceed = true;
+ }
+ if($buffer == '' || $proceed)
+ {
+ $res = $this->say_time($time, $escape_digits);
+ if($res['code'] == AGIRES_OK && $res['result'] > 0)
+ $buffer .= chr($res['result']);
+ return $res;
+ }
+ return array('code'=>AGIRES_OK, 'result'=>ord($buffer{strlen($buffer)-1}));
+ }
+
+ /**
+ * Play the given audio file, allowing playback to be interrupted by a DTMF digit. This command is similar to the GET DATA
+ * command but this command returns after the first DTMF digit has been pressed while GET DATA can accumulated any number of
+ * digits before returning.
+ * Return early if $buffer is adequate for request.
+ *
+ * @link http://www.voip-info.org/wiki-stream+file
+ * @param string $buffer
+ * @param string $filename without extension, often in /var/lib/asterisk/sounds
+ * @param string $escape_digits
+ * @param integer $offset
+ * @return array, see evaluate for return information. ['result'] is -1 on hangup or error, 0 if playback completes with no
+ * digit received, otherwise a decimal value of the DTMF tone. Use chr() to convert to ASCII.
+ */
+ function fastpass_stream_file(&$buffer, $filename, $escape_digits='', $offset=0)
+ {
+ $proceed = false;
+ if($escape_digits != '' && $buffer != '')
+ {
+ if(!strpos(chr(255) . $escape_digits, $buffer{strlen($buffer)-1}))
+ $proceed = true;
+ }
+ if($buffer == '' || $proceed)
+ {
+ $res = $this->stream_file($filename, $escape_digits, $offset);
+ if($res['code'] == AGIRES_OK && $res['result'] > 0)
+ $buffer .= chr($res['result']);
+ return $res;
+ }
+ return array('code'=>AGIRES_OK, 'result'=>ord($buffer{strlen($buffer)-1}), 'endpos'=>0);
+ }
+
+ /**
+ * Use festival to read text.
+ * Return early if $buffer is adequate for request.
+ *
+ * @link http://www.cstr.ed.ac.uk/projects/festival/
+ * @param string $buffer
+ * @param string $text
+ * @param string $escape_digits
+ * @param integer $frequency
+ * @return array, see evaluate for return information.
+ */
+ function fastpass_text2wav(&$buffer, $text, $escape_digits='', $frequency=8000)
+ {
+ $proceed = false;
+ if($escape_digits != '' && $buffer != '')
+ {
+ if(!strpos(chr(255) . $escape_digits, $buffer{strlen($buffer)-1}))
+ $proceed = true;
+ }
+ if($buffer == '' || $proceed)
+ {
+ $res = $this->text2wav($text, $escape_digits, $frequency);
+ if($res['code'] == AGIRES_OK && $res['result'] > 0)
+ $buffer .= chr($res['result']);
+ return $res;
+ }
+ return array('code'=>AGIRES_OK, 'result'=>ord($buffer{strlen($buffer)-1}), 'endpos'=>0);
+ }
+
+ /**
+ * Use Cepstral Swift to read text.
+ * Return early if $buffer is adequate for request.
+ *
+ * @link http://www.cepstral.com/
+ * @param string $buffer
+ * @param string $text
+ * @param string $escape_digits
+ * @param integer $frequency
+ * @return array, see evaluate for return information.
+ */
+ function fastpass_swift(&$buffer, $text, $escape_digits='', $frequency=8000, $voice=NULL)
+ {
+ $proceed = false;
+ if($escape_digits != '' && $buffer != '')
+ {
+ if(!strpos(chr(255) . $escape_digits, $buffer{strlen($buffer)-1}))
+ $proceed = true;
+ }
+ if($buffer == '' || $proceed)
+ {
+ $res = $this->swift($text, $escape_digits, $frequency, $voice);
+ if($res['code'] == AGIRES_OK && $res['result'] > 0)
+ $buffer .= chr($res['result']);
+ return $res;
+ }
+ return array('code'=>AGIRES_OK, 'result'=>ord($buffer{strlen($buffer)-1}), 'endpos'=>0);
+ }
+
+ /**
+ * Say Puncutation in a string.
+ * Return early if $buffer is adequate for request.
+ *
+ * @param string $buffer
+ * @param string $text
+ * @param string $escape_digits
+ * @param integer $frequency
+ * @return array, see evaluate for return information.
+ */
+ function fastpass_say_punctuation(&$buffer, $text, $escape_digits='', $frequency=8000)
+ {
+ $proceed = false;
+ if($escape_digits != '' && $buffer != '')
+ {
+ if(!strpos(chr(255) . $escape_digits, $buffer{strlen($buffer)-1}))
+ $proceed = true;
+ }
+ if($buffer == '' || $proceed)
+ {
+ $res = $this->say_punctuation($text, $escape_digits, $frequency);
+ if($res['code'] == AGIRES_OK && $res['result'] > 0)
+ $buffer .= chr($res['result']);
+ return $res;
+ }
+ return array('code'=>AGIRES_OK, 'result'=>ord($buffer{strlen($buffer)-1}));
+ }
+
+ /**
+ * Plays the given file and receives DTMF data.
+ * Return early if $buffer is adequate for request.
+ *
+ * This is similar to STREAM FILE, but this command can accept and return many DTMF digits,
+ * while STREAM FILE returns immediately after the first DTMF digit is detected.
+ *
+ * Asterisk looks for the file to play in /var/lib/asterisk/sounds by default.
+ *
+ * If the user doesn't press any keys when the message plays, there is $timeout milliseconds
+ * of silence then the command ends.
+ *
+ * The user has the opportunity to press a key at any time during the message or the
+ * post-message silence. If the user presses a key while the message is playing, the
+ * message stops playing. When the first key is pressed a timer starts counting for
+ * $timeout milliseconds. Every time the user presses another key the timer is restarted.
+ * The command ends when the counter goes to zero or the maximum number of digits is entered,
+ * whichever happens first.
+ *
+ * If you don't specify a time out then a default timeout of 2000 is used following a pressed
+ * digit. If no digits are pressed then 6 seconds of silence follow the message.
+ *
+ * If you don't specify $max_digits then the user can enter as many digits as they want.
+ *
+ * Pressing the # key has the same effect as the timer running out: the command ends and
+ * any previously keyed digits are returned. A side effect of this is that there is no
+ * way to read a # key using this command.
+ *
+ * @link http://www.voip-info.org/wiki-get+data
+ * @param string $buffer
+ * @param string $filename file to play. Do not include file extension.
+ * @param integer $timeout milliseconds
+ * @param integer $max_digits
+ * @return array, see evaluate for return information. ['result'] holds the digits and ['data'] holds the timeout if present.
+ *
+ * This differs from other commands with return DTMF as numbers representing ASCII characters.
+ */
+ function fastpass_get_data(&$buffer, $filename, $timeout=NULL, $max_digits=NULL)
+ {
+ if(is_null($max_digits) || strlen($buffer) < $max_digits)
+ {
+ if($buffer == '')
+ {
+ $res = $this->get_data($filename, $timeout, $max_digits);
+ if($res['code'] == AGIRES_OK)
+ $buffer .= $res['result'];
+ return $res;
+ }
+ else
+ {
+ while(is_null($max_digits) || strlen($buffer) < $max_digits)
+ {
+ $res = $this->wait_for_digit();
+ if($res['code'] != AGIRES_OK) return $res;
+ if($res['result'] == ord('#')) break;
+ $buffer .= chr($res['result']);
+ }
+ }
+ }
+ return array('code'=>AGIRES_OK, 'result'=>$buffer);
+ }
+
+ // *********************************************************************************************************
+ // ** DERIVED **
+ // *********************************************************************************************************
+
+ /**
+ * Menu.
+ *
+ * This function presents the user with a menu and reads the response
+ *
+ * @param array $choices has the following structure:
+ * array('1'=>'*Press 1 for this', // festival reads if prompt starts with *
+ * '2'=>'some-gsm-without-extension',
+ * '*'=>'*Press star for help');
+ * @return mixed key pressed on sucess, -1 on failure
+ */
+ function menu($choices, $timeout=2000)
+ {
+ $keys = join('', array_keys($choices));
+ $choice = NULL;
+ while(is_null($choice))
+ {
+ foreach($choices as $prompt)
+ {
+ if($prompt{0} == '*')
+ $ret = $this->text2wav(substr($prompt, 1), $keys);
+ else
+ $ret = $this->stream_file($prompt, $keys);
+
+ if($ret['code'] != AGIRES_OK || $ret['result'] == -1)
+ {
+ $choice = -1;
+ break;
+ }
+
+ if($ret['result'] != 0)
+ {
+ $choice = chr($ret['result']);
+ break;
+ }
+ }
+
+ if(is_null($choice))
+ {
+ $ret = $this->get_data('beep', $timeout, 1);
+ if($ret['code'] != AGIRES_OK || $ret['result'] == -1)
+ $choice = -1;
+ elseif($ret['result'] != '' && strpos(' '.$keys, $ret['result']))
+ $choice = $ret['result'];
+ }
+ }
+ return $choice;
+ }
+
+ /**
+ * Goto - Set context, extension and priority.
+ *
+ * @param string $context
+ * @param string $extension
+ * @param string $priority
+ */
+ function goto($context, $extension='s', $priority=1)
+ {
+ $this->set_context($context);
+ $this->set_extension($extension);
+ $this->set_priority($priority);
+ }
+
+ /**
+ * Parse caller id.
+ *
+ * @example examples/dtmf.php Get DTMF tones from the user and say the digits
+ * @example examples/input.php Get text input from the user and say it back
+ *
+ * "name" <proto:user@server:port>
+ *
+ * @param string $callerid
+ * @return array('Name'=>$name, 'Number'=>$number)
+ */
+ function parse_callerid($callerid=NULL)
+ {
+ if(is_null($callerid))
+ $callerid = $this->request['agi_callerid'];
+
+ $ret = array('name'=>'', 'protocol'=>'', 'username'=>'', 'host'=>'', 'port'=>'');
+ $callerid = trim($callerid);
+
+ if($callerid{0} == '"' || $callerid{0} == "'")
+ {
+ $d = $callerid{0};
+ $callerid = explode($d, substr($callerid, 1));
+ $ret['name'] = array_shift($callerid);
+ $callerid = join($d, $callerid);
+ }
+
+ $callerid = explode('@', trim($callerid, '<> '));
+ $username = explode(':', array_shift($callerid));
+ if(count($username) == 1)
+ $ret['username'] = $username[0];
+ else
+ {
+ $ret['protocol'] = array_shift($username);
+ $ret['username'] = join(':', $username);
+ }
+
+ $callerid = join('@', $callerid);
+ $host = explode(':', $callerid);
+ if(count($host) == 1)
+ $ret['host'] = $host[0];
+ else
+ {
+ $ret['host'] = array_shift($host);
+ $ret['port'] = join(':', $host);
+ }
+
+ return $ret;
+ }
+
+ /**
+ * Use festival to read text.
+ *
+ * @example examples/dtmf.php Get DTMF tones from the user and say the digits
+ * @example examples/input.php Get text input from the user and say it back
+ * @example examples/ping.php Ping an IP address
+ *
+ * @link http://www.cstr.ed.ac.uk/projects/festival/
+ * @param string $text
+ * @param string $escape_digits
+ * @param integer $frequency
+ * @return array, see evaluate for return information.
+ */
+ function text2wav($text, $escape_digits='', $frequency=8000)
+ {
+ $text = trim($text);
+ if($text == '') return true;
+
+ $hash = md5($text);
+ $fname = $this->config['phpagi']['tempdir'] . DIRECTORY_SEPARATOR;
+ $fname .= 'text2wav_' . $hash;
+
+ // create wave file
+ if(!file_exists("$fname.wav"))
+ {
+ // write text file
+ if(!file_exists("$fname.txt"))
+ {
+ $fp = fopen("$fname.txt", 'w');
+ fputs($fp, $text);
+ fclose($fp);
+ }
+
+ shell_exec("{$this->config['festival']['text2wave']} -F $frequency -o $fname.wav $fname.txt");
+ }
+ else
+ {
+ touch("$fname.txt");
+ touch("$fname.wav");
+ }
+
+ // stream it
+ $ret = $this->stream_file($fname, $escape_digits);
+
+ // clean up old files
+ $delete = time() - 2592000; // 1 month
+ foreach(glob($this->config['phpagi']['tempdir'] . DIRECTORY_SEPARATOR . 'text2wav_*') as $file)
+ if(filemtime($file) < $delete)
+ unlink($file);
+
+ return $ret;
+ }
+
+ /**
+ * Use Cepstral Swift to read text.
+ *
+ * @link http://www.cepstral.com/
+ * @param string $text
+ * @param string $escape_digits
+ * @param integer $frequency
+ * @return array, see evaluate for return information.
+ */
+ function swift($text, $escape_digits='', $frequency=8000, $voice=NULL)
+ {
+ if(!is_null($voice))
+ $voice = "-n $voice";
+ elseif(isset($this->config['cepstral']['voice']))
+ $voice = "-n {$this->config['cepstral']['voice']}";
+
+ $text = trim($text);
+ if($text == '') return true;
+
+ $hash = md5($text);
+ $fname = $this->config['phpagi']['tempdir'] . DIRECTORY_SEPARATOR;
+ $fname .= 'swift_' . $hash;
+
+ // create wave file
+ if(!file_exists("$fname.wav"))
+ {
+ // write text file
+ if(!file_exists("$fname.txt"))
+ {
+ $fp = fopen("$fname.txt", 'w');
+ fputs($fp, $text);
+ fclose($fp);
+ }
+
+ shell_exec("{$this->config['cepstral']['swift']} -p audio/channels=1,audio/sampling-rate=$frequency $voice -o $fname.wav -f $fname.txt");
+ }
+
+ // stream it
+ $ret = $this->stream_file($fname, $escape_digits);
+
+ // clean up old files
+ $delete = time() - 2592000; // 1 month
+ foreach(glob($this->config['phpagi']['tempdir'] . DIRECTORY_SEPARATOR . 'swift_*') as $file)
+ if(filemtime($file) < $delete)
+ unlink($file);
+
+ return $ret;
+ }
+
+ /**
+ * Text Input.
+ *
+ * Based on ideas found at http://www.voip-info.org/wiki-Asterisk+cmd+DTMFToText
+ *
+ * Example:
+ * UC H LC i , SP h o w SP a r e SP y o u ?
+ * $string = '*8'.'44*'.'*5'.'444*'.'00*'.'0*'.'44*'.'666*'.'9*'.'0*'.'2*'.'777*'.'33*'.'0*'.'999*'.'666*'.'88*'.'0000*';
+ *
+ * @link http://www.voip-info.org/wiki-Asterisk+cmd+DTMFToText
+ * @example examples/input.php Get text input from the user and say it back
+ *
+ * @return string
+ */
+ function text_input($mode='NUMERIC')
+ {
+ $alpha = array( 'k0'=>' ', 'k00'=>',', 'k000'=>'.', 'k0000'=>'?', 'k00000'=>'0',
+ 'k1'=>'!', 'k11'=>':', 'k111'=>';', 'k1111'=>'#', 'k11111'=>'1',
+ 'k2'=>'A', 'k22'=>'B', 'k222'=>'C', 'k2222'=>'2',
+ 'k3'=>'D', 'k33'=>'E', 'k333'=>'F', 'k3333'=>'3',
+ 'k4'=>'G', 'k44'=>'H', 'k444'=>'I', 'k4444'=>'4',
+ 'k5'=>'J', 'k55'=>'K', 'k555'=>'L', 'k5555'=>'5',
+ 'k6'=>'M', 'k66'=>'N', 'k666'=>'O', 'k6666'=>'6',
+ 'k7'=>'P', 'k77'=>'Q', 'k777'=>'R', 'k7777'=>'S', 'k77777'=>'7',
+ 'k8'=>'T', 'k88'=>'U', 'k888'=>'V', 'k8888'=>'8',
+ 'k9'=>'W', 'k99'=>'X', 'k999'=>'Y', 'k9999'=>'Z', 'k99999'=>'9');
+ $symbol = array('k0'=>'=',
+ 'k1'=>'<', 'k11'=>'(', 'k111'=>'[', 'k1111'=>'{', 'k11111'=>'1',
+ 'k2'=>'@', 'k22'=>'$', 'k222'=>'&', 'k2222'=>'%', 'k22222'=>'2',
+ 'k3'=>'>', 'k33'=>')', 'k333'=>']', 'k3333'=>'}', 'k33333'=>'3',
+ 'k4'=>'+', 'k44'=>'-', 'k444'=>'*', 'k4444'=>'/', 'k44444'=>'4',
+ 'k5'=>"'", 'k55'=>'`', 'k555'=>'5',
+ 'k6'=>'"', 'k66'=>'6',
+ 'k7'=>'^', 'k77'=>'7',
+ 'k8'=>"\\",'k88'=>'|', 'k888'=>'8',
+ 'k9'=>'_', 'k99'=>'~', 'k999'=>'9');
+ $text = '';
+ do
+ {
+ $command = false;
+ $result = $this->get_data('beep');
+ foreach(explode('*', $result['result']) as $code)
+ {
+ if($command)
+ {
+ switch($code{0})
+ {
+ case '2': $text = substr($text, 0, strlen($text) - 1); break; // backspace
+ case '5': $mode = 'LOWERCASE'; break;
+ case '6': $mode = 'NUMERIC'; break;
+ case '7': $mode = 'SYMBOL'; break;
+ case '8': $mode = 'UPPERCASE'; break;
+ case '9': $text = explode(' ', $text); unset($text[count($text)-1]); $text = join(' ', $text); break; // backspace a word
+ }
+ $code = substr($code, 1);
+ $command = false;
+ }
+ if($code == '')
+ $command = true;
+ elseif($mode == 'NUMERIC')
+ $text .= $code;
+ elseif($mode == 'UPPERCASE' && isset($alpha['k'.$code]))
+ $text .= $alpha['k'.$code];
+ elseif($mode == 'LOWERCASE' && isset($alpha['k'.$code]))
+ $text .= strtolower($alpha['k'.$code]);
+ elseif($mode == 'SYMBOL' && isset($symbol['k'.$code]))
+ $text .= $symbol['k'.$code];
+ }
+ $this->say_punctuation($text);
+ } while(substr($result['result'], -2) == '**');
+ return $text;
+ }
+
+ /**
+ * Say Puncutation in a string.
+ *
+ * @param string $text
+ * @param string $escape_digits
+ * @param integer $frequency
+ * @return array, see evaluate for return information.
+ */
+ function say_punctuation($text, $escape_digits='', $frequency=8000)
+ {
+ for($i = 0; $i < strlen($text); $i++)
+ {
+ switch($text{$i})
+ {
+ case ' ': $ret .= 'SPACE ';
+ case ',': $ret .= 'COMMA '; break;
+ case '.': $ret .= 'PERIOD '; break;
+ case '?': $ret .= 'QUESTION MARK '; break;
+ case '!': $ret .= 'EXPLANATION POINT '; break;
+ case ':': $ret .= 'COLON '; break;
+ case ';': $ret .= 'SEMICOLON '; break;
+ case '#': $ret .= 'POUND '; break;
+ case '=': $ret .= 'EQUALS '; break;
+ case '<': $ret .= 'LESS THAN '; break;
+ case '(': $ret .= 'LEFT PARENTHESIS '; break;
+ case '[': $ret .= 'LEFT BRACKET '; break;
+ case '{': $ret .= 'LEFT BRACE '; break;
+ case '@': $ret .= 'AT '; break;
+ case '$': $ret .= 'DOLLAR SIGN '; break;
+ case '&': $ret .= 'AMPERSAND '; break;
+ case '%': $ret .= 'PERCENT '; break;
+ case '>': $ret .= 'GREATER THAN '; break;
+ case ')': $ret .= 'RIGHT PARENTHESIS '; break;
+ case ']': $ret .= 'RIGHT BRACKET '; break;
+ case '}': $ret .= 'RIGHT BRACE '; break;
+ case '+': $ret .= 'PLUS '; break;
+ case '-': $ret .= 'MINUS '; break;
+ case '*': $ret .= 'ASTERISK '; break;
+ case '/': $ret .= 'SLASH '; break;
+ case "'": $ret .= 'SINGLE QUOTE '; break;
+ case '`': $ret .= 'BACK TICK '; break;
+ case '"': $ret .= 'QUOTE '; break;
+ case '^': $ret .= 'CAROT '; break;
+ case "\\": $ret .= 'BACK SLASH '; break;
+ case '|': $ret .= 'BAR '; break;
+ case '_': $ret .= 'UNDERSCORE '; break;
+ case '~': $ret .= 'TILDE '; break;
+ default: $ret .= $text{$i} . ' '; break;
+ }
+ }
+ return $this->text2wav($ret, $escape_digits, $frequency);
+ }
+
+ /**
+ * Create a new AGI_AsteriskManager.
+ */
+ function &new_AsteriskManager()
+ {
+ $this->asm = new AGI_AsteriskManager(NULL, $this->config);
+ $this->asm->pagi =& $this;
+ $this->config =& $this->asm->config;
+ return $this->asm;
+ }
+
+
+ // *********************************************************************************************************
+ // ** PRIVATE **
+ // *********************************************************************************************************
+
+
+ /**
+ * Evaluate an AGI command.
+ *
+ * @access private
+ * @param string $command
+ * @return array ('code'=>$code, 'result'=>$result, 'data'=>$data)
+ */
+ function evaluate($command)
+ {
+ $broken = array('code'=>500, 'result'=>-1, 'data'=>'');
+
+ // write command
+ if(!@fwrite($this->out, trim($command) . "\n")) return $broken;
+ fflush($this->out);
+
+ // Read result. Occasionally, a command return a string followed by an extra new line.
+ // When this happens, our script will ignore the new line, but it will still be in the
+ // buffer. So, if we get a blank line, it is probably the result of a previous
+ // command. We read until we get a valid result or asterisk hangs up. One offending
+ // command is SEND TEXT.
+ $count = 0;
+ do
+ {
+ $str = trim(fgets($this->in, 4096));
+ } while($str == '' && $count++ < 5);
+
+/*
+ PATCH
+*/
+ logthis("AGI EVALUATE '$command' returned: '$str' in $count reads");
+
+ if($count >= 5)
+ {
+// $this->conlog("evaluate error on read for $command");
+ return $broken;
+ }
+
+ // parse result
+ $ret['code'] = substr($str, 0, 3);
+ $str = trim(substr($str, 3));
+
+ if($str{0} == '-') // we have a multiline response!
+ {
+ $count = 0;
+ $str = substr($str, 1) . "\n";
+ $line = fgets($this->in, 4096);
+ while(substr($line, 0, 3) != $ret['code'] && $count < 5)
+ {
+ $str .= $line;
+ $line = fgets($this->in, 4096);
+ $count = (trim($line) == '') ? $count + 1 : 0;
+ }
+ if($count >= 5)
+ {
+// $this->conlog("evaluate error on multiline read for $command");
+ return $broken;
+ }
+ }
+
+ $ret['result'] = NULL;
+ $ret['data'] = '';
+ if($ret['code'] != AGIRES_OK) // some sort of error
+ {
+ $ret['data'] = $str;
+ $this->conlog(print_r($ret, true));
+ }
+ else // normal AGIRES_OK response
+ {
+ $parse = explode(' ', trim($str));
+ $in_token = false;
+ foreach($parse as $token)
+ {
+ if($in_token) // we previously hit a token starting with ')' but not ending in ')'
+ {
+ $ret['data'] .= ' ' . trim($token, '() ');
+ if($token{strlen($token)-1} == ')') $in_token = false;
+ }
+ elseif($token{0} == '(')
+ {
+ if($token{strlen($token)-1} != ')') $in_token = true;
+ $ret['data'] .= ' ' . trim($token, '() ');
+ }
+ elseif(strpos($token, '='))
+ {
+ $token = explode('=', $token);
+ $ret[$token[0]] = $token[1];
+ }
+ elseif($token != '')
+ $ret['data'] .= ' ' . $token;
+ }
+ $ret['data'] = trim($ret['data']);
+ }
+
+ // log some errors
+ if($ret['result'] < 0)
+ $this->conlog("$command returned {$ret['result']}");
+
+ return $ret;
+ }
+
+ /**
+ * Log to console if debug mode.
+ *
+ * @example examples/ping.php Ping an IP address
+ *
+ * @param string $str
+ * @param integer $vbl verbose level
+ */
+ function conlog($str, $vbl=1)
+ {
+ static $busy = false;
+
+ if($this->config['phpagi']['debug'] != false)
+ {
+ if(!$busy) // no conlogs inside conlog!!!
+ {
+ $busy = true;
+ $this->verbose($str, $vbl);
+ $busy = false;
+ }
+ }
+ }
+
+ /**
+ * Find an execuable in the path.
+ *
+ * @access private
+ * @param string $cmd command to find
+ * @param string $checkpath path to check
+ * @return string the path to the command
+ */
+ function which($cmd, $checkpath=NULL)
+ {
+ global $_ENV;
+ $chpath = is_null($checkpath) ? $_ENV['PATH'] : $checkpath;
+
+ foreach(explode(':', $chpath) as $path)
+ if(is_executable("$path/$cmd"))
+ return "$path/$cmd";
+
+ if(is_null($checkpath))
+ return $this->which($cmd, '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:'.
+ '/usr/X11R6/bin:/usr/local/apache/bin:/usr/local/mysql/bin');
+ return false;
+ }
+
+ /**
+ * Make a folder recursively.
+ *
+ * @access private
+ * @param string $folder
+ * @param integer $perms
+ */
+ function make_folder($folder, $perms=0755)
+ {
+ $f = explode(DIRECTORY_SEPARATOR, $folder);
+ $base = '';
+ for($i = 0; $i < count($f); $i++)
+ {
+ $base .= $f[$i];
+ if($f[$i] != '' && !file_exists($base))
+ mkdir($base, $perms);
+ $base .= DIRECTORY_SEPARATOR;
+ }
+ }
+ }
+
+/**
+ * error handler for phpagi.
+ *
+ * @param integer $level PHP error level
+ * @param string $message error message
+ * @param string $file path to file
+ * @param integer $line line number of error
+ * @param array $context variables in the current scope
+ */
+ function phpagi_error_handler($level, $message, $file, $line, $context)
+ {
+ if(ini_get('error_reporting') == 0) return; // this happens with an @
+
+ @syslog(LOG_WARNING, $file . '[' . $line . ']: ' . $message);
+
+ global $phpagi_error_handler_email;
+ if(function_exists('mail') && !is_null($phpagi_error_handler_email)) // generate email debugging information
+ {
+ // decode error level
+ switch($level)
+ {
+ case E_WARNING:
+ case E_USER_WARNING:
+ $level = "Warning";
+ break;
+ case E_NOTICE:
+ case E_USER_NOTICE:
+ $level = "Notice";
+ break;
+ case E_USER_ERROR:
+ $level = "Error";
+ break;
+ }
+
+ // build message
+ $basefile = basename($file);
+ $subject = "$basefile/$line/$level: $message";
+ $message = "$level: $message in $file on line $line\n\n";
+
+ if(function_exists('mysql_errno') && strpos(' '.strtolower($message), 'mysql'))
+ $message .= 'MySQL error ' . mysql_errno() . ": " . mysql_error() . "\n\n";
+
+ // figure out who we are
+ if(function_exists('socket_create'))
+ {
+ $addr = NULL;
+ $port = 80;
+ $socket = @socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
+ @socket_connect($socket, '64.0.0.0', $port);
+ @socket_getsockname($socket, $addr, $port);
+ @socket_close($socket);
+ $message .= "\n\nIP Address: $addr\n";
+ }
+
+ // include variables
+ $message .= "\n\nContext:\n" . print_r($context, true);
+ $message .= "\n\nGLOBALS:\n" . print_r($GLOBALS, true);
+ $message .= "\n\nBacktrace:\n" . print_r(debug_backtrace(), true);
+
+ // include code fragment
+ if(file_exists($file))
+ {
+ $message .= "\n\n$file:\n";
+ $code = @file($file);
+ for($i = max(0, $line - 10); $i < min($line + 10, count($code)); $i++)
+ $message .= ($i + 1)."\t$code[$i]";
+ }
+
+ // make sure message is fully readable (convert unprintable chars to hex representation)
+ $ret = '';
+ for($i = 0; $i < strlen($message); $i++)
+ {
+ $c = ord($message{$i});
+ if($c == 10 || $c == 13 || $c == 9)
+ $ret .= $message{$i};
+ elseif($c < 16)
+ $ret .= '\x0' . dechex($c);
+ elseif($c < 32 || $c > 127)
+ $ret .= '\x' . dechex($c);
+ else
+ $ret .= $message{$i};
+ }
+ $message = $ret;
+
+ // send the mail if less than 5 errors
+ static $mailcount = 0;
+ if($mailcount < 5)
+ @mail($phpagi_error_handler_email, $subject, $message);
+ $mailcount++;
+ }
+ }
+ $phpagi_error_handler_email = NULL;
+?>
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribhunmonkluasupport_functions_databaseluafromrev15313freeswitchtrunkcontribhunmonkluasupport_functions_databaselua"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/hunmonk/lua/support_functions_database.lua (from rev 15313, freeswitch/trunk/contrib/hunmonk/lua/support_functions_database.lua) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/hunmonk/lua/support_functions_database.lua         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/hunmonk/lua/support_functions_database.lua        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+--[[
+ Helper functions for database operations.
+]]
+
+--[[
+ Escapes special characters for the MySQL database.
+]]
+function mysql_escape(string_to_escape)
+ -- Single quote, double quote, backspace.
+ escaped_string, replacements = string.gsub(string_to_escape, "(['\"\\])", function(x) return "\\" .. x end)
+ -- Null byte.
+ escaped_string, replacements = string.gsub(escaped_string, "%z", "\\0")
+
+ return escaped_string
+end
+
+--[[
+ Escapes special characters for the Postgres database.
+]]
+function pgsql_escape(string_to_escape)
+ -- Single quote..
+ escaped_string, replacements = string.gsub(string_to_escape, "'", "''")
+ -- Null byte.
+ escaped_string, replacements = string.gsub(escaped_string, "%z", "")
+
+ return escaped_string
+end
+
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlconfigurationeasyrouteconfphpfromrev15313freeswitchtrunkcontribintralanmanPHPfs_curlconfigurationeasyrouteconfphp"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/easyroute.conf.php (from rev 15313, freeswitch/trunk/contrib/intralanman/PHP/fs_curl/configuration/easyroute.conf.php) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/easyroute.conf.php         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/easyroute.conf.php        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * easyroute.conf.php
+ */
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman@gmail.com>
+ * @version 0.1
+ * Writes out easyroute.conf XML
+ * @see fs_configuration
+ */
+class easyroute_conf extends fs_configuration {
+ public function easyroute_conf() {
+ $this->fs_configuration();
+ }
+
+ public function main() {
+ $config = $this->get_config();
+ $this->write_config($config);
+ }
+
+ private function get_config() {
+ $query = sprintf('SELECT * FROM easyroute_conf');
+ $settings_array = $this -> db -> queryAll($query);
+ $settings_count = count($settings_array);
+ if (FS_PDO::isError($settings_array)) {
+ $this -> comment($query);
+ $this -> comment($this -> db -> getMessage());
+ return ;
+ }
+
+ return $settings_array;
+ }
+
+ private function write_config($settings_array) {
+ $this->xmlw->startElement('configuration');
+ $this->xmlw->writeAttribute('name', basename(__FILE__, '.php'));
+ $this->xmlw->writeAttribute('description', 'Dynamic ' . ucfirst(basename(__FILE__, '.conf.php')) . ' Configuration');
+ $this->xmlw->startElement('settings');
+ $settings_count = count($settings_array);
+ if ($settings_count > 0) {
+ for ($i=0; $i<$settings_count; $i++) {
+ $this->xmlw->startElement('param');
+ $this->xmlw->writeAttribute('name', $settings_array[$i]['param_name']);
+ $this->xmlw->writeAttribute('value', $settings_array[$i]['param_value']);
+ $this->xmlw->endElement();//</param>
+ }
+ }
+ $this->xmlw->endElement(); // </settings>
+ $this->xmlw->endElement();
+ }
+}
+
+
+
+?>
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlconfigurationlcrconfphpfromrev15313freeswitchtrunkcontribintralanmanPHPfs_curlconfigurationlcrconfphp"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/lcr.conf.php (from rev 15313, freeswitch/trunk/contrib/intralanman/PHP/fs_curl/configuration/lcr.conf.php) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/lcr.conf.php         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/lcr.conf.php        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,104 @@
</span><ins>+<?php
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * lcr.conf.php
+ */
+/**
+ * @package FS_CURL
+ * @subpackage FS_CURL_Configuration
+ * @license
+ * @author Raymond Chandler (intralanman) <intralanman@gmail.com>
+ * @version 0.1
+ * Writes out lcr.conf XML
+ * @see fs_configuration
+ */
+class lcr_conf extends fs_configuration {
+ public function lcr_conf() {
+ $this->fs_configuration();
+ }
+
+ public function main() {
+ $this->write_config();
+ }
+
+ private function write_config() {
+
+ $this->xmlw->startElement('configuration');
+ $this->xmlw->writeAttribute('name', basename(__FILE__, '.php'));
+ $this->xmlw->writeAttribute('description', 'Dynamic ' . ucfirst(basename(__FILE__, '.conf.php')) . ' Configuration');
+
+ $this->xmlw->startElement('settings');
+ $query = sprintf('SELECT * FROM lcr_conf;');
+ $settings_array = $this -> db -> queryAll($query);
+ $settings_count = count($settings_array);
+ if (FS_PDO::isError($settings_array)) {
+ $this -> comment($query);
+ $this -> comment($this -> db -> getMessage());
+ return ;
+ }
+ for ($i = 0; $i < $settings_count; $i++) {
+ $this->xmlw->startElement('param');
+ $this->xmlw->writeAttribute('name', $settings_array[$i]['param_name']);
+ $this->xmlw->writeAttribute('value', $settings_array[$i]['param_value']);
+ $this->xmlw->endElement();
+ }
+ $this->xmlw->endElement(); // </settings>
+
+
+ $profiles = $this->get_profiles();
+ $this->write_profiles($profiles);
+
+ $this->xmlw->endElement(); // </configuration>
+ }
+
+ private function get_profiles() {
+ $query = sprintf(
+ 'SELECT *, lp.id AS lcr_id FROM lcr_profiles lp
+ LEFT JOIN lcr_settings ls ON ls.lcr_id = lp.id
+ ORDER BY lp.id;'
+ );
+ $settings_array = $this -> db -> queryAll($query);
+ $settings_count = count($settings_array);
+ if (FS_PDO::isError($settings_array)) {
+ $this -> comment($query);
+ $this -> comment($this -> db -> getMessage());
+ return ;
+ }
+
+ $settings = array();
+ for ($i = 0; $i < $settings_count; $i++) {
+ $profile = $settings_array[$i]['profile_name'];
+ $param = $settings_array[$i]['param_name'];
+ $settings[$profile]['id'] = $settings_array[$i]['lcr_id'];
+ $settings[$profile][$param] = $settings_array[$i]['param_value'];
+ }
+ return $settings;
+ }
+
+ private function write_profiles($settings_array) {
+ $this->xmlw->startElement('profiles');
+
+
+ foreach ($settings_array as $profile => $profile_data) {
+ $this->xmlw->startElement('profile');
+ $this->xmlw->writeAttribute('name', $profile);
+ $this->debug($profile_data);
+ foreach ($profile_data as $name => $value) {
+ if (!$name) {
+ continue;
+ }
+ $this->xmlw->startElement('param');
+ $this->xmlw->writeAttribute('name', $name);
+ $this->xmlw->writeAttribute('value', $value);
+ $this->xmlw->endElement();//</param>
+ }
+ $this->xmlw->endElement(); // </profile>
+ }
+
+
+
+ $this->xmlw->endElement(); // </profiles>
+ }
+}
+
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlconfigurationpost_load_modulesconfphp"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/post_load_modules.conf.php (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/post_load_modules.conf.php        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/post_load_modules.conf.php        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> */
</span><span class="cx"> function get_modules_array() {
</span><span class="cx"> $query = sprintf(
</span><del>- 'SELECT * FROM post_load_modules_conf WHERE load_module=1 ORDER BY priority;'
</del><ins>+ "SELECT * FROM post_load_modules_conf WHERE load_module='1' ORDER BY priority;"
</ins><span class="cx"> );
</span><span class="cx"> $res = $this -> db -> query($query);
</span><span class="cx"> if (FS_PDO::isError($res)) {
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> $this -> comment($res -> getMessage());
</span><span class="cx"> return array();
</span><span class="cx"> }
</span><del>- $this -> comment($res -> numRows() . 'rows');
</del><ins>+ $this -> comment($res -> numRows() . ' rows');
</ins><span class="cx"> if ($res -> numRows() == 0) {
</span><span class="cx"> return array();
</span><span class="cx"> }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlconfigurationvoicemailconfphp"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/voicemail.conf.php (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/voicemail.conf.php        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/voicemail.conf.php        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> <?php
</span><span class="cx"> /**
</span><span class="cx"> * @package FS_CURL
</span><del>- * @subpackage FS_CURL_Directory
</del><ins>+ * @subpackage FS_CURL_Configuration
</ins><span class="cx"> * voicemail.conf.php
</span><span class="cx"> */
</span><span class="cx"> /**
</span><span class="lines">@@ -12,10 +12,10 @@
</span><span class="cx"> * @version 0.1
</span><span class="cx"> * Writes out voicemail.conf XML
</span><span class="cx"> * @see fs_configuration
</span><del>-*/
</del><ins>+ */
</ins><span class="cx"> class voicemail_conf extends fs_configuration {
</span><span class="cx">
</span><del>- public function voicemail_conf() {
</del><ins>+ public function voicemail_conf() {
</ins><span class="cx"> $this -> fs_configuration();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> /**
</span><span class="cx"> * Get voicemail profiles from db
</span><span class="cx"> * @return array
</span><del>- */
</del><ins>+ */
</ins><span class="cx"> private function get_profiles() {
</span><span class="cx"> $query = "SELECT * FROM voicemail_conf ORDER BY id";
</span><span class="cx"> $profiles = $this -> db -> queryAll($query);
</span><span class="lines">@@ -37,12 +37,12 @@
</span><span class="cx"> /**
</span><span class="cx"> * Write XML for voicemail <settings>
</span><span class="cx"> * @return void
</span><del>- */
</del><ins>+ */
</ins><span class="cx"> private function write_settings($profile_id) {
</span><span class="cx"> $query = sprintf('%s %s %s;'
</span><del>- , "SELECT * FROM voicemail_settings "
- , "WHERE voicemail_id=$profile_id "
- , "ORDER BY voicemail_id, param_name"
</del><ins>+ , "SELECT * FROM voicemail_settings "
+ , "WHERE voicemail_id=$profile_id "
+ , "ORDER BY voicemail_id, param_name"
</ins><span class="cx"> );
</span><span class="cx"> $settings_array = $this -> db -> queryAll($query);
</span><span class="cx"> $settings_count = count($settings_array);
</span><span class="lines">@@ -54,28 +54,26 @@
</span><span class="cx"> if ($settings_count < 1) {
</span><span class="cx"> return ;
</span><span class="cx"> }
</span><del>- //$this -> xmlw -> startElement('settings');
</del><span class="cx">
</span><span class="cx"> for ($i=0; $i<$settings_count; $i++) {
</span><del>- //$this -> comment_array($settings_array[$i]);
</del><ins>+ //$this -> comment_array($settings_array[$i]);
</ins><span class="cx"> $this -> xmlw -> startElement('param');
</span><span class="cx"> $this -> xmlw -> writeAttribute('name', $settings_array[$i]['param_name']);
</span><span class="cx"> $this -> xmlw -> writeAttribute('value', $settings_array[$i]['param_value']);
</span><span class="cx"> $this -> xmlw -> endElement();//</param>
</span><span class="cx"> }
</span><span class="cx"> $this -> write_email($profile_id);
</span><del>- //$this -> xmlw -> endElement();
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Write XML for voicemail email settings
</span><span class="cx"> * @return void
</span><del>- */
</del><ins>+ */
</ins><span class="cx"> private function write_email($profile_id) {
</span><span class="cx"> $query = sprintf('%s %s %s;'
</span><del>- , "SELECT * FROM voicemail_email "
- , "WHERE voicemail_id=$profile_id "
- , "ORDER BY voicemail_id, param_name"
</del><ins>+ , "SELECT * FROM voicemail_email "
+ , "WHERE voicemail_id=$profile_id "
+ , "ORDER BY voicemail_id, param_name"
</ins><span class="cx"> );
</span><span class="cx"> $settings_array = $this -> db -> queryAll($query);
</span><span class="cx"> $settings_count = count($settings_array);
</span><span class="lines">@@ -90,7 +88,7 @@
</span><span class="cx"> $this -> xmlw -> startElement('email');
</span><span class="cx">
</span><span class="cx"> for ($i=0; $i<$settings_count; $i++) {
</span><del>- //$this -> comment_array($settings_array[$i]);
</del><ins>+ //$this -> comment_array($settings_array[$i]);
</ins><span class="cx"> $this -> xmlw -> startElement('param');
</span><span class="cx"> $this -> xmlw -> writeAttribute('name', $settings_array[$i]['param_name']);
</span><span class="cx"> $this -> xmlw -> writeAttribute('value', $settings_array[$i]['param_value']);
</span><span class="lines">@@ -102,7 +100,7 @@
</span><span class="cx"> /**
</span><span class="cx"> * Write the XML for the current profile in write_profiles
</span><span class="cx"> * @return void
</span><del>- */
</del><ins>+ */
</ins><span class="cx"> private function write_single_profile($profile) {
</span><span class="cx"> $this -> xmlw -> startElement('profile');
</span><span class="cx"> $this -> xmlw -> writeAttribute('name', $profile['vm_profile']);
</span><span class="lines">@@ -114,7 +112,7 @@
</span><span class="cx"> * Write the entire XML config for the voicemail module
</span><span class="cx"> * Write XML by calling other methods to do specific areas of config
</span><span class="cx"> * @return void
</span><del>- */
</del><ins>+ */
</ins><span class="cx"> private function write_config($profiles) {
</span><span class="cx"> $profile_count = count($profiles);
</span><span class="cx"> $this -> xmlw -> startElement('configuration');
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlconfigurationxml_cdrconfphp"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/xml_cdr.conf.php (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/xml_cdr.conf.php        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/configuration/xml_cdr.conf.php        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -14,35 +14,34 @@
</span><span class="cx"> */
</span><span class="cx"> class xml_cdr_conf extends fs_configuration {
</span><span class="cx">         function xml_cdr_conf() {
</span><del>-                $this -> fs_configuration();
</del><ins>+                $this->fs_configuration();
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function main() {
</span><del>-                $params = $this -> get_settings();
-                $this -> write_settings($params);
</del><ins>+                $params = $this->get_settings();
+                $this->write_settings($params);
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function get_settings() {
</span><del>-         return array('url'=>'http://$${curl_host}/fs_curl/cdr.php', 'encode'=>'true');
</del><span class="cx">                 return array(
</span><del>-                'url'=>'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']
</del><ins>+                'url'=>'http://' . $_SERVER['HTTP_HOST'] . '/' . $_SERVER['PHP_SELF']
</ins><span class="cx">                 , 'encode'=>'true'
</span><span class="cx">                 );
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function write_settings($params) {
</span><del>-                $this -> xmlw -> startElement('configuration');
-                $this -> xmlw -> writeAttribute('name', basename(__FILE__, '.php'));
-                $this -> xmlw -> writeAttribute('description', 'CDRs via XML Post');
-                $this -> xmlw -> startElement('settings');
</del><ins>+                $this->xmlw->startElement('configuration');
+                $this->xmlw->writeAttribute('name', basename(__FILE__, '.php'));
+                $this->xmlw->writeAttribute('description', 'CDRs via XML Post');
+                $this->xmlw->startElement('settings');
</ins><span class="cx">                 while (list($name, $value) = each($params)) {
</span><del>-                        $this -> xmlw -> startElement('param');
-                        $this -> xmlw -> writeAttribute('name', $name);
-                        $this -> xmlw -> writeAttribute('value', $value);
-                        $this -> xmlw -> endElement();
</del><ins>+                        $this->xmlw->startElement('param');
+                        $this->xmlw->writeAttribute('name', $name);
+                        $this->xmlw->writeAttribute('value', $value);
+                        $this->xmlw->endElement();
</ins><span class="cx">                 }
</span><del>-                $this -> xmlw -> endElement();
-                $this -> xmlw -> endElement();
</del><ins>+                $this->xmlw->endElement();
+                $this->xmlw->endElement();
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlfs_configurationphp"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/fs_configuration.php (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/fs_configuration.php        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/fs_configuration.php        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -23,7 +23,9 @@
</span><span class="cx"> */
</span><span class="cx"> function fs_configuration() {
</span><span class="cx"> $this -> fs_curl();
</span><del>- $mod_name = sprintf('mod_%s', str_replace('.conf', '', $this -> request['key_value']));
</del><ins>+ $conf_file = $this->request['key_value'];
+ $this->debug("RECEIVED REQUEST FOR $conf_file");
+ $mod_name = sprintf('mod_%s', str_replace('.conf', '', $conf_file));
</ins><span class="cx"> $this -> comment("module name is $mod_name");
</span><span class="cx"> if (!($this -> is_mod_enabled($mod_name))
</span><span class="cx"> && !($this -> is_modless_conf($this -> request['key_value']))) {
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlfs_curlphp"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/fs_curl.php (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/fs_curl.php        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/fs_curl.php        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -80,7 +80,7 @@
</span><span class="cx"> case 'mysql':
</span><span class="cx"> $quoter = '`';
</span><span class="cx"> break;
</span><del>- case 'postgres':
</del><ins>+ case 'pgsql':
</ins><span class="cx"> $quoter = '"';
</span><span class="cx"> break;
</span><span class="cx"> default:
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlfs_directoryphp"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/fs_directory.php (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/fs_directory.php        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/fs_directory.php        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -49,7 +49,10 @@
</span><span class="cx"> SET %1$sparam_value%1$s = \'%2$s\'
</span><span class="cx"> WHERE %1$sparam_name%1$s = \'vm-password\'
</span><span class="cx"> AND %1$sdirectory_id%1$s =
</span><del>- (SELECT %1$sid%1$s FROM %1$sdirectory%1$s WHERE %1$susername%1$s = \'%3$s\' AND %1$sdomain%1$s = \'%4$s\')'
</del><ins>+ (SELECT %1$sid%1$s
+ FROM %1$sdirectory%1$s
+ WHERE %1$susername%1$s = \'%3$s\'
+ AND %1$sdomain%1$s = \'%4$s\')'
</ins><span class="cx"> , DB_FIELD_QUOTE, $new_pin, $username, $this->request['domain']
</span><span class="cx"> );
</span><span class="cx"> $this->debug($query);
</span><span class="lines">@@ -64,6 +67,7 @@
</span><span class="cx"> */
</span><span class="cx"> private function get_directory() {
</span><span class="cx"> $directory_array = array();
</span><ins>+ $join_clause = '';
</ins><span class="cx"> if (!array_key_exists('domain', $this -> request)) {
</span><span class="cx"> $this -> comment('domain not passed');
</span><span class="cx"> $this -> file_not_found();
</span><span class="lines">@@ -74,6 +78,11 @@
</span><span class="cx"> if (array_key_exists('user', $this -> request)) {
</span><span class="cx"> $where_array[] = sprintf("username='%s'", $this -> user);
</span><span class="cx"> }
</span><ins>+ if (array_key_exists('group', $this->request)) {
+ $where_array[] = sprintf("group_name='%s'", $this->request['group']);
+ $join_clause = "JOIN directory_group_user_map dgum ON d.id=dgum.user_id ";
+ $join_clause .= "JOIN directory_groups dg ON dgum.group_id=dg.group_id ";
+ }
</ins><span class="cx"> if (!empty($where_array)) {
</span><span class="cx"> $this -> comment('where array has contents');
</span><span class="cx"> if (count($where_array) > 1) {
</span><span class="lines">@@ -84,9 +93,10 @@
</span><span class="cx"> } else {
</span><span class="cx"> $where_clause = '';
</span><span class="cx"> }
</span><del>- $query = sprintf("SELECT * FROM directory %s ORDER BY username"
- , $where_clause
</del><ins>+ $query = sprintf("SELECT * FROM directory d %s %s ORDER BY username"
+ , $join_clause, $where_clause
</ins><span class="cx"> );
</span><ins>+ $this->debug($query);
</ins><span class="cx"> $res = $this -> db -> queryAll($query);
</span><span class="cx"> if (FS_PDO::isError($res)) {
</span><span class="cx"> $this -> comment($query);
</span><span class="lines">@@ -133,7 +143,8 @@
</span><span class="cx"> * @return void
</span><span class="cx"> */
</span><span class="cx"> private function write_params($user_id) {
</span><del>- if (is_array($this->users_params[$user_id])
</del><ins>+ if (array_key_exists($user_id, $this->users_params)
+ && is_array($this->users_params[$user_id])
</ins><span class="cx"> && count($this->users_params[$user_id]) > 0) {
</span><span class="cx"> $this -> xmlw -> startElement('params');
</span><span class="cx"> foreach($this->users_params[$user_id] as $pname => $pvalue) {
</span><span class="lines">@@ -219,7 +230,8 @@
</span><span class="cx"> * @return void
</span><span class="cx"> */
</span><span class="cx"> private function write_gateways($user_id) {
</span><del>- if (array_key_exists($user_id, $this->users_gateways)
</del><ins>+ if (is_array($this->users_gateways)
+ && array_key_exists($user_id, $this->users_gateways)
</ins><span class="cx"> && is_array($this -> users_gateways[$user_id])) {
</span><span class="cx"> $this -> xmlw -> startElement('gateways');
</span><span class="cx"> $gateway_count = count($this -> users_gateways[$user_id]);
</span><span class="lines">@@ -296,6 +308,9 @@
</span><span class="cx"> $param_count = count($res);
</span><span class="cx"> $this -> xmlw -> startElement('params');
</span><span class="cx"> for ($i=0; $i<$param_count; $i++) {
</span><ins>+ if (empty($res[$i]['param_name'])) {
+ continue;
+ }
</ins><span class="cx"> $this -> xmlw -> startElement('param');
</span><span class="cx"> $this -> xmlw -> writeAttribute('name', $res[$i]['param_name']);
</span><span class="cx"> $this -> xmlw -> writeAttribute('value', $res[$i]['param_value']);
</span><span class="lines">@@ -325,6 +340,9 @@
</span><span class="cx"> $param_count = count($res);
</span><span class="cx"> $this -> xmlw -> startElement('variables');
</span><span class="cx"> for ($i=0; $i<$param_count; $i++) {
</span><ins>+ if (empty($res[$i]['var_name'])) {
+ continue;
+ }
</ins><span class="cx"> $this -> xmlw -> startElement('variable');
</span><span class="cx"> $this -> xmlw -> writeAttribute('name', $res[$i]['var_name']);
</span><span class="cx"> $this -> xmlw -> writeAttribute('value', $res[$i]['var_value']);
</span><span class="lines">@@ -359,17 +377,30 @@
</span><span class="cx"> $this -> write_global_params();
</span><span class="cx"> $this -> write_global_vars();
</span><span class="cx">
</span><ins>+ $this->xmlw->startElement('groups');
+ $this->xmlw->startElement('group');
+ if (array_key_exists('group', $this->request)) {
+ $this->xmlw->writeAttribute('name', $this->request['group']);
+ } else {
+ $this->xmlw->writeAttribute('name', 'default');
+ }
+ $this->xmlw->startElement('users');
</ins><span class="cx"> for ($i=0; $i<$directory_count; $i++) {
</span><span class="cx"> $username = $directory[$i]['username'];
</span><span class="cx"> $mailbox = empty($directory[$i]['mailbox']) ? $username : $directory[$i]['mailbox'];
</span><span class="cx"> $this -> xmlw -> startElement('user');
</span><span class="cx"> $this -> xmlw -> writeAttribute('id', $username);
</span><del>- $this -> xmlw -> writeAttribute('mailbox', $mailbox);
- $this -> write_params($directory[$i]['id']);
- $this -> write_variables($directory[$i]['id']);
- $this -> write_gateways($directory[$i]['id']);
</del><ins>+ if (empty($directory[$i]['group_name'])) {
+ $this -> write_params($directory[$i]['id']);
+ $this -> write_variables($directory[$i]['id']);
+ $this -> write_gateways($directory[$i]['id']);
+ } else {
+ $this->xmlw->writeAttribute('type', 'pointer');
+ }
</ins><span class="cx"> $this -> xmlw -> endElement();
</span><span class="cx"> }
</span><ins>+ $this->xmlw->endElement();
+ $this->xmlw->endElement();
</ins><span class="cx"> $this -> xmlw -> endElement();
</span><span class="cx"> $this -> xmlw -> endElement();
</span><span class="cx"> }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlglobal_definesphp"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/global_defines.php (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/global_defines.php        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/global_defines.php        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx"> /**
</span><span class="cx"> * Defines the default dsn for the FS_PDO class
</span><span class="cx"> */
</span><del>-define('DEFAULT_DSN', 'mysql:dbname=freeswitch;host=127.0.0.1');
</del><ins>+define('DEFAULT_DSN', 'pgsql:dbname=freeswitch;host=127.0.0.1');
</ins><span class="cx"> /**
</span><span class="cx"> * Defines the default dsn login for the PDO class
</span><span class="cx"> */
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx"> * 1 xml comment
</span><span class="cx"> * 2 file (named in FS_DEBUG_FILE), take care when using this option as there's currently nothing to watch the file's size
</span><span class="cx"> */
</span><del>-define('FS_DEBUG_TYPE', 1);
</del><ins>+define('FS_DEBUG_TYPE', 0);
</ins><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * File to use for debugging to file
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_curlsqlpostgres84sqlfromrev15313freeswitchtrunkcontribintralanmanPHPfs_curlsqlpostgres84sql"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/sql/postgres-8.4.sql (from rev 15313, freeswitch/trunk/contrib/intralanman/PHP/fs_curl/sql/postgres-8.4.sql) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/sql/postgres-8.4.sql         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_curl/sql/postgres-8.4.sql        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,3574 @@
</span><ins>+--
+-- PostgreSQL database dump
+--
+
+SET statement_timeout = 0;
+SET client_encoding = 'UTF8';
+SET standard_conforming_strings = off;
+SET check_function_bodies = false;
+SET client_min_messages = warning;
+SET escape_string_warning = off;
+
+--
+-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres
+--
+
+CREATE PROCEDURAL LANGUAGE plpgsql;
+
+
+ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres;
+
+SET search_path = public, pg_catalog;
+
+SET default_tablespace = '';
+
+SET default_with_oids = false;
+
+--
+-- Name: accounts; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE accounts (
+ id bigint NOT NULL,
+ name character varying(256),
+ cash double precision NOT NULL
+);
+
+
+ALTER TABLE public.accounts OWNER TO freeswitch;
+
+--
+-- Name: accounts_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE accounts_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.accounts_id_seq OWNER TO freeswitch;
+
+--
+-- Name: accounts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE accounts_id_seq OWNED BY accounts.id;
+
+
+--
+-- Name: acl_lists; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE acl_lists (
+ id integer NOT NULL,
+ acl_name character varying(128) NOT NULL,
+ default_policy character varying(48) NOT NULL
+);
+
+
+ALTER TABLE public.acl_lists OWNER TO freeswitch;
+
+--
+-- Name: acl_lists_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE acl_lists_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.acl_lists_id_seq OWNER TO freeswitch;
+
+--
+-- Name: acl_lists_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE acl_lists_id_seq OWNED BY acl_lists.id;
+
+
+--
+-- Name: acl_nodes; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE acl_nodes (
+ id integer NOT NULL,
+ cidr character varying(48) NOT NULL,
+ type character varying(16) NOT NULL,
+ list_id integer NOT NULL
+);
+
+
+ALTER TABLE public.acl_nodes OWNER TO freeswitch;
+
+--
+-- Name: acl_nodes_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE acl_nodes_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.acl_nodes_id_seq OWNER TO freeswitch;
+
+--
+-- Name: acl_nodes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE acl_nodes_id_seq OWNED BY acl_nodes.id;
+
+
+--
+-- Name: carrier_gateway; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE carrier_gateway (
+ id integer NOT NULL,
+ carrier_id integer,
+ prefix character varying(128) DEFAULT ''::character varying NOT NULL,
+ suffix character varying(128) DEFAULT ''::character varying NOT NULL,
+ codec character varying(128) DEFAULT ''::character varying NOT NULL,
+ enabled boolean DEFAULT true NOT NULL
+);
+
+
+ALTER TABLE public.carrier_gateway OWNER TO freeswitch;
+
+--
+-- Name: carrier_gateway_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE carrier_gateway_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.carrier_gateway_id_seq OWNER TO freeswitch;
+
+--
+-- Name: carrier_gateway_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE carrier_gateway_id_seq OWNED BY carrier_gateway.id;
+
+
+--
+-- Name: carriers; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE carriers (
+ id integer NOT NULL,
+ carrier_name character varying(255) NOT NULL,
+ enabled boolean DEFAULT true NOT NULL
+);
+
+
+ALTER TABLE public.carriers OWNER TO freeswitch;
+
+--
+-- Name: carriers_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE carriers_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.carriers_id_seq OWNER TO freeswitch;
+
+--
+-- Name: carriers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE carriers_id_seq OWNED BY carriers.id;
+
+
+--
+-- Name: conference_advertise; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE conference_advertise (
+ id integer NOT NULL,
+ room character varying(64) NOT NULL,
+ status character varying(128) NOT NULL
+);
+
+
+ALTER TABLE public.conference_advertise OWNER TO freeswitch;
+
+--
+-- Name: conference_advertise_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE conference_advertise_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.conference_advertise_id_seq OWNER TO freeswitch;
+
+--
+-- Name: conference_advertise_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE conference_advertise_id_seq OWNED BY conference_advertise.id;
+
+
+--
+-- Name: conference_controls; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE conference_controls (
+ id integer NOT NULL,
+ conf_group character varying(64) NOT NULL,
+ action character varying(64) NOT NULL,
+ digits character varying(16) NOT NULL
+);
+
+
+ALTER TABLE public.conference_controls OWNER TO freeswitch;
+
+--
+-- Name: conference_controls_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE conference_controls_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.conference_controls_id_seq OWNER TO freeswitch;
+
+--
+-- Name: conference_controls_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE conference_controls_id_seq OWNED BY conference_controls.id;
+
+
+--
+-- Name: conference_profiles; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE conference_profiles (
+ id integer NOT NULL,
+ profile_name character varying(64) NOT NULL,
+ param_name character varying(64) NOT NULL,
+ param_value character varying(64) NOT NULL
+);
+
+
+ALTER TABLE public.conference_profiles OWNER TO freeswitch;
+
+--
+-- Name: conference_profiles_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE conference_profiles_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.conference_profiles_id_seq OWNER TO freeswitch;
+
+--
+-- Name: conference_profiles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE conference_profiles_id_seq OWNED BY conference_profiles.id;
+
+
+--
+-- Name: dialplan; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE dialplan (
+ dialplan_id integer NOT NULL,
+ domain character varying(128) NOT NULL,
+ ip_address character varying(16) NOT NULL
+);
+
+
+ALTER TABLE public.dialplan OWNER TO freeswitch;
+
+--
+-- Name: dialplan_actions; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE dialplan_actions (
+ action_id integer NOT NULL,
+ condition_id integer NOT NULL,
+ application character varying(256) NOT NULL,
+ data character varying(256) NOT NULL,
+ type character varying(32) NOT NULL,
+ weight integer NOT NULL
+);
+
+
+ALTER TABLE public.dialplan_actions OWNER TO freeswitch;
+
+--
+-- Name: dialplan_actions_action_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE dialplan_actions_action_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.dialplan_actions_action_id_seq OWNER TO freeswitch;
+
+--
+-- Name: dialplan_actions_action_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE dialplan_actions_action_id_seq OWNED BY dialplan_actions.action_id;
+
+
+--
+-- Name: dialplan_condition; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE dialplan_condition (
+ condition_id integer NOT NULL,
+ extension_id integer NOT NULL,
+ field character varying(128) NOT NULL,
+ expression character varying(128) NOT NULL,
+ weight integer NOT NULL
+);
+
+
+ALTER TABLE public.dialplan_condition OWNER TO freeswitch;
+
+--
+-- Name: dialplan_condition_condition_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE dialplan_condition_condition_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.dialplan_condition_condition_id_seq OWNER TO freeswitch;
+
+--
+-- Name: dialplan_condition_condition_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE dialplan_condition_condition_id_seq OWNED BY dialplan_condition.condition_id;
+
+
+--
+-- Name: dialplan_context; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE dialplan_context (
+ context_id integer NOT NULL,
+ dialplan_id integer NOT NULL,
+ context character varying(64) NOT NULL,
+ weight integer NOT NULL
+);
+
+
+ALTER TABLE public.dialplan_context OWNER TO freeswitch;
+
+--
+-- Name: dialplan_context_context_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE dialplan_context_context_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.dialplan_context_context_id_seq OWNER TO freeswitch;
+
+--
+-- Name: dialplan_context_context_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE dialplan_context_context_id_seq OWNED BY dialplan_context.context_id;
+
+
+--
+-- Name: dialplan_dialplan_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE dialplan_dialplan_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.dialplan_dialplan_id_seq OWNER TO freeswitch;
+
+--
+-- Name: dialplan_dialplan_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE dialplan_dialplan_id_seq OWNED BY dialplan.dialplan_id;
+
+
+--
+-- Name: dialplan_extension; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE dialplan_extension (
+ extension_id integer NOT NULL,
+ context_id integer NOT NULL,
+ name character varying(128) NOT NULL,
+ continue character varying(32) NOT NULL,
+ weight integer NOT NULL
+);
+
+
+ALTER TABLE public.dialplan_extension OWNER TO freeswitch;
+
+--
+-- Name: dialplan_extension_extension_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE dialplan_extension_extension_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.dialplan_extension_extension_id_seq OWNER TO freeswitch;
+
+--
+-- Name: dialplan_extension_extension_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE dialplan_extension_extension_id_seq OWNED BY dialplan_extension.extension_id;
+
+
+--
+-- Name: dialplan_special; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE dialplan_special (
+ id integer NOT NULL,
+ context character varying(256) NOT NULL,
+ class_file character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.dialplan_special OWNER TO freeswitch;
+
+--
+-- Name: dialplan_special_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE dialplan_special_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.dialplan_special_id_seq OWNER TO freeswitch;
+
+--
+-- Name: dialplan_special_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE dialplan_special_id_seq OWNED BY dialplan_special.id;
+
+
+--
+-- Name: dingaling_profile_params; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE dingaling_profile_params (
+ id integer NOT NULL,
+ dingaling_id integer NOT NULL,
+ param_name character varying(64) NOT NULL,
+ param_value character varying(64) NOT NULL
+);
+
+
+ALTER TABLE public.dingaling_profile_params OWNER TO freeswitch;
+
+--
+-- Name: dingaling_profile_params_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE dingaling_profile_params_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.dingaling_profile_params_id_seq OWNER TO freeswitch;
+
+--
+-- Name: dingaling_profile_params_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE dingaling_profile_params_id_seq OWNED BY dingaling_profile_params.id;
+
+
+--
+-- Name: dingaling_profiles; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE dingaling_profiles (
+ id integer NOT NULL,
+ profile_name character varying(64) NOT NULL,
+ type character varying(64) NOT NULL
+);
+
+
+ALTER TABLE public.dingaling_profiles OWNER TO freeswitch;
+
+--
+-- Name: dingaling_profiles_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE dingaling_profiles_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.dingaling_profiles_id_seq OWNER TO freeswitch;
+
+--
+-- Name: dingaling_profiles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE dingaling_profiles_id_seq OWNED BY dingaling_profiles.id;
+
+
+--
+-- Name: dingaling_settings; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE dingaling_settings (
+ id integer NOT NULL,
+ param_name character varying(64) NOT NULL,
+ param_value character varying(64) NOT NULL
+);
+
+
+ALTER TABLE public.dingaling_settings OWNER TO freeswitch;
+
+--
+-- Name: dingaling_settings_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE dingaling_settings_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.dingaling_settings_id_seq OWNER TO freeswitch;
+
+--
+-- Name: dingaling_settings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE dingaling_settings_id_seq OWNED BY dingaling_settings.id;
+
+
+--
+-- Name: directory; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE directory (
+ id integer NOT NULL,
+ username character varying(256) NOT NULL,
+ domain character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.directory OWNER TO freeswitch;
+
+--
+-- Name: directory_domains; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE directory_domains (
+ id integer NOT NULL,
+ domain_name character varying(128) NOT NULL
+);
+
+
+ALTER TABLE public.directory_domains OWNER TO freeswitch;
+
+--
+-- Name: directory_domains_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE directory_domains_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.directory_domains_id_seq OWNER TO freeswitch;
+
+--
+-- Name: directory_domains_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE directory_domains_id_seq OWNED BY directory_domains.id;
+
+
+--
+-- Name: directory_gateway_params; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE directory_gateway_params (
+ id integer NOT NULL,
+ d_gw_id integer NOT NULL,
+ param_name character varying(64) NOT NULL,
+ param_value character varying(64) NOT NULL
+);
+
+
+ALTER TABLE public.directory_gateway_params OWNER TO freeswitch;
+
+--
+-- Name: directory_gateway_params_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE directory_gateway_params_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.directory_gateway_params_id_seq OWNER TO freeswitch;
+
+--
+-- Name: directory_gateway_params_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE directory_gateway_params_id_seq OWNED BY directory_gateway_params.id;
+
+
+--
+-- Name: directory_gateways; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE directory_gateways (
+ id integer NOT NULL,
+ directory_id integer NOT NULL,
+ gateway_name character varying(128) NOT NULL
+);
+
+
+ALTER TABLE public.directory_gateways OWNER TO freeswitch;
+
+--
+-- Name: directory_gateways_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE directory_gateways_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.directory_gateways_id_seq OWNER TO freeswitch;
+
+--
+-- Name: directory_gateways_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE directory_gateways_id_seq OWNED BY directory_gateways.id;
+
+
+--
+-- Name: directory_global_params; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE directory_global_params (
+ id integer NOT NULL,
+ param_name character varying(64) NOT NULL,
+ param_value character varying(128) NOT NULL,
+ domain_id integer NOT NULL
+);
+
+
+ALTER TABLE public.directory_global_params OWNER TO freeswitch;
+
+--
+-- Name: directory_global_params_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE directory_global_params_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.directory_global_params_id_seq OWNER TO freeswitch;
+
+--
+-- Name: directory_global_params_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE directory_global_params_id_seq OWNED BY directory_global_params.id;
+
+
+--
+-- Name: directory_global_vars; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE directory_global_vars (
+ id integer NOT NULL,
+ var_name character varying(64) NOT NULL,
+ var_value character varying(128) NOT NULL,
+ domain_id integer NOT NULL
+);
+
+
+ALTER TABLE public.directory_global_vars OWNER TO freeswitch;
+
+--
+-- Name: directory_global_vars_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE directory_global_vars_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.directory_global_vars_id_seq OWNER TO freeswitch;
+
+--
+-- Name: directory_global_vars_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE directory_global_vars_id_seq OWNED BY directory_global_vars.id;
+
+
+--
+-- Name: directory_group_user_map; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE directory_group_user_map (
+ map_id integer NOT NULL,
+ group_id integer NOT NULL,
+ user_id integer NOT NULL
+);
+
+
+ALTER TABLE public.directory_group_user_map OWNER TO freeswitch;
+
+--
+-- Name: directory_group_user_map_map_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE directory_group_user_map_map_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.directory_group_user_map_map_id_seq OWNER TO freeswitch;
+
+--
+-- Name: directory_group_user_map_map_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE directory_group_user_map_map_id_seq OWNED BY directory_group_user_map.map_id;
+
+
+--
+-- Name: directory_groups; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE directory_groups (
+ group_id integer NOT NULL,
+ group_name character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.directory_groups OWNER TO freeswitch;
+
+--
+-- Name: directory_groups_group_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE directory_groups_group_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.directory_groups_group_id_seq OWNER TO freeswitch;
+
+--
+-- Name: directory_groups_group_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE directory_groups_group_id_seq OWNED BY directory_groups.group_id;
+
+
+--
+-- Name: directory_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE directory_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.directory_id_seq OWNER TO freeswitch;
+
+--
+-- Name: directory_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE directory_id_seq OWNED BY directory.id;
+
+
+--
+-- Name: directory_params; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE directory_params (
+ id integer NOT NULL,
+ directory_id integer NOT NULL,
+ param_name character varying(256) NOT NULL,
+ param_value character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.directory_params OWNER TO freeswitch;
+
+--
+-- Name: directory_params_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE directory_params_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.directory_params_id_seq OWNER TO freeswitch;
+
+--
+-- Name: directory_params_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE directory_params_id_seq OWNED BY directory_params.id;
+
+
+--
+-- Name: directory_vars; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE directory_vars (
+ id integer NOT NULL,
+ directory_id integer NOT NULL,
+ var_name character varying(256) NOT NULL,
+ var_value character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.directory_vars OWNER TO freeswitch;
+
+--
+-- Name: directory_vars_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE directory_vars_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.directory_vars_id_seq OWNER TO freeswitch;
+
+--
+-- Name: directory_vars_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE directory_vars_id_seq OWNED BY directory_vars.id;
+
+
+--
+-- Name: easyroute_conf; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE easyroute_conf (
+ id integer NOT NULL,
+ param_name character varying(256) NOT NULL,
+ param_value character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.easyroute_conf OWNER TO freeswitch;
+
+--
+-- Name: easyroute_conf_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE easyroute_conf_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.easyroute_conf_id_seq OWNER TO freeswitch;
+
+--
+-- Name: easyroute_conf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE easyroute_conf_id_seq OWNED BY easyroute_conf.id;
+
+
+--
+-- Name: easyroute_data; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE easyroute_data (
+ id integer NOT NULL,
+ gateway character varying(128) NOT NULL,
+ "group" character varying(128) NOT NULL,
+ call_limit character varying(16) NOT NULL,
+ tech_prefix character varying(128) NOT NULL,
+ acctcode character varying(128) NOT NULL,
+ destination_number character varying(128) NOT NULL
+);
+
+
+ALTER TABLE public.easyroute_data OWNER TO freeswitch;
+
+--
+-- Name: easyroute_data_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE easyroute_data_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.easyroute_data_id_seq OWNER TO freeswitch;
+
+--
+-- Name: easyroute_data_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE easyroute_data_id_seq OWNED BY easyroute_data.id;
+
+
+--
+-- Name: iax_conf; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE iax_conf (
+ id integer NOT NULL,
+ profile_name character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.iax_conf OWNER TO freeswitch;
+
+--
+-- Name: iax_conf_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE iax_conf_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.iax_conf_id_seq OWNER TO freeswitch;
+
+--
+-- Name: iax_conf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE iax_conf_id_seq OWNED BY iax_conf.id;
+
+
+--
+-- Name: iax_settings; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE iax_settings (
+ id integer NOT NULL,
+ iax_id integer NOT NULL,
+ param_name character varying(256) NOT NULL,
+ param_value character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.iax_settings OWNER TO freeswitch;
+
+--
+-- Name: iax_settings_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE iax_settings_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.iax_settings_id_seq OWNER TO freeswitch;
+
+--
+-- Name: iax_settings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE iax_settings_id_seq OWNED BY iax_settings.id;
+
+
+--
+-- Name: ivr_conf; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE ivr_conf (
+ id integer NOT NULL,
+ name character varying(64) NOT NULL,
+ greet_long character varying(256) NOT NULL,
+ greet_short character varying(256) NOT NULL,
+ invalid_sound character varying(256) NOT NULL,
+ exit_sound character varying(256) NOT NULL,
+ max_failures integer NOT NULL,
+ timeout integer NOT NULL,
+ tts_engine character varying(64) NOT NULL,
+ tts_voice character varying(64) NOT NULL
+);
+
+
+ALTER TABLE public.ivr_conf OWNER TO freeswitch;
+
+--
+-- Name: ivr_conf_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE ivr_conf_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.ivr_conf_id_seq OWNER TO freeswitch;
+
+--
+-- Name: ivr_conf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE ivr_conf_id_seq OWNED BY ivr_conf.id;
+
+
+--
+-- Name: ivr_entries; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE ivr_entries (
+ id integer NOT NULL,
+ ivr_id integer NOT NULL,
+ action character varying(64) NOT NULL,
+ digits character varying(64) NOT NULL,
+ params character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.ivr_entries OWNER TO freeswitch;
+
+--
+-- Name: ivr_entries_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE ivr_entries_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.ivr_entries_id_seq OWNER TO freeswitch;
+
+--
+-- Name: ivr_entries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE ivr_entries_id_seq OWNED BY ivr_entries.id;
+
+
+--
+-- Name: lcr; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE lcr (
+ id integer NOT NULL,
+ digits numeric(20,0),
+ rate numeric(11,5) NOT NULL,
+ intrastate_rate numeric(11,5) NOT NULL,
+ intralata_rate numeric(11,5) NOT NULL,
+ carrier_id integer NOT NULL,
+ lead_strip integer DEFAULT 0 NOT NULL,
+ trail_strip integer DEFAULT 0 NOT NULL,
+ prefix character varying(16) DEFAULT ''::character varying NOT NULL,
+ suffix character varying(16) DEFAULT ''::character varying NOT NULL,
+ lcr_profile integer DEFAULT 0 NOT NULL,
+ date_start timestamp with time zone DEFAULT '1970-01-01 00:00:00-05'::timestamp with time zone NOT NULL,
+ date_end timestamp with time zone DEFAULT '2030-12-31 00:00:00-05'::timestamp with time zone NOT NULL,
+ quality numeric(10,6) DEFAULT 0 NOT NULL,
+ reliability numeric(10,6) DEFAULT 0 NOT NULL,
+ cid character varying(32) DEFAULT ''::character varying NOT NULL,
+ enabled boolean DEFAULT true NOT NULL
+);
+
+
+ALTER TABLE public.lcr OWNER TO freeswitch;
+
+--
+-- Name: lcr_conf; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE lcr_conf (
+ id integer NOT NULL,
+ param_name character varying(256) NOT NULL,
+ param_value character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.lcr_conf OWNER TO freeswitch;
+
+--
+-- Name: lcr_conf_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE lcr_conf_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.lcr_conf_id_seq OWNER TO freeswitch;
+
+--
+-- Name: lcr_conf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE lcr_conf_id_seq OWNED BY lcr_conf.id;
+
+
+--
+-- Name: lcr_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE lcr_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.lcr_id_seq OWNER TO freeswitch;
+
+--
+-- Name: lcr_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE lcr_id_seq OWNED BY lcr.id;
+
+
+--
+-- Name: lcr_profiles; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE lcr_profiles (
+ id integer NOT NULL,
+ profile_name character varying(128) NOT NULL
+);
+
+
+ALTER TABLE public.lcr_profiles OWNER TO freeswitch;
+
+--
+-- Name: lcr_profiles_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE lcr_profiles_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.lcr_profiles_id_seq OWNER TO freeswitch;
+
+--
+-- Name: lcr_profiles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE lcr_profiles_id_seq OWNED BY lcr_profiles.id;
+
+
+--
+-- Name: lcr_settings; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE lcr_settings (
+ id integer NOT NULL,
+ lcr_id integer NOT NULL,
+ param_name character varying(256) NOT NULL,
+ param_value character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.lcr_settings OWNER TO freeswitch;
+
+--
+-- Name: lcr_settings_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE lcr_settings_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.lcr_settings_id_seq OWNER TO freeswitch;
+
+--
+-- Name: lcr_settings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE lcr_settings_id_seq OWNED BY lcr_settings.id;
+
+
+--
+-- Name: limit_conf; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE limit_conf (
+ id integer NOT NULL,
+ name character varying(256) NOT NULL,
+ value character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.limit_conf OWNER TO freeswitch;
+
+--
+-- Name: limit_conf_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE limit_conf_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.limit_conf_id_seq OWNER TO freeswitch;
+
+--
+-- Name: limit_conf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE limit_conf_id_seq OWNED BY limit_conf.id;
+
+
+--
+-- Name: limit_data; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE limit_data (
+ hostname character varying(255) DEFAULT NULL::character varying,
+ realm character varying(255) DEFAULT NULL::character varying,
+ id character varying(255) DEFAULT NULL::character varying,
+ uuid character varying(255) DEFAULT NULL::character varying
+);
+
+
+ALTER TABLE public.limit_data OWNER TO freeswitch;
+
+--
+-- Name: local_stream_conf; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE local_stream_conf (
+ id integer NOT NULL,
+ directory_name character varying(256) NOT NULL,
+ directory_path text NOT NULL,
+ param_name character varying(256) NOT NULL,
+ param_value character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.local_stream_conf OWNER TO freeswitch;
+
+--
+-- Name: local_stream_conf_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE local_stream_conf_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.local_stream_conf_id_seq OWNER TO freeswitch;
+
+--
+-- Name: local_stream_conf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE local_stream_conf_id_seq OWNED BY local_stream_conf.id;
+
+
+--
+-- Name: modless_conf; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE modless_conf (
+ id integer NOT NULL,
+ conf_name character varying(64) NOT NULL
+);
+
+
+ALTER TABLE public.modless_conf OWNER TO freeswitch;
+
+--
+-- Name: modless_conf_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE modless_conf_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.modless_conf_id_seq OWNER TO freeswitch;
+
+--
+-- Name: modless_conf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE modless_conf_id_seq OWNED BY modless_conf.id;
+
+
+--
+-- Name: npa_nxx_company_ocn; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE npa_nxx_company_ocn (
+ npa smallint NOT NULL,
+ nxx smallint NOT NULL,
+ company_type text,
+ ocn text,
+ company_name text,
+ lata integer,
+ ratecenter text,
+ state text
+);
+
+
+ALTER TABLE public.npa_nxx_company_ocn OWNER TO freeswitch;
+
+--
+-- Name: post_load_modules_conf; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE post_load_modules_conf (
+ id integer NOT NULL,
+ module_name character varying(64) NOT NULL,
+ load_module boolean DEFAULT true NOT NULL,
+ priority integer DEFAULT 1000 NOT NULL
+);
+
+
+ALTER TABLE public.post_load_modules_conf OWNER TO freeswitch;
+
+--
+-- Name: post_load_modules_conf_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE post_load_modules_conf_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.post_load_modules_conf_id_seq OWNER TO freeswitch;
+
+--
+-- Name: post_load_modules_conf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE post_load_modules_conf_id_seq OWNED BY post_load_modules_conf.id;
+
+
+--
+-- Name: rss_conf; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE rss_conf (
+ id integer NOT NULL,
+ directory_id integer NOT NULL,
+ feed text NOT NULL,
+ local_file text NOT NULL,
+ description text NOT NULL,
+ priority integer DEFAULT 1000 NOT NULL
+);
+
+
+ALTER TABLE public.rss_conf OWNER TO freeswitch;
+
+--
+-- Name: rss_conf_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE rss_conf_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.rss_conf_id_seq OWNER TO freeswitch;
+
+--
+-- Name: rss_conf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE rss_conf_id_seq OWNED BY rss_conf.id;
+
+
+--
+-- Name: sip_authentication; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE sip_authentication (
+ nonce character varying(255),
+ expires integer,
+ profile_name character varying(255),
+ hostname character varying(255)
+);
+
+
+ALTER TABLE public.sip_authentication OWNER TO freeswitch;
+
+--
+-- Name: sip_dialogs; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE sip_dialogs (
+ call_id character varying(255),
+ uuid character varying(255),
+ sip_to_user character varying(255),
+ sip_to_host character varying(255),
+ sip_from_user character varying(255),
+ sip_from_host character varying(255),
+ contact_user character varying(255),
+ contact_host character varying(255),
+ state character varying(255),
+ direction character varying(255),
+ user_agent character varying(255),
+ profile_name character varying(255),
+ hostname character varying(255)
+);
+
+
+ALTER TABLE public.sip_dialogs OWNER TO freeswitch;
+
+--
+-- Name: sip_presence; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE sip_presence (
+ sip_user character varying(255),
+ sip_host character varying(255),
+ status character varying(255),
+ rpid character varying(255),
+ expires integer,
+ user_agent character varying(255),
+ profile_name character varying(255),
+ hostname character varying(255),
+ network_ip character varying(255),
+ network_port character varying(6)
+);
+
+
+ALTER TABLE public.sip_presence OWNER TO freeswitch;
+
+--
+-- Name: sip_registrations; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE sip_registrations (
+ call_id character varying(255),
+ sip_user character varying(255),
+ sip_host character varying(255),
+ presence_hosts character varying(255),
+ contact character varying(1024),
+ status character varying(255),
+ rpid character varying(255),
+ expires integer,
+ user_agent character varying(255),
+ server_user character varying(255),
+ server_host character varying(255),
+ profile_name character varying(255),
+ hostname character varying(255),
+ network_ip character varying(255),
+ network_port character varying(6),
+ sip_username character varying(255),
+ sip_realm character varying(255),
+ mwi_user character varying(255),
+ mwi_host character varying(255)
+);
+
+
+ALTER TABLE public.sip_registrations OWNER TO freeswitch;
+
+--
+-- Name: sip_shared_appearance_dialogs; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE sip_shared_appearance_dialogs (
+ profile_name character varying(255),
+ hostname character varying(255),
+ contact_str character varying(255),
+ call_id character varying(255),
+ network_ip character varying(255),
+ expires integer
+);
+
+
+ALTER TABLE public.sip_shared_appearance_dialogs OWNER TO freeswitch;
+
+--
+-- Name: sip_shared_appearance_subscriptions; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE sip_shared_appearance_subscriptions (
+ subscriber character varying(255),
+ call_id character varying(255),
+ aor character varying(255),
+ profile_name character varying(255),
+ hostname character varying(255),
+ contact_str character varying(255),
+ network_ip character varying(255)
+);
+
+
+ALTER TABLE public.sip_shared_appearance_subscriptions OWNER TO freeswitch;
+
+--
+-- Name: sip_subscriptions; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE sip_subscriptions (
+ proto character varying(255),
+ sip_user character varying(255),
+ sip_host character varying(255),
+ sub_to_user character varying(255),
+ sub_to_host character varying(255),
+ presence_hosts character varying(255),
+ event character varying(255),
+ contact character varying(1024),
+ call_id character varying(255),
+ full_from character varying(255),
+ full_via character varying(255),
+ expires integer,
+ user_agent character varying(255),
+ accept character varying(255),
+ profile_name character varying(255),
+ hostname character varying(255),
+ network_port character varying(6),
+ network_ip character varying(255)
+);
+
+
+ALTER TABLE public.sip_subscriptions OWNER TO freeswitch;
+
+--
+-- Name: sofia_aliases; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE sofia_aliases (
+ id integer NOT NULL,
+ sofia_id integer NOT NULL,
+ alias_name character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.sofia_aliases OWNER TO freeswitch;
+
+--
+-- Name: sofia_aliases_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE sofia_aliases_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.sofia_aliases_id_seq OWNER TO freeswitch;
+
+--
+-- Name: sofia_aliases_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE sofia_aliases_id_seq OWNED BY sofia_aliases.id;
+
+
+--
+-- Name: sofia_conf; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE sofia_conf (
+ id integer NOT NULL,
+ profile_name character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.sofia_conf OWNER TO freeswitch;
+
+--
+-- Name: sofia_conf_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE sofia_conf_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.sofia_conf_id_seq OWNER TO freeswitch;
+
+--
+-- Name: sofia_conf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE sofia_conf_id_seq OWNED BY sofia_conf.id;
+
+
+--
+-- Name: sofia_domains; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE sofia_domains (
+ id integer NOT NULL,
+ sofia_id integer NOT NULL,
+ domain_name character varying(256) NOT NULL,
+ parse boolean DEFAULT false NOT NULL
+);
+
+
+ALTER TABLE public.sofia_domains OWNER TO freeswitch;
+
+--
+-- Name: sofia_domains_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE sofia_domains_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.sofia_domains_id_seq OWNER TO freeswitch;
+
+--
+-- Name: sofia_domains_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE sofia_domains_id_seq OWNED BY sofia_domains.id;
+
+
+--
+-- Name: sofia_gateways; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE sofia_gateways (
+ id integer NOT NULL,
+ sofia_id integer NOT NULL,
+ gateway_name character varying(256) NOT NULL,
+ gateway_param character varying(256) NOT NULL,
+ gateway_value character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.sofia_gateways OWNER TO freeswitch;
+
+--
+-- Name: sofia_gateways_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE sofia_gateways_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.sofia_gateways_id_seq OWNER TO freeswitch;
+
+--
+-- Name: sofia_gateways_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE sofia_gateways_id_seq OWNED BY sofia_gateways.id;
+
+
+--
+-- Name: sofia_settings; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE sofia_settings (
+ id integer NOT NULL,
+ sofia_id integer NOT NULL,
+ param_name character varying(256) NOT NULL,
+ param_value character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.sofia_settings OWNER TO freeswitch;
+
+--
+-- Name: sofia_settings_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE sofia_settings_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.sofia_settings_id_seq OWNER TO freeswitch;
+
+--
+-- Name: sofia_settings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE sofia_settings_id_seq OWNED BY sofia_settings.id;
+
+
+--
+-- Name: voicemail_conf; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE voicemail_conf (
+ id integer NOT NULL,
+ vm_profile character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.voicemail_conf OWNER TO freeswitch;
+
+--
+-- Name: voicemail_conf_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE voicemail_conf_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.voicemail_conf_id_seq OWNER TO freeswitch;
+
+--
+-- Name: voicemail_conf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE voicemail_conf_id_seq OWNED BY voicemail_conf.id;
+
+
+--
+-- Name: voicemail_email; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE voicemail_email (
+ id integer NOT NULL,
+ voicemail_id integer NOT NULL,
+ param_name character varying(256) NOT NULL,
+ param_value character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.voicemail_email OWNER TO freeswitch;
+
+--
+-- Name: voicemail_email_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE voicemail_email_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.voicemail_email_id_seq OWNER TO freeswitch;
+
+--
+-- Name: voicemail_email_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE voicemail_email_id_seq OWNED BY voicemail_email.id;
+
+
+--
+-- Name: voicemail_msgs; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE voicemail_msgs (
+ created_epoch integer,
+ read_epoch integer,
+ username character varying(255),
+ domain character varying(255),
+ uuid character varying(255),
+ cid_name character varying(255),
+ cid_number character varying(255),
+ in_folder character varying(255),
+ file_path character varying(255),
+ message_len integer,
+ flags character varying(255),
+ read_flags character varying(255)
+);
+
+
+ALTER TABLE public.voicemail_msgs OWNER TO freeswitch;
+
+--
+-- Name: voicemail_prefs; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE voicemail_prefs (
+ username character varying(255),
+ domain character varying(255),
+ name_path character varying(255),
+ greeting_path character varying(255),
+ password character varying(255)
+);
+
+
+ALTER TABLE public.voicemail_prefs OWNER TO freeswitch;
+
+--
+-- Name: voicemail_settings; Type: TABLE; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE TABLE voicemail_settings (
+ id integer NOT NULL,
+ voicemail_id integer NOT NULL,
+ param_name character varying(256) NOT NULL,
+ param_value character varying(256) NOT NULL
+);
+
+
+ALTER TABLE public.voicemail_settings OWNER TO freeswitch;
+
+--
+-- Name: voicemail_settings_id_seq; Type: SEQUENCE; Schema: public; Owner: freeswitch
+--
+
+CREATE SEQUENCE voicemail_settings_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MAXVALUE
+ NO MINVALUE
+ CACHE 1;
+
+
+ALTER TABLE public.voicemail_settings_id_seq OWNER TO freeswitch;
+
+--
+-- Name: voicemail_settings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: freeswitch
+--
+
+ALTER SEQUENCE voicemail_settings_id_seq OWNED BY voicemail_settings.id;
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE accounts ALTER COLUMN id SET DEFAULT nextval('accounts_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE acl_lists ALTER COLUMN id SET DEFAULT nextval('acl_lists_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE acl_nodes ALTER COLUMN id SET DEFAULT nextval('acl_nodes_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE carrier_gateway ALTER COLUMN id SET DEFAULT nextval('carrier_gateway_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE carriers ALTER COLUMN id SET DEFAULT nextval('carriers_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE conference_advertise ALTER COLUMN id SET DEFAULT nextval('conference_advertise_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE conference_controls ALTER COLUMN id SET DEFAULT nextval('conference_controls_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE conference_profiles ALTER COLUMN id SET DEFAULT nextval('conference_profiles_id_seq'::regclass);
+
+
+--
+-- Name: dialplan_id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE dialplan ALTER COLUMN dialplan_id SET DEFAULT nextval('dialplan_dialplan_id_seq'::regclass);
+
+
+--
+-- Name: action_id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE dialplan_actions ALTER COLUMN action_id SET DEFAULT nextval('dialplan_actions_action_id_seq'::regclass);
+
+
+--
+-- Name: condition_id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE dialplan_condition ALTER COLUMN condition_id SET DEFAULT nextval('dialplan_condition_condition_id_seq'::regclass);
+
+
+--
+-- Name: context_id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE dialplan_context ALTER COLUMN context_id SET DEFAULT nextval('dialplan_context_context_id_seq'::regclass);
+
+
+--
+-- Name: extension_id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE dialplan_extension ALTER COLUMN extension_id SET DEFAULT nextval('dialplan_extension_extension_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE dialplan_special ALTER COLUMN id SET DEFAULT nextval('dialplan_special_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE dingaling_profile_params ALTER COLUMN id SET DEFAULT nextval('dingaling_profile_params_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE dingaling_profiles ALTER COLUMN id SET DEFAULT nextval('dingaling_profiles_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE dingaling_settings ALTER COLUMN id SET DEFAULT nextval('dingaling_settings_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE directory ALTER COLUMN id SET DEFAULT nextval('directory_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE directory_domains ALTER COLUMN id SET DEFAULT nextval('directory_domains_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE directory_gateway_params ALTER COLUMN id SET DEFAULT nextval('directory_gateway_params_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE directory_gateways ALTER COLUMN id SET DEFAULT nextval('directory_gateways_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE directory_global_params ALTER COLUMN id SET DEFAULT nextval('directory_global_params_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE directory_global_vars ALTER COLUMN id SET DEFAULT nextval('directory_global_vars_id_seq'::regclass);
+
+
+--
+-- Name: map_id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE directory_group_user_map ALTER COLUMN map_id SET DEFAULT nextval('directory_group_user_map_map_id_seq'::regclass);
+
+
+--
+-- Name: group_id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE directory_groups ALTER COLUMN group_id SET DEFAULT nextval('directory_groups_group_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE directory_params ALTER COLUMN id SET DEFAULT nextval('directory_params_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE directory_vars ALTER COLUMN id SET DEFAULT nextval('directory_vars_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE easyroute_conf ALTER COLUMN id SET DEFAULT nextval('easyroute_conf_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE easyroute_data ALTER COLUMN id SET DEFAULT nextval('easyroute_data_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE iax_conf ALTER COLUMN id SET DEFAULT nextval('iax_conf_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE iax_settings ALTER COLUMN id SET DEFAULT nextval('iax_settings_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ivr_conf ALTER COLUMN id SET DEFAULT nextval('ivr_conf_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ivr_entries ALTER COLUMN id SET DEFAULT nextval('ivr_entries_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE lcr ALTER COLUMN id SET DEFAULT nextval('lcr_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE lcr_conf ALTER COLUMN id SET DEFAULT nextval('lcr_conf_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE lcr_profiles ALTER COLUMN id SET DEFAULT nextval('lcr_profiles_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE lcr_settings ALTER COLUMN id SET DEFAULT nextval('lcr_settings_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE limit_conf ALTER COLUMN id SET DEFAULT nextval('limit_conf_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE local_stream_conf ALTER COLUMN id SET DEFAULT nextval('local_stream_conf_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE modless_conf ALTER COLUMN id SET DEFAULT nextval('modless_conf_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE post_load_modules_conf ALTER COLUMN id SET DEFAULT nextval('post_load_modules_conf_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE rss_conf ALTER COLUMN id SET DEFAULT nextval('rss_conf_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE sofia_aliases ALTER COLUMN id SET DEFAULT nextval('sofia_aliases_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE sofia_conf ALTER COLUMN id SET DEFAULT nextval('sofia_conf_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE sofia_domains ALTER COLUMN id SET DEFAULT nextval('sofia_domains_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE sofia_gateways ALTER COLUMN id SET DEFAULT nextval('sofia_gateways_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE sofia_settings ALTER COLUMN id SET DEFAULT nextval('sofia_settings_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE voicemail_conf ALTER COLUMN id SET DEFAULT nextval('voicemail_conf_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE voicemail_email ALTER COLUMN id SET DEFAULT nextval('voicemail_email_id_seq'::regclass);
+
+
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE voicemail_settings ALTER COLUMN id SET DEFAULT nextval('voicemail_settings_id_seq'::regclass);
+
+
+--
+-- Name: acl_lists_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY acl_lists
+ ADD CONSTRAINT acl_lists_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: acl_nodes_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY acl_nodes
+ ADD CONSTRAINT acl_nodes_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: carrier_gateway_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY carrier_gateway
+ ADD CONSTRAINT carrier_gateway_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: carriers_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY carriers
+ ADD CONSTRAINT carriers_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: conference_advertise_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY conference_advertise
+ ADD CONSTRAINT conference_advertise_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: conference_controls_conf_group_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY conference_controls
+ ADD CONSTRAINT conference_controls_conf_group_key UNIQUE (conf_group, action);
+
+
+--
+-- Name: conference_controls_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY conference_controls
+ ADD CONSTRAINT conference_controls_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: conference_profiles_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY conference_profiles
+ ADD CONSTRAINT conference_profiles_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: conference_profiles_profile_name_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY conference_profiles
+ ADD CONSTRAINT conference_profiles_profile_name_key UNIQUE (profile_name, param_name);
+
+
+--
+-- Name: dialplan_actions_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY dialplan_actions
+ ADD CONSTRAINT dialplan_actions_pkey PRIMARY KEY (action_id);
+
+
+--
+-- Name: dialplan_condition_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY dialplan_condition
+ ADD CONSTRAINT dialplan_condition_pkey PRIMARY KEY (condition_id);
+
+
+--
+-- Name: dialplan_context_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY dialplan_context
+ ADD CONSTRAINT dialplan_context_pkey PRIMARY KEY (context_id);
+
+
+--
+-- Name: dialplan_extension_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY dialplan_extension
+ ADD CONSTRAINT dialplan_extension_pkey PRIMARY KEY (extension_id);
+
+
+--
+-- Name: dialplan_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY dialplan
+ ADD CONSTRAINT dialplan_pkey PRIMARY KEY (dialplan_id);
+
+
+--
+-- Name: dialplan_special_context_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY dialplan_special
+ ADD CONSTRAINT dialplan_special_context_key UNIQUE (context);
+
+
+--
+-- Name: dialplan_special_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY dialplan_special
+ ADD CONSTRAINT dialplan_special_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: dingaling_profile_params_dingaling_id_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY dingaling_profile_params
+ ADD CONSTRAINT dingaling_profile_params_dingaling_id_key UNIQUE (dingaling_id, param_name);
+
+
+--
+-- Name: dingaling_profile_params_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY dingaling_profile_params
+ ADD CONSTRAINT dingaling_profile_params_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: dingaling_profiles_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY dingaling_profiles
+ ADD CONSTRAINT dingaling_profiles_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: dingaling_profiles_profile_name_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY dingaling_profiles
+ ADD CONSTRAINT dingaling_profiles_profile_name_key UNIQUE (profile_name);
+
+
+--
+-- Name: dingaling_settings_param_name_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY dingaling_settings
+ ADD CONSTRAINT dingaling_settings_param_name_key UNIQUE (param_name);
+
+
+--
+-- Name: dingaling_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY dingaling_settings
+ ADD CONSTRAINT dingaling_settings_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: directory_domains_domain_name_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY directory_domains
+ ADD CONSTRAINT directory_domains_domain_name_key UNIQUE (domain_name);
+
+
+--
+-- Name: directory_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY directory_domains
+ ADD CONSTRAINT directory_domains_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: directory_gateway_params_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY directory_gateway_params
+ ADD CONSTRAINT directory_gateway_params_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: directory_gateways_gateway_name_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY directory_gateways
+ ADD CONSTRAINT directory_gateways_gateway_name_key UNIQUE (gateway_name);
+
+
+--
+-- Name: directory_gateways_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY directory_gateways
+ ADD CONSTRAINT directory_gateways_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: directory_global_params_directory_id_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY directory_global_params
+ ADD CONSTRAINT directory_global_params_directory_id_key UNIQUE (domain_id, param_name);
+
+
+--
+-- Name: directory_global_params_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY directory_global_params
+ ADD CONSTRAINT directory_global_params_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: directory_global_vars_directory_id_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY directory_global_vars
+ ADD CONSTRAINT directory_global_vars_directory_id_key UNIQUE (domain_id, var_name);
+
+
+--
+-- Name: directory_global_vars_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY directory_global_vars
+ ADD CONSTRAINT directory_global_vars_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: directory_group_user_map_group_id_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY directory_group_user_map
+ ADD CONSTRAINT directory_group_user_map_group_id_key UNIQUE (group_id, user_id);
+
+
+--
+-- Name: directory_group_user_map_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY directory_group_user_map
+ ADD CONSTRAINT directory_group_user_map_pkey PRIMARY KEY (map_id);
+
+
+--
+-- Name: directory_groups_group_name_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY directory_groups
+ ADD CONSTRAINT directory_groups_group_name_key UNIQUE (group_name);
+
+
+--
+-- Name: directory_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY directory_groups
+ ADD CONSTRAINT directory_groups_pkey PRIMARY KEY (group_id);
+
+
+--
+-- Name: directory_params_directory_id_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY directory_params
+ ADD CONSTRAINT directory_params_directory_id_key UNIQUE (directory_id, param_name);
+
+
+--
+-- Name: directory_params_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY directory_params
+ ADD CONSTRAINT directory_params_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: directory_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY directory
+ ADD CONSTRAINT directory_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: directory_username_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY directory
+ ADD CONSTRAINT directory_username_key UNIQUE (username, domain);
+
+
+--
+-- Name: directory_vars_directory_id_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY directory_vars
+ ADD CONSTRAINT directory_vars_directory_id_key UNIQUE (directory_id, var_name);
+
+
+--
+-- Name: directory_vars_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY directory_vars
+ ADD CONSTRAINT directory_vars_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: easyroute_conf_param_name_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY easyroute_conf
+ ADD CONSTRAINT easyroute_conf_param_name_key UNIQUE (param_name);
+
+
+--
+-- Name: easyroute_conf_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY easyroute_conf
+ ADD CONSTRAINT easyroute_conf_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: easyroute_data_destination_number_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY easyroute_data
+ ADD CONSTRAINT easyroute_data_destination_number_key UNIQUE (destination_number);
+
+
+--
+-- Name: easyroute_data_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY easyroute_data
+ ADD CONSTRAINT easyroute_data_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: iax_conf_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY iax_conf
+ ADD CONSTRAINT iax_conf_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: iax_conf_profile_name_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY iax_conf
+ ADD CONSTRAINT iax_conf_profile_name_key UNIQUE (profile_name);
+
+
+--
+-- Name: iax_settings_iax_id_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY iax_settings
+ ADD CONSTRAINT iax_settings_iax_id_key UNIQUE (iax_id, param_name);
+
+
+--
+-- Name: iax_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY iax_settings
+ ADD CONSTRAINT iax_settings_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: ivr_conf_name_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY ivr_conf
+ ADD CONSTRAINT ivr_conf_name_key UNIQUE (name);
+
+
+--
+-- Name: ivr_conf_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY ivr_conf
+ ADD CONSTRAINT ivr_conf_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: ivr_entries_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY ivr_entries
+ ADD CONSTRAINT ivr_entries_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: lcr_conf_param_name_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY lcr_conf
+ ADD CONSTRAINT lcr_conf_param_name_key UNIQUE (param_name);
+
+
+--
+-- Name: lcr_conf_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY lcr_conf
+ ADD CONSTRAINT lcr_conf_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: lcr_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY lcr
+ ADD CONSTRAINT lcr_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: lcr_profiles_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY lcr_profiles
+ ADD CONSTRAINT lcr_profiles_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: lcr_profiles_profile_name_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY lcr_profiles
+ ADD CONSTRAINT lcr_profiles_profile_name_key UNIQUE (profile_name);
+
+
+--
+-- Name: lcr_settings_lcr_id_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY lcr_settings
+ ADD CONSTRAINT lcr_settings_lcr_id_key UNIQUE (lcr_id, param_name);
+
+
+--
+-- Name: lcr_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY lcr_settings
+ ADD CONSTRAINT lcr_settings_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: limit_conf_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY limit_conf
+ ADD CONSTRAINT limit_conf_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: local_stream_conf_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY local_stream_conf
+ ADD CONSTRAINT local_stream_conf_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: modless_conf_conf_name_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY modless_conf
+ ADD CONSTRAINT modless_conf_conf_name_key UNIQUE (conf_name);
+
+
+--
+-- Name: modless_conf_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY modless_conf
+ ADD CONSTRAINT modless_conf_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: npa_nxx_company_ocn_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY npa_nxx_company_ocn
+ ADD CONSTRAINT npa_nxx_company_ocn_pkey PRIMARY KEY (npa, nxx);
+
+
+--
+-- Name: post_load_modules_conf_module_name_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY post_load_modules_conf
+ ADD CONSTRAINT post_load_modules_conf_module_name_key UNIQUE (module_name);
+
+
+--
+-- Name: post_load_modules_conf_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY post_load_modules_conf
+ ADD CONSTRAINT post_load_modules_conf_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: rss_conf_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY rss_conf
+ ADD CONSTRAINT rss_conf_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: sofia_aliases_alias_name_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY sofia_aliases
+ ADD CONSTRAINT sofia_aliases_alias_name_key UNIQUE (alias_name);
+
+
+--
+-- Name: sofia_aliases_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY sofia_aliases
+ ADD CONSTRAINT sofia_aliases_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: sofia_conf_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY sofia_conf
+ ADD CONSTRAINT sofia_conf_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: sofia_conf_profile_name_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY sofia_conf
+ ADD CONSTRAINT sofia_conf_profile_name_key UNIQUE (profile_name);
+
+
+--
+-- Name: sofia_domains_domain_name_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY sofia_domains
+ ADD CONSTRAINT sofia_domains_domain_name_key UNIQUE (domain_name);
+
+
+--
+-- Name: sofia_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY sofia_domains
+ ADD CONSTRAINT sofia_domains_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: sofia_gateways_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY sofia_gateways
+ ADD CONSTRAINT sofia_gateways_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: sofia_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY sofia_settings
+ ADD CONSTRAINT sofia_settings_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: sofia_settings_sofia_id_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY sofia_settings
+ ADD CONSTRAINT sofia_settings_sofia_id_key UNIQUE (sofia_id, param_name);
+
+
+--
+-- Name: voicemail_conf_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY voicemail_conf
+ ADD CONSTRAINT voicemail_conf_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: voicemail_conf_vm_profile_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY voicemail_conf
+ ADD CONSTRAINT voicemail_conf_vm_profile_key UNIQUE (vm_profile);
+
+
+--
+-- Name: voicemail_email_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY voicemail_email
+ ADD CONSTRAINT voicemail_email_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: voicemail_email_voicemail_id_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY voicemail_email
+ ADD CONSTRAINT voicemail_email_voicemail_id_key UNIQUE (voicemail_id, param_name);
+
+
+--
+-- Name: voicemail_settings_pkey; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY voicemail_settings
+ ADD CONSTRAINT voicemail_settings_pkey PRIMARY KEY (id);
+
+
+--
+-- Name: voicemail_settings_voicemail_id_key; Type: CONSTRAINT; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+ALTER TABLE ONLY voicemail_settings
+ ADD CONSTRAINT voicemail_settings_voicemail_id_key UNIQUE (voicemail_id, param_name);
+
+
+--
+-- Name: digits_rate; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX digits_rate ON lcr USING btree (digits, rate);
+
+
+--
+-- Name: fki_; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX fki_ ON acl_nodes USING btree (list_id);
+
+
+--
+-- Name: fki_lcr_profile; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX fki_lcr_profile ON lcr USING btree (lcr_profile);
+
+
+--
+-- Name: gateway; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE UNIQUE INDEX gateway ON carrier_gateway USING btree (prefix, suffix);
+
+
+--
+-- Name: profile_digits_15; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX profile_digits_15 ON lcr USING btree (digits, lcr_profile);
+
+
+--
+-- Name: sa_hostname; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX sa_hostname ON sip_authentication USING btree (hostname);
+
+
+--
+-- Name: sa_nonce; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX sa_nonce ON sip_authentication USING btree (nonce);
+
+
+--
+-- Name: sd_hostname; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX sd_hostname ON sip_dialogs USING btree (hostname);
+
+
+--
+-- Name: sd_uuid; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX sd_uuid ON sip_dialogs USING btree (uuid);
+
+
+--
+-- Name: sp_hostname; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX sp_hostname ON sip_presence USING btree (hostname);
+
+
+--
+-- Name: sr_call_id; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX sr_call_id ON sip_registrations USING btree (call_id);
+
+
+--
+-- Name: sr_contact; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX sr_contact ON sip_registrations USING btree (contact);
+
+
+--
+-- Name: sr_expires; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX sr_expires ON sip_registrations USING btree (expires);
+
+
+--
+-- Name: sr_hostname; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX sr_hostname ON sip_registrations USING btree (hostname);
+
+
+--
+-- Name: sr_network_ip; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX sr_network_ip ON sip_registrations USING btree (network_ip);
+
+
+--
+-- Name: sr_network_port; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX sr_network_port ON sip_registrations USING btree (network_port);
+
+
+--
+-- Name: sr_presence_hosts; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX sr_presence_hosts ON sip_registrations USING btree (presence_hosts);
+
+
+--
+-- Name: sr_profile_name; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX sr_profile_name ON sip_registrations USING btree (profile_name);
+
+
+--
+-- Name: sr_sip_host; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX sr_sip_host ON sip_registrations USING btree (sip_host);
+
+
+--
+-- Name: sr_sip_realm; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX sr_sip_realm ON sip_registrations USING btree (sip_realm);
+
+
+--
+-- Name: sr_sip_user; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX sr_sip_user ON sip_registrations USING btree (sip_user);
+
+
+--
+-- Name: sr_sip_username; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX sr_sip_username ON sip_registrations USING btree (sip_username);
+
+
+--
+-- Name: sr_status; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX sr_status ON sip_registrations USING btree (status);
+
+
+--
+-- Name: ss_call_id; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX ss_call_id ON sip_subscriptions USING btree (call_id);
+
+
+--
+-- Name: ss_event; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX ss_event ON sip_subscriptions USING btree (event);
+
+
+--
+-- Name: ss_hostname; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX ss_hostname ON sip_subscriptions USING btree (hostname);
+
+
+--
+-- Name: ss_presence_hosts; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX ss_presence_hosts ON sip_subscriptions USING btree (presence_hosts);
+
+
+--
+-- Name: ss_proto; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX ss_proto ON sip_subscriptions USING btree (proto);
+
+
+--
+-- Name: ss_sip_host; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX ss_sip_host ON sip_subscriptions USING btree (sip_host);
+
+
+--
+-- Name: ss_sip_user; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX ss_sip_user ON sip_subscriptions USING btree (sip_user);
+
+
+--
+-- Name: ss_sub_to_host; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX ss_sub_to_host ON sip_subscriptions USING btree (sub_to_host);
+
+
+--
+-- Name: ss_sub_to_user; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX ss_sub_to_user ON sip_subscriptions USING btree (sub_to_user);
+
+
+--
+-- Name: ssa_aor; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX ssa_aor ON sip_shared_appearance_subscriptions USING btree (aor);
+
+
+--
+-- Name: ssa_hostname; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX ssa_hostname ON sip_shared_appearance_subscriptions USING btree (hostname);
+
+
+--
+-- Name: ssa_profile_name; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX ssa_profile_name ON sip_shared_appearance_subscriptions USING btree (profile_name);
+
+
+--
+-- Name: ssa_subscriber; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX ssa_subscriber ON sip_shared_appearance_subscriptions USING btree (subscriber);
+
+
+--
+-- Name: ssd_call_id; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX ssd_call_id ON sip_shared_appearance_dialogs USING btree (call_id);
+
+
+--
+-- Name: ssd_contact_str; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX ssd_contact_str ON sip_shared_appearance_dialogs USING btree (contact_str);
+
+
+--
+-- Name: ssd_expires; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX ssd_expires ON sip_shared_appearance_dialogs USING btree (expires);
+
+
+--
+-- Name: ssd_hostname; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX ssd_hostname ON sip_shared_appearance_dialogs USING btree (hostname);
+
+
+--
+-- Name: ssd_profile_name; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX ssd_profile_name ON sip_shared_appearance_dialogs USING btree (profile_name);
+
+
+--
+-- Name: unique_route; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX unique_route ON lcr USING btree (digits, carrier_id);
+
+
+--
+-- Name: voicemail_msgs_idx1; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX voicemail_msgs_idx1 ON voicemail_msgs USING btree (created_epoch);
+
+
+--
+-- Name: voicemail_msgs_idx2; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX voicemail_msgs_idx2 ON voicemail_msgs USING btree (username);
+
+
+--
+-- Name: voicemail_msgs_idx3; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX voicemail_msgs_idx3 ON voicemail_msgs USING btree (domain);
+
+
+--
+-- Name: voicemail_msgs_idx4; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX voicemail_msgs_idx4 ON voicemail_msgs USING btree (uuid);
+
+
+--
+-- Name: voicemail_msgs_idx5; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX voicemail_msgs_idx5 ON voicemail_msgs USING btree (in_folder);
+
+
+--
+-- Name: voicemail_msgs_idx6; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX voicemail_msgs_idx6 ON voicemail_msgs USING btree (read_flags);
+
+
+--
+-- Name: voicemail_prefs_idx1; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX voicemail_prefs_idx1 ON voicemail_prefs USING btree (username);
+
+
+--
+-- Name: voicemail_prefs_idx2; Type: INDEX; Schema: public; Owner: freeswitch; Tablespace:
+--
+
+CREATE INDEX voicemail_prefs_idx2 ON voicemail_prefs USING btree (domain);
+
+
+--
+-- Name: acl_nodes_list_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY acl_nodes
+ ADD CONSTRAINT acl_nodes_list_id_fkey FOREIGN KEY (list_id) REFERENCES acl_lists(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: carrier_gateway_carrier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY carrier_gateway
+ ADD CONSTRAINT carrier_gateway_carrier_id_fkey FOREIGN KEY (carrier_id) REFERENCES carriers(id);
+
+
+--
+-- Name: dialplan_actions_condition_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY dialplan_actions
+ ADD CONSTRAINT dialplan_actions_condition_id_fkey FOREIGN KEY (condition_id) REFERENCES dialplan_condition(condition_id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: dialplan_condition_extension_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY dialplan_condition
+ ADD CONSTRAINT dialplan_condition_extension_id_fkey FOREIGN KEY (extension_id) REFERENCES dialplan_extension(extension_id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: dialplan_context_dialplan_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY dialplan_context
+ ADD CONSTRAINT dialplan_context_dialplan_id_fkey FOREIGN KEY (dialplan_id) REFERENCES dialplan(dialplan_id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: dialplan_extension_context_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY dialplan_extension
+ ADD CONSTRAINT dialplan_extension_context_id_fkey FOREIGN KEY (context_id) REFERENCES dialplan_context(context_id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: dingaling_profile_params_dingaling_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY dingaling_profile_params
+ ADD CONSTRAINT dingaling_profile_params_dingaling_id_fkey FOREIGN KEY (dingaling_id) REFERENCES dingaling_profiles(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: directory_gateway_params_d_gw_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY directory_gateway_params
+ ADD CONSTRAINT directory_gateway_params_d_gw_id_fkey FOREIGN KEY (d_gw_id) REFERENCES directory_gateways(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: directory_gateways_directory_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY directory_gateways
+ ADD CONSTRAINT directory_gateways_directory_id_fkey FOREIGN KEY (directory_id) REFERENCES directory(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: directory_global_params_directory_id_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY directory_global_params
+ ADD CONSTRAINT directory_global_params_directory_id_fkey1 FOREIGN KEY (domain_id) REFERENCES directory_domains(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: directory_global_vars_directory_id_fkey1; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY directory_global_vars
+ ADD CONSTRAINT directory_global_vars_directory_id_fkey1 FOREIGN KEY (domain_id) REFERENCES directory_domains(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: directory_group_user_map_group_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY directory_group_user_map
+ ADD CONSTRAINT directory_group_user_map_group_id_fkey FOREIGN KEY (group_id) REFERENCES directory_groups(group_id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: directory_group_user_map_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY directory_group_user_map
+ ADD CONSTRAINT directory_group_user_map_user_id_fkey FOREIGN KEY (user_id) REFERENCES directory(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: directory_params_directory_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY directory_params
+ ADD CONSTRAINT directory_params_directory_id_fkey FOREIGN KEY (directory_id) REFERENCES directory(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: directory_vars_directory_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY directory_vars
+ ADD CONSTRAINT directory_vars_directory_id_fkey FOREIGN KEY (directory_id) REFERENCES directory(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: iax_settings_iax_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY iax_settings
+ ADD CONSTRAINT iax_settings_iax_id_fkey FOREIGN KEY (iax_id) REFERENCES iax_conf(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: ivr_entries_ivr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY ivr_entries
+ ADD CONSTRAINT ivr_entries_ivr_id_fkey FOREIGN KEY (ivr_id) REFERENCES ivr_conf(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: lcr_carrier_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY lcr
+ ADD CONSTRAINT lcr_carrier_id_fkey FOREIGN KEY (carrier_id) REFERENCES carriers(id);
+
+
+--
+-- Name: lcr_profile; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY lcr
+ ADD CONSTRAINT lcr_profile FOREIGN KEY (lcr_profile) REFERENCES lcr_profiles(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: lcr_settings_lcr_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY lcr_settings
+ ADD CONSTRAINT lcr_settings_lcr_id_fkey FOREIGN KEY (lcr_id) REFERENCES lcr_profiles(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: sofia_aliases_sofia_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY sofia_aliases
+ ADD CONSTRAINT sofia_aliases_sofia_id_fkey FOREIGN KEY (sofia_id) REFERENCES sofia_conf(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: sofia_domains_sofia_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY sofia_domains
+ ADD CONSTRAINT sofia_domains_sofia_id_fkey FOREIGN KEY (sofia_id) REFERENCES sofia_conf(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: sofia_gateways_sofia_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY sofia_gateways
+ ADD CONSTRAINT sofia_gateways_sofia_id_fkey FOREIGN KEY (sofia_id) REFERENCES sofia_conf(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: sofia_settings_sofia_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY sofia_settings
+ ADD CONSTRAINT sofia_settings_sofia_id_fkey FOREIGN KEY (sofia_id) REFERENCES sofia_conf(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: voicemail_email_voicemail_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY voicemail_email
+ ADD CONSTRAINT voicemail_email_voicemail_id_fkey FOREIGN KEY (voicemail_id) REFERENCES voicemail_conf(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: voicemail_settings_voicemail_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: freeswitch
+--
+
+ALTER TABLE ONLY voicemail_settings
+ ADD CONSTRAINT voicemail_settings_voicemail_id_fkey FOREIGN KEY (voicemail_id) REFERENCES voicemail_conf(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+
+--
+-- Name: public; Type: ACL; Schema: -; Owner: postgres
+--
+
+REVOKE ALL ON SCHEMA public FROM PUBLIC;
+REVOKE ALL ON SCHEMA public FROM postgres;
+GRANT ALL ON SCHEMA public TO postgres;
+GRANT ALL ON SCHEMA public TO PUBLIC;
+
+
+--
+-- PostgreSQL database dump complete
+--
+
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribintralanmanPHPfs_sockfs_sockphp"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_sock/fs_sock.php (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_sock/fs_sock.php        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/intralanman/PHP/fs_sock/fs_sock.php        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -9,11 +9,11 @@
</span><span class="cx"> *
</span><span class="cx"> */
</span><span class="cx"> class fs_sock {
</span><del>- /**
- * file handler for FreeSWITCH socket connection
- *
- * @var file pointer
- */
</del><ins>+/**
+ * file handler for FreeSWITCH socket connection
+ *
+ * @var file pointer
+ */
</ins><span class="cx"> public $sock;
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -43,10 +43,10 @@
</span><span class="cx"> */
</span><span class="cx"> function fs_sock($vars=null) {
</span><span class="cx"> if (!defined('BUFFER_SIZE')) {
</span><del>- /**
- * This is the buffer size for fread/fgets operations (default 4096)
- * Define BUFFER_SIZE before instantiation to use a different size
- */
</del><ins>+ /**
+ * This is the buffer size for fread/fgets operations (default 4096)
+ * Define BUFFER_SIZE before instantiation to use a different size
+ */
</ins><span class="cx"> define('BUFFER_SIZE', 4096);
</span><span class="cx"> }
</span><span class="cx"> $vars_array = is_array($vars) ? $vars : array();
</span><span class="lines">@@ -77,23 +77,23 @@
</span><span class="cx"> */
</span><span class="cx"> function set_initial_vars($var_array) {
</span><span class="cx"> $defaults = array(
</span><del>- 'host' => '127.0.0.1',
- 'port' => '8021',
- 'pass' => 'ClueCon',
- 'timeout' => 30,
- 'stream_timeout' => 5
</del><ins>+ 'host' => '127.0.0.1',
+ 'port' => '8021',
+ 'pass' => 'ClueCon',
+ 'timeout' => 30,
+ 'stream_timeout' => 5
</ins><span class="cx"> );
</span><span class="cx"> if (array_key_exists('host', $var_array)
</span><del>- && $var_array['host'] == 'localhost') {
- //$this -> debug('Replacing localhost with 127.0.0.1');
</del><ins>+ && $var_array['host'] == 'localhost') {
+ //$this -> debug('Replacing localhost with 127.0.0.1');
</ins><span class="cx"> $var_array['host'] = '127.0.0.1';
</span><span class="cx"> }
</span><span class="cx"> foreach ($defaults as $key => $val) {
</span><span class="cx"> if (array_key_exists($key, $var_array)) {
</span><del>- //$this -> debug("$key found in vars");
</del><ins>+ //$this -> debug("$key found in vars");
</ins><span class="cx"> $connection_settings[$key] = $var_array[$key];
</span><span class="cx"> } else {
</span><del>- //$this -> debug("$key not found in vars");
</del><ins>+ //$this -> debug("$key not found in vars");
</ins><span class="cx"> $connection_settings[$key] = $val;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -108,19 +108,19 @@
</span><span class="cx"> * @return boolean
</span><span class="cx"> */
</span><span class="cx"> function sock_connect($sock_array) {
</span><del>- //$this -> debug($sock_array);
</del><ins>+ //$this -> debug($sock_array);
</ins><span class="cx"> $host = $sock_array['host'];
</span><span class="cx"> $port = $sock_array['port'];
</span><span class="cx"> $timeout = $sock_array['timeout'];
</span><span class="cx"> $this -> sock = fsockopen($host, $port, $errno, $errstr, $timeout);
</span><span class="cx"> if (!$this -> sock) {
</span><span class="cx"> $error = sprintf('Unable to connect to %s:%s Error #%s: %s'
</span><del>- , $host, $port, $errno, $errstr
</del><ins>+ , $host, $port, $errno, $errstr
</ins><span class="cx"> );
</span><span class="cx"> trigger_error($error, E_USER_ERROR);
</span><span class="cx"> return false;
</span><span class="cx"> } else {
</span><del>- //$this -> debug(stream_get_meta_data($this -> sock));
</del><ins>+ //$this -> debug(stream_get_meta_data($this -> sock));
</ins><span class="cx"> $this -> set_stream_opts($sock_array);
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -133,9 +133,9 @@
</span><span class="cx"> * @return void
</span><span class="cx"> */
</span><span class="cx"> function set_stream_opts($opts) {
</span><del>- //$this -> debug($opts);
</del><ins>+ //$this -> debug($opts);
</ins><span class="cx"> if (ereg('^[0-9]*\.[0-9]+$', $opts['stream_timeout'])) {
</span><del>- //$this -> debug($opts['stream_timeout'] . ' seems to be a float');
</del><ins>+ //$this -> debug($opts['stream_timeout'] . ' seems to be a float');
</ins><span class="cx"> $time_opts = split('\.', $opts['stream_timeout']);
</span><span class="cx"> //$this -> debug($time_opts);
</span><span class="cx"> $secs = sprintf('%d', $time_opts[0]);
</span><span class="lines">@@ -146,7 +146,7 @@
</span><span class="cx"> }
</span><span class="cx"> if (!stream_set_timeout($this -> sock, $secs, $ms)) {
</span><span class="cx"> $this -> debug(
</span><del>- "Failed to set timeout to $secs seconds and $ms microseconds"
</del><ins>+ "Failed to set timeout to $secs seconds and $ms microseconds"
</ins><span class="cx"> );
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -160,7 +160,7 @@
</span><span class="cx"> function sock_auth($pass) {
</span><span class="cx"> $reply = $this -> send_command("auth $pass");
</span><span class="cx"> if (is_array($reply) && array_key_exists('Reply-Text', $reply)
</span><del>- && ereg('^\+?OK', $reply['Reply-Text'])) {
</del><ins>+ && ereg('^\+?OK', $reply['Reply-Text'])) {
</ins><span class="cx"> $this -> debug('Successfully authenticated');
</span><span class="cx"> $this -> debug($reply);
</span><span class="cx"> $this -> auth = true;
</span><span class="lines">@@ -200,7 +200,7 @@
</span><span class="cx"> $event[$header] = $value;
</span><span class="cx"> }
</span><span class="cx"> } elseif (is_array($event)
</span><del>- && array_key_exists('Content-Length', $event)) {
</del><ins>+ && array_key_exists('Content-Length', $event)) {
</ins><span class="cx"> $this -> debug("line is empty: " . (empty($trim_line) ? 'true' : 'false'));
</span><span class="cx"> $event['Body'] = $this -> sock_get_length($event['Content-Length']);
</span><span class="cx"> break;
</span><span class="lines">@@ -214,7 +214,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Read $content_len bytes from the socket
</del><ins>+ * Read $content_len bytes from the socket splitting by :
</ins><span class="cx"> *
</span><span class="cx"> * @param integer $content_len
</span><span class="cx"> * @return array
</span><span class="lines">@@ -234,8 +234,8 @@
</span><span class="cx"> $value = trim($split[1]);
</span><span class="cx"> $content[$attribute] = urldecode($value);
</span><span class="cx"> } elseif (empty($trim_line) && is_array($content)
</span><del>- && array_key_exists('Content-Length', $content)) {
- $content['Body'] = $this -> sock_get_length($content['Content-Length']);
</del><ins>+ && array_key_exists('Content-Length', $content)) {
+ $content['Body'] = $this -> sock_get_body($content['Content-Length']);
</ins><span class="cx"> $len += $content['Content-Length'];
</span><span class="cx"> break;
</span><span class="cx"> } elseif (!empty($trim_line)) {
</span><span class="lines">@@ -251,6 +251,32 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * Read $content_len bytes from the socket
+ *
+ * @param integer $content_len
+ * @return array
+ */
+ private function sock_get_body($content_len) {
+ $len = 0;
+ $content = null;
+
+ while ($orig_line = fgets($this -> sock, BUFFER_SIZE)) {
+
+ $len += strlen($orig_line);
+ $trim_line = trim($orig_line);
+
+ $content .= $trim_line;
+
+ if ($len >= $content_len) {
+ break;
+ }
+
+ }
+
+ return $content;
+ }
+
+ /**
</ins><span class="cx"> * Send a command to the FreeSWITCH event socket
</span><span class="cx"> * This method sends a command string to the FreeSWITCH event socket and
</span><span class="cx"> * returns true upon success and false upon failure
</span><span class="lines">@@ -271,7 +297,7 @@
</span><span class="cx"> $this -> sock_put("$cmd\r\n\r\n", $sock);
</span><span class="cx"> if ($this -> command != 'exit') {
</span><span class="cx"> $reply = $this -> sock_get($sock);
</span><del>- //$this -> debug($reply);
</del><ins>+ //$this -> debug($reply);
</ins><span class="cx"> } else {
</span><span class="cx"> unset($this -> command);
</span><span class="cx"> return;
</span><span class="lines">@@ -298,8 +324,8 @@
</span><span class="cx"> while ($reply['Content-Type'] != 'api/response') {
</span><span class="cx"> if (count($reply) > 0) {
</span><span class="cx"> $debug_text = sprintf(
</span><del>- "%s - (%s) != (api/response) adding an event to the output buffer"
- , count($reply), $reply['Content-Type']
</del><ins>+ "%s - (%s) != (api/response) adding an event to the output buffer"
+ , count($reply), $reply['Content-Type']
</ins><span class="cx"> );
</span><span class="cx"> $this -> debug($debug_text);
</span><span class="cx"> $this -> output_buffer[] = $reply;
</span><span class="lines">@@ -320,8 +346,8 @@
</span><span class="cx"> while ($reply['Content-Type'] != 'command/reply') {
</span><span class="cx"> if (count($reply) > 0) {
</span><span class="cx"> $debug_text = sprintf(
</span><del>- "%s - (%s) != (command/reply) adding an event to the output buffer"
- , count($reply), $reply['Content-Type']
</del><ins>+ "%s - (%s) != (command/reply) adding an event to the output buffer"
+ , count($reply), $reply['Content-Type']
</ins><span class="cx"> );
</span><span class="cx"> $this -> debug($debug_text);
</span><span class="cx"> $this -> output_buffer[] = $reply;
</span><span class="lines">@@ -410,10 +436,10 @@
</span><span class="cx"> $this -> debug(")", $spaces);
</span><span class="cx"> } else {
</span><span class="cx"> if (is_array($_SERVER)
</span><del>- && array_key_exists('HTTP_HOST', $_SERVER)) {
</del><ins>+ && array_key_exists('HTTP_HOST', $_SERVER)) {
</ins><span class="cx"> printf("<!--%s%s-->\r\n"
</span><del>- , str_repeat(' ', $spaces)
- , htmlentities($input)
</del><ins>+ , str_repeat(' ', $spaces)
+ , htmlentities($input)
</ins><span class="cx"> );
</span><span class="cx"> } else {
</span><span class="cx"> $input = trim($input);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribjtregunnamod_fastsmsmod_fastsmsc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/jtregunna/mod_fastsms/mod_fastsms.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/jtregunna/mod_fastsms/mod_fastsms.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/jtregunna/mod_fastsms/mod_fastsms.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx">         char* text = NULL;
</span><span class="cx">         const char* originator = switch_channel_get_variable(channel, "fastsms_originator");
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data)) {
</del><ins>+        if (!zstr(data)) {
</ins><span class="cx">                 msisdn = switch_core_session_strdup(session, data);
</span><span class="cx">                 text = strchr(msisdn, ' ');
</span><span class="cx">                 if (text)
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_odbc_querymod_odbc_queryc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_odbc_query/mod_odbc_query.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_odbc_query/mod_odbc_query.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_odbc_query/mod_odbc_query.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -95,7 +95,7 @@
</span><span class="cx">                 for (param = switch_xml_child(settings, "param"); param; param = param->next) {
</span><span class="cx">                         char *var = (char *) switch_xml_attr_soft(param, "name");
</span><span class="cx">                         char *val = (char *) switch_xml_attr_soft(param, "value");
</span><del>-                        if (!strcasecmp(var, "odbc-dsn") && (!switch_strlen_zero(val))) {
</del><ins>+                        if (!strcasecmp(var, "odbc-dsn") && (!zstr(val))) {
</ins><span class="cx">                                 globals.odbc_dsn = switch_core_strdup(globals.pool, val);
</span><span class="cx">                                 if ((odbc_user = strchr(globals.odbc_dsn, ':'))) {
</span><span class="cx">                                         *odbc_user++ = '\0';
</span><span class="lines">@@ -112,7 +112,7 @@
</span><span class="cx">                 for (query = switch_xml_child(queries, "query"); query; query = query->next) {
</span><span class="cx">                         char *var = (char *) switch_xml_attr_soft(query, "name");
</span><span class="cx">                         char *val = (char *) switch_xml_attr_soft(query, "value");
</span><del>-                        if (!switch_strlen_zero(var) && !switch_strlen_zero(val)) {
</del><ins>+                        if (!zstr(var) && !zstr(val)) {
</ins><span class="cx">                                 switch_core_hash_insert(globals.queries_hash, var, val);
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="lines">@@ -172,7 +172,7 @@
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!data || switch_strlen_zero(data)) {
</del><ins>+        if (!data || zstr(data)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No query provided!\n");
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_pclifromrev15313freeswitchtrunkcontribledrcmod_pcli"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli (from rev 15313, freeswitch/trunk/contrib/ledr/c/mod_pcli)</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_pcli"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:mergeinfo
</span><span class="cx"> +
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_pcliMakefile"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/Makefile</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_pcliMakefilefromrev15313freeswitchtrunkcontribledrcmod_pcliMakefile"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/Makefile (from rev 15313, freeswitch/trunk/contrib/ledr/c/mod_pcli/Makefile) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/Makefile         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/Makefile        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+BASE=/usr/src/freeswitch/trunk
+include $(BASE)/build/modmake.rules
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_pclimod_pclic"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/mod_pcli.c</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_pclimod_pclicfromrev15313freeswitchtrunkcontribledrcmod_pclimod_pclic"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/mod_pcli.c (from rev 15313, freeswitch/trunk/contrib/ledr/c/mod_pcli/mod_pcli.c) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/mod_pcli.c         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/mod_pcli.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,362 @@
</span><ins>+/*
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005-2009, 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/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Anthony Minessale II <anthm@freeswitch.org>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Leon de Rooij <leon@toyos.nl>
+ *
+ *
+ * mod_pcli.c -- PacketCable Lawful Intercept
+ *
+ */
+#include <switch.h>
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_pcli_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_pcli_shutdown);
+SWITCH_MODULE_DEFINITION(mod_pcli, mod_pcli_load, mod_pcli_shutdown, NULL);
+
+SWITCH_STANDARD_APP(pcli_start_function);
+
+typedef enum {
+        PCLI_MEDIA_DIRECTION_UNKNOWN, /* 0 */
+        PCLI_MEDIA_DIRECTION_FROM_TARGET, /* 1 */
+        PCLI_MEDIA_DIRECTION_TO_TARGET, /* 2 */
+        PCLI_MEDIA_DIRECTION_MONO_MODE /* 3 */
+} pcli_media_direction_t;
+
+static struct {
+        switch_memory_pool_t *pool;
+        int switch_id;
+        char *local_addr;
+        int local_port;
+        char *remote_addr;
+        int remote_port;
+        switch_socket_t *socket;
+} pcli_globals;
+
+// temporary declaration here.. remove after testing is done !!!!
+static switch_status_t gen_pcli_header(uint32_t *pcli_header, pcli_media_direction_t media_direction, uint16_t call_id, uint8_t switch_id, uint16_t ini_id);
+
+typedef struct {
+        switch_core_session_t *session;
+        char *ini_id;
+} pcli_session_helper_t;
+
+/* config item validations */
+static switch_xml_config_int_options_t config_opt_valid_switch_id = { SWITCH_TRUE, 0, SWITCH_TRUE, 15 };
+static switch_xml_config_string_options_t config_opt_valid_addr = { NULL, 0, ".+" };
+static switch_xml_config_int_options_t config_opt_valid_port = { SWITCH_TRUE, 0, SWITCH_TRUE, 65535 };
+
+/* config items */
+static switch_xml_config_item_t instructions[] = {
+        SWITCH_CONFIG_ITEM("switch_id", SWITCH_CONFIG_INT, CONFIG_RELOADABLE, &pcli_globals.switch_id,
+                (void*)0, &config_opt_valid_switch_id, NULL, NULL),
+        SWITCH_CONFIG_ITEM("local_addr", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE, &pcli_globals.local_addr,
+                "localhost", &config_opt_valid_addr, NULL, NULL),
+        SWITCH_CONFIG_ITEM("local_port", SWITCH_CONFIG_INT, CONFIG_RELOADABLE, &pcli_globals.local_port,
+                (void*)10741, &config_opt_valid_port, NULL, NULL),
+        SWITCH_CONFIG_ITEM("remote_addr", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE, &pcli_globals.remote_addr,
+                "localhost", &config_opt_valid_addr, NULL, NULL),
+        SWITCH_CONFIG_ITEM("remote_port", SWITCH_CONFIG_INT, CONFIG_RELOADABLE, &pcli_globals.remote_port,
+                (void*)10741, &config_opt_valid_port, NULL, NULL),
+        SWITCH_CONFIG_ITEM_END()
+};
+
+/* called at startup and reload of the module */
+static switch_status_t do_config(switch_bool_t reload)
+{
+        switch_socket_t *socket = NULL;
+        switch_sockaddr_t *local_sockaddr;
+        switch_sockaddr_t *remote_sockaddr;
+
+        if (switch_xml_config_parse_module_settings("pcli.conf", reload, instructions) != SWITCH_STATUS_SUCCESS) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Could not open pcli.conf\n");
+                return SWITCH_STATUS_FALSE;
+        }
+
+        /* for now, only init port on startup, fix reload later !! */
+        if (!reload) {
+
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Trying to create a udp socket !!\n");
+
+                if (switch_sockaddr_info_get(&local_sockaddr, pcli_globals.local_addr, SWITCH_UNSPEC, pcli_globals.local_port, 0, pcli_globals.pool) != SWITCH_STATUS_SUCCESS || !local_sockaddr) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Local Address Error!\n");
+                        return SWITCH_STATUS_FALSE;
+                }
+
+                if (switch_socket_create(&socket, switch_sockaddr_get_family(local_sockaddr), SOCK_DGRAM, 0, pcli_globals.pool) != SWITCH_STATUS_SUCCESS) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Socket Error!\n");
+                        return SWITCH_STATUS_FALSE;
+                }
+
+                if (switch_socket_opt_set(socket, SWITCH_SO_REUSEADDR, 1) != SWITCH_STATUS_SUCCESS) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Socket Error!\n");
+                        return SWITCH_STATUS_FALSE;
+                }
+
+                if (switch_socket_bind(socket, local_sockaddr) != SWITCH_STATUS_SUCCESS) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Bind Error!\n");
+                        return SWITCH_STATUS_FALSE;
+                }
+
+                pcli_globals.socket = socket;
+
+                /* TEST SENDING A PACKET */
+                if (switch_sockaddr_info_get(&remote_sockaddr, pcli_globals.remote_addr, SWITCH_UNSPEC, pcli_globals.remote_port, 0, pcli_globals.pool) != SWITCH_STATUS_SUCCESS || !remote_sockaddr) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Remote Address Error!\n");
+                        return SWITCH_STATUS_FALSE;
+                }
+
+                /* create a pcli header */
+                uint32_t pcli_header;
+                pcli_media_direction_t media_direction = PCLI_MEDIA_DIRECTION_FROM_TARGET;
+                uint16_t call_id = 123;
+                uint8_t switch_id = 12;
+                uint16_t ini_id = 10741;
+                gen_pcli_header(&pcli_header, media_direction, call_id, switch_id, ini_id);
+
+                uint32_t network_byte_order_pcli_header;
+                network_byte_order_pcli_header = htonl(pcli_header);
+
+                /* create a pcli body */
+                char *pcli_body = "ABCD";
+
+                /* create a full packet */
+                char *packet;
+                packet = malloc(sizeof(network_byte_order_pcli_header) + sizeof(pcli_body));
+                memcpy(packet, &network_byte_order_pcli_header, sizeof(network_byte_order_pcli_header));
+                memcpy(packet + sizeof(network_byte_order_pcli_header), pcli_body, sizeof(pcli_body));
+
+                size_t packetsize;
+                packetsize = sizeof(packet);
+
+                switch_socket_sendto(pcli_globals.socket, remote_sockaddr, 0, packet, &packetsize);
+
+        }
+
+        return SWITCH_STATUS_SUCCESS;
+}
+
+/* called when SWITCH_EVENT_RELOADXML is sent to this module */
+static void reload_event_handler(switch_event_t *event)
+{
+        do_config(SWITCH_TRUE);
+}
+
+/* generate a PacketCable Lawful Intercept header, that can be prepended to an RTP packet */
+static switch_status_t gen_pcli_header(uint32_t *pcli_header, pcli_media_direction_t media_direction, uint16_t call_id, uint8_t switch_id, uint16_t ini_id)
+{
+        *pcli_header = 0;
+
+        /* some sanity checks */
+
+        if (media_direction > 3) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Invalid media direction, may only be 0-3\n");
+                return SWITCH_STATUS_FALSE;
+        }
+
+        if (call_id > 1023) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Invalid call_id, may only be 0-1023\n");
+                return SWITCH_STATUS_FALSE;
+        }
+
+        if (switch_id > 15) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Invalid switch_id, may only be 0-15\n");
+                return SWITCH_STATUS_FALSE;
+        }
+
+        /* ini_id needs no check as it may use the full uint16_t */
+
+        *pcli_header |= (media_direction);
+        *pcli_header |= (call_id << 2);
+        *pcli_header |= (switch_id << 12);
+        *pcli_header |= (ini_id << 16);
+
+        return SWITCH_STATUS_SUCCESS;
+}
+
+static switch_bool_t pcli_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type)
+{
+//        pcli_session_helper_t *pcli_session_helper = (pcli_session_helper_t *) user_data;
+
+        switch (type) {
+        case SWITCH_ABC_TYPE_INIT:
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "--> INIT\n");
+                break;
+
+        case SWITCH_ABC_TYPE_READ_PING:
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "--> PING\n");
+                break;
+
+        case SWITCH_ABC_TYPE_CLOSE:
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "--> CLOSE\n");
+                break;
+
+        case SWITCH_ABC_TYPE_READ:
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "--> READ\n");
+                break;
+
+        case SWITCH_ABC_TYPE_WRITE:
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "--> WRITE\n");
+                break;
+
+        case SWITCH_ABC_TYPE_READ_REPLACE:
+                {
+                        switch_frame_t *rframe = switch_core_media_bug_get_read_replace_frame(bug);
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "--> READ_REPLACE seq[%u] ssrc[%lu] packetlen[%lu] rate [%lu] samples [%lu]\n",
+                                (unsigned)rframe->seq, (unsigned long)rframe->ssrc, (unsigned long)rframe->packetlen, (unsigned long)rframe->rate, (unsigned long)rframe->samples);
+switch_size_t packetlength = sizeof(rframe->packet);
+switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, ">>> [%lu]\n", (unsigned long)packetlength);
+
+                }
+                break;
+
+        case SWITCH_ABC_TYPE_WRITE_REPLACE:
+                {
+                        switch_frame_t *rframe = switch_core_media_bug_get_write_replace_frame(bug);
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "--> WRITE_REPLACE seq[%u] ssrc[%lu] packetlen[%lu] rate [%lu] samples[%lu]\n",
+                                (unsigned)rframe->seq, (unsigned long)rframe->ssrc, (unsigned long)rframe->packetlen, (unsigned long)rframe->rate, (unsigned long)rframe->samples);
+switch_size_t packetlength = sizeof(rframe->packet);
+switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, ">>> [%lu]\n", (unsigned long)packetlength);
+
+                }
+                break;
+        }
+
+        return SWITCH_TRUE;
+}
+
+/* necessary for hooking to SWITCH_EVENT_RELOADXML */
+static switch_event_node_t *NODE = NULL;
+
+SWITCH_STANDARD_APP(pcli_start_function)
+{
+        switch_media_bug_t *bug;
+        switch_status_t status;
+        switch_channel_t *channel;
+        pcli_session_helper_t *pcli_session_helper;
+        const char *p;
+
+        if (session == NULL)
+                return;
+
+        channel = switch_core_session_get_channel(session);
+
+        /* Is this channel already set? */
+        bug = (switch_media_bug_t *) switch_channel_get_private(channel, "_pcli_");
+        /* If yes */
+        if (bug != NULL) {
+                /* If we have a stop remove audio bug */
+                if (strcasecmp(data, "stop") == 0) {
+                        switch_channel_set_private(channel, "_pcli_", NULL);
+                        switch_core_media_bug_remove(session, &bug);
+                        return;
+                }
+
+                /* We have already started */
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Cannot run 2 at once on the same channel!\n");
+
+                return;
+        }
+
+        /* create a new pcli_session_helper */
+        pcli_session_helper = (pcli_session_helper_t *) switch_core_session_alloc(session, sizeof(pcli_session_helper_t));
+
+        /* make session available from pcli_session_helper */
+        pcli_session_helper->session = session;
+
+        /* get LI_ID and store in pcli_session_helper */
+        if ((p = switch_channel_get_variable(channel, "LI_ID")) && switch_true(p)) {
+                pcli_session_helper->ini_id = switch_core_session_strdup(session, p);
+        } else {
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No LI_ID was set!\n");
+                return;
+        }
+
+        /* add the bug */
+        //status = switch_core_media_bug_add(session, pcli_callback, pcli_session_helper, 0, SMBF_BOTH, &bug);
+        //status = switch_core_media_bug_add(session, pcli_callback, pcli_session_helper, 0, SMBF_READ_STREAM | SMBF_WRITE_STREAM, &bug);
+        status = switch_core_media_bug_add(session, pcli_callback, pcli_session_helper, 0, SMBF_READ_REPLACE | SMBF_WRITE_REPLACE, &bug);
+        //status = switch_core_media_bug_add(session, pcli_callback, pcli_session_helper, 0, SMBF_READ_REPLACE, &bug);
+
+        if (status != SWITCH_STATUS_SUCCESS) {
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Failure hooking to stream\n");
+                return;
+        }
+
+        switch_channel_set_private(channel, "_pcli_", bug);
+}
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_pcli_load)
+{
+        switch_application_interface_t *app_interface;
+
+        /* initialize pcli_globals struct */
+        memset(&pcli_globals, 0, sizeof(pcli_globals));
+
+        /* make the pool available from pcli_globals */
+        pcli_globals.pool = pool;
+
+        /* do config */
+        do_config(SWITCH_FALSE);
+
+        /* connect my internal structure to the blank pointer passed to me */
+        *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+
+        /* make the pcli application available to the system */
+        SWITCH_ADD_APP(app_interface, "pcli", "PacketCable Lawful Intercept", "PacketCable Lawful Intercept", pcli_start_function, "<start>", SAF_NONE);
+
+        /* subscribe to reloadxml event, and hook it to reload_event_handler */
+        if ((switch_event_bind_removable(modname, SWITCH_EVENT_RELOADXML, NULL, reload_event_handler, NULL, &NODE) != SWITCH_STATUS_SUCCESS)) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind event!\n");
+                return SWITCH_STATUS_TERM;
+        }
+
+        /* say it */
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Lawful Intercept enabled\n");
+
+        /* indicate that the module should continue to be loaded */
+        return SWITCH_STATUS_SUCCESS;
+}
+
+
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_pcli_shutdown)
+{
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "PacketCable Lawful Intercept disabled\n");
+
+/* TODO DESTROY THE SOCKET HERE ! */
+
+        return SWITCH_STATUS_SUCCESS;
+}
+
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
+ */
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_pclipcliconfxml"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/pcli.conf.xml</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_pclipcliconfxmlfromrev15313freeswitchtrunkcontribledrcmod_pclipcliconfxml"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/pcli.conf.xml (from rev 15313, freeswitch/trunk/contrib/ledr/c/mod_pcli/pcli.conf.xml) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/pcli.conf.xml         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/pcli.conf.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+<configuration name="pcli.conf" description="PacketCable Lawful Intercept Configuration">
+
+ <settings>
+ <param name="switch_id" value="0"/>
+ <!-- <param name="method" value="bug"/> -->
+ <param name="local_addr" value="172.31.1.5"/>
+ <param name="local_port" value="8000"/>
+ <param name="remote_addr" value="172.31.1.4"/>
+ <param name="remote_port" value="8000"/>
+ </settings>
+
+</configuration>
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_pclipclistructuremysql"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/pcli.structure.mysql</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribledrcmod_pclipclistructuremysqlfromrev15313freeswitchtrunkcontribledrcmod_pclipclistructuremysql"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/pcli.structure.mysql (from rev 15313, freeswitch/trunk/contrib/ledr/c/mod_pcli/pcli.structure.mysql) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/pcli.structure.mysql         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/ledr/c/mod_pcli/pcli.structure.mysql        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+-- TODO: SEEMS TO WORK, BUT VERIFY STILL !
+
+CREATE TABLE IF NOT EXISTS `pcli` (
+        `ini_id` varchar(255) NOT NULL,
+        `count` int(11) NOT NULL,
+UNIQUE KEY `ini_id` (`ini_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+
+DROP PROCEDURE IF EXISTS get_and_incr_pcli_count;
+delimiter $$
+CREATE PROCEDURE get_and_incr_pcli_count(i VARCHAR(255), OUT c INT)
+BEGIN
+        SET AUTOCOMMIT = 0;
+        START TRANSACTION;
+        SELECT `count` INTO c FROM `pcli` WHERE `ini_id` = i FOR UPDATE;
+        IF (c >= 0) THEN
+                SET c = c + 1;
+                UPDATE `pcli` SET `count` = c WHERE `ini_id` = i;
+        ELSE
+                SET c = 0;
+                INSERT INTO `pcli` (`ini_id`, `count`) VALUES (i, c);
+        END IF;
+        COMMIT;
+END $$
+delimiter ;
+
+-- test with:
+CALL get_and_incr_pcli_count('test', @c);
+SELECT @c AS `count`;
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribmodxml_intmod_xml_odbcmod_xml_odbcc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/mod/xml_int/mod_xml_odbc/mod_xml_odbc.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/mod/xml_int/mod_xml_odbc/mod_xml_odbc.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/mod/xml_int/mod_xml_odbc/mod_xml_odbc.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 goto usage;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -125,7 +125,7 @@
</span><span class="cx">         xml_odbc_session_helper_t *helper = (xml_odbc_session_helper_t *) pArg;
</span><span class="cx">         int i, tmp_rowcount;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(helper->next_template_name)) goto done;
</del><ins>+        if (!zstr(helper->next_template_name)) goto done;
</ins><span class="cx">
</span><span class="cx">         /* loop through all columns and store them in helper->event->headers */
</span><span class="cx">         for (i = 0; i < argc; i++) {
</span><span class="lines">@@ -245,7 +245,7 @@
</span><span class="cx">                 goto done;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(empty_result_break_to) && helper->rowcount == 0) {
</del><ins>+        if (!zstr(empty_result_break_to) && helper->rowcount == 0) {
</ins><span class="cx">                 helper->next_template_name = empty_result_break_to;
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="lines">@@ -265,7 +265,7 @@
</span><span class="cx">         if (!strcasecmp(helper->xml_in_cur->name, "xml-odbc-do")) {
</span><span class="cx">                 char *name = (char *) switch_xml_attr_soft(helper->xml_in_cur, "name");
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(name)) {
</del><ins>+                if (zstr(name)) {
</ins><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Ignoring xml-odbc-do because no name is given\n");
</span><span class="cx">                         goto done;
</span><span class="cx">                 }
</span><span class="lines">@@ -286,7 +286,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* just copy xml_in_cur to xml_out */
</span><del>-        if (switch_strlen_zero(helper->xml_out_cur->name)) {
</del><ins>+        if (zstr(helper->xml_out_cur->name)) {
</ins><span class="cx">                 helper->xml_out_cur->name = switch_core_strdup(helper->pool, helper->xml_in_cur->name);
</span><span class="cx">
</span><span class="cx">         } else if (!(helper->xml_out_cur = switch_xml_add_child_d(helper->xml_out_cur, helper->xml_in_cur->name, helper->xml_out_cur_off++))) {
</span><span class="lines">@@ -324,7 +324,7 @@
</span><span class="cx">                 /* restore helper->xml_out_cur in case it was changed during render_tag */
</span><span class="cx">                 helper->xml_out_cur = xml_out_cur_tmp;
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(helper->next_template_name)) goto done;
</del><ins>+                if (!zstr(helper->next_template_name)) goto done;
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         status = SWITCH_STATUS_SUCCESS;
</span><span class="lines">@@ -370,7 +370,7 @@
</span><span class="cx">         if ((helper->xml_in_cur = switch_xml_find_child(globals.templates_tag, "template", "name", helper->next_template_name))) {
</span><span class="cx">                 helper->next_template_name = "";
</span><span class="cx">                 status = xml_odbc_render_children(helper);
</span><del>-                if (!switch_strlen_zero(helper->next_template_name)) goto reset;
</del><ins>+                if (!zstr(helper->next_template_name)) goto reset;
</ins><span class="cx">         } else {
</span><span class="cx">                 helper->next_template_name = "not-found";
</span><span class="cx">                 goto reset;
</span><span class="lines">@@ -553,7 +553,7 @@
</span><span class="cx">                 var = (char *) switch_xml_attr_soft(param, "name");
</span><span class="cx">                 val = (char *) switch_xml_attr_soft(param, "value");
</span><span class="cx">
</span><del>-                if (!strcasecmp(var, "binding") && !switch_strlen_zero(val)) {
</del><ins>+                if (!strcasecmp(var, "binding") && !zstr(val)) {
</ins><span class="cx">                         if (!(binding = malloc(sizeof(*binding)))) {
</span><span class="cx">                                 goto done;
</span><span class="cx">                         }
</span><span class="lines">@@ -570,7 +570,7 @@
</span><span class="cx">                 /* change odbc-dsn to something like odbc-handle with name=default and dsn=a:b:c
</span><span class="cx">                  * so a linked list or something is created with multiple handles that can be
</span><span class="cx">                  * selected from xml-odbc-do name=query !!! that would be COOL !!! */
</span><del>-                } else if (!strcasecmp(var, "odbc-dsn") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "odbc-dsn") && !zstr(val)) {
</ins><span class="cx">                         globals.odbc_dsn = switch_core_strdup(globals.pool, val);
</span><span class="cx">                         if ((odbc_user = strchr(globals.odbc_dsn, ':'))) {
</span><span class="cx">                                 *odbc_user++ = '\0';
</span><span class="lines">@@ -578,13 +578,13 @@
</span><span class="cx">                                         *odbc_pass++ = '\0';
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><del>-                } else if (!strcasecmp(var, "debug") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "debug") && !zstr(val)) {
</ins><span class="cx">                         if (!strcasecmp(val, "true") || !strcasecmp(val, "on")) {
</span><span class="cx">                                 globals.debug = SWITCH_TRUE;
</span><span class="cx">                         } else {
</span><span class="cx">                                 globals.debug = SWITCH_FALSE;
</span><span class="cx">                         }
</span><del>-                } else if (!strcasecmp(var, "keep-files-around") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "keep-files-around") && !zstr(val)) {
</ins><span class="cx">                         if (!strcasecmp(val, "true") || !strcasecmp(val, "on")) {
</span><span class="cx">                                 globals.keep_files_around = SWITCH_TRUE;
</span><span class="cx">                         } else {
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribtrixterREADME"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/trixter/README (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/trixter/README        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/trixter/README        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -23,6 +23,13 @@
</span><span class="cx">
</span><span class="cx"> == FILE LIST ==
</span><span class="cx">
</span><ins>+scheduled_event.lua
+        LUA script that adds scheduler ability via a MySQL store.
+        Allows for many systems to process events to scale to enterprise capability
+        Events survive switch shutdown, restart, reboot, crash, etc
+        Simple DB schema which allows you to easily integrate into webapps
+
+
</ins><span class="cx"> apiexec.pl
</span><span class="cx">         Execute api commands from the console/cron/windows scheduler/etc
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorcontribtrixterscheduled_eventluafromrev15313freeswitchtrunkcontribtrixterscheduled_eventlua"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/trixter/scheduled_event.lua (from rev 15313, freeswitch/trunk/contrib/trixter/scheduled_event.lua) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/trixter/scheduled_event.lua         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/contrib/trixter/scheduled_event.lua        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,199 @@
</span><ins>+-- 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
+--
+-- Software distributed under the License is distributed on an "AS IS" basis
+-- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+-- for the specific language governing rights and limitations under the
+-- License
+--
+-- The Original Code is FreeSWITCH[tm] LUA event scheduler
+--
+-- The Initial Developer of the Original Code is
+-- Bret McDanel <bret AT 0xdecafbad dot com>
+--
+-- Portions created by the Initial Developer are Copyright (C) 2007
+-- the Initial Developer. All Rights Reserved
+--
+-- Contributor(s)
+--
+-- Why use this?
+-- No reason in particular, however if you use sched_api and shut down you lose your scheduled events, by
+-- placing them in a database you get the advantage of them being able to survive a shutdown/crash/reboot/etc
+-- Additionally this script is written in a way to allow for multiple switch boxes to access the same database
+-- and look for events to process, in this way you can scale this to a very large amount of actions
+--
+--
+-- Usage: in FreeSWITCH console or fs_cli,
+-- luarun scheduled_event.lua
+-- starts the script - this is not needed if its auto loaded
+-- luarun scheduled_event.lua <dbuser username> <dbhost hostname> <dbpass password> <dbname database_name>
+-- changes the DB info allowing you to do load management, maintenence, or other things
+-- luarun scheduled_event.lua stop
+-- stops the running script
+--
+-- in lua.conf.xml:
+--          <param name="startup-script" value="scheduled_event.lua"/>
+--        
+--
+-- You need to get "mysql.so" for lua and install it in <freeswitch install>/luasql/mysql.so
+-- (or some other place that is in the search path)
+--
+-- Minimal DB schema **AUTOMAGICALLY CREATED IF IT DOES NOT EXIST** (at script start)
+-- CREATE TABLE scheduler (
+-- acctid int(11) NOT NULL auto_increment,
+-- action varchar(1024) NOT NULL,
+-- timestamp timestamp NOT NULL,
+-- server varchar(64) NOT NULL DEFAULT '*',
+-- primary key (acctid)
+-- );
+--
+-- "actions" in the scheduler table should be api commands eg:
+-- insert into scheduler (action,timestamp) values ("pa call 1234",NOW())
+--
+--
+-- Every "heartbeat" events are pulled 1 at a time using write locks on mysql
+-- if your MySQL supports those locks, then only one process can access the DB at a time
+-- events are immediately deleted, and then processed to keep the lock time low
+-- failed events are NOT rescheduled
+-- many boxes can pull events and process them, however I did not attempt to process more
+-- events than time allows for in a given heartbeat interval, some backlog may exist which
+-- may cause this script to totally freak
+
+
+-- currently this script requires http://jira.freeswitch.org/browse/MODAPP-357
+
+ require "luasql.mysql"
+
+ -- Database setup
+ DATABASE = "database"
+ USERNAME = "dbuser"
+ PASSWORD = "het is geheim"
+ DBHOST = "localhost"
+ TABLENAME = "scheduler"
+
+ -- LOGGING
+ LOGLEVEL = "info"
+
+ -- PROGNAME
+ PROGNAME = "scheduled_event.lua"
+
+ function logger(message)
+ freeswitch.console_log(LOGLEVEL,"["..PROGNAME.."] "..message.."\n")
+ end
+
+
+ if argv[1] then
+ i=1
+ while argv[i] do
+         if argv[i] == "stop" then
+         local event = freeswitch.Event("custom", "lua::scheduled_event")
+         event:addHeader("Action", "stop")
+         event:fire()
+         logger("Sent stop message to lua script")
+         return
+         elseif (argv[i] == "dbuser") then
+         i=i+1
+         if argv[i] then
+         logger("Setting DB Username to "..argv[i])
+         USERNAME = argv[i]
+         else
+         logger("You must specify a username!")
+         end
+         elseif (argv[i] == "dbhost") then
+         i=i+1
+         if argv[i] then
+         logger("Setting DB Hostname to "..argv[i])
+         DBHOST = argv[i]
+         else
+         logger("You must specify a hostname!")
+         end
+         elseif (argv[i] == "dbpass") then
+         i=i+1
+         if argv[i] then
+         logger("Setting DB Password to "..argv[i])
+         PASSWORD = argv[i]
+         else
+         logger("You must specify a password!")
+         end
+         elseif (argv[i] == "dbname") then
+         i=i+1
+         if argv[i] then
+         logger("Setting DB to "..argv[i])
+         DATABASE = argv[i]
+         else
+         logger("You must specify a database name!")
+         end
+         end
+         i=i+1
+ end
+ return
+ end
+
+ --Main function starts here
+ logger("Starting")
+
+ -- ensure DB works, create table if it doesnt exist
+ env = assert (luasql.mysql())
+ dbcon = assert (env:connect(DATABASE,USERNAME,PASSWORD,DBHOST))
+ blah = assert(dbcon:execute("CREATE TABLE if not exists "..TABLENAME.." ("..
+                         "acctid int(11) NOT NULL auto_increment,"..
+                         "action varchar(1024) NOT NULL,"..
+                         "timestamp timestamp NOT NULL,"..
+                         "server varchar(64) NOT NULL DEFAULT '*',"..
+                         "primary key (acctid)"..
+                         ")"))
+ dbcon:close()
+ env:close()
+
+ local event_name
+ local event_subclass
+
+ con = freeswitch.EventConsumer("all") -- too lazy to figure out why "heartbeat CUSTOM lua::scheduled_event"
+ -- does not work properly, that is really all we need
+ api = freeswitch.API()
+
+ hostname = api:execute("hostname")
+
+ if blah ~= 0 then
+ logger("Unable to connect to DB or create the table, something is broken.")
+ else
+ for e in (function() return con:pop(1) end) do
+         event_name = e:getHeader("Event-Name") or ""
+         event_subclass = e:getHeader("Event-Subclass") or ""
+        
+         if(event_name == "HEARTBEAT") then
+         -- check the system load
+         load = api:execute("status")
+         cur_sessions,rate_sessions,max_rate,max_sessions = string.match(load,"(%d+) session.s. (%d+)/(%d+)\n(%d+) session.s. max")
+         if ((tonumber(cur_sessions) < tonumber(max_sessions)) and (tonumber(rate_sessions) < tonumber(max_rate))) then
+         env = assert (luasql.mysql())
+         dbcon = assert (env:connect(DATABASE,USERNAME,PASSWORD,DBHOST))
+         while true do
+                 assert (dbcon:execute("LOCK TABLE "..TABLENAME.." WRITE"))
+                 cur = assert (dbcon:execute("select * from "..TABLENAME.." where timestamp < NOW() and (server = '"..hostname.."' or server = '*') order by timestamp limit 1"))
+                 row = cur:fetch({},"a")
+                 if not row then
+                 break
+                 end
+                 assert(dbcon:execute("delete from "..TABLENAME.." where acctid = "..row.acctid));
+                 assert (dbcon:execute("UNLOCK TABLES"))
+                 apicmd,apiarg = string.match(row.action,"(%w+) (.*)")
+                 api:execute(apicmd,apiarg)
+         end -- while
+         dbcon:close()
+         env:close()
+         end -- rate limiting
+         else if (event_name == "CUSTOM" and event_subclass == "lua::scheduled_event") then
+         action = e:getHeader("Action") or ""
+         if (action == "stop") then
+                 logger("got stop message, Exiting")
+                 break
+         end
+         end -- not a custom message
+         end -- not a processable event
+ end -- foreach event
+ end -- main loop, DB connection established
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactordebiancontrol"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/control (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/control        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/control        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx"> Maintainer: Michal Bielicki <michal.bielicki@voiceworks.pl>
</span><span class="cx"> Section: net
</span><span class="cx"> Priority: extra
</span><del>-Build-Depends: debhelper (>= 5), fakeroot, wget, automake1.9, autoconf, libtool, unixodbc-dev, libasound2-dev, libcurl3-openssl-dev|libcurl4-openssl-dev, libssl-dev, ncurses-dev, libogg-dev, libvorbis-dev, libperl-dev, libgdbm-dev, libdb-dev, libgnutls-dev, libtiff4-dev, python, libmemcache-dev, memcached
</del><ins>+Build-Depends: debhelper (>= 5), fakeroot, wget, automake1.9, autoconf, libtool, unixodbc-dev, libasound2-dev, libcurl3-openssl-dev|libcurl4-openssl-dev, libssl-dev, ncurses-dev, libogg-dev, libvorbis-dev, libperl-dev, libgdbm-dev, libdb-dev, libgnutls-dev, libtiff4-dev, python, libmemcache-dev, memcached, libx11-dev
</ins><span class="cx"> Standards-Version: 3.7.3
</span><span class="cx">
</span><span class="cx"> Package: freeswitch
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx"> Architecture: any
</span><span class="cx"> Depends: ${shlibs:Depends}, ${misc:Depends}, freeswitch
</span><span class="cx"> Recommends: freeswitch-sounds-en-us-callie-8000
</span><del>-Suggests: freeswitch-sounds-en-us-callie-16000, freeswitch-sounds-en-us-callie-32000
</del><ins>+Suggests: freeswitch-sounds-en-us-callie-16000, freeswitch-sounds-en-us-callie-32000, freeswitch-sounds-en-us-callie-48000
</ins><span class="cx"> Description: English language files for the FreeSWITCH(TM)
</span><span class="cx"> FreeSWITCH is an open source telephony platform designed to facilitate the
</span><span class="cx"> creation of voice and chat driven products scaling from a soft-phone up to
</span><span class="lines">@@ -150,6 +150,16 @@
</span><span class="cx"> or a media server to host IVR applications using simple scripts or XML to
</span><span class="cx"> control the callflow.
</span><span class="cx">
</span><ins>+Package: freeswitch-sounds-en-us-callie-48000
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, freeswitch
+Description: English language files for the FreeSWITCH(TM) (48000)
+ FreeSWITCH is an open source telephony platform designed to facilitate the
+ creation of voice and chat driven products scaling from a soft-phone up to
+ a soft-switch. It can be used as a simple switching engine, a media gateway
+ or a media server to host IVR applications using simple scripts or XML to
+ control the callflow.
+
</ins><span class="cx"> Package: freeswitch-lang-de
</span><span class="cx"> Architecture: any
</span><span class="cx"> Depends: ${shlibs:Depends}, ${misc:Depends}, freeswitch
</span><span class="lines">@@ -199,3 +209,55 @@
</span><span class="cx"> a soft-switch. It can be used as a simple switching engine, a media gateway
</span><span class="cx"> or a media server to host IVR applications using simple scripts or XML to
</span><span class="cx"> control the callflow.
</span><ins>+
+Package: freeswitch-lang-ru
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, freeswitch
+Recommends: freeswitch-sounds-ru-ru-elena-8000
+Suggests: freeswitch-sounds-ru-ru-elena-16000, freeswitch-sounds-ru-ru-elena-32000, freeswitch-sounds-ru-ru-elena-48000
+Description: Russian language files for the FreeSWITCH(TM)
+ FreeSWITCH is an open source telephony platform designed to facilitate the
+ creation of voice and chat driven products scaling from a soft-phone up to
+ a soft-switch. It can be used as a simple switching engine, a media gateway
+ or a media server to host IVR applications using simple scripts or XML to
+ control the callflow.
+
+Package: freeswitch-sounds-ru-ru-elena-8000
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, freeswitch
+Description: Russian language files for the FreeSWITCH(TM)
+ FreeSWITCH is an open source telephony platform designed to facilitate the
+ creation of voice and chat driven products scaling from a soft-phone up to
+ a soft-switch. It can be used as a simple switching engine, a media gateway
+ or a media server to host IVR applications using simple scripts or XML to
+ control the callflow.
+
+Package: freeswitch-sounds-ru-ru-elena-16000
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, freeswitch
+Description: Russian language files for the FreeSWITCH(TM) (16000)
+ FreeSWITCH is an open source telephony platform designed to facilitate the
+ creation of voice and chat driven products scaling from a soft-phone up to
+ a soft-switch. It can be used as a simple switching engine, a media gateway
+ or a media server to host IVR applications using simple scripts or XML to
+ control the callflow.
+
+Package: freeswitch-sounds-ru-ru-elena-32000
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, freeswitch
+Description: Russian language files for the FreeSWITCH(TM) (32000)
+ FreeSWITCH is an open source telephony platform designed to facilitate the
+ creation of voice and chat driven products scaling from a soft-phone up to
+ a soft-switch. It can be used as a simple switching engine, a media gateway
+ or a media server to host IVR applications using simple scripts or XML to
+ control the callflow.
+
+Package: freeswitch-sounds-ru-ru-elena-48000
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, freeswitch
+Description: Russian language files for the FreeSWITCH(TM) (48000)
+ FreeSWITCH is an open source telephony platform designed to facilitate the
+ creation of voice and chat driven products scaling from a soft-phone up to
+ a soft-switch. It can be used as a simple switching engine, a media gateway
+ or a media server to host IVR applications using simple scripts or XML to
+ control the callflow.
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactordebianfreeswitchlangruconffilesfromrev15313freeswitchtrunkdebianfreeswitchlangruconffiles"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-lang-ru.conffiles (from rev 15313, freeswitch/trunk/debian/freeswitch-lang-ru.conffiles) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-lang-ru.conffiles         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-lang-ru.conffiles        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+/opt/freeswitch/conf/lang/ru/ru.xml
+/opt/freeswitch/conf/lang/ru/demo/demo.xml
+/opt/freeswitch/conf/lang/ru/vm/sounds.xml
+/opt/freeswitch/conf/lang/ru/vm/tts.xml
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactordebianfreeswitchlangruinstallfromrev15313freeswitchtrunkdebianfreeswitchlangruinstall"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-lang-ru.install (from rev 15313, freeswitch/trunk/debian/freeswitch-lang-ru.install) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-lang-ru.install         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-lang-ru.install        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+opt/freeswitch/conf/lang/ru/*.xml
+opt/freeswitch/conf/lang/ru/demo/*.xml
+opt/freeswitch/conf/lang/ru/vm/*.xml
+opt/freeswitch/mod/mod_say_ru.so*
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactordebianfreeswitchsoundsenuscallie48000installfromrev15313freeswitchtrunkdebianfreeswitchsoundsenuscallie48000install"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-en-us-callie-48000.install (from rev 15313, freeswitch/trunk/debian/freeswitch-sounds-en-us-callie-48000.install) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-en-us-callie-48000.install         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-en-us-callie-48000.install        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+opt/freeswitch/sounds/en/us/callie/*/48000/*
+
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactordebianfreeswitchsoundsruruelena16000installfromrev15313freeswitchtrunkdebianfreeswitchsoundsruruelena16000install"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-ru-ru-elena-16000.install (from rev 15313, freeswitch/trunk/debian/freeswitch-sounds-ru-ru-elena-16000.install) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-ru-ru-elena-16000.install         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-ru-ru-elena-16000.install        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+opt/freeswitch/sounds/ru/RU/elena/*/16000/*
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactordebianfreeswitchsoundsruruelena32000installfromrev15313freeswitchtrunkdebianfreeswitchsoundsruruelena32000install"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-ru-ru-elena-32000.install (from rev 15313, freeswitch/trunk/debian/freeswitch-sounds-ru-ru-elena-32000.install) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-ru-ru-elena-32000.install         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-ru-ru-elena-32000.install        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+opt/freeswitch/sounds/ru/RU/elena/*/32000/*
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactordebianfreeswitchsoundsruruelena48000installfromrev15313freeswitchtrunkdebianfreeswitchsoundsruruelena48000install"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-ru-ru-elena-48000.install (from rev 15313, freeswitch/trunk/debian/freeswitch-sounds-ru-ru-elena-48000.install) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-ru-ru-elena-48000.install         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-ru-ru-elena-48000.install        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+opt/freeswitch/sounds/ru/RU/elena/*/48000/*
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactordebianfreeswitchsoundsruruelena8000installfromrev15313freeswitchtrunkdebianfreeswitchsoundsruruelena8000install"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-ru-ru-elena-8000.install (from rev 15313, freeswitch/trunk/debian/freeswitch-sounds-ru-ru-elena-8000.install) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-ru-ru-elena-8000.install         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch-sounds-ru-ru-elena-8000.install        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+opt/freeswitch/sounds/ru/RU/elena/*/8000/*
+
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactordebianfreeswitchinstall"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch.install (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch.install        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/freeswitch.install        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -7,7 +7,6 @@
</span><span class="cx"> opt/freeswitch/bin/scripts/*
</span><span class="cx"> opt/freeswitch/lib/libfreeswitch*.so*
</span><span class="cx"> opt/freeswitch/lib/libopenzap*.so*
</span><del>-opt/freeswitch/mod/mod_amr*
</del><span class="cx"> opt/freeswitch/mod/mod_cidlookup*
</span><span class="cx"> opt/freeswitch/mod/mod_curl*
</span><span class="cx"> opt/freeswitch/mod/mod_easyroute*
</span><span class="lines">@@ -17,7 +16,6 @@
</span><span class="cx"> opt/freeswitch/mod/mod_skypiax*
</span><span class="cx"> opt/freeswitch/mod/mod_snom*
</span><span class="cx"> opt/freeswitch/mod/mod_spy*
</span><del>-opt/freeswitch/mod/mod_t38gateway*
</del><span class="cx"> opt/freeswitch/mod/mod_vmd*
</span><span class="cx"> opt/freeswitch/mod/mod_shout*
</span><span class="cx"> opt/freeswitch/mod/mod_cdr_csv.so*
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactordebianrules"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/rules (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/rules        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/debian/rules        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -15,7 +15,7 @@
</span><span class="cx">                          applications/mod_rss applications/mod_voicemail applications/mod_fsv \
</span><span class="cx">                          applications/mod_fax applications/mod_cidlookup applications/mod_curl applications/mod_easyroute \
</span><span class="cx">                          applications/mod_lcr applications/mod_memcache applications/mod_nibblebill applications/mod_snom \
</span><del>-                         applications/mod_spy applications/mod_t38gateway applications/mod_vmd
</del><ins>+                         applications/mod_spy applications/mod_vmd
</ins><span class="cx"> export ASR_TTS_MODULES=asr_tts/mod_tts_commandline
</span><span class="cx"> export CODECS_MODULES=codecs/mod_ilbc codecs/mod_h26x codecs/mod_speex codecs/mod_voipcodecs codecs/mod_siren codecs/mod_celt
</span><span class="cx"> export DIALPLANS_MODULES=dialplans/mod_dialplan_asterisk dialplans/mod_dialplan_directory dialplans/mod_dialplan_xml
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> export FORMATS_MODULES=formats/mod_local_stream formats/mod_native_file formats/mod_sndfile formats/mod_tone_stream formats/mod_shout
</span><span class="cx"> export LANGUAGES_MODULES=languages/mod_perl languages/mod_lua
</span><span class="cx"> export LOGGERS_MODULES=loggers/mod_console loggers/mod_logfile loggers/mod_syslog
</span><del>-export SAY_MODULES=say/mod_say_en say/mod_say_it say/mod_say_de say/mod_say_fr say/mod_say_es say/mod_say_nl
</del><ins>+export SAY_MODULES=say/mod_say_en say/mod_say_it say/mod_say_de say/mod_say_fr say/mod_say_es say/mod_say_nl say/mod_say_ru
</ins><span class="cx"> export TIMERS_MODULES=
</span><span class="cx"> export DISABLED_MODULES=applications/mod_soundtouch directories/mod_ldap languages/mod_java languages/mod_python \
</span><span class="cx">                         languages/mod_spidermonkey_skel ast_tts/mod_cepstral asr_tts/mod_lumenvox endpoints/mod_wanpipe \
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx">         dh_clean -k
</span><span class="cx">         dh_installdirs -A --sourcedir=debian/tmp
</span><span class="cx">
</span><del>-        $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install uhd-sounds-install moh-install
</del><ins>+        $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install cd-sounds-install cd-sounds-ru-install moh-install
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> # Build architecture-independent files here.
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactordocsChangeLog"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/docs/ChangeLog (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/docs/ChangeLog        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/docs/ChangeLog        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -1,9 +1,20 @@
</span><span class="cx"> freeswitch (1.0.5)
</span><span class="cx">
</span><ins>+        applications: add inline dp to multiple apps (MODAPP-337/r:14922)
</ins><span class="cx">         build: Fix build to account for FreeBSD sed issues (FSBUILD-184/r:14479)
</span><span class="cx">         build: build unimrcp after sofia (r:14507)
</span><span class="cx">         build: Fix mod_ldap not building on Linux (FSBUILD-189/r:14725)
</span><span class="cx">         build: add --with-rundir configure param and -run freeswitch runtime param to adjust the location of the pid file (FSBUILD-188/r:14768)
</span><ins>+        build: fix compile on Ubuntu 8.10 (FSCORE-443/r:14928)
+        build: add mod_cidlookup (r:14930)
+        build: fix libtiff build (r:15034)
+        build: CMAKE_MINIMUM_REQUIRED is called too late. (FSBUILD-192/r:15050)
+        build: remove broken modules from debian build (FSBUILD-193/r:15068)
+        build: fix Build-Depends on debian build for skypiax (FSBUILD-197/r:15113)
+        build: Debian build misses some packages (FSBUILD-201/r:15216)
+        config: improvements to French language handling (MODASRTTS-20/r:14911)
+        config: Add valet_parking to default config (r:15124)
+        config: Add valet macros (r:15156)
</ins><span class="cx">         core: Add per-call logging (r:14509)
</span><span class="cx">         core: Fix IVR menu timeout when caller presses no digits (DP-4/r:14548)
</span><span class="cx">         core: refactor node allocation and make a copy of userdata in case the session gets killed before the logger module gets the node (r:14555)
</span><span class="lines">@@ -26,28 +37,149 @@
</span><span class="cx">         core: CoreSession::originate: set the uuid on success (r:14773)
</span><span class="cx">         core: add optional prefix arg to set_user (FSCORE-429/r:14789)
</span><span class="cx">         core: try to improve autoflush and other silly audio glitches from edge cases and help (FSCORE-416/r:14800)
</span><ins>+        core: fix Windows mem leak (FSCORE-440/r:14882)
+        core: tolerate offset dtmf payload (zoiper) (r:14883)
+        core: Add the ability to seperate the spool and the storage directories for voicemail (BOUNTY-9/r:14889)
+        core: Add min_dtmf_duration setting to FS core and modified default_dtmf_duration in rfc2833 queing function to not be used as min (FSCORE-442/r:14893)
+        core: Remove crash protection (r:14919)
+        core: Move switch_util_quote_shell_arg to core functions (FSCORE-446:/r:14958)
+        core: add preprocess framework for agc ec etc, ALPHA, needs work (r:14960)
+        core: add i flag to bind_meta_app to do inline execute of the app (not wise to use unless app returns instantly) (r:14969)
+        core: fix using native_file as ringback on codecs that have passthru only (r:14980)
+        core: pita bypass media transfer fiasco fix (r:14983)
+        core: don't enforce existing file check on streams (r:15014)
+        core: re-INVITEs sent only after ~2 seconds (FSCORE-453/r:15021)
+        core: changing default behaviour ignore_early_media=true must be set together with ringback to generate local ringback on early media (r:15025)
+        core: improve behavior of leg_delay_start, leg_timeout, leg_progress_timeout (FSCORE-439/r:15027)
+        core: Fix spinning threads that receive 183 on bridge/originate with bypass_media set (FSCORE-452/r:15028)
+        core: Check handling of SIGINT (FSCORE-456/r:15051)
+        core: add bridge_answer_timeout variable, a timeout in seconds how long to tolerate a bridge that is in early media without being answered (can be set on either leg) (r:15057)
+        core: Enable auto update displays in more places (r:15110)
+        core: fix file handle mem leak (thanks pressuerman) (r:15114)
+        core: add CALL_UPDATE event (r:15119)
+        core: move accidental new behaviour behind new param originate_continue_on_timeout=true (r:15121)
+        core: fix att xfer to an app (r:15122)
+        core: Fix CODEC event has duplicate codec name and rate in lowercase (MODEVENT-59/r:15123)
+        core: add missing comma that causes buffer overflow in event socket (r:15128)
+        core: expand range of acceptable chars (MODENDP-249/r:15129)
+        core: Add 48k 30ms and 40ms codecs (r:15135)
+        core: Fix playback cannot play stereo .wav files (FSCORE-463/r:15139)
+        core: refactor some of the message parsing code to use fifo to reduce threading contention (r:15142)
+        core: send update after both sides are answered (r:15149)
+        core: fix playback_ms and record_ms to work right and add playback_seconds and record_seconds (r:15155)
+        core: delay update till after media has been confirmed to prevent SOA race in sip (r:15159)
+        core: fix arg parsing on restart to not accumulate args (r:15164)
+        core: add new macro to make sure we don't send bypass command too soon (r:15165)
+        core: Fix shutdown not working on Windows with fs_cli (FSCORE-435/r:15167)
+        core: Fix inbound calls with incompatible codecs can result in heap corruption and crash (FSCORE-467/r:15178)
+        core: prevent unsolicted ring_ready (r:15179)
+        core: make switch_core_sqldb_stop non-blocking (FSCORE-470/r:15183)
+        core: add SWITCH_MESSAGE_INDICATE_UUID_CHANGE to warn a session when the uuid has changed (r:15193)
+        core: Handle bypass_media_after_bridge with loopback (FSCORE-418/r:15195)
+        core: hangup_after_bridge=false only works if bypass_media=false (FSCORE-417/r:15196)
+        core: add api_on_answer var (r:15207)
+        core: Fix thread runaway in switch_console_loop for Windows (FSCORE-472/r:15209)
+        core: change switch_strlen_zero to zstr (r:15211)
+        core: add ignore_display_updates variable to block display updates on that leg (r:15218)
+        core: refactor how record_answer_req=true works, add media_bug_answer_req=true variable and backport record_answer_req=true to use it (IRQ-00/r:15235)
+        core: don't consider cng packets for rtp auto-adjust (r:15240)
+        core: add RECORD_READ_ONLY and RECORD_WRITE_ONLY chan vars to influence session_record (r:15257)
+        core: answer channel on record to ensure media (r:15265)
+        core: refactor ringback so it does not start early_media until it has to (r:15266)
+        core: add record_min_sec chan var (r:15271)
+        docs: Add large Doxygen update (thanks Muhammed Shahzad) (r:14973)
</ins><span class="cx">         embedded_languages: Prevent unloading of embedded languages modules (also fixes MODLANG-121/r:14491)
</span><ins>+        embedded_languages: add session.hangupCause() (r:14912)
+        embedded_languages: add session.getState() (r:14924)
+        embedded_languages: Fix caller_profile old code forcing empty caller ID (FSCORE-450/r:15006)
</ins><span class="cx">         libdingaling: patch libdingaling to use next_tag instead of child (r:14624)
</span><span class="cx">         libesl: automatically load ESL.so in PHP (r:14707)
</span><del>-        libesl: fix php swig generation (ESL-20/r:14750)
</del><ins>+        libesl: fix php swig generation (ESL-20/r:14750)
+        libesl: disable duplicate headers on request param events (r:14909)
+        libesl: c# wrapper for esl lib (r:14955)
+        libspandsp: update to spandsp snapshot 20091005 (r:15084)
+        libspandsp: update to spandsp-20091006 snapshot (r:15093)
+        libstfu: add resize function (r:14871)
+        mod_alsa: update to new module api (r:14833)
+        mod_cdr_csv: try to rotate on failed write to cdr file (r:14948)
+        mod_celt: bring CELT up to the latest build we need more testers (r:15278)
+        mod_cid_lookup: Fix segfault on no DSN (MODAPP-346/r:15019)
+        mod_cidlookup: add whitepages.com support (r:15023)
+        mod_cidlookup: add channel var / debug log for cidlookup src (r:15268)
</ins><span class="cx">         mod_commands: add host_lookup api call (r:14667)
</span><span class="cx">         mod_commands: add uuid_exists api call (r:14668)
</span><span class="cx">         mod_commands: add non-destructive regex substitution (MODAPP-319/r:14727)
</span><span class="cx">         mod_commands: add bg_system (like system but in the bg) (r:14746)
</span><span class="cx">         mod_commands: add optional trailing & to sched_api to denote running the task in a sep thread (r:14765)
</span><ins>+        mod_commands: fix segfault (r:14961)
+        mod_commands: Updating tab completion for show cli command (FSCORE-468/r:15180)
+        mod_commands: add api hostname (r:15225)
+        mod_commands: add uuid_debug_audio <uuid> <read|write|both> <on|off> (r:15274)
</ins><span class="cx">         mod_conference: Fix conference floor ownership being ceded too easily (MODAPP-323/r:14703)
</span><ins>+        mod_conference: Display callers' rates (r:14992)
+        mod_conference: Don't start conf auto record until a second party arrives (MODAPP-348/r:15029)
+        mod_conference: wait-mod doesn't loop moh-sound audio file (MODAPP-349/r:15171)
+        mod_conference: Return additional flags in xml_list (MODAPP-360/r:15275)
+        mod_console: Improved tab completions, and more description usage informations (LOGGER-2/r:15103)
+        mod_dialplan_xml: Fix anti-action not being supported for time-based conditions (DP-6/r:14901)
+        mod_dialplan_xml: add inline=true to actions to exec certian apps right away (also mod_dptools) (r:14906)
+        mod_dialplan_xml: Fix condition "week of year" calculation (DP-7/r:14968)
</ins><span class="cx">         mod_dingaling: fix segfault on unload (MODENDP-243/r:14588)
</span><ins>+        mod_dingaling: Fix mod_dingaling does not reads profile information from configuration file at runtime till whole module is reloaded (LBDING-15/r:14917)
+        mod_directory: initial commit of real code (MODAPP-325/r:14981)
+        mod_directory: fix segfault on failure (r:15076)
</ins><span class="cx">         mod_dptools: add optional level argument to info app to choose the log level it logs on (r:14643)
</span><span class="cx">         mod_dptools: jump to a specific offset with the playback by appending @@<samples> to the path (r:14752)
</span><ins>+        mod_dptools: make continue_on_fail trigger explicit matching and only do default behaviour when it's not set (r:14972)
+        mod_dptools: att_xfer sometimes doesn't detect B leg hanging up on PSTN - this is a patch to hangup B and initiate the transfer of A to C by pressing * (DP-8/r:15013)
+        mod_dptools: Add Campon feature. (r:15201)
+        mod_dptools: Add campon_stop_key and campon_announce_sound to tell the user how to force it to the end of the waiting period (r:15220)
+        mod_erlang_event: Add support for simply sending an arbitrary message to an arbitrary registered process at a node (r:14875)
+        mod_erlang_event: Deprecate new_pid message in favor of get_pid which has an extra element, the call's UUID (r:14877)
+        mod_erlang_event: optionally allow compatability with nodes running older OTP releases (R7 through current) (r:15189)
+        mod_esf: Add ability to adjust multicast packet TTL with the config (MODAPP-338/r:14927)
+        mod_esf: fix compile error on windows (r:14934)
+        mod_event_socket: add unique-id check to sendevent to send and event to a session instead of the system (r:14874)
+        mod_event_socket: fix mem leak (MODEVENT-54/r:14891)
+        mod_event_socket: fix CHANNEL_HANGUP_COMPLETE missing under myevents (MODEVENT-56/r:15011)
</ins><span class="cx">         mod_fifo: fix mod_fifo not honoring member_timeout (MODAPP-322/r:14552)
</span><ins>+        mod_fifo: add fifo_position var (r:14806)
+        mod_fifo: add API: fifo_add_outbound to add outbound members to a FIFO (r:14809)
+        mod_fifo: allow to call outbound member on on-the-fly fifo, also add a settings params to delete or keep all dynamic fifo entry (MODAPP-332/r:14989)
+        mod_fifo: skip setting callerid when it's already set (r:15071)
+        mod_h323: initial commit (r:15223)
+        mod_fifo: gracefully fail on missing config file (r:15106)
+        mod_iax: avoiding buffer overflow in silly iax lib (r:14910)
</ins><span class="cx">         mod_lcr: fix possible null string passed to switch_log_printf (r:14514)
</span><ins>+        mod_lcr: Add support for user_rates which are the (optional) end-user rates (MODAPP-340/r:15022)
</ins><span class="cx">         mod_limit: set more chan vars in limit_function (r:14733)
</span><del>-        mod_lua: add conjure-session code and make session available in api commands (r:14739)
</del><ins>+        mod_limit: fix counter-only mode in limit_hash_execute (r:14829)
+        mod_limit: add limit_ignore_transfer var (MODAPP-334/r:14830)
+        mod_limit: add limit_execute (like limit_hash_execute); allow -#s to act as counter only; add INFO level logs to limit similar to limit_hash (r:14870)
+        mod_limit: make limit work with neg count like limit_hash (r:14920)
+        mod_local_stream: add chime-list to local_stream (r:14966)
+        mod_lua: add conjure-session code and make session available in API commands (r:14739)
</ins><span class="cx">         mod_lua: make luarun use a new pool every call (r:14763)
</span><ins>+        mod_lua: fix seek function (MODLANG-124/r:14812)
+        mod_managed: Add utility function to create SWIGTYPE_p objects (r:14923)
+        mod_managed: Add ProgressMediaTime to ChannelVariables (r:15001)
+        mod_memcache: update to libmemcached 0.32 (r:14935)
+        mod_memcache: add --with-memcached=no to libmemcached configure (r:14938)
+        mod_opal: Added setting of outgoing number and display name from extension number so H.323/Q.931 fields are set correctly in ALERTING and CONNECT messages sent for incoming calls.(r:14900)
</ins><span class="cx">         mod_portaudio: fix compilation failure in mod_portaudio_stream (MODFORM-35/r:14531)
</span><span class="cx">         mod_portaudio: add context param (r:14737)
</span><ins>+        mod_python: Fix segfault on multiple calls to Python (MODLANG-133/r:14847)
+        mod_python: Fix infinite recursion in python script causing crash (MODLANG-134/r:14898)
+        mod_radius_cdr: Fix Framed-IP-Address in start and stop having wrong IP (MODEVENT-52/r:15197)
+        mod_radius_cdr: Fix memory leak from large CPS test (MODEVENT-55/r:15198)
+        mod_skel_codec: Add (thanks Moy) (MODCODEC-14/r:14959)
</ins><span class="cx">         mod_skypiax: ubermegapatch, more stability, robustness, scalability. Memory leaks not yet investigated, we'll do next (r:14517)
</span><span class="cx">         mod_skypiax: more stability, no dangling channels, MODSKYPIAX-42, added 'sk list' statistics (thanks Seven Du) MODENDP-236 (r:14533)
</span><ins>+        mod_skypiax: now it accepts a max of 1 call from the same skypename to the same skypename (multiple instances of user A calling multiple instances of user B) each 1.5 seconds (r:14834)
+        mod_skypiax: fires a custom event when an incoming CHATMESSAGE arrives. (r:14845)
+        mod_skypiax: added skypiax_chat command.(r:14857)
+        mod_skypiax: now outbound chatmessages follow the standard path, you can send them with: chat,<proto>|<from>|<to>|<message> or with: skypiax_chat,<interfacename> <to> <text>. (r:14884)
+        mod_snipe_hunt: add mod_snipe_hunt to tree (r:14937)
</ins><span class="cx">         mod_sofia: allow custom SIP X-headers in 180/183/200 messages (MODSOFIA-20/r:14482)
</span><span class="cx">         mod_sofia: use switch_mprintf to securely parse the user parameters for the SQL query for reboot in mod_sofia (MODENDP-233/r:14484)
</span><span class="cx">         mod_sofia: display the profile name on sofia status gateway xxx (r:14520)
</span><span class="lines">@@ -60,9 +192,63 @@
</span><span class="cx">         mod_sofia: add 10 second media timeout waiting for codec establishment (MODSOFIA-22/r:14586)
</span><span class="cx">         mod_sofia: Enable creation of sip compact headers from sofia profile configuration (MODENDP-246/r:14698)
</span><span class="cx">         mod_sofia: Fix race with hold/unhold in proxy media (FSCORE-432/r:14797)
</span><ins>+        mod_sofia: ATTENTION BEHAVIOR CHANGE... you now have to explicitly set sip_invite_to_params to add params to the to field we will NO longer fall back to sip_invite_params in this case. (FSCORE-433/r:14849)
+        mod_sofia: Fix missing NOTIFY MWI when registering via proxy (MODSOFIA-26/r:14851)
+        mod_sofia: add set funcs for impls (r:14881)
+        mod_sofia: Segfault when receiving 30x response without contact header (MODENDP-247/r:14953)
+        mod_sofia: Added sip_rh_ response header addition capability (MODSOFIA-29/r:14967)
+        mod_sofia: new param force-subscription-domain (r:14971)
+        mod_sofia: improve bad timestamp detection (r:14979)
+        mod_sofia: Override the MWI User@Domain used per user/group/domain (MODENDP-241/r:14987)
+        mod_sofia: set extension=auto_to_user in gateway to make destination equal to user (r:15010)
+        mod_sofia: cover up sofia bug parsing contact strings that do not have <> in them (r:15026)
+        mod_sofia: no more 202 Accepted after REFER since changeset 14701 (MODSOFIA-31/r:15056)
+        mod_sofia: append host when its not supplied on carrot dialing (r:15099)
+        mod_sofia: Fix MESSAGE_QUERY causes event without minimum event information (MODEVENT-58/r:15117)
+        mod_sofia: Add a log message when the invite has no SDP and 3pcc isn't enabled to aid troubleshooting (r:15140)
+        mod_sofia: add variable for one legged 302's via originate so you can tell it happened. (r:15163)
+        mod_sofia: clear up some more display issues and fix resume-media-on-hold sofia option (r:15177)
+        mod_sofia: Fix bridge call seems to hangup as if originator_cancelled when it has not (FSCORE-471/r:15186)
+        mod_sofia: fix issue with resume-media-on-hold and t38 re-invites (r:15187)
+        mod_sofia: Fix RTP destination port is not updated (SFSIP-180/r:15190)
+        mod_sofia: add sip-force-extension (r:15191)
+        mod_sofia: add firing of event after processing re-INVITE (MODENDP-253/r:15205)
+        mod_sofia: record path and template are two values with backwards compatibility tried (r:15208)
+        mod_sofia: make sure dest is not blank for rare edge case (r:15212)
+        mod_sofia: Fix seg where INVITE w/o SDP + FS 3pcc-proxy + B leg has early media (MODSOFIA-33/r:15214)
+        mod_sofia: sql-in-transactions profile param (only vaid on first load) whether or not to bundle sql stmts in transactions (r:15217)
+        mod_sofia: add pass-callee-id (defaults to true) disable by setting it to false if you encounter something too stupid to ignore X headers (r:15230)
+        mod_sofia: overcome ack via in nat (r:15277)
+        mod_syslog: Enable mod_syslog to log to a specific facility (LOGGER-3/r:15162)
+        mod_tts_commandline: Add new module (r:14827)
+        mod_tts_commandline: introduce the rate parameter, decrease useless verbosity (r:14885)
+        mod_tts_commandline: cut samples in half (suggested by anthm), ajust and clean log levels (r:14886)
+        mod_tts_commandline: add config (r:14887)
+        mod_tts_commandline: quote shell args, create an unique tempfile (r:14931)
+        mod_tts_commandline: improve, update config file (MODASRTTS-21/r:14932)
+        mod_unimrcp: add support for file://, <speak, and <grammar (r:15236)
+        mod_valet_parking: add (r:15072)
+        mod_valet_parking: sense att xfer in valet (r:15126)
+        mod_valet_parking: add events and valet_info fsapi to valet parking (r:15136)
+        mod_valet_parking: add auto ext type and support for being called from bind_meta_app to valet_parking (needs some more) (r:15145)
+        mod_valet_parking: add sleep to inline dp to make xfer to valet wait a second (r:15168)
+        mod_valet_parking: enforce arg checking (r:15176)
+        mod_valet_parking: Add mod_valet_parking to the windows build (r:15185)
+        mod_vmd: fix glaring rwdeadlock in mod_vmd (r:14994)
</ins><span class="cx">         mod_voicemail: fix operator-ext/operator-extension duplicate config declaration (r:14498)
</span><span class="cx">         mod_voicemail: allow profile to be specified sep from domain user@domain.com@myprofile (r:14756)
</span><ins>+        mod_voicemail: announce number of saved messages when there are no new messages (r:14964)
+        mod_voicemail: Add new api call to get user mailbox settings (MODAPP-325/r:14982)
+        mod_voicemail: Add ability to skip greeting and instructions when leaving voicemail (MODAPP-331/r:14990)
+        mod_voicemail: Fix VM disk quota (MODAPP-353/r:15161)
+        mod_voipcodecs: move mod_voipcodecs to use spandsp instead of libvoipcodecs (windows build to follow) (r:15036)
+        mod_voicemail: add missing switch_event_destroy in profile config function (r:15262)
+        mod_voipcodecs: move mod_voipcodecs to use spandsp instead of libvoipcodecs - windows (r:15088)
+        mod_xml_curl: Fix crash when using use-dynamic-url (XML-10/r:14850)
+        mod_xml_curl: Allow choice between HTTP Basic and Digest authentication (r:15107)
</ins><span class="cx">         mod_xml_rpc: Fix auth issue (XMLINT-54/r:14580)
</span><ins>+        phrases: Add Recursive phrases support (FSCORE-458/r:15101)
+        support: add fscore_pb script for dumping core info directly to pastebin (r:14904)
</ins><span class="cx">         switch_utils: add a host lookup func (r:14653)
</span><span class="cx">         
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactordocsphrasephrase_enxml"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/docs/phrase/phrase_en.xml (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/docs/phrase/phrase_en.xml        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/docs/phrase/phrase_en.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -219,6 +219,25 @@
</span><span class="cx"> <prompt phrase="urgent" filename="vm-urgent.wav"/>
</span><span class="cx"> <prompt phrase="That mailbox is full. Please try your call again later." filename="vm-mailbox_full.wav"/>
</span><span class="cx"> </voicemail>
</span><ins>+ <directory>
+         <prompt phrase="Please enter the first few letters of the persons" filename="dir-enter-person.wav"/>
+         <prompt phrase="last name." filename="dir-last_name.wav"/>
+         <prompt phrase="To search by" filename="dir-to_search_by.wav"/>
+         <prompt phrase="first name." filename="dir-first_name.wav"/>
+         <prompt phrase="Your search matched no results, try again." filename="dir-no_match_entry.wav"/>
+         <prompt phrase="results matched your search." filename="dir-result_match.wav"/>
+         <prompt phrase="Your search returned too many results, please try again." filename="dir-to_many_result.wav"/>
+         <prompt phrase="No more results." filename="dir-no_more_result.wav"/>
+         <prompt phrase="Result number." filename="dir-result_number.wav"/>
+         <prompt phrase="at extension" filename="dir-at_extension.wav"/>
+         <prompt phrase="To select this entry" filename="dir-to_select_entry.wav"/>
+         <prompt phrase="For the next entry" filename="dir-for_next.wav"/>
+         <prompt phrase="For the previous entry" filename="dir-for_prev.wav"/>
+         <prompt phrase="To start a new search" filename="dir-to_make_new_search.wav"/>
+         <prompt phrase="You need to specify a minimum of" filename="dir-specify_mininum_first.wav"/>
+         <prompt phrase="letters of the person name, try again." filename="dir-letters_of_person_name.wav"/>
+         <prompt phrase="press" filename="dir-press.wav"/>
+ </directory>
</ins><span class="cx"> <conference>
</span><span class="cx"> <prompt phrase="NULL" filename="conf-ack.wav" type="tone"/>
</span><span class="cx"> <prompt phrase="NULL" filename="conf-nack.wav" type="tone"/>
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactordocsphrasephrase_frxml"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/docs/phrase/phrase_fr.xml (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/docs/phrase/phrase_fr.xml        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/docs/phrase/phrase_fr.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -218,7 +218,26 @@
</span><span class="cx"> <prompt phrase="pour répondre à cet appel tout de suite" filename="vm-return_call.wav"/>
</span><span class="cx"> <prompt phrase="urgent" filename="vm-urgent.wav"/>
</span><span class="cx"> </voicemail>
</span><del>- <conference>
</del><ins>+        <directory>
+                <prompt phrase="Veuillez entrer les premiere lettre du" filename="dir-enter-person.wav"/>
+                <prompt phrase="nom de famille." filename="dir-last_name.wav"/>
+                <prompt phrase="Pour chercher par" filename="dir-to_search_by.wav"/>
+                <prompt phrase="prénom." filename="dir-first_name.wav"/>
+                <prompt phrase="Votre recherche a retourner aucune résultat, essayer de nouveaux." filename="dir-no_match_entry.wav"/>
+                <prompt phrase="résultats correspond a votre recherche." filename="dir-result_match.wav"/>
+                <prompt phrase="Votre recherche retourne trop de résultat, essayer de nouveaux." filename="dir-to_many_result.wav"/>
+                <prompt phrase="Fin des résultats." filename="dir-no_more_result.wav"/>
+                <prompt phrase="Résultat numéro" filename="dir-result_number.wav"/>
+                <prompt phrase="aux poste" filename="dir-at_extension.wav"/>
+                <prompt phrase="Pour selectionner ce nom" filename="dir-to_select_entry.wav"/>
+                <prompt phrase="Pour le nom suivant" filename="dir-for_next.wav"/>
+                <prompt phrase="Pour le nom précédent" filename="dir-for_prev.wav"/>
+                <prompt phrase="Pour faire une nouvelle recherche" filename="dir-to_make_new_search.wav"/>
+                <prompt phrase="Vous devez entré au minimum" filename="dir-specify_mininum_first.wav"/>
+                <prompt phrase="lettre du nom de la personne, essayer de nouveaux." filename="dir-letters_of_person_name.wav"/>
+                <prompt phrase="Appuyez" filename="dir-press.wav"/>
+        </directory>
+        <conference>
</ins><span class="cx"> <prompt phrase="NULL" filename="conf-ack.wav" type="tone"/>
</span><span class="cx"> <prompt phrase="NULL" filename="conf-nack.wav" type="tone"/>
</span><span class="cx"> <prompt phrase="Personne ne peut vous entendre." filename="conf-mute.wav"/>
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorfreeswitchspec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/freeswitch.spec (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/freeswitch.spec        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/freeswitch.spec        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -314,7 +314,7 @@
</span><span class="cx">
</span><span class="cx"> PASSTHRU_CODEC_MODULES="codecs/mod_g729 codecs/mod_g723_1 codecs/mod_amr codecs/mod_amrwb"
</span><span class="cx"> SPIDERMONKEY_MODULES="languages/mod_spidermonkey languages/mod_spidermonkey_curl languages/mod_spidermonkey_core_db languages/mod_spidermonkey_odbc languages/mod_spidermonkey_socket languages/mod_spidermonkey_teletone"
</span><del>-APPLICATIONS_MODULES="applications/mod_commands applications/mod_conference applications/mod_dptools applications/mod_enum applications/mod_esf applications/mod_expr applications/mod_fifo applications/mod_limit applications/mod_rss applications/mod_voicemail applications/mod_fsv applications/mod_lcr applications/mod_easyroute applications/mod_stress applications/mod_vmd applications/mod_limit applications/mod_soundtouch applications/mod_fax"
</del><ins>+APPLICATIONS_MODULES="applications/mod_commands applications/mod_conference applications/mod_dptools applications/mod_enum applications/mod_esf applications/mod_expr applications/mod_fifo applications/mod_limit applications/mod_rss applications/mod_voicemail applications/mod_directory applications/mod_fsv applications/mod_lcr applications/mod_easyroute applications/mod_stress applications/mod_vmd applications/mod_limit applications/mod_soundtouch applications/mod_fax"
</ins><span class="cx"> CODECS_MODULES="codecs/mod_ilbc codecs/mod_h26x codecs/mod_voipcodecs codecs/mod_speex codecs/mod_celt codecs/mod_siren"
</span><span class="cx"> DIALPLANS_MODULES="dialplans/mod_dialplan_asterisk dialplans/mod_dialplan_directory dialplans/mod_dialplan_xml"
</span><span class="cx"> DIRECTORIES_MODULES=""
</span><span class="lines">@@ -541,6 +541,7 @@
</span><span class="cx"> %{prefix}/mod/mod_limit.so*
</span><span class="cx"> %{prefix}/mod/mod_rss.so*
</span><span class="cx"> %{prefix}/mod/mod_voicemail.so*
</span><ins>+%{prefix}/mod/mod_directory.so*
</ins><span class="cx"> %{prefix}/mod/mod_pocketsphinx.so*
</span><span class="cx"> %{prefix}/mod/mod_flite.so*
</span><span class="cx"> %{prefix}/mod/mod_ilbc.so*
</span><span class="lines">@@ -592,7 +593,7 @@
</span><span class="cx"> %{prefix}/mod/ozmod_analog_em.so*
</span><span class="cx"> %{prefix}/mod/ozmod_isdn.so*
</span><span class="cx"> %{prefix}/mod/ozmod_skel.*
</span><del>-%{prefix}/mod/ozmod_ss7_boost.so*
</del><ins>+%{prefix}/mod/ozmod_sangoma_boost.so*
</ins><span class="cx"> %{prefix}/mod/ozmod_zt.so*
</span><span class="cx">
</span><span class="cx"> %files codec-passthru-amrwb
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibseslphpMakefile"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/esl/php/Makefile (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/esl/php/Makefile        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/esl/php/Makefile        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -26,5 +26,5 @@
</span><span class="cx">
</span><span class="cx"> install: ESL.so
</span><span class="cx">         cp ESL.so $(shell php-config --extension-dir)
</span><del>-        cp ESL.php $(shell php -r 'phpinfo();' | grep include_path | cut -d: -f2)
</del><ins>+        cp ESL.php $(shell php -r 'echo ini_get("include_path");' | cut -d: -f2)
</ins><span class="cx">         echo 'extension=ESL.so' > $(shell php-config --configure-options | tr " " "\n" | grep -- --with-config-file-scan-dir | cut -f2 -d=)/esl.ini
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibseslsrcesl_eventc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/esl/src/esl_event.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/esl/src/esl_event.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/esl/src/esl_event.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -128,6 +128,7 @@
</span><span class="cx">         "NAT",
</span><span class="cx">         "RECORD_START",
</span><span class="cx">         "RECORD_STOP",
</span><ins>+        "CALL_UPDATE",
</ins><span class="cx">         "ALL"
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibseslsrcincludeesl_eventh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/esl/src/include/esl_event.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/esl/src/include/esl_event.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/esl/src/include/esl_event.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -116,6 +116,7 @@
</span><span class="cx">         ESL_EVENT_NAT,
</span><span class="cx">         ESL_EVENT_RECORD_START,
</span><span class="cx">         ESL_EVENT_RECORD_STOP,
</span><ins>+        ESL_EVENT_CALL_UPDATE,
</ins><span class="cx">         ESL_EVENT_ALL
</span><span class="cx"> } esl_event_types_t;
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibssofiasiplibsofiasipuanuanua_sessionc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -943,14 +943,19 @@
</span><span class="cx"> SU_DEBUG_5(("nua(%p): %s: %s %s in %u %s\n", \
</span><span class="cx">          (void *)nh, cr->cr_method_name, (m), received, status, phrase))
</span><span class="cx">
</span><ins>+ retry:
+
</ins><span class="cx"> if (!ss || !sip || 300 <= status)
</span><span class="cx"> /* Xyzzy */;
</span><span class="cx"> else if (!session_get_description(sip, &sdp, &len))
</span><span class="cx"> /* No SDP */;
</span><span class="cx"> else if (cr->cr_answer_recv) {
</span><span class="cx"> /* Ignore spurious answers after completing O/A */
</span><del>- LOG3("ignoring duplicate");
- sdp = NULL;
</del><ins>+         //LOG3("ignoring duplicate");
+         //sdp = NULL;
+         // we need to make sure its *actually* a dup, so we can't assume for now.
+         cr->cr_answer_recv = 0;
+         goto retry;
</ins><span class="cx"> }
</span><span class="cx"> else if (cr->cr_offer_sent) {
</span><span class="cx"> /* case 1: answer to our offer */
</span><span class="lines">@@ -3490,8 +3495,9 @@
</span><span class="cx">         if ((overlap = sr0->sr_offer_recv && !sr0->sr_answer_sent))
</span><span class="cx">          break;
</span><span class="cx">
</span><del>- if (nh->nh_soa && overlap)
- return nua_server_retry_after(sr, 500, "Overlapping Offer/Answer", 1, 9);
</del><ins>+ if (nh->nh_soa && overlap) {
+                return nua_server_retry_after(sr, 500, "Overlapping Offer/Answer", 1, 9);
+        }
</ins><span class="cx">
</span><span class="cx"> if (nh->nh_soa &&
</span><span class="cx">         soa_set_remote_sdp(nh->nh_soa, NULL, sr->sr_sdp, sr->sr_sdp_len) < 0) {
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspupdate"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/.update (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/.update        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/.update        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -1 +1 @@
</span><del>-Wed Oct 1 00:08:32 EDT 2008
</del><ins>+Mon Oct 5 12:03:35 CDT 2009
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspconfigureac"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/configure.ac (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/configure.ac        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/configure.ac        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -16,7 +16,7 @@
</span><span class="cx"> # License along with this program; if not, write to the Free Software
</span><span class="cx"> # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> #
</span><del>-# $Id: configure.ac,v 1.71 2009/07/12 09:29:18 steveu Exp $
</del><ins>+# $Id: configure.ac,v 1.73 2009/10/03 04:37:25 steveu Exp $
</ins><span class="cx">
</span><span class="cx"> # @start 1
</span><span class="cx">
</span><span class="lines">@@ -108,6 +108,22 @@
</span><span class="cx"> CXXFLAGS=${CXXFLAGS-"-g -O2"}
</span><span class="cx"> fi
</span><span class="cx">
</span><ins>+AC_DEFUN([REMOVE_FROM_VAR],[
+ new_val=""
+ removed=0
+ for i in $$1; do
+ if test "x$i" != "x$2"; then
+ new_val="$new_val $i"
+ else
+ removed=1
+ fi
+ done
+ if test $removed = "1"; then
+ echo " removed \"$2\" from $1"
+ $1=$new_val
+ fi
+])
+
</ins><span class="cx"> AC_C_CONST
</span><span class="cx"> AC_C_INLINE
</span><span class="cx"> AC_C_VOLATILE
</span><span class="lines">@@ -130,10 +146,10 @@
</span><span class="cx"> AC_ARG_ENABLE(sse4a, [ --enable-sse4a Enable SSE4A support])
</span><span class="cx"> AC_ARG_ENABLE(sse5, [ --enable-sse5 Enable SSE5 support])
</span><span class="cx"> AC_ARG_ENABLE(fixed_point, [ --enable-fixed-point Enable fixed point support])
</span><ins>+# The following is for MSVC, where we may be using a local copy of libtiff, built alongside spandsp
</ins><span class="cx"> AC_ARG_ENABLE(builtin_tiff,
</span><del>-[AC_HELP_STRING([--enable-builtin-tiff],[build with builtin libtiff])],[enable_builtin_tiff="$enableval"],[enable_builtin_tiff="no"])
</del><ins>+ [AC_HELP_STRING([--enable-builtin-tiff],[build with builtin libtiff])],[enable_builtin_tiff="$enableval"],[enable_builtin_tiff="no"])
</ins><span class="cx">
</span><del>-
</del><span class="cx"> AC_FUNC_ERROR_AT_LINE
</span><span class="cx"> AC_FUNC_VPRINTF
</span><span class="cx"> AC_FUNC_MALLOC
</span><span class="lines">@@ -344,6 +360,7 @@
</span><span class="cx"> COMP_VENDOR_CFLAGS="-native -fast $COMP_VENDOR_CFLAGS"
</span><span class="cx"> fi
</span><span class="cx"> COMP_VENDOR_LDFLAGS=
</span><ins>+ REMOVE_FROM_VAR(CFLAGS, -Xc)
</ins><span class="cx"> ;;
</span><span class="cx"> *)
</span><span class="cx"> COMP_VENDOR_CFLAGS="-std=c99 -Wall -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes $COMP_VENDOR_CFLAGS"
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspspandspfaxtestsdtd"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/spandsp/fax-tests.dtd (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/spandsp/fax-tests.dtd        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/spandsp/fax-tests.dtd        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> <!-- FAX test scripts -->
</span><span class="cx"> <!ELEMENT fax-tests (config|messages|test-group)* >
</span><span class="cx"> <!ELEMENT config (path)* >
</span><ins>+<!ELEMENT path (EMPTY)* >
</ins><span class="cx"> <!ATTLIST path
</span><span class="cx"> type CDATA #REQUIRED
</span><span class="cx"> value CDATA #REQUIRED
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspspandspsimline_modelc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/spandsp-sim/line_model.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/spandsp-sim/line_model.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/spandsp-sim/line_model.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> * along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: line_model.c,v 1.12 2009/06/01 16:27:12 steveu Exp $
</del><ins>+ * $Id: line_model.c,v 1.14 2009/09/23 16:02:59 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #if defined(HAVE_CONFIG_H)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx"> #define NULL (void *) 0
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-float null_line_model[] =
</del><ins>+static const float null_line_model[] =
</ins><span class="cx"> {
</span><span class="cx"> 0.0,
</span><span class="cx"> 0.0,
</span><span class="lines">@@ -187,7 +187,7 @@
</span><span class="cx"> 1.0
</span><span class="cx"> };
</span><span class="cx">
</span><del>-static float *models[] =
</del><ins>+SPAN_DECLARE_DATA const float *line_models[] =
</ins><span class="cx"> {
</span><span class="cx"> null_line_model, /* 0 */
</span><span class="cx"> proakis_line_model,
</span><span class="lines">@@ -225,7 +225,7 @@
</span><span class="cx"> s->near_buf_ptr = p;
</span><span class="cx">
</span><span class="cx"> /* Apply the filter */
</span><del>- sum = 0;
</del><ins>+ sum = 0.0f;
</ins><span class="cx"> for (j = 0; j < s->near_filter_len; j++)
</span><span class="cx"> {
</span><span class="cx"> sum += s->near_filter[j]*s->near_buf[p];
</span><span class="lines">@@ -254,7 +254,7 @@
</span><span class="cx"> s->far_buf_ptr = p;
</span><span class="cx">
</span><span class="cx"> /* Apply the filter */
</span><del>- sum = 0;
</del><ins>+ sum = 0.0f;
</ins><span class="cx"> for (j = 0; j < s->far_filter_len; j++)
</span><span class="cx"> {
</span><span class="cx"> sum += s->far_filter[j]*s->far_buf[p];
</span><span class="lines">@@ -479,10 +479,10 @@
</span><span class="cx">
</span><span class="cx"> s->munge = codec_munge_init(codec, rbs_pattern);
</span><span class="cx">
</span><del>- s->near_filter = models[model];
</del><ins>+ s->near_filter = line_models[model];
</ins><span class="cx"> s->near_filter_len = 129;
</span><span class="cx">
</span><del>- s->far_filter = models[model];
</del><ins>+ s->far_filter = line_models[model];
</ins><span class="cx"> s->far_filter_len = 129;
</span><span class="cx">
</span><span class="cx"> /* Put half the noise in each analogue section */
</span><span class="lines">@@ -526,14 +526,14 @@
</span><span class="cx"> s->line1.bulk_delay_ptr = 0;
</span><span class="cx"> s->line2.bulk_delay_ptr = 0;
</span><span class="cx">
</span><del>- s->line1.near_filter = models[model1];
</del><ins>+ s->line1.near_filter = line_models[model1];
</ins><span class="cx"> s->line1.near_filter_len = 129;
</span><del>- s->line2.near_filter = models[model2];
</del><ins>+ s->line2.near_filter = line_models[model2];
</ins><span class="cx"> s->line2.near_filter_len = 129;
</span><span class="cx">
</span><del>- s->line1.far_filter = models[model1];
</del><ins>+ s->line1.far_filter = line_models[model1];
</ins><span class="cx"> s->line1.far_filter_len = 129;
</span><del>- s->line2.far_filter = models[model2];
</del><ins>+ s->line2.far_filter = line_models[model2];
</ins><span class="cx"> s->line2.far_filter_len = 129;
</span><span class="cx">
</span><span class="cx"> /* Put half the noise in each analogue section */
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspspandspsimmake_line_modelsc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/spandsp-sim/make_line_models.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/spandsp-sim/make_line_models.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/spandsp-sim/make_line_models.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> * along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: make_line_models.c,v 1.9 2009/02/10 17:49:20 steveu Exp $
</del><ins>+ * $Id: make_line_models.c,v 1.10 2009/09/23 16:02:59 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \page make_line_models_page Telephony line model construction
</span><span class="lines">@@ -849,7 +849,8 @@
</span><span class="cx"> offset = (f - edd[l - 1].freq)/(edd[l].freq - edd[l - 1].freq);
</span><span class="cx"> delay = (1.0f - offset)*edd[l - 1].edd[k] + offset*edd[l].edd[k];
</span><span class="cx"> }
</span><del>- phase = 2.0f*M_PI*f*delay*0.001f;
</del><ins>+ //phase = 2.0f*M_PI*f*delay*0.001f;
+ phase = 0.0f;
</ins><span class="cx"> #if defined(HAVE_FFTW3_H)
</span><span class="cx"> in[i][0] = amp*cosf(phase);
</span><span class="cx"> in[i][1] = amp*sinf(phase);
</span><span class="lines">@@ -874,7 +875,7 @@
</span><span class="cx">
</span><span class="cx"> fprintf(outfile, "/* V.56bis AD-%d, EDD%d */\n", (j == 0) ? 1 : j + 4, k + 1);
</span><span class="cx">
</span><del>- fprintf(outfile, "float ad_%d_edd_%d_model[] =\n", (j == 0) ? 1 : j + 4, k + 1);
</del><ins>+ fprintf(outfile, "const float ad_%d_edd_%d_model[] =\n", (j == 0) ? 1 : j + 4, k + 1);
</ins><span class="cx"> fprintf(outfile, "{\n");
</span><span class="cx"> /* Normalise the filter's gain */
</span><span class="cx"> pw = 0.0f;
</span><span class="lines">@@ -955,7 +956,8 @@
</span><span class="cx"> /* Linear interpolation */
</span><span class="cx"> amp = ((1.0f - offset)*proakis[index].amp + offset*proakis[index + 1].amp)/2.3f;
</span><span class="cx"> delay = (1.0f - offset)*proakis[index].delay + offset*proakis[index + 1].delay;
</span><del>- phase = 2.0f*M_PI*f*delay*0.001f;
</del><ins>+ //phase = 2.0f*M_PI*f*delay*0.001f;
+ phase = 0.0f;
</ins><span class="cx"> #if defined(HAVE_FFTW3_H)
</span><span class="cx"> in[i][0] = amp*cosf(phase);
</span><span class="cx"> in[i][1] = amp*sinf(phase);
</span><span class="lines">@@ -978,7 +980,7 @@
</span><span class="cx"> fprintf(outfile, "/* Medium range telephone line response\n");
</span><span class="cx"> fprintf(outfile, " (from p 537, Digital Communication, John G. Proakis */\n");
</span><span class="cx">
</span><del>- fprintf(outfile, "float proakis_line_model[] =\n");
</del><ins>+ fprintf(outfile, "const float proakis_line_model[] =\n");
</ins><span class="cx"> fprintf(outfile, "{\n");
</span><span class="cx"> /* Normalise the filter's gain */
</span><span class="cx"> pw = 0.0f;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspspandspsimspandspline_modelh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/spandsp-sim/spandsp/line_model.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/spandsp-sim/spandsp/line_model.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/spandsp-sim/spandsp/line_model.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: line_model.h,v 1.6 2009/05/31 14:47:10 steveu Exp $
</del><ins>+ * $Id: line_model.h,v 1.7 2009/09/23 16:02:59 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -132,6 +132,8 @@
</span><span class="cx"> {
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+SPAN_DECLARE_DATA extern const float *line_models[];
+
</ins><span class="cx"> SPAN_DECLARE(void) both_ways_line_model(both_ways_line_model_state_t *s,
</span><span class="cx"> int16_t output1[],
</span><span class="cx"> const int16_t input1[],
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcMakefileam"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/Makefile.am (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/Makefile.am        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/Makefile.am        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -16,7 +16,7 @@
</span><span class="cx"> ## License along with this program; if not, write to the Free Software
</span><span class="cx"> ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> ##
</span><del>-## $Id: Makefile.am,v 1.135 2009/07/12 09:23:09 steveu Exp $
</del><ins>+## $Id: Makefile.am,v 1.137 2009/09/22 14:52:31 steveu Exp $
</ins><span class="cx">
</span><span class="cx"> AM_CFLAGS = $(COMP_VENDOR_CFLAGS)
</span><span class="cx"> AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS)
</span><span class="lines">@@ -110,6 +110,7 @@
</span><span class="cx"> silence_gen.c \
</span><span class="cx"> super_tone_rx.c \
</span><span class="cx"> super_tone_tx.c \
</span><ins>+ swept_tone.c \
</ins><span class="cx"> t4.c \
</span><span class="cx"> t30.c \
</span><span class="cx"> t30_api.c \
</span><span class="lines">@@ -188,6 +189,7 @@
</span><span class="cx"> spandsp/silence_gen.h \
</span><span class="cx"> spandsp/super_tone_rx.h \
</span><span class="cx"> spandsp/super_tone_tx.h \
</span><ins>+ spandsp/swept_tone.h \
</ins><span class="cx"> spandsp/t4.h \
</span><span class="cx"> spandsp/t30.h \
</span><span class="cx"> spandsp/t30_api.h \
</span><span class="lines">@@ -226,6 +228,7 @@
</span><span class="cx"> spandsp/private/bert.h \
</span><span class="cx"> spandsp/private/bitstream.h \
</span><span class="cx"> spandsp/private/dtmf.h \
</span><ins>+ spandsp/private/echo.h \
</ins><span class="cx"> spandsp/private/fax.h \
</span><span class="cx"> spandsp/private/fax_modems.h \
</span><span class="cx"> spandsp/private/fsk.h \
</span><span class="lines">@@ -238,6 +241,7 @@
</span><span class="cx"> spandsp/private/logging.h \
</span><span class="cx"> spandsp/private/lpc10.h \
</span><span class="cx"> spandsp/private/modem_connect_tones.h \
</span><ins>+ spandsp/private/modem_echo.h \
</ins><span class="cx"> spandsp/private/noise.h \
</span><span class="cx"> spandsp/private/oki_adpcm.h \
</span><span class="cx"> spandsp/private/queue.h \
</span><span class="lines">@@ -246,6 +250,7 @@
</span><span class="cx"> spandsp/private/silence_gen.h \
</span><span class="cx"> spandsp/private/super_tone_rx.h \
</span><span class="cx"> spandsp/private/super_tone_tx.h \
</span><ins>+ spandsp/private/swept_tone.h \
</ins><span class="cx"> spandsp/private/t30.h \
</span><span class="cx"> spandsp/private/t31.h \
</span><span class="cx"> spandsp/private/t38_core.h \
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcat_interpreterc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/at_interpreter.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/at_interpreter.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/at_interpreter.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: at_interpreter.c,v 1.40 2009/07/10 13:15:56 steveu Exp $
</del><ins>+ * $Id: at_interpreter.c,v 1.41 2009/10/03 04:37:25 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -34,6 +34,10 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if defined(__sun)
+#define __EXTENSIONS__
+#endif
+
</ins><span class="cx"> #include <inttypes.h>
</span><span class="cx"> #include <stdlib.h>
</span><span class="cx"> #include <stdio.h>
</span><span class="lines">@@ -76,7 +80,7 @@
</span><span class="cx"> static at_profile_t profiles[3] =
</span><span class="cx"> {
</span><span class="cx"> {
</span><del>-#if defined(_MSC_VER) || defined(__sunos) || defined(__solaris)
</del><ins>+#if defined(_MSC_VER) || defined(__sunos) || defined(__solaris) || defined(__sun)
</ins><span class="cx"> /*.echo =*/ TRUE,
</span><span class="cx"> /*.verbose =*/ TRUE,
</span><span class="cx"> /*.result_code_format =*/ ASCII_RESULT_CODES,
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcechoc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/echo.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/echo.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/echo.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: echo.c,v 1.32 2009/02/10 13:06:46 steveu Exp $
</del><ins>+ * $Id: echo.c,v 1.33 2009/09/22 13:11:04 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -102,6 +102,8 @@
</span><span class="cx"> #include "spandsp/bit_operations.h"
</span><span class="cx"> #include "spandsp/echo.h"
</span><span class="cx">
</span><ins>+#include "spandsp/private/echo.h"
+
</ins><span class="cx"> #if !defined(NULL)
</span><span class="cx"> #define NULL (void *) 0
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcfaxc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/fax.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/fax.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/fax.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: fax.c,v 1.93 2009/05/24 07:18:36 steveu Exp $
</del><ins>+ * $Id: fax.c,v 1.94 2009/09/04 14:38:46 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -128,9 +128,13 @@
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="cx">
</span><del>-static void set_rx_handler(fax_state_t *s, span_rx_handler_t *handler, void *user_data)
</del><ins>+static void set_rx_handler(fax_state_t *s,
+ span_rx_handler_t *rx_handler,
+ span_rx_fillin_handler_t *fillin_handler,
+ void *user_data)
</ins><span class="cx"> {
</span><del>- s->modems.rx_handler = handler;
</del><ins>+ s->modems.rx_handler = rx_handler;
+ s->modems.rx_fillin_handler = fillin_handler;
</ins><span class="cx"> s->modems.rx_user_data = user_data;
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="lines">@@ -162,7 +166,7 @@
</span><span class="cx"> /* The fast modem has trained, so we no longer need to run the slow
</span><span class="cx"> one in parallel. */
</span><span class="cx"> span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.17 + V.21 to V.17 (%.2fdBm0)\n", v17_rx_signal_power(&s->v17_rx));
</span><del>- set_rx_handler(t, (span_rx_handler_t *) &v17_rx, &s->v17_rx);
</del><ins>+ set_rx_handler(t, (span_rx_handler_t *) &v17_rx, (span_rx_fillin_handler_t *) &v17_rx_fillin, &s->v17_rx);
</ins><span class="cx"> }
</span><span class="cx"> else
</span><span class="cx"> {
</span><span class="lines">@@ -172,13 +176,26 @@
</span><span class="cx"> /* We have received something, and the fast modem has not trained. We must
</span><span class="cx"> be receiving valid V.21 */
</span><span class="cx"> span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.17 + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx));
</span><del>- set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, &s->v21_rx);
</del><ins>+ set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &s->v21_rx);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="cx">
</span><ins>+static int v17_v21_rx_fillin(void *user_data, int len)
+{
+ fax_state_t *t;
+ fax_modems_state_t *s;
+
+ t = (fax_state_t *) user_data;
+ s = &t->modems;
+ v17_rx_fillin(&s->v17_rx, len);
+ fsk_rx_fillin(&s->v21_rx, len);
+ return 0;
+}
+/*- End of function --------------------------------------------------------*/
+
</ins><span class="cx"> static int v27ter_v21_rx(void *user_data, const int16_t amp[], int len)
</span><span class="cx"> {
</span><span class="cx"> fax_state_t *t;
</span><span class="lines">@@ -192,7 +209,7 @@
</span><span class="cx"> /* The fast modem has trained, so we no longer need to run the slow
</span><span class="cx"> one in parallel. */
</span><span class="cx"> span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.27ter + V.21 to V.27ter (%.2fdBm0)\n", v27ter_rx_signal_power(&s->v27ter_rx));
</span><del>- set_rx_handler(t, (span_rx_handler_t *) &v27ter_rx, &s->v27ter_rx);
</del><ins>+ set_rx_handler(t, (span_rx_handler_t *) &v27ter_rx, (span_rx_fillin_handler_t *) &v27ter_rx_fillin, &s->v27ter_rx);
</ins><span class="cx"> }
</span><span class="cx"> else
</span><span class="cx"> {
</span><span class="lines">@@ -202,13 +219,26 @@
</span><span class="cx"> /* We have received something, and the fast modem has not trained. We must
</span><span class="cx"> be receiving valid V.21 */
</span><span class="cx"> span_log(&s->logging, SPAN_LOG_FLOW, "Switching from V.27ter + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx));
</span><del>- set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, &s->v21_rx);
</del><ins>+ set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &s->v21_rx);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="cx">
</span><ins>+static int v27ter_v21_rx_fillin(void *user_data, int len)
+{
+ fax_state_t *t;
+ fax_modems_state_t *s;
+
+ t = (fax_state_t *) user_data;
+ s = &t->modems;
+ v27ter_rx_fillin(&s->v27ter_rx, len);
+ fsk_rx_fillin(&s->v21_rx, len);
+ return 0;
+}
+/*- End of function --------------------------------------------------------*/
+
</ins><span class="cx"> static int v29_v21_rx(void *user_data, const int16_t amp[], int len)
</span><span class="cx"> {
</span><span class="cx"> fax_state_t *t;
</span><span class="lines">@@ -222,7 +252,7 @@
</span><span class="cx"> /* The fast modem has trained, so we no longer need to run the slow
</span><span class="cx"> one in parallel. */
</span><span class="cx"> span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.29 + V.21 to V.29 (%.2fdBm0)\n", v29_rx_signal_power(&s->v29_rx));
</span><del>- set_rx_handler(t, (span_rx_handler_t *) &v29_rx, &s->v29_rx);
</del><ins>+ set_rx_handler(t, (span_rx_handler_t *) &v29_rx, (span_rx_fillin_handler_t *) &v29_rx_fillin, &s->v29_rx);
</ins><span class="cx"> }
</span><span class="cx"> else
</span><span class="cx"> {
</span><span class="lines">@@ -232,13 +262,26 @@
</span><span class="cx"> /* We have received something, and the fast modem has not trained. We must
</span><span class="cx"> be receiving valid V.21 */
</span><span class="cx"> span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.29 + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx));
</span><del>- set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, &s->v21_rx);
</del><ins>+ set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &s->v21_rx);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="cx">
</span><ins>+static int v29_v21_rx_fillin(void *user_data, int len)
+{
+ fax_state_t *t;
+ fax_modems_state_t *s;
+
+ t = (fax_state_t *) user_data;
+ s = &t->modems;
+ v29_rx_fillin(&s->v29_rx, len);
+ fsk_rx_fillin(&s->v21_rx, len);
+ return 0;
+}
+/*- End of function --------------------------------------------------------*/
+
</ins><span class="cx"> SPAN_DECLARE(int) fax_rx(fax_state_t *s, int16_t *amp, int len)
</span><span class="cx"> {
</span><span class="cx"> int i;
</span><span class="lines">@@ -276,26 +319,9 @@
</span><span class="cx"> write(s->modems.audio_rx_log, amp, len*sizeof(int16_t));
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><ins>+ /* Call the fillin function of the current modem (if there is one). */
+ s->modems.rx_fillin_handler(s->modems.rx_user_data, len);
</ins><span class="cx"> t30_timer_update(&s->t30, len);
</span><del>- /* Call the fillin function of the current modem (if there is one). */
- switch (s->modems.current_rx_type)
- {
- case T30_MODEM_V21:
- len = fsk_rx_fillin(&s->modems.v21_rx, len);
- break;
- case T30_MODEM_V27TER:
- /* TODO: what about FSK in the early stages */
- len = v27ter_rx_fillin(&s->modems.v27ter_rx, len);
- break;
- case T30_MODEM_V29:
- /* TODO: what about FSK in the early stages */
- len = v29_rx_fillin(&s->modems.v29_rx, len);
- break;
- case T30_MODEM_V17:
- /* TODO: what about FSK in the early stages */
- len = v17_rx_fillin(&s->modems.v17_rx, len);
- break;
- }
</del><span class="cx"> return len;
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="lines">@@ -399,27 +425,27 @@
</span><span class="cx"> case T30_MODEM_V21:
</span><span class="cx"> fsk_rx_init(&t->v21_rx, &preset_fsk_specs[FSK_V21CH2], TRUE, (put_bit_func_t) hdlc_rx_put_bit, put_bit_user_data);
</span><span class="cx"> fsk_rx_signal_cutoff(&t->v21_rx, -45.5f);
</span><del>- set_rx_handler(s, (span_rx_handler_t *) &fsk_rx, &t->v21_rx);
</del><ins>+ set_rx_handler(s, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &t->v21_rx);
</ins><span class="cx"> break;
</span><span class="cx"> case T30_MODEM_V27TER:
</span><span class="cx"> v27ter_rx_restart(&t->v27ter_rx, bit_rate, FALSE);
</span><span class="cx"> v27ter_rx_set_put_bit(&t->v27ter_rx, put_bit_func, put_bit_user_data);
</span><del>- set_rx_handler(s, &v27ter_v21_rx, s);
</del><ins>+ set_rx_handler(s, &v27ter_v21_rx, &v27ter_v21_rx_fillin, s);
</ins><span class="cx"> break;
</span><span class="cx"> case T30_MODEM_V29:
</span><span class="cx"> v29_rx_restart(&t->v29_rx, bit_rate, FALSE);
</span><span class="cx"> v29_rx_set_put_bit(&t->v29_rx, put_bit_func, put_bit_user_data);
</span><del>- set_rx_handler(s, &v29_v21_rx, s);
</del><ins>+ set_rx_handler(s, &v29_v21_rx, &v29_v21_rx_fillin, s);
</ins><span class="cx"> break;
</span><span class="cx"> case T30_MODEM_V17:
</span><span class="cx"> v17_rx_restart(&t->v17_rx, bit_rate, short_train);
</span><span class="cx"> v17_rx_set_put_bit(&t->v17_rx, put_bit_func, put_bit_user_data);
</span><del>- set_rx_handler(s, &v17_v21_rx, s);
</del><ins>+ set_rx_handler(s, &v17_v21_rx, &v17_v21_rx_fillin, s);
</ins><span class="cx"> break;
</span><span class="cx"> case T30_MODEM_DONE:
</span><span class="cx"> span_log(&s->logging, SPAN_LOG_FLOW, "FAX exchange complete\n");
</span><span class="cx"> default:
</span><del>- set_rx_handler(s, (span_rx_handler_t *) &span_dummy_rx, s);
</del><ins>+ set_rx_handler(s, (span_rx_handler_t *) &span_dummy_rx, (span_rx_fillin_handler_t *) &span_dummy_rx_fillin, s);
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcfax_modemsc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/fax_modems.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/fax_modems.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/fax_modems.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: fax_modems.c,v 1.5 2009/04/12 03:29:58 steveu Exp $
</del><ins>+ * $Id: fax_modems.c,v 1.7 2009/10/05 16:33:25 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -45,9 +45,6 @@
</span><span class="cx"> #include <assert.h>
</span><span class="cx"> #include <fcntl.h>
</span><span class="cx"> #include <time.h>
</span><del>-#if defined(LOG_FAX_AUDIO)
-#include <unistd.h>
-#endif
</del><span class="cx">
</span><span class="cx"> #include "spandsp/telephony.h"
</span><span class="cx"> #include "spandsp/logging.h"
</span><span class="lines">@@ -101,6 +98,7 @@
</span><span class="cx"> be receiving valid V.21 */
</span><span class="cx"> span_log(&s->logging, SPAN_LOG_FLOW, "Switching from V.17 + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx));
</span><span class="cx"> s->rx_handler = (span_rx_handler_t *) &fsk_rx;
</span><ins>+ s->rx_fillin_handler = (span_rx_fillin_handler_t *) &fsk_rx_fillin;
</ins><span class="cx"> s->rx_user_data = &s->v21_rx;
</span><span class="cx"> }
</span><span class="cx"> return 0;
</span><span class="lines">@@ -131,6 +129,7 @@
</span><span class="cx"> be receiving valid V.21 */
</span><span class="cx"> span_log(&s->logging, SPAN_LOG_FLOW, "Switching from V.27ter + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx));
</span><span class="cx"> s->rx_handler = (span_rx_handler_t *) &fsk_rx;
</span><ins>+ s->rx_fillin_handler = (span_rx_fillin_handler_t *) &fsk_rx_fillin;
</ins><span class="cx"> s->rx_user_data = &s->v21_rx;
</span><span class="cx"> }
</span><span class="cx"> return 0;
</span><span class="lines">@@ -161,6 +160,7 @@
</span><span class="cx"> be receiving valid V.21 */
</span><span class="cx"> span_log(&s->logging, SPAN_LOG_FLOW, "Switching from V.29 + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx));
</span><span class="cx"> s->rx_handler = (span_rx_handler_t *) &fsk_rx;
</span><ins>+ s->rx_fillin_handler = (span_rx_fillin_handler_t *) &fsk_rx_fillin;
</ins><span class="cx"> s->rx_user_data = &s->v21_rx;
</span><span class="cx"> }
</span><span class="cx"> return 0;
</span><span class="lines">@@ -196,6 +196,7 @@
</span><span class="cx"> case SIG_STATUS_TRAINING_SUCCEEDED:
</span><span class="cx"> span_log(&s->logging, SPAN_LOG_FLOW, "Switching to V.17 (%.2fdBm0)\n", v17_rx_signal_power(&s->v17_rx));
</span><span class="cx"> s->rx_handler = (span_rx_handler_t *) &v17_rx;
</span><ins>+ s->rx_fillin_handler = (span_rx_fillin_handler_t *) &v17_rx_fillin;
</ins><span class="cx"> s->rx_user_data = &s->v17_rx;
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="lines">@@ -212,6 +213,7 @@
</span><span class="cx"> case SIG_STATUS_TRAINING_SUCCEEDED:
</span><span class="cx"> span_log(&s->logging, SPAN_LOG_FLOW, "Switching to V.27ter (%.2fdBm0)\n", v27ter_rx_signal_power(&s->v27ter_rx));
</span><span class="cx"> s->rx_handler = (span_rx_handler_t *) &v27ter_rx;
</span><ins>+ s->rx_fillin_handler = (span_rx_fillin_handler_t *) &v27ter_rx_fillin;
</ins><span class="cx"> s->rx_user_data = &s->v27ter_rx;
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="lines">@@ -228,6 +230,7 @@
</span><span class="cx"> case SIG_STATUS_TRAINING_SUCCEEDED:
</span><span class="cx"> span_log(&s->logging, SPAN_LOG_FLOW, "Switching to V.29 (%.2fdBm0)\n", v29_rx_signal_power(&s->v29_rx));
</span><span class="cx"> s->rx_handler = (span_rx_handler_t *) &v29_rx;
</span><ins>+ s->rx_fillin_handler = (span_rx_fillin_handler_t *) &v29_rx_fillin;
</ins><span class="cx"> s->rx_user_data = &s->v29_rx;
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="lines">@@ -300,6 +303,7 @@
</span><span class="cx">
</span><span class="cx"> s->rx_signal_present = FALSE;
</span><span class="cx"> s->rx_handler = (span_rx_handler_t *) &span_dummy_rx;
</span><ins>+ s->rx_fillin_handler = (span_rx_fillin_handler_t *) &span_dummy_rx;
</ins><span class="cx"> s->rx_user_data = NULL;
</span><span class="cx"> s->tx_handler = (span_tx_handler_t *) &silence_gen;
</span><span class="cx"> s->tx_user_data = &s->silence_gen;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcfilter_toolsc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/filter_tools.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/filter_tools.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/filter_tools.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: filter_tools.c,v 1.10 2009/02/10 17:16:57 steveu Exp $
</del><ins>+ * $Id: filter_tools.c,v 1.11 2009/10/05 16:33:25 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #if defined(HAVE_CONFIG_H)
</span><span class="lines">@@ -34,7 +34,6 @@
</span><span class="cx">
</span><span class="cx"> #include <inttypes.h>
</span><span class="cx"> #include <stdlib.h>
</span><del>-#include <unistd.h>
</del><span class="cx"> #if defined(HAVE_TGMATH_H)
</span><span class="cx"> #include <tgmath.h>
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrclibspandsp2005vcproj"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/libspandsp.2005.vcproj (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/libspandsp.2005.vcproj        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/libspandsp.2005.vcproj        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -142,6 +142,7 @@
</span><span class="cx"> <File RelativePath="silence_gen.c"></File>
</span><span class="cx"> <File RelativePath="super_tone_rx.c"></File>
</span><span class="cx"> <File RelativePath="super_tone_tx.c"></File>
</span><ins>+<File RelativePath="swept_tone.c"></File>
</ins><span class="cx"> <File RelativePath="t4.c"></File>
</span><span class="cx"> <File RelativePath="t30.c"></File>
</span><span class="cx"> <File RelativePath="t30_api.c"></File>
</span><span class="lines">@@ -219,6 +220,7 @@
</span><span class="cx"> <File RelativePath="spandsp/silence_gen.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/super_tone_rx.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/super_tone_tx.h"></File>
</span><ins>+<File RelativePath="spandsp/swept_tone.h"></File>
</ins><span class="cx"> <File RelativePath="spandsp/t4.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/t30.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/t30_api.h"></File>
</span><span class="lines">@@ -257,6 +259,7 @@
</span><span class="cx"> <File RelativePath="spandsp/private/bert.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/bitstream.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/dtmf.h"></File>
</span><ins>+<File RelativePath="spandsp/private/echo.h"></File>
</ins><span class="cx"> <File RelativePath="spandsp/private/fax.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/fax_modems.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/fsk.h"></File>
</span><span class="lines">@@ -269,6 +272,7 @@
</span><span class="cx"> <File RelativePath="spandsp/private/logging.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/lpc10.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/modem_connect_tones.h"></File>
</span><ins>+<File RelativePath="spandsp/private/modem_echo.h"></File>
</ins><span class="cx"> <File RelativePath="spandsp/private/noise.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/oki_adpcm.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/queue.h"></File>
</span><span class="lines">@@ -277,6 +281,7 @@
</span><span class="cx"> <File RelativePath="spandsp/private/silence_gen.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/super_tone_rx.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/super_tone_tx.h"></File>
</span><ins>+<File RelativePath="spandsp/private/swept_tone.h"></File>
</ins><span class="cx"> <File RelativePath="spandsp/private/t30.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/t31.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/t38_core.h"></File>
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrclibspandsp2008vcproj"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/libspandsp.2008.vcproj (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/libspandsp.2008.vcproj        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/libspandsp.2008.vcproj        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -212,6 +212,7 @@
</span><span class="cx"> <File RelativePath="silence_gen.c"></File>
</span><span class="cx"> <File RelativePath="super_tone_rx.c"></File>
</span><span class="cx"> <File RelativePath="super_tone_tx.c"></File>
</span><ins>+<File RelativePath="swept_tone.c"></File>
</ins><span class="cx"> <File RelativePath="t4.c"></File>
</span><span class="cx"> <File RelativePath="t30.c"></File>
</span><span class="cx"> <File RelativePath="t30_api.c"></File>
</span><span class="lines">@@ -289,6 +290,7 @@
</span><span class="cx"> <File RelativePath="spandsp/silence_gen.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/super_tone_rx.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/super_tone_tx.h"></File>
</span><ins>+<File RelativePath="spandsp/swept_tone.h"></File>
</ins><span class="cx"> <File RelativePath="spandsp/t4.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/t30.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/t30_api.h"></File>
</span><span class="lines">@@ -327,6 +329,7 @@
</span><span class="cx"> <File RelativePath="spandsp/private/bert.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/bitstream.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/dtmf.h"></File>
</span><ins>+<File RelativePath="spandsp/private/echo.h"></File>
</ins><span class="cx"> <File RelativePath="spandsp/private/fax.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/fax_modems.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/fsk.h"></File>
</span><span class="lines">@@ -339,6 +342,7 @@
</span><span class="cx"> <File RelativePath="spandsp/private/logging.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/lpc10.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/modem_connect_tones.h"></File>
</span><ins>+<File RelativePath="spandsp/private/modem_echo.h"></File>
</ins><span class="cx"> <File RelativePath="spandsp/private/noise.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/oki_adpcm.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/queue.h"></File>
</span><span class="lines">@@ -347,6 +351,7 @@
</span><span class="cx"> <File RelativePath="spandsp/private/silence_gen.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/super_tone_rx.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/super_tone_tx.h"></File>
</span><ins>+<File RelativePath="spandsp/private/swept_tone.h"></File>
</ins><span class="cx"> <File RelativePath="spandsp/private/t30.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/t31.h"></File>
</span><span class="cx"> <File RelativePath="spandsp/private/t38_core.h"></File>
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrclibspandspdsp"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/libspandsp.dsp (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/libspandsp.dsp        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/libspandsp.dsp        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -293,6 +293,10 @@
</span><span class="cx"> # End Source File
</span><span class="cx"> # Begin Source File
</span><span class="cx">
</span><ins>+SOURCE=.\swept_tone.c
+# End Source File
+# Begin Source File
+
</ins><span class="cx"> SOURCE=.\t4.c
</span><span class="cx"> # End Source File
</span><span class="cx"> # Begin Source File
</span><span class="lines">@@ -599,6 +603,10 @@
</span><span class="cx"> # End Source File
</span><span class="cx"> # Begin Source File
</span><span class="cx">
</span><ins>+SOURCE=.\spandsp/swept_tone.h
+# End Source File
+# Begin Source File
+
</ins><span class="cx"> SOURCE=.\spandsp/t4.h
</span><span class="cx"> # End Source File
</span><span class="cx"> # Begin Source File
</span><span class="lines">@@ -751,6 +759,10 @@
</span><span class="cx"> # End Source File
</span><span class="cx"> # Begin Source File
</span><span class="cx">
</span><ins>+SOURCE=.\spandsp/private/echo.h
+# End Source File
+# Begin Source File
+
</ins><span class="cx"> SOURCE=.\spandsp/private/fax.h
</span><span class="cx"> # End Source File
</span><span class="cx"> # Begin Source File
</span><span class="lines">@@ -799,6 +811,10 @@
</span><span class="cx"> # End Source File
</span><span class="cx"> # Begin Source File
</span><span class="cx">
</span><ins>+SOURCE=.\spandsp/private/modem_echo.h
+# End Source File
+# Begin Source File
+
</ins><span class="cx"> SOURCE=.\spandsp/private/noise.h
</span><span class="cx"> # End Source File
</span><span class="cx"> # Begin Source File
</span><span class="lines">@@ -831,6 +847,10 @@
</span><span class="cx"> # End Source File
</span><span class="cx"> # Begin Source File
</span><span class="cx">
</span><ins>+SOURCE=.\spandsp/private/swept_tone.h
+# End Source File
+# Begin Source File
+
</ins><span class="cx"> SOURCE=.\spandsp/private/t30.h
</span><span class="cx"> # End Source File
</span><span class="cx"> # Begin Source File
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcmake_at_dictionaryc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/make_at_dictionary.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/make_at_dictionary.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/make_at_dictionary.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: make_at_dictionary.c,v 1.4 2009/04/24 22:35:25 steveu Exp $
</del><ins>+ * $Id: make_at_dictionary.c,v 1.5 2009/10/05 16:36:42 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #if defined(HAVE_CONFIG_H)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx">
</span><span class="cx"> #include <inttypes.h>
</span><span class="cx"> #include <stdlib.h>
</span><del>-#include <unistd.h>
</del><span class="cx"> #include <stdio.h>
</span><span class="cx"> #include <fcntl.h>
</span><span class="cx"> #include <string.h>
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcmake_modem_filterc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/make_modem_filter.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/make_modem_filter.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/make_modem_filter.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx"> * along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: make_modem_filter.c,v 1.16 2009/07/10 13:15:56 steveu Exp $
</del><ins>+ * $Id: make_modem_filter.c,v 1.17 2009/10/03 04:37:25 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #if defined(HAVE_CONFIG_H)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> #include <stdio.h>
</span><span class="cx"> #include <time.h>
</span><span class="cx"> #include <fcntl.h>
</span><del>-#if defined(__sunos) || defined(__solaris)
</del><ins>+#if defined(__sunos) || defined(__solaris) || defined(__sun)
</ins><span class="cx"> #include <getopt.h>
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcmodem_echoc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/modem_echo.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/modem_echo.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/modem_echo.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: modem_echo.c,v 1.25 2009/02/03 16:28:39 steveu Exp $
</del><ins>+ * $Id: modem_echo.c,v 1.26 2009/09/22 13:11:04 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -53,6 +53,8 @@
</span><span class="cx"> #include "spandsp/dc_restore.h"
</span><span class="cx"> #include "spandsp/modem_echo.h"
</span><span class="cx">
</span><ins>+#include "spandsp/private/modem_echo.h"
+
</ins><span class="cx"> SPAN_DECLARE(modem_echo_can_state_t *) modem_echo_can_create(int len)
</span><span class="cx"> {
</span><span class="cx"> modem_echo_can_state_t *ec;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcmsvcspandsph"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/msvc/spandsp.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/msvc/spandsp.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/msvc/spandsp.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: spandsp.h.in,v 1.18 2009/04/02 13:43:49 steveu Exp $
</del><ins>+ * $Id: spandsp.h.in,v 1.19 2009/09/22 13:11:04 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -69,6 +69,7 @@
</span><span class="cx"> #include <spandsp/complex_filters.h>
</span><span class="cx"> #include <spandsp/dc_restore.h>
</span><span class="cx"> #include <spandsp/dds.h>
</span><ins>+#include <spandsp/swept_tone.h>
</ins><span class="cx"> #include <spandsp/echo.h>
</span><span class="cx"> #include <spandsp/modem_echo.h>
</span><span class="cx"> #include <spandsp/crc.h>
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcsig_tonec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/sig_tone.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/sig_tone.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/sig_tone.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: sig_tone.c,v 1.32 2009/04/12 14:18:02 steveu Exp $
</del><ins>+ * $Id: sig_tone.c,v 1.33 2009/09/04 14:38:46 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -44,14 +44,17 @@
</span><span class="cx"> #include "floating_fudge.h"
</span><span class="cx"> #include <memory.h>
</span><span class="cx"> #include <string.h>
</span><ins>+#include <limits.h>
</ins><span class="cx">
</span><span class="cx"> #undef SPANDSP_USE_FIXED_POINT
</span><span class="cx"> #include "spandsp/telephony.h"
</span><span class="cx"> #include "spandsp/fast_convert.h"
</span><span class="cx"> #include "spandsp/dc_restore.h"
</span><span class="cx"> #include "spandsp/saturated.h"
</span><ins>+#include "spandsp/vector_int.h"
</ins><span class="cx"> #include "spandsp/complex.h"
</span><span class="cx"> #include "spandsp/dds.h"
</span><ins>+#include "spandsp/super_tone_rx.h"
</ins><span class="cx"> #include "spandsp/sig_tone.h"
</span><span class="cx">
</span><span class="cx"> #include "spandsp/private/sig_tone.h"
</span><span class="lines">@@ -67,12 +70,12 @@
</span><span class="cx"> {
</span><span class="cx"> /* 2280Hz (e.g. AC15, and many other European protocols) */
</span><span class="cx"> {2280, 0},
</span><del>- {-10, -20}, /* -10+-1 dBmO and -20+-1 dBm0 */
- 400*(SAMPLE_RATE/1000), /* 300ms to 550ms */
</del><ins>+ {{-10, -20}, {0, 0}}, /* -10+-1 dBmO and -20+-1 dBm0 */
+ ms_to_samples(400), /* 300ms to 550ms */
</ins><span class="cx">
</span><del>- 225*(SAMPLE_RATE/1000),
</del><ins>+ ms_to_samples(225),
</ins><span class="cx">
</span><del>- 225*(SAMPLE_RATE/1000),
</del><ins>+ ms_to_samples(225),
</ins><span class="cx"> TRUE,
</span><span class="cx">
</span><span class="cx"> 24,
</span><span class="lines">@@ -135,12 +138,12 @@
</span><span class="cx"> {
</span><span class="cx"> /* 2600Hz (e.g. many US protocols) */
</span><span class="cx"> {2600, 0},
</span><del>- {-8, -8},
- 400*(SAMPLE_RATE/1000),
</del><ins>+ {{-8, -8}, {0, 0}},
+ ms_to_samples(400),
</ins><span class="cx">
</span><del>- 225*(SAMPLE_RATE/1000),
</del><ins>+ ms_to_samples(225),
</ins><span class="cx">
</span><del>- 225*(SAMPLE_RATE/1000),
</del><ins>+ ms_to_samples(225),
</ins><span class="cx"> FALSE,
</span><span class="cx">
</span><span class="cx"> 24,
</span><span class="lines">@@ -202,13 +205,13 @@
</span><span class="cx"> },
</span><span class="cx"> {
</span><span class="cx"> /* 2400Hz/2600Hz (e.g. SS5 and SS5bis) */
</span><del>- {2400, 2600},
- {-8, -8},
- 400*(SAMPLE_RATE/1000),
</del><ins>+ {2600, 2400},
+ {{-8, -8}, {-8, -8}},
+ ms_to_samples(400),
</ins><span class="cx">
</span><del>- 225*(SAMPLE_RATE/1000),
</del><ins>+ ms_to_samples(225),
</ins><span class="cx">
</span><del>- 225*(SAMPLE_RATE/1000),
</del><ins>+ ms_to_samples(225),
</ins><span class="cx"> FALSE,
</span><span class="cx">
</span><span class="cx"> 24,
</span><span class="lines">@@ -276,19 +279,40 @@
</span><span class="cx"> int j;
</span><span class="cx"> int n;
</span><span class="cx"> int16_t tone;
</span><del>- int update;
</del><ins>+ int need_update;
</ins><span class="cx"> int high_low;
</span><span class="cx">
</span><span class="cx"> for (i = 0; i < len; i += n)
</span><span class="cx"> {
</span><del>- if (s->current_tx_timeout < len - i)
- n = s->current_tx_timeout;
</del><ins>+ if (s->current_tx_timeout)
+ {
+ if (s->current_tx_timeout <= len - i)
+ {
+ n = s->current_tx_timeout;
+ need_update = TRUE;
+ }
+ else
+ {
+ n = len - i;
+ need_update = FALSE;
+ }
+ s->current_tx_timeout -= n;
+ }
</ins><span class="cx"> else
</span><ins>+ {
</ins><span class="cx"> n = len - i;
</span><ins>+ need_update = FALSE;
+ }
+ if (!(s->current_tx_tone & SIG_TONE_TX_PASSTHROUGH))
+ vec_zeroi16(&amp[i], n);
+ /*endif*/
</ins><span class="cx"> if ((s->current_tx_tone & (SIG_TONE_1_PRESENT || SIG_TONE_2_PRESENT)))
</span><span class="cx"> {
</span><span class="cx"> /* Are we in the early phase (high tone energy level), or the sustaining
</span><span class="cx"> phase (low tone energy level) of tone generation? */
</span><ins>+ /* This doesn't try to get the high/low timing precise, as there is no
+ value in doing so. It works block by block, and the blocks are normally
+ quite short. */
</ins><span class="cx"> if (s->high_low_timer > 0)
</span><span class="cx"> {
</span><span class="cx"> if (n > s->high_low_timer)
</span><span class="lines">@@ -301,47 +325,30 @@
</span><span class="cx"> high_low = 1;
</span><span class="cx"> }
</span><span class="cx"> /*endif*/
</span><del>- if (s->current_tx_tone & SIG_TONE_TX_PASSTHROUGH)
</del><ins>+ if ((s->current_tx_tone & SIG_TONE_1_PRESENT) && s->phase_rate[0])
</ins><span class="cx"> {
</span><span class="cx"> for (j = i; j < i + n; j++)
</span><span class="cx"> {
</span><del>- tone = dds_mod(&(s->phase_acc[0]), s->phase_rate[0], s->tone_scaling[high_low], 0);
</del><ins>+ tone = dds_mod(&(s->phase_acc[0]), s->phase_rate[0], s->tone_scaling[0][high_low], 0);
</ins><span class="cx"> amp[j] = saturate(amp[j] + tone);
</span><span class="cx"> }
</span><span class="cx"> /*endfor*/
</span><span class="cx"> }
</span><del>- else
</del><ins>+ /*endif*/
+ if ((s->current_tx_tone & SIG_TONE_2_PRESENT) && s->phase_rate[1])
</ins><span class="cx"> {
</span><span class="cx"> for (j = i; j < i + n; j++)
</span><del>- amp[j] = dds_mod(&(s->phase_acc[0]), s->phase_rate[0], s->tone_scaling[high_low], 0);
</del><ins>+ {
+ tone = dds_mod(&(s->phase_acc[1]), s->phase_rate[1], s->tone_scaling[1][high_low], 0);
+ amp[j] = saturate(amp[j] + tone);
+ }
</ins><span class="cx"> /*endfor*/
</span><span class="cx"> }
</span><span class="cx"> /*endif*/
</span><span class="cx"> }
</span><del>- else
- {
- /* There is no tone. We either leave the audio in the buffer, or silence it. */
- if (!(s->current_tx_tone & SIG_TONE_TX_PASSTHROUGH))
- {
- /* Zap any audio in the buffer */
- memset(amp + i, 0, sizeof(int16_t)*n);
- }
- /*endif*/
- }
</del><span class="cx"> /*endif*/
</span><del>- if ((s->current_tx_timeout -= n) <= 0)
- {
- if (s->sig_update)
- {
- update = s->sig_update(s->user_data, SIG_TONE_UPDATE_REQUEST);
- if ((update & 0x03) == 0x03)
- s->high_low_timer = s->desc->high_low_timeout;
- /*endif*/
- s->current_tx_tone = update & 0xFFFF;
- s->current_tx_timeout = (update >> 16) & 0xFFFF;
- }
- /*endif*/
- }
</del><ins>+ if (need_update && s->sig_update)
+ s->sig_update(s->user_data, SIG_TONE_TX_UPDATE_REQUEST, 0, 0);
</ins><span class="cx"> /*endif*/
</span><span class="cx"> }
</span><span class="cx"> /*endfor*/
</span><span class="lines">@@ -349,17 +356,22 @@
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="cx">
</span><del>-SPAN_DECLARE(void) sig_tone_tx_set_mode(sig_tone_tx_state_t *s, int mode)
</del><ins>+SPAN_DECLARE(void) sig_tone_tx_set_mode(sig_tone_tx_state_t *s, int mode, int duration)
</ins><span class="cx"> {
</span><del>- if ((mode & 0x03) == 0x03 && !(s->current_tx_tone & SIG_TONE_1_PRESENT))
</del><ins>+ int old_tones;
+ int new_tones;
+
+ old_tones = s->current_tx_tone & (SIG_TONE_1_PRESENT | SIG_TONE_2_PRESENT);
+ new_tones = mode & (SIG_TONE_1_PRESENT | SIG_TONE_2_PRESENT);
+ if (new_tones && old_tones != new_tones)
</ins><span class="cx"> s->high_low_timer = s->desc->high_low_timeout;
</span><span class="cx"> /*endif*/
</span><del>- s->current_tx_tone = mode & 0xFFFF;
- s->current_tx_timeout = (mode >> 16) & 0xFFFF;
</del><ins>+ s->current_tx_tone = mode;
+ s->current_tx_timeout = duration;
</ins><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="cx">
</span><del>-SPAN_DECLARE(sig_tone_tx_state_t *) sig_tone_tx_init(sig_tone_tx_state_t *s, int tone_type, sig_tone_func_t sig_update, void *user_data)
</del><ins>+SPAN_DECLARE(sig_tone_tx_state_t *) sig_tone_tx_init(sig_tone_tx_state_t *s, int tone_type, tone_report_func_t sig_update, void *user_data)
</ins><span class="cx"> {
</span><span class="cx"> int i;
</span><span class="cx">
</span><span class="lines">@@ -385,7 +397,8 @@
</span><span class="cx"> s->phase_rate[i] = dds_phase_rate((float) s->desc->tone_freq[i]);
</span><span class="cx"> else
</span><span class="cx"> s->phase_rate[i] = 0;
</span><del>- s->tone_scaling[i] = dds_scaling_dbm0((float) s->desc->tone_amp[i]);
</del><ins>+ s->tone_scaling[i][0] = dds_scaling_dbm0((float) s->desc->tone_amp[i][0]);
+ s->tone_scaling[i][1] = dds_scaling_dbm0((float) s->desc->tone_amp[i][1]);
</ins><span class="cx"> }
</span><span class="cx"> return s;
</span><span class="cx"> }
</span><span class="lines">@@ -404,6 +417,7 @@
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><ins>+
</ins><span class="cx"> SPAN_DECLARE(int) sig_tone_rx(sig_tone_rx_state_t *s, int16_t amp[], int len)
</span><span class="cx"> {
</span><span class="cx"> #if defined(SPANDSP_USE_FIXED_POINT)
</span><span class="lines">@@ -422,7 +436,7 @@
</span><span class="cx">
</span><span class="cx"> for (i = 0; i < len; i++)
</span><span class="cx"> {
</span><del>- if (s->signaling_state_duration < 0xFFFF)
</del><ins>+ if (s->signaling_state_duration < INT_MAX)
</ins><span class="cx"> s->signaling_state_duration++;
</span><span class="cx"> /*endif*/
</span><span class="cx"> notched_signal = 0;
</span><span class="lines">@@ -529,7 +543,7 @@
</span><span class="cx"> if (!s->tone_present)
</span><span class="cx"> {
</span><span class="cx"> if (s->sig_update)
</span><del>- s->sig_update(s->user_data, SIG_TONE_1_CHANGE | (s->signaling_state_duration << 16));
</del><ins>+ s->sig_update(s->user_data, SIG_TONE_1_CHANGE, 0, s->signaling_state_duration);
</ins><span class="cx"> /*endif*/
</span><span class="cx"> s->signaling_state_duration = 0;
</span><span class="cx"> }
</span><span class="lines">@@ -541,15 +555,15 @@
</span><span class="cx"> if (s->tone_present)
</span><span class="cx"> {
</span><span class="cx"> if (s->sig_update)
</span><del>- s->sig_update(s->user_data, SIG_TONE_1_CHANGE | SIG_TONE_1_PRESENT | (s->signaling_state_duration << 16));
</del><ins>+ s->sig_update(s->user_data, SIG_TONE_1_CHANGE | SIG_TONE_1_PRESENT, 0, s->signaling_state_duration);
</ins><span class="cx"> /*endif*/
</span><span class="cx"> s->signaling_state_duration = 0;
</span><span class="cx"> }
</span><span class="cx"> /*endif*/
</span><span class="cx"> }
</span><span class="cx"> /*endif*/
</span><del>- /* Notch insertion logic */
-
</del><ins>+
+ /* Notch insertion logic */
</ins><span class="cx"> /* tone_present and tone_on are equivalent in flat mode */
</span><span class="cx"> if (s->tone_present)
</span><span class="cx"> {
</span><span class="lines">@@ -590,7 +604,7 @@
</span><span class="cx"> s->tone_persistence_timeout = s->desc->tone_off_check_time;
</span><span class="cx"> s->notch_insertion_timeout = s->desc->notch_lag_time;
</span><span class="cx"> if (s->sig_update)
</span><del>- s->sig_update(s->user_data, SIG_TONE_1_CHANGE | SIG_TONE_1_PRESENT | (s->signaling_state_duration << 16));
</del><ins>+ s->sig_update(s->user_data, SIG_TONE_1_CHANGE | SIG_TONE_1_PRESENT, 0, s->signaling_state_duration);
</ins><span class="cx"> /*endif*/
</span><span class="cx"> s->signaling_state_duration = 0;
</span><span class="cx"> }
</span><span class="lines">@@ -626,7 +640,7 @@
</span><span class="cx"> s->tone_present = FALSE;
</span><span class="cx"> s->tone_persistence_timeout = s->desc->tone_on_check_time;
</span><span class="cx"> if (s->sig_update)
</span><del>- s->sig_update(s->user_data, SIG_TONE_1_CHANGE | (s->signaling_state_duration << 16));
</del><ins>+ s->sig_update(s->user_data, SIG_TONE_1_CHANGE, 0, s->signaling_state_duration);
</ins><span class="cx"> /*endif*/
</span><span class="cx"> s->signaling_state_duration = 0;
</span><span class="cx"> }
</span><span class="lines">@@ -648,7 +662,7 @@
</span><span class="cx">
</span><span class="cx"> if ((s->current_rx_tone & SIG_TONE_RX_PASSTHROUGH))
</span><span class="cx"> {
</span><del>- if (s->notch_enabled)
</del><ins>+ if ((s->current_rx_tone & SIG_TONE_RX_FILTER_TONE) || s->notch_enabled)
</ins><span class="cx"> amp[i] = (int16_t) notched_signal;
</span><span class="cx"> /*endif*/
</span><span class="cx"> }
</span><span class="lines">@@ -663,8 +677,14 @@
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="cx">
</span><del>-SPAN_DECLARE(sig_tone_rx_state_t *) sig_tone_rx_init(sig_tone_rx_state_t *s, int tone_type, sig_tone_func_t sig_update, void *user_data)
</del><ins>+SPAN_DECLARE(void) sig_tone_rx_set_mode(sig_tone_rx_state_t *s, int mode, int duration)
</ins><span class="cx"> {
</span><ins>+ s->current_rx_tone = mode;
+}
+/*- End of function --------------------------------------------------------*/
+
+SPAN_DECLARE(sig_tone_rx_state_t *) sig_tone_rx_init(sig_tone_rx_state_t *s, int tone_type, tone_report_func_t sig_update, void *user_data)
+{
</ins><span class="cx"> if (sig_update == NULL || tone_type < 1 || tone_type > 3)
</span><span class="cx"> return NULL;
</span><span class="cx"> /*endif*/
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcsilence_genc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/silence_gen.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/silence_gen.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/silence_gen.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: silence_gen.c,v 1.22 2009/06/02 16:03:56 steveu Exp $
</del><ins>+ * $Id: silence_gen.c,v 1.23 2009/09/04 14:38:46 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -158,4 +158,10 @@
</span><span class="cx"> return len;
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><ins>+
+SPAN_DECLARE_NONSTD(int) span_dummy_rx_fillin(void *user_data, int len)
+{
+ return 0;
+}
+/*- End of function --------------------------------------------------------*/
</ins><span class="cx"> /*- End of file ------------------------------------------------------------*/
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspechoh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/echo.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/echo.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/echo.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: echo.h,v 1.19 2009/02/10 13:06:47 steveu Exp $
</del><ins>+ * $Id: echo.h,v 1.20 2009/09/22 13:11:04 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -133,60 +133,8 @@
</span><span class="cx"> G.168 echo canceller descriptor. This defines the working state for a line
</span><span class="cx"> echo canceller.
</span><span class="cx"> */
</span><del>-typedef struct
-{
- int tx_power[4];
- int rx_power[3];
- int clean_rx_power;
</del><ins>+typedef struct echo_can_state_s echo_can_state_t;
</ins><span class="cx">
</span><del>- int rx_power_threshold;
- int nonupdate_dwell;
-
- int curr_pos;
-        
- int taps;
- int tap_mask;
- int adaption_mode;
-
- int32_t supp_test1;
- int32_t supp_test2;
- int32_t supp1;
- int32_t supp2;
- int vad;
- int cng;
-
- int16_t geigel_max;
- int geigel_lag;
- int dtd_onset;
- int tap_set;
- int tap_rotate_counter;
-
- int32_t latest_correction; /* Indication of the magnitude of the latest
- adaption, or a code to indicate why adaption
- was skipped, for test purposes */
- int32_t last_acf[28];
- int narrowband_count;
- int narrowband_score;
-
- fir16_state_t fir_state;
- /*! Echo FIR taps (16 bit version) */
- int16_t *fir_taps16[4];
- /*! Echo FIR taps (32 bit version) */
- int32_t *fir_taps32;
-
- /* DC and near DC blocking filter states */
- int32_t tx_hpf[2];
- int32_t rx_hpf[2];
-
- /* Parameters for the optional Hoth noise generator */
- int cng_level;
- int cng_rndnum;
- int cng_filter;
-
- /* Snapshot sample of coeffs used for development */
- int16_t *snapshot;
-} echo_can_state_t;
-
</del><span class="cx"> #if defined(__cplusplus)
</span><span class="cx"> extern "C"
</span><span class="cx"> {
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspexposeh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/expose.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/expose.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/expose.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: expose.h,v 1.13 2009/05/16 03:34:45 steveu Exp $
</del><ins>+ * $Id: expose.h,v 1.14 2009/09/22 13:11:04 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -56,6 +56,9 @@
</span><span class="cx"> #include <spandsp/private/super_tone_tx.h>
</span><span class="cx"> #include <spandsp/private/super_tone_rx.h>
</span><span class="cx"> #include <spandsp/private/silence_gen.h>
</span><ins>+#include <spandsp/private/swept_tone.h>
+#include <spandsp/private/echo.h>
+#include <spandsp/private/modem_echo.h>
</ins><span class="cx"> #include <spandsp/private/async.h>
</span><span class="cx"> #include <spandsp/private/fsk.h>
</span><span class="cx"> #include <spandsp/private/v29rx.h>
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspfast_converth"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/fast_convert.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/fast_convert.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/fast_convert.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: fast_convert.h,v 1.8 2009/07/10 13:15:56 steveu Exp $
</del><ins>+ * $Id: fast_convert.h,v 1.9 2009/10/03 04:37:25 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #if !defined(_SPANDSP_FAST_CONVERT_H_)
</span><span class="lines">@@ -150,7 +150,7 @@
</span><span class="cx"> );
</span><span class="cx"> return retval;
</span><span class="cx"> }
</span><del>-#elif defined(__GNUC__)
</del><ins>+#elif defined(__GNUC__) || (__SUNPRO_C >= 0x0590)
</ins><span class="cx">
</span><span class="cx"> #if defined(__i386__)
</span><span class="cx"> /* These routines are guaranteed fast on an i386 machine. Using the built in
</span><span class="lines">@@ -403,7 +403,7 @@
</span><span class="cx"> the accuracy issues related to changing the rounding scheme are of little concern
</span><span class="cx"> to us. */
</span><span class="cx">
</span><del>- #if !defined(__sgi) && !defined(__sunos) && !defined(__solaris)
</del><ins>+ #if !defined(__sgi) && !defined(__sunos) && !defined(__solaris) && !defined(__sun)
</ins><span class="cx"> #warning "No usable lrint() and lrintf() functions available."
</span><span class="cx"> #warning "Replacing these functions with a simple C cast."
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspmodem_echoh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/modem_echo.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/modem_echo.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/modem_echo.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: modem_echo.h,v 1.13 2009/02/03 16:28:41 steveu Exp $
</del><ins>+ * $Id: modem_echo.h,v 1.14 2009/09/22 13:11:04 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -84,23 +84,8 @@
</span><span class="cx"> Modem line echo canceller descriptor. This defines the working state for a line
</span><span class="cx"> echo canceller.
</span><span class="cx"> */
</span><del>-typedef struct
-{
- int adapt;
- int taps;
</del><ins>+typedef struct modem_echo_can_state_s modem_echo_can_state_t;
</ins><span class="cx">
</span><del>- fir16_state_t fir_state;
- /*! Echo FIR taps (16 bit version) */
- int16_t *fir_taps16;
- /*! Echo FIR taps (32 bit version) */
- int32_t *fir_taps32;
-
- int tx_power;
- int rx_power;
-
- int curr_pos;
-} modem_echo_can_state_t;
-
</del><span class="cx"> #if defined(__cplusplus)
</span><span class="cx"> extern "C"
</span><span class="cx"> {
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspprivateechohfromrev15313freeswitchtrunklibsspandspsrcspandspprivateechoh"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/echo.h (from rev 15313, freeswitch/trunk/libs/spandsp/src/spandsp/private/echo.h) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/echo.h         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/echo.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,94 @@
</span><ins>+/*
+ * SpanDSP - a series of DSP components for telephony
+ *
+ * private/echo.h - An echo cancellor, suitable for electrical and acoustic
+ *         cancellation. This code does not currently comply with
+ *         any relevant standards (e.g. G.164/5/7/8).
+ *
+ * Written by Steve Underwood <steveu@coppice.org>
+ *
+ * Copyright (C) 2001 Steve Underwood
+ *
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 2.1,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id: echo.h,v 1.1 2009/09/22 13:11:04 steveu Exp $
+ */
+
+/*! \file */
+
+#if !defined(_SPANDSP_PRIVATE_ECHO_H_)
+#define _SPANDSP_PRIVATE_ECHO_H_
+
+/*!
+ G.168 echo canceller descriptor. This defines the working state for a line
+ echo canceller.
+*/
+struct echo_can_state_s
+{
+ int tx_power[4];
+ int rx_power[3];
+ int clean_rx_power;
+
+ int rx_power_threshold;
+ int nonupdate_dwell;
+
+ int curr_pos;
+        
+ int taps;
+ int tap_mask;
+ int adaption_mode;
+
+ int32_t supp_test1;
+ int32_t supp_test2;
+ int32_t supp1;
+ int32_t supp2;
+ int vad;
+ int cng;
+
+ int16_t geigel_max;
+ int geigel_lag;
+ int dtd_onset;
+ int tap_set;
+ int tap_rotate_counter;
+
+ int32_t latest_correction; /* Indication of the magnitude of the latest
+ adaption, or a code to indicate why adaption
+ was skipped, for test purposes */
+ int32_t last_acf[28];
+ int narrowband_count;
+ int narrowband_score;
+
+ fir16_state_t fir_state;
+ /*! Echo FIR taps (16 bit version) */
+ int16_t *fir_taps16[4];
+ /*! Echo FIR taps (32 bit version) */
+ int32_t *fir_taps32;
+
+ /* DC and near DC blocking filter states */
+ int32_t tx_hpf[2];
+ int32_t rx_hpf[2];
+
+ /* Parameters for the optional Hoth noise generator */
+ int cng_level;
+ int cng_rndnum;
+ int cng_filter;
+
+ /* Snapshot sample of coeffs used for development */
+ int16_t *snapshot;
+};
+
+#endif
+/*- End of file ------------------------------------------------------------*/
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspprivatefax_modemsh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/fax_modems.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/fax_modems.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/fax_modems.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: fax_modems.h,v 1.3 2009/03/23 14:17:42 steveu Exp $
</del><ins>+ * $Id: fax_modems.h,v 1.4 2009/09/04 14:38:47 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -95,11 +95,9 @@
</span><span class="cx">
</span><span class="cx"> /*! The current receive signal handler */
</span><span class="cx"> span_rx_handler_t *rx_handler;
</span><del>- void *rx_user_data;
-
</del><span class="cx"> /*! The current receive missing signal fill-in handler */
</span><span class="cx"> span_rx_fillin_handler_t *rx_fillin_handler;
</span><del>- void *rx_fillin_user_data;
</del><ins>+ void *rx_user_data;
</ins><span class="cx">
</span><span class="cx"> /*! The current transmit signal handler */
</span><span class="cx"> span_tx_handler_t *tx_handler;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspprivatemodem_echohfromrev15313freeswitchtrunklibsspandspsrcspandspprivatemodem_echoh"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/modem_echo.h (from rev 15313, freeswitch/trunk/libs/spandsp/src/spandsp/private/modem_echo.h) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/modem_echo.h         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/modem_echo.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+/*
+ * SpanDSP - a series of DSP components for telephony
+ *
+ * private/modem_echo.h - An echo cancellor, suitable for electrical echos in GSTN modems
+ *
+ * Written by Steve Underwood <steveu@coppice.org>
+ *
+ * Copyright (C) 2001, 2004 Steve Underwood
+ *
+ * Based on a bit from here, a bit from there, eye of toad,
+ * ear of bat, etc - plus, of course, my own 2 cents.
+ *
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 2.1,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id: modem_echo.h,v 1.1 2009/09/22 13:11:04 steveu Exp $
+ */
+
+/*! \file */
+
+#if !defined(_SPANDSP_PRIVATE_MODEM_ECHO_H_)
+#define _SPANDSP_PRIVATE_MODEM_ECHO_H_
+
+/*!
+ Modem line echo canceller descriptor. This defines the working state for a line
+ echo canceller.
+*/
+struct modem_echo_can_state_s
+{
+ int adapt;
+ int taps;
+
+ fir16_state_t fir_state;
+ /*! Echo FIR taps (16 bit version) */
+ int16_t *fir_taps16;
+ /*! Echo FIR taps (32 bit version) */
+ int32_t *fir_taps32;
+
+ int tx_power;
+ int rx_power;
+
+ int curr_pos;
+};
+
+#endif
+/*- End of file ------------------------------------------------------------*/
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspprivatesig_toneh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/sig_tone.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/sig_tone.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/sig_tone.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: sig_tone.h,v 1.3 2009/04/12 14:18:02 steveu Exp $
</del><ins>+ * $Id: sig_tone.h,v 1.4 2009/09/04 14:38:47 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #if !defined(_SPANDSP_PRIVATE_SIG_TONE_H_)
</span><span class="lines">@@ -38,8 +38,8 @@
</span><span class="cx"> {
</span><span class="cx"> /*! \brief The tones used. */
</span><span class="cx"> int tone_freq[2];
</span><del>- /*! \brief The high and low tone amplitudes. */
- int tone_amp[2];
</del><ins>+ /*! \brief The high and low tone amplitudes for each of the tones. */
+ int tone_amp[2][2];
</ins><span class="cx">
</span><span class="cx"> /*! \brief The delay, in audio samples, before the high level tone drops
</span><span class="cx"> to a low level tone. */
</span><span class="lines">@@ -80,7 +80,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> } tone[2];
</span><span class="cx">
</span><del>-
</del><span class="cx"> #if defined(SPANDSP_USE_FIXED_POINT)
</span><span class="cx"> /*! \brief Flat mode bandpass bi-quad parameters */
</span><span class="cx"> int32_t broad_a[3];
</span><span class="lines">@@ -128,23 +127,23 @@
</span><span class="cx"> struct sig_tone_tx_state_s
</span><span class="cx"> {
</span><span class="cx"> /*! \brief The callback function used to handle signaling changes. */
</span><del>- sig_tone_func_t sig_update;
</del><ins>+ tone_report_func_t sig_update;
</ins><span class="cx"> /*! \brief A user specified opaque pointer passed to the callback function. */
</span><span class="cx"> void *user_data;
</span><span class="cx">
</span><span class="cx"> /*! \brief Tone descriptor */
</span><span class="cx"> sig_tone_descriptor_t *desc;
</span><span class="cx">
</span><del>- /*! The scaling values for the high and low level tones */
- int16_t tone_scaling[2];
- /*! The sample timer, used to switch between the high and low level tones. */
- int high_low_timer;
-
</del><span class="cx"> /*! The phase rates for the one or two tones */
</span><span class="cx"> int32_t phase_rate[2];
</span><span class="cx"> /*! The phase accumulators for the one or two tones */
</span><span class="cx"> uint32_t phase_acc[2];
</span><span class="cx">
</span><ins>+ /*! The scaling values for the one or two tones, and the high and low level of each tone */
+ int16_t tone_scaling[2][2];
+ /*! The sample timer, used to switch between the high and low level tones. */
+ int high_low_timer;
+
</ins><span class="cx"> /*! \brief Current transmit tone */
</span><span class="cx"> int current_tx_tone;
</span><span class="cx"> /*! \brief Current transmit timeout */
</span><span class="lines">@@ -159,7 +158,7 @@
</span><span class="cx"> struct sig_tone_rx_state_s
</span><span class="cx"> {
</span><span class="cx"> /*! \brief The callback function used to handle signaling changes. */
</span><del>- sig_tone_func_t sig_update;
</del><ins>+ tone_report_func_t sig_update;
</ins><span class="cx"> /*! \brief A user specified opaque pointer passed to the callback function. */
</span><span class="cx"> void *user_data;
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspprivateswept_tonehfromrev15313freeswitchtrunklibsspandspsrcspandspprivateswept_toneh"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/swept_tone.h (from rev 15313, freeswitch/trunk/libs/spandsp/src/spandsp/private/swept_tone.h) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/swept_tone.h         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/swept_tone.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+/*
+ * SpanDSP - a series of DSP components for telephony
+ *
+ * private/swept_tone.h - Swept tone generation
+ *
+ * Written by Steve Underwood <steveu@coppice.org>
+ *
+ * Copyright (C) 2009 Steve Underwood
+ *
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2, as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id: swept_tone.h,v 1.1 2009/09/22 12:54:33 steveu Exp $
+ */
+
+#if !defined(_SPANDSP_PRIVATE_SWEPT_TONE_H_)
+#define _SPANDSP_PRIVATE_SWEPT_TONE_H_
+
+struct swept_tone_state_s
+{
+ int32_t starting_phase_inc;
+ int32_t phase_inc_step;
+ int scale;
+ int duration;
+ int repeating;
+ int pos;
+ int32_t current_phase_inc;
+ uint32_t phase;
+};
+
+#endif
+/*- End of file ------------------------------------------------------------*/
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspprivatet30h"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/t30.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/t30.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/private/t30.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: t30.h,v 1.4 2009/04/12 14:18:02 steveu Exp $
</del><ins>+ * $Id: t30.h,v 1.5 2009/09/20 13:42:29 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -221,10 +221,10 @@
</span><span class="cx"> /*! \brief A bit map of the OK ECM frames, constructed as a PPR frame. */
</span><span class="cx"> uint8_t ecm_frame_map[3 + 32];
</span><span class="cx">
</span><del>- /*! \brief The current page number for receiving, in ECM mode. This is reset at the start of a call. */
- int ecm_rx_page;
- /*! \brief The current page number for sending, in ECM mode. This is reset at the start of a call. */
- int ecm_tx_page;
</del><ins>+ /*! \brief The current page number for receiving, in ECM or non-ECM mode. This is reset at the start of a call. */
+ int rx_page_number;
+ /*! \brief The current page number for sending, in ECM or non-ECM mode. This is reset at the start of a call. */
+ int tx_page_number;
</ins><span class="cx"> /*! \brief The current block number, in ECM mode */
</span><span class="cx"> int ecm_block;
</span><span class="cx"> /*! \brief The number of frames in the current block number, in ECM mode */
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspsig_toneh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/sig_tone.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/sig_tone.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/sig_tone.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: sig_tone.h,v 1.19 2009/04/12 14:18:02 steveu Exp $
</del><ins>+ * $Id: sig_tone.h,v 1.20 2009/09/04 14:38:46 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -54,32 +54,39 @@
</span><span class="cx"> #if !defined(_SPANDSP_SIG_TONE_H_)
</span><span class="cx"> #define _SPANDSP_SIG_TONE_H_
</span><span class="cx">
</span><del>-typedef int (*sig_tone_func_t)(void *user_data, int what);
-
</del><span class="cx"> /* The optional tone sets */
</span><span class="cx"> enum
</span><span class="cx"> {
</span><del>- /*! European 2280Hz signaling tone */
</del><ins>+ /*! European 2280Hz signaling tone. Tone 1 is 2280Hz. Tone 2 is not used. */
</ins><span class="cx"> SIG_TONE_2280HZ = 1,
</span><del>- /*! US 2600Hz signaling tone */
</del><ins>+ /*! US 2600Hz signaling tone. Tone 1 is 2600Hz. Tone 2 is not used. */
</ins><span class="cx"> SIG_TONE_2600HZ,
</span><del>- /*! US 2400Hz + 2600Hz signaling tones */
</del><ins>+ /*! US 2400Hz + 2600Hz signaling tones. Tone 1 is 2600Hz. Tone 2 is 2400Hz. */
</ins><span class="cx"> SIG_TONE_2400HZ_2600HZ
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+/* Mode control and report bits for transmit and receive */
</ins><span class="cx"> enum
</span><span class="cx"> {
</span><span class="cx"> /*! Signaling tone 1 is present */
</span><span class="cx"> SIG_TONE_1_PRESENT = 0x001,
</span><ins>+ /*! Signaling tone 1 has changed state (ignored when setting tx mode) */
</ins><span class="cx"> SIG_TONE_1_CHANGE = 0x002,
</span><span class="cx"> /*! Signaling tone 2 is present */
</span><span class="cx"> SIG_TONE_2_PRESENT = 0x004,
</span><ins>+ /*! Signaling tone 2 has changed state (ignored when setting tx mode) */
</ins><span class="cx"> SIG_TONE_2_CHANGE = 0x008,
</span><span class="cx"> /*! The media signal is passing through. Tones might be added to it. */
</span><span class="cx"> SIG_TONE_TX_PASSTHROUGH = 0x010,
</span><span class="cx"> /*! The media signal is passing through. Tones might be extracted from it, if detected. */
</span><del>- SIG_TONE_RX_PASSTHROUGH = 0x020,
- SIG_TONE_UPDATE_REQUEST = 0x100
</del><ins>+ SIG_TONE_RX_PASSTHROUGH = 0x040,
+ /*! Force filtering of the signaling tone, whether signaling is being detected or not.
+ This is mostly useful for test purposes. */
+ SIG_TONE_RX_FILTER_TONE = 0x080,
+ /*! Request an update of the transmit status, upon timeout of the previous status. */
+ SIG_TONE_TX_UPDATE_REQUEST = 0x100,
+ /*! Request an update of the receiver status, upon timeout of the previous status. */
+ SIG_TONE_RX_UPDATE_REQUEST = 0x200
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> /*!
</span><span class="lines">@@ -106,6 +113,14 @@
</span><span class="cx"> \return The number of samples unprocessed. */
</span><span class="cx"> SPAN_DECLARE(int) sig_tone_rx(sig_tone_rx_state_t *s, int16_t amp[], int len);
</span><span class="cx">
</span><ins>+/*! Set the receive mode.
+ \brief Set the receive mode.
+ \param s The signaling tone context.
+ \param mode The new mode for the receiver.
+ \param duration The duration for this mode, before an update is requested.
+ A duration of zero means forever. */
+SPAN_DECLARE(void) sig_tone_rx_set_mode(sig_tone_rx_state_t *s, int mode, int duration);
+
</ins><span class="cx"> /*! Initialise a signaling tone receiver context.
</span><span class="cx"> \brief Initialise a signaling tone context.
</span><span class="cx"> \param s The signaling tone context.
</span><span class="lines">@@ -113,7 +128,7 @@
</span><span class="cx"> \param sig_update Callback function to handle signaling updates.
</span><span class="cx"> \param user_data An opaque pointer.
</span><span class="cx"> \return A pointer to the signalling tone context, or NULL if there was a problem. */
</span><del>-SPAN_DECLARE(sig_tone_rx_state_t *) sig_tone_rx_init(sig_tone_rx_state_t *s, int tone_type, sig_tone_func_t sig_update, void *user_data);
</del><ins>+SPAN_DECLARE(sig_tone_rx_state_t *) sig_tone_rx_init(sig_tone_rx_state_t *s, int tone_type, tone_report_func_t sig_update, void *user_data);
</ins><span class="cx">
</span><span class="cx"> /*! Release a signaling tone receiver context.
</span><span class="cx"> \brief Release a signaling tone receiver context.
</span><span class="lines">@@ -138,8 +153,10 @@
</span><span class="cx"> /*! Set the tone mode.
</span><span class="cx"> \brief Set the tone mode.
</span><span class="cx"> \param s The signaling tone context.
</span><del>- \param mode The new mode for the transmitted tones. */
-SPAN_DECLARE(void) sig_tone_tx_set_mode(sig_tone_tx_state_t *s, int mode);
</del><ins>+ \param mode The new mode for the transmitted tones.
+ \param duration The duration for this mode, before an update is requested.
+ A duration of zero means forever. */
+SPAN_DECLARE(void) sig_tone_tx_set_mode(sig_tone_tx_state_t *s, int mode, int duration);
</ins><span class="cx">
</span><span class="cx"> /*! Initialise a signaling tone transmitter context.
</span><span class="cx"> \brief Initialise a signaling tone context.
</span><span class="lines">@@ -148,7 +165,7 @@
</span><span class="cx"> \param sig_update Callback function to handle signaling updates.
</span><span class="cx"> \param user_data An opaque pointer.
</span><span class="cx"> \return A pointer to the signalling tone context, or NULL if there was a problem. */
</span><del>-SPAN_DECLARE(sig_tone_tx_state_t *) sig_tone_tx_init(sig_tone_tx_state_t *s, int tone_type, sig_tone_func_t sig_update, void *user_data);
</del><ins>+SPAN_DECLARE(sig_tone_tx_state_t *) sig_tone_tx_init(sig_tone_tx_state_t *s, int tone_type, tone_report_func_t sig_update, void *user_data);
</ins><span class="cx">
</span><span class="cx"> /*! Release a signaling tone transmitter context.
</span><span class="cx"> \brief Release a signaling tone transmitter context.
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspsilence_genh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/silence_gen.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/silence_gen.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/silence_gen.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: silence_gen.h,v 1.18 2009/06/02 16:03:56 steveu Exp $
</del><ins>+ * $Id: silence_gen.h,v 1.19 2009/09/04 14:38:47 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #if !defined(_SPANDSP_SILENCE_GEN_H_)
</span><span class="lines">@@ -125,6 +125,16 @@
</span><span class="cx"> */
</span><span class="cx"> SPAN_DECLARE(int) span_dummy_mod(void *user_data, int16_t amp[], int len);
</span><span class="cx">
</span><ins>+/*! A dummy routine to use as a receive fillin callback, when we aren't really
+ trying to process what is received. It just absorbs and ignores the
+ request.
+ \brief Dummy receive fillin callback.
+ \param user_data The context.
+ \param len The length of the signal buffer
+ \return 0.
+*/
+SPAN_DECLARE_NONSTD(int) span_dummy_rx_fillin(void *user_data, int len);
+
</ins><span class="cx"> #if defined(__cplusplus)
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspswept_tonehfromrev15313freeswitchtrunklibsspandspsrcspandspswept_toneh"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/swept_tone.h (from rev 15313, freeswitch/trunk/libs/spandsp/src/spandsp/swept_tone.h) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/swept_tone.h         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/swept_tone.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * SpanDSP - a series of DSP components for telephony
+ *
+ * swept_tone.h - Swept tone generation
+ *
+ * Written by Steve Underwood <steveu@coppice.org>
+ *
+ * Copyright (C) 2009 Steve Underwood
+ *
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2, as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id: swept_tone.h,v 1.1 2009/09/22 12:54:33 steveu Exp $
+ */
+
+/*! \file */
+
+#if !defined(_SPANDSP_SWEPT_TONE_H_)
+#define _SPANDSP_SWEPT_TONE_H_
+
+/*! \page swept_tone_page The swept tone generator
+\section swept_tone_page_sec_1 What does it do?
+*/
+
+typedef struct swept_tone_state_s swept_tone_state_t;
+
+#if defined(__cplusplus)
+extern "C"
+{
+#endif
+
+SPAN_DECLARE(swept_tone_state_t *) swept_tone_init(swept_tone_state_t *s, float start, float end, float level, int duration, int repeating);
+
+SPAN_DECLARE(int) swept_tone(swept_tone_state_t *s, int16_t amp[], int len);
+
+SPAN_DECLARE(float) swept_tone_current_frequency(swept_tone_state_t *s);
+
+SPAN_DECLARE(int) swept_tone_release(swept_tone_state_t *s);
+
+SPAN_DECLARE(int) swept_tone_free(swept_tone_state_t *s);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif
+/*- End of file ------------------------------------------------------------*/
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspt30h"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/t30.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/t30.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/t30.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: t30.h,v 1.125 2009/04/12 09:12:10 steveu Exp $
</del><ins>+ * $Id: t30.h,v 1.126 2009/09/21 15:52:39 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -524,9 +524,9 @@
</span><span class="cx"> int pages_rx;
</span><span class="cx"> /*! \brief The number of pages in the file (<0 if not known). */
</span><span class="cx"> int pages_in_file;
</span><del>- /*! \brief The horizontal column-to-column resolution of the page, in pixels per metre */
</del><ins>+ /*! \brief The horizontal column-to-column resolution of the most recent page, in pixels per metre */
</ins><span class="cx"> int x_resolution;
</span><del>- /*! \brief The vertical row-to-row resolution of the page, in pixels per metre */
</del><ins>+ /*! \brief The vertical row-to-row resolution of the most recent page, in pixels per metre */
</ins><span class="cx"> int y_resolution;
</span><span class="cx"> /*! \brief The number of horizontal pixels in the most recent page. */
</span><span class="cx"> int width;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandsptimingh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/timing.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/timing.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/timing.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: timing.h,v 1.13 2008/04/17 14:27:01 steveu Exp $
</del><ins>+ * $Id: timing.h,v 1.14 2009/09/04 14:38:47 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #if !defined(_SPANDSP_TIMING_H_)
</span><span class="lines">@@ -56,8 +56,8 @@
</span><span class="cx"> #elif defined(__x86_64__)
</span><span class="cx"> static __inline__ uint64_t rdtscll(void)
</span><span class="cx"> {
</span><del>- unsigned int a;
- unsigned int d;
</del><ins>+ uint32_t a;
+ uint32_t d;
</ins><span class="cx">
</span><span class="cx"> /* For x86_64 we need to merge the result in 2 32 bit registers
</span><span class="cx"> into one clean 64 bit result. */
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandspversionh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/version.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/version.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp/version.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -30,9 +30,9 @@
</span><span class="cx">
</span><span class="cx"> /* The date and time of the version are in UTC form. */
</span><span class="cx">
</span><del>-#define SPANDSP_RELEASE_DATE 20090714
-#define SPANDSP_RELEASE_TIME 135534
-#define SPANDSP_RELEASE_DATETIME_STRING "20090714 135534"
</del><ins>+#define SPANDSP_RELEASE_DATE 20091005
+#define SPANDSP_RELEASE_TIME 163835
+#define SPANDSP_RELEASE_DATETIME_STRING "20091005 163835"
</ins><span class="cx">
</span><span class="cx"> #endif
</span><span class="cx"> /*- End of file ------------------------------------------------------------*/
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcspandsphin"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp.h.in (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp.h.in        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/spandsp.h.in        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: spandsp.h.in,v 1.18 2009/04/02 13:43:49 steveu Exp $
</del><ins>+ * $Id: spandsp.h.in,v 1.19 2009/09/22 13:11:04 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -66,6 +66,7 @@
</span><span class="cx"> #include <spandsp/complex_filters.h>
</span><span class="cx"> #include <spandsp/dc_restore.h>
</span><span class="cx"> #include <spandsp/dds.h>
</span><ins>+#include <spandsp/swept_tone.h>
</ins><span class="cx"> #include <spandsp/echo.h>
</span><span class="cx"> #include <spandsp/modem_echo.h>
</span><span class="cx"> #include <spandsp/crc.h>
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrcswept_tonecfromrev15313freeswitchtrunklibsspandspsrcswept_tonec"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/swept_tone.c (from rev 15313, freeswitch/trunk/libs/spandsp/src/swept_tone.c) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/swept_tone.c         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/swept_tone.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,128 @@
</span><ins>+/*
+ * SpanDSP - a series of DSP components for telephony
+ *
+ * swept_tone.c - Swept tone generation
+ *
+ * Written by Steve Underwood <steveu@coppice.org>
+ *
+ * Copyright (C) 2009 Steve Underwood
+ *
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2, as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id: swept_tone.c,v 1.2 2009/09/23 16:02:59 steveu Exp $
+ */
+
+/*! \file */
+
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <inttypes.h>
+#include <string.h>
+#include <stdio.h>
+#if defined(HAVE_TGMATH_H)
+#include <tgmath.h>
+#endif
+#if defined(HAVE_MATH_H)
+#include <math.h>
+#endif
+#include "floating_fudge.h"
+
+#include "spandsp/telephony.h"
+#include "spandsp/logging.h"
+#include "spandsp/complex.h"
+#include "spandsp/vector_float.h"
+#include "spandsp/complex_vector_float.h"
+#include "spandsp/vector_int.h"
+#include "spandsp/complex_vector_int.h"
+#include "spandsp/dds.h"
+
+#include "spandsp/swept_tone.h"
+
+#include "spandsp/private/logging.h"
+#include "spandsp/private/swept_tone.h"
+
+SPAN_DECLARE(swept_tone_state_t *) swept_tone_init(swept_tone_state_t *s, float start, float end, float level, int duration, int repeating)
+{
+ if (s == NULL)
+ {
+ if ((s = (swept_tone_state_t *) malloc(sizeof(*s))) == NULL)
+ return NULL;
+ }
+ memset(s, 0, sizeof(*s));
+ s->current_phase_inc =
+ s->starting_phase_inc = dds_phase_rate(start);
+ s->phase_inc_step = dds_phase_rate((end - start)/(float) duration);
+ s->scale = dds_scaling_dbm0(level);
+ s->duration = duration;
+ s->repeating = repeating;
+ s->pos = 0;
+ s->phase = 0;
+ return s;
+}
+/*- End of function --------------------------------------------------------*/
+
+SPAN_DECLARE(int) swept_tone(swept_tone_state_t *s, int16_t amp[], int max_len)
+{
+ int i;
+ int len;
+ int chunk_len;
+
+ for (len = 0; len < max_len; )
+ {
+ chunk_len = max_len - len;
+ if (chunk_len > s->duration - s->pos)
+ chunk_len = s->duration - s->pos;
+ for (i = len; i < len + chunk_len; i++)
+ {
+ amp[i] = (dds(&s->phase, s->current_phase_inc)*s->scale) >> 15;
+ s->current_phase_inc += s->phase_inc_step;
+ }
+ len += chunk_len;
+ s->pos += chunk_len;
+ if (s->pos >= s->duration)
+ {
+ if (!s->repeating)
+ break;
+ s->pos = 0;
+ s->current_phase_inc = s->starting_phase_inc;
+ }
+ }
+ return len;
+}
+/*- End of function --------------------------------------------------------*/
+
+SPAN_DECLARE(float) swept_tone_current_frequency(swept_tone_state_t *s)
+{
+ return dds_frequency(s->current_phase_inc);
+}
+/*- End of function --------------------------------------------------------*/
+
+SPAN_DECLARE(int) swept_tone_release(swept_tone_state_t *s)
+{
+ return 0;
+}
+/*- End of function --------------------------------------------------------*/
+
+SPAN_DECLARE(int) swept_tone_free(swept_tone_state_t *s)
+{
+ free(s);
+ return 0;
+}
+/*- End of function --------------------------------------------------------*/
+/*- End of file ------------------------------------------------------------*/
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrct30c"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/t30.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/t30.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/t30.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: t30.c,v 1.301 2009/05/25 12:37:38 steveu Exp $
</del><ins>+ * $Id: t30.c,v 1.303 2009/09/21 15:51:18 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -421,7 +421,7 @@
</span><span class="cx"> }
</span><span class="cx"> s->ecm_block = 0;
</span><span class="cx"> s->error_correcting_mode_retries = 0;
</span><del>- span_log(&s->logging, SPAN_LOG_FLOW, "Starting page %d of transfer\n", s->ecm_tx_page + 1);
</del><ins>+ span_log(&s->logging, SPAN_LOG_FLOW, "Starting page %d of transfer\n", s->tx_page_number + 1);
</ins><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="lines">@@ -431,7 +431,7 @@
</span><span class="cx"> s->retries = 0;
</span><span class="cx"> if (t4_tx_end_page(&(s->t4)) == 0)
</span><span class="cx"> {
</span><del>- s->ecm_tx_page++;
</del><ins>+ s->tx_page_number++;
</ins><span class="cx"> s->ecm_block = 0;
</span><span class="cx"> }
</span><span class="cx"> return 0;
</span><span class="lines">@@ -470,7 +470,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (t4_rx_end_page(&(s->t4)) == 0)
</span><span class="cx"> {
</span><del>- s->ecm_rx_page++;
</del><ins>+ s->rx_page_number++;
</ins><span class="cx"> s->ecm_block = 0;
</span><span class="cx"> }
</span><span class="cx"> return 0;
</span><span class="lines">@@ -1042,7 +1042,7 @@
</span><span class="cx"> frame[1] = CONTROL_FIELD_FINAL_FRAME;
</span><span class="cx"> frame[2] = (uint8_t) (T30_PPS | s->dis_received);
</span><span class="cx"> frame[3] = (s->ecm_at_page_end) ? ((uint8_t) (s->next_tx_step | s->dis_received)) : T30_NULL;
</span><del>- frame[4] = (uint8_t) (s->ecm_tx_page & 0xFF);
</del><ins>+ frame[4] = (uint8_t) (s->tx_page_number & 0xFF);
</ins><span class="cx"> frame[5] = (uint8_t) (s->ecm_block & 0xFF);
</span><span class="cx"> frame[6] = (uint8_t) ((s->ecm_frames_this_tx_burst == 0) ? 0 : (s->ecm_frames_this_tx_burst - 1));
</span><span class="cx"> span_log(&s->logging, SPAN_LOG_FLOW, "Sending PPS + %s\n", t30_frametype(frame[3]));
</span><span class="lines">@@ -1957,30 +1957,19 @@
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="cx">
</span><del>-static void unexpected_frame(t30_state_t *s, const uint8_t *msg, int len)
-{
- span_log(&s->logging, SPAN_LOG_FLOW, "Unexpected %s received in state %d\n", t30_frametype(msg[2]), s->state);
- switch (s->state)
- {
- case T30_STATE_F_DOC_ECM:
- case T30_STATE_F_DOC_NON_ECM:
- s->current_status = T30_ERR_RX_INVALCMD;
- break;
- }
-}
-/*- End of function --------------------------------------------------------*/
-
</del><span class="cx"> static void unexpected_non_final_frame(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><span class="cx"> span_log(&s->logging, SPAN_LOG_FLOW, "Unexpected %s frame in state %d\n", t30_frametype(msg[2]), s->state);
</span><del>- s->current_status = T30_ERR_UNEXPECTED;
</del><ins>+ if (s->current_status == T30_ERR_OK)
+ s->current_status = T30_ERR_UNEXPECTED;
</ins><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="cx">
</span><span class="cx"> static void unexpected_final_frame(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- span_log(&s->logging, SPAN_LOG_FLOW, "Unexpected %s received in state %d\n", t30_frametype(msg[2]), s->state);
- s->current_status = T30_ERR_UNEXPECTED;
</del><ins>+ span_log(&s->logging, SPAN_LOG_FLOW, "Unexpected %s frame in state %d\n", t30_frametype(msg[2]), s->state);
+ if (s->current_status == T30_ERR_OK)
+ s->current_status = T30_ERR_UNEXPECTED;
</ins><span class="cx"> send_dcn(s);
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="lines">@@ -1988,7 +1977,8 @@
</span><span class="cx"> static void unexpected_frame_length(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><span class="cx"> span_log(&s->logging, SPAN_LOG_FLOW, "Unexpected %s frame length - %d\n", t30_frametype(msg[0]), len);
</span><del>- s->current_status = T30_ERR_UNEXPECTED;
</del><ins>+ if (s->current_status == T30_ERR_OK)
+ s->current_status = T30_ERR_UNEXPECTED;
</ins><span class="cx"> send_dcn(s);
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="lines">@@ -2372,9 +2362,9 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> span_log(&s->logging, SPAN_LOG_FLOW, "Received PPS + %s - page %d, block %d, %d frames\n", t30_frametype(msg[3]), page, block, frames);
</span><del>- if (page != s->ecm_rx_page)
</del><ins>+ if (page != s->rx_page_number)
</ins><span class="cx"> {
</span><del>- span_log(&s->logging, SPAN_LOG_FLOW, "ECM rx page mismatch - expected %d, but received %d.\n", s->ecm_rx_page, page);
</del><ins>+ span_log(&s->logging, SPAN_LOG_FLOW, "ECM rx page mismatch - expected %d, but received %d.\n", s->rx_page_number, page);
</ins><span class="cx"> }
</span><span class="cx"> if (block != s->ecm_block)
</span><span class="cx"> {
</span><span class="lines">@@ -2645,7 +2635,11 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_answering(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ uint8_t fcf;
+
+ /* We should be sending the TCF data right now */
+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_DIS:
</span><span class="cx"> /* TODO: This is a fudge to allow for starting up in T.38, where the other end has
</span><span class="lines">@@ -2675,7 +2669,11 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_b(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ uint8_t fcf;
+
+ /* We should be sending the TCF data right now */
+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_DCN:
</span><span class="cx"> /* Just ignore any DCN's which appear at this stage. */
</span><span class="lines">@@ -2696,7 +2694,10 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_c(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ uint8_t fcf;
+
+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_DCN:
</span><span class="cx"> /* Just ignore any DCN's which appear at this stage. */
</span><span class="lines">@@ -2717,8 +2718,11 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_d(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><ins>+ uint8_t fcf;
+
</ins><span class="cx"> /* We should be sending the DCS sequence right now */
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_DCN:
</span><span class="cx"> s->current_status = T30_ERR_TX_BADDCS;
</span><span class="lines">@@ -2740,8 +2744,11 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_d_tcf(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><ins>+ uint8_t fcf;
+
</ins><span class="cx"> /* We should be sending the TCF data right now */
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_DCN:
</span><span class="cx"> s->current_status = T30_ERR_TX_BADDCS;
</span><span class="lines">@@ -2763,7 +2770,10 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_d_post_tcf(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ uint8_t fcf;
+
+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_CFR:
</span><span class="cx"> /* Trainability test succeeded. Send the document. */
</span><span class="lines">@@ -2832,8 +2842,11 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_f_tcf(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><ins>+ uint8_t fcf;
+
</ins><span class="cx"> /* We should be receiving TCF right now, not HDLC messages */
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_CRP:
</span><span class="cx"> repeat_last_command(s);
</span><span class="lines">@@ -2851,8 +2864,11 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_f_cfr(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><ins>+ uint8_t fcf;
+
</ins><span class="cx"> /* We're waiting for a response to the CFR we sent */
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_DCS:
</span><span class="cx"> /* If we received another DCS, they must have missed our CFR */
</span><span class="lines">@@ -2874,8 +2890,11 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_f_ftt(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><ins>+ uint8_t fcf;
+
</ins><span class="cx"> /* We're waiting for a response to the FTT we sent */
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_DCS:
</span><span class="cx"> process_rx_dcs(s, msg, len);
</span><span class="lines">@@ -2896,12 +2915,15 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_f_doc_non_ecm(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><ins>+ uint8_t fcf;
+
</ins><span class="cx"> /* If we are getting HDLC messages, and we have not moved to the _POST_DOC_NON_ECM
</span><span class="cx"> state, it looks like either:
</span><span class="cx"> - we didn't see the image data carrier properly, or
</span><span class="cx"> - they didn't see our T30_CFR, and are repeating the DCS/TCF sequence.
</span><span class="cx"> - they didn't see out T30_MCF, and are repeating the end of page message. */
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_DIS:
</span><span class="cx"> process_rx_dis_dtc(s, msg, len);
</span><span class="lines">@@ -2912,7 +2934,7 @@
</span><span class="cx"> case T30_MPS:
</span><span class="cx"> /* Treat this as a bad quality page. */
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, msg[2] & 0xFE);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> s->next_rx_step = msg[2] & 0xFE;
</span><span class="cx"> queue_phase(s, T30_PHASE_D_TX);
</span><span class="cx"> set_state(s, T30_STATE_III_Q_RTN);
</span><span class="lines">@@ -2922,7 +2944,7 @@
</span><span class="cx"> /* Treat this as a bad quality page. */
</span><span class="cx"> if (s->phase_d_handler)
</span><span class="cx"> {
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, msg[2] & 0xFE);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3);
</span><span class="cx"> }
</span><span class="cx"> s->next_rx_step = msg[2] & 0xFE;
</span><span class="lines">@@ -2932,7 +2954,7 @@
</span><span class="cx"> case T30_EOS:
</span><span class="cx"> /* Treat this as a bad quality page. */
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, msg[2] & 0xFE);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> s->next_rx_step = msg[2] & 0xFE;
</span><span class="cx"> /* Return to phase B */
</span><span class="cx"> queue_phase(s, T30_PHASE_B_TX);
</span><span class="lines">@@ -2943,7 +2965,7 @@
</span><span class="cx"> /* Treat this as a bad quality page. */
</span><span class="cx"> if (s->phase_d_handler)
</span><span class="cx"> {
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, msg[2] & 0xFE);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3);
</span><span class="cx"> }
</span><span class="cx"> s->next_rx_step = T30_PRI_EOM;
</span><span class="lines">@@ -2952,7 +2974,7 @@
</span><span class="cx"> case T30_EOP:
</span><span class="cx"> /* Treat this as a bad quality page. */
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, msg[2] & 0xFE);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> s->next_rx_step = msg[2] & 0xFE;
</span><span class="cx"> queue_phase(s, T30_PHASE_D_TX);
</span><span class="cx"> set_state(s, T30_STATE_III_Q_RTN);
</span><span class="lines">@@ -2962,7 +2984,7 @@
</span><span class="cx"> /* Treat this as a bad quality page. */
</span><span class="cx"> if (s->phase_d_handler)
</span><span class="cx"> {
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, msg[2] & 0xFE);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3);
</span><span class="cx"> }
</span><span class="cx"> s->next_rx_step = msg[2] & 0xFE;
</span><span class="lines">@@ -2980,6 +3002,7 @@
</span><span class="cx"> break;
</span><span class="cx"> default:
</span><span class="cx"> /* We don't know what to do with this. */
</span><ins>+ s->current_status = T30_ERR_RX_INVALCMD;
</ins><span class="cx"> unexpected_final_frame(s, msg, len);
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="lines">@@ -2988,12 +3011,15 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_f_post_doc_non_ecm(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ uint8_t fcf;
+
+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_MPS:
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, msg[2] & 0xFE);
- s->next_rx_step = msg[2] & 0xFE;
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
+ s->next_rx_step = fcf;
</ins><span class="cx"> queue_phase(s, T30_PHASE_D_TX);
</span><span class="cx"> switch (copy_quality(s))
</span><span class="cx"> {
</span><span class="lines">@@ -3020,10 +3046,10 @@
</span><span class="cx"> case T30_PRI_MPS:
</span><span class="cx"> if (s->phase_d_handler)
</span><span class="cx"> {
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, msg[2] & 0xFE);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3);
</span><span class="cx"> }
</span><del>- s->next_rx_step = msg[2] & 0xFE;
</del><ins>+ s->next_rx_step = fcf;
</ins><span class="cx"> switch (copy_quality(s))
</span><span class="cx"> {
</span><span class="cx"> case T30_COPY_QUALITY_PERFECT:
</span><span class="lines">@@ -3049,8 +3075,8 @@
</span><span class="cx"> case T30_EOM:
</span><span class="cx"> case T30_EOS:
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, msg[2] & 0xFE);
- s->next_rx_step = msg[2] & 0xFE;
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
+ s->next_rx_step = fcf;
</ins><span class="cx"> /* Return to phase B */
</span><span class="cx"> queue_phase(s, T30_PHASE_B_TX);
</span><span class="cx"> switch (copy_quality(s))
</span><span class="lines">@@ -3078,10 +3104,10 @@
</span><span class="cx"> case T30_PRI_EOM:
</span><span class="cx"> if (s->phase_d_handler)
</span><span class="cx"> {
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, msg[2] & 0xFE);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3);
</span><span class="cx"> }
</span><del>- s->next_rx_step = msg[2] & 0xFE;
</del><ins>+ s->next_rx_step = fcf;
</ins><span class="cx"> switch (copy_quality(s))
</span><span class="cx"> {
</span><span class="cx"> case T30_COPY_QUALITY_PERFECT:
</span><span class="lines">@@ -3106,8 +3132,8 @@
</span><span class="cx"> break;
</span><span class="cx"> case T30_EOP:
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, msg[2] & 0xFE);
- s->next_rx_step = msg[2] & 0xFE;
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
+ s->next_rx_step = fcf;
</ins><span class="cx"> queue_phase(s, T30_PHASE_D_TX);
</span><span class="cx"> switch (copy_quality(s))
</span><span class="cx"> {
</span><span class="lines">@@ -3137,10 +3163,10 @@
</span><span class="cx"> case T30_PRI_EOP:
</span><span class="cx"> if (s->phase_d_handler)
</span><span class="cx"> {
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, msg[2] & 0xFE);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3);
</span><span class="cx"> }
</span><del>- s->next_rx_step = msg[2] & 0xFE;
</del><ins>+ s->next_rx_step = fcf;
</ins><span class="cx"> switch (copy_quality(s))
</span><span class="cx"> {
</span><span class="cx"> case T30_COPY_QUALITY_PERFECT:
</span><span class="lines">@@ -3175,6 +3201,7 @@
</span><span class="cx"> break;
</span><span class="cx"> default:
</span><span class="cx"> /* We don't know what to do with this. */
</span><ins>+ s->current_status = T30_ERR_RX_INVALCMD;
</ins><span class="cx"> unexpected_final_frame(s, msg, len);
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="lines">@@ -3183,10 +3210,12 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_f_doc_and_post_doc_ecm(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><ins>+ uint8_t fcf;
</ins><span class="cx"> uint8_t fcf2;
</span><span class="cx">
</span><span class="cx"> /* This actually handles 2 states - _DOC_ECM and _POST_DOC_ECM - as they are very similar */
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_DIS:
</span><span class="cx"> process_rx_dis_dtc(s, msg, len);
</span><span class="lines">@@ -3267,6 +3296,7 @@
</span><span class="cx"> break;
</span><span class="cx"> default:
</span><span class="cx"> /* We don't know what to do with this. */
</span><ins>+ s->current_status = T30_ERR_RX_INVALCMD;
</ins><span class="cx"> unexpected_final_frame(s, msg, len);
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="lines">@@ -3275,7 +3305,10 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_f_post_rcp_mcf(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ uint8_t fcf;
+
+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_CRP:
</span><span class="cx"> repeat_last_command(s);
</span><span class="lines">@@ -3296,7 +3329,10 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_f_post_rcp_ppr(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ uint8_t fcf;
+
+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_CRP:
</span><span class="cx"> repeat_last_command(s);
</span><span class="lines">@@ -3314,7 +3350,10 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_f_post_rcp_rnr(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ uint8_t fcf;
+
+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_RR:
</span><span class="cx"> if (s->receiver_not_ready_count > 0)
</span><span class="lines">@@ -3345,7 +3384,10 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_r(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ uint8_t fcf;
+
+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_DIS:
</span><span class="cx"> process_rx_dis_dtc(s, msg, len);
</span><span class="lines">@@ -3374,7 +3416,10 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_t(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ uint8_t fcf;
+
+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_DIS:
</span><span class="cx"> process_rx_dis_dtc(s, msg, len);
</span><span class="lines">@@ -3400,7 +3445,10 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_i(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ uint8_t fcf;
+
+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_CRP:
</span><span class="cx"> repeat_last_command(s);
</span><span class="lines">@@ -3418,7 +3466,10 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_ii(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ uint8_t fcf;
+
+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_CRP:
</span><span class="cx"> repeat_last_command(s);
</span><span class="lines">@@ -3437,8 +3488,10 @@
</span><span class="cx"> static void process_state_ii_q(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><span class="cx"> t4_stats_t stats;
</span><ins>+ uint8_t fcf;
</ins><span class="cx">
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_MCF:
</span><span class="cx"> switch (s->next_tx_step)
</span><span class="lines">@@ -3447,7 +3500,8 @@
</span><span class="cx"> case T30_PRI_MPS:
</span><span class="cx"> tx_end_page(s);
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_MCF);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
+ /* Transmit the next page */
</ins><span class="cx"> if (tx_start_page(s))
</span><span class="cx"> {
</span><span class="cx"> /* TODO: recover */
</span><span class="lines">@@ -3461,7 +3515,7 @@
</span><span class="cx"> case T30_EOS:
</span><span class="cx"> tx_end_page(s);
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_MCF);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> t4_tx_release(&(s->t4));
</span><span class="cx"> s->operation_in_progress = OPERATION_IN_PROGRESS_NONE;
</span><span class="cx"> if (span_log_test(&s->logging, SPAN_LOG_FLOW))
</span><span class="lines">@@ -3475,7 +3529,7 @@
</span><span class="cx"> case T30_PRI_EOP:
</span><span class="cx"> tx_end_page(s);
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_MCF);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> t4_tx_release(&(s->t4));
</span><span class="cx"> s->operation_in_progress = OPERATION_IN_PROGRESS_NONE;
</span><span class="cx"> send_dcn(s);
</span><span class="lines">@@ -3488,13 +3542,16 @@
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case T30_RTP:
</span><ins>+#if 0
+ s->rtp_events++;
+#endif
</ins><span class="cx"> switch (s->next_tx_step)
</span><span class="cx"> {
</span><span class="cx"> case T30_MPS:
</span><span class="cx"> case T30_PRI_MPS:
</span><span class="cx"> tx_end_page(s);
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_RTP);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> if (tx_start_page(s))
</span><span class="cx"> {
</span><span class="cx"> /* TODO: recover */
</span><span class="lines">@@ -3517,7 +3574,7 @@
</span><span class="cx"> case T30_EOS:
</span><span class="cx"> tx_end_page(s);
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_RTP);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> t4_tx_release(&(s->t4));
</span><span class="cx"> /* TODO: should go back to T, and resend */
</span><span class="cx"> return_to_phase_b(s, TRUE);
</span><span class="lines">@@ -3526,22 +3583,35 @@
</span><span class="cx"> case T30_PRI_EOP:
</span><span class="cx"> tx_end_page(s);
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_RTP);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> t4_tx_release(&(s->t4));
</span><del>- s->current_status = T30_ERR_TX_INVALRSP;
</del><span class="cx"> send_dcn(s);
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case T30_RTN:
</span><ins>+#if 0
+ s->rtn_events++;
+#endif
</ins><span class="cx"> switch (s->next_tx_step)
</span><span class="cx"> {
</span><span class="cx"> case T30_MPS:
</span><span class="cx"> case T30_PRI_MPS:
</span><span class="cx"> s->retries = 0;
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_RTN);
- /* Send fresh training, and then repeat the last page */
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
+#if 0
+ if (!s->retransmit_capable)
+#endif
+ {
+ /* Send the next page, regardless of the problem with the current one. */
+ if (tx_start_page(s))
+ {
+ /* TODO: recover */
+ break;
+ }
+ }
+ /* Send fresh training */
</ins><span class="cx"> if (step_fallback_entry(s) < 0)
</span><span class="cx"> {
</span><span class="cx"> /* We have fallen back as far as we can go. Give up. */
</span><span class="lines">@@ -3558,17 +3628,43 @@
</span><span class="cx"> case T30_EOS:
</span><span class="cx"> s->retries = 0;
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_RTN);
- s->current_status = T30_ERR_TX_INVALRSP;
- return_to_phase_b(s, TRUE);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
+#if 0
+ if (s->retransmit_capable)
+ {
+ /* Wait for DIS */
+ }
+ else
+#endif
+ {
+ return_to_phase_b(s, TRUE);
+ }
</ins><span class="cx"> break;
</span><span class="cx"> case T30_EOP:
</span><span class="cx"> case T30_PRI_EOP:
</span><span class="cx"> s->retries = 0;
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_RTN);
- s->current_status = T30_ERR_TX_INVALRSP;
- send_dcn(s);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
+#if 0
+ if (s->retransmit_capable)
+ {
+ /* Send fresh training, and then repeat the last page */
+ if (step_fallback_entry(s) < 0)
+ {
+ /* We have fallen back as far as we can go. Give up. */
+ s->current_fallback = 0;
+ s->current_status = T30_ERR_CANNOT_TRAIN;
+ send_dcn(s);
+ break;
+ }
+ queue_phase(s, T30_PHASE_B_TX);
+ restart_sending_document(s);
+ }
+ else
+#endif
+ {
+ send_dcn(s);
+ }
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="lines">@@ -3576,7 +3672,7 @@
</span><span class="cx"> s->retries = 0;
</span><span class="cx"> if (s->phase_d_handler)
</span><span class="cx"> {
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_PIP);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3);
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="lines">@@ -3584,7 +3680,7 @@
</span><span class="cx"> s->retries = 0;
</span><span class="cx"> if (s->phase_d_handler)
</span><span class="cx"> {
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_PIN);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3);
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="lines">@@ -3613,6 +3709,7 @@
</span><span class="cx"> break;
</span><span class="cx"> default:
</span><span class="cx"> /* We don't know what to do with this. */
</span><ins>+ s->current_status = T30_ERR_TX_INVALRSP;
</ins><span class="cx"> unexpected_final_frame(s, msg, len);
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="lines">@@ -3621,7 +3718,10 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_iii_q_mcf(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ uint8_t fcf;
+
+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_EOP:
</span><span class="cx"> case T30_EOM:
</span><span class="lines">@@ -3655,7 +3755,10 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_iii_q_rtp(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ uint8_t fcf;
+
+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_EOP:
</span><span class="cx"> case T30_EOM:
</span><span class="lines">@@ -3686,7 +3789,10 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_iii_q_rtn(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ uint8_t fcf;
+
+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_EOP:
</span><span class="cx"> case T30_EOM:
</span><span class="lines">@@ -3721,7 +3827,10 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_iv(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ uint8_t fcf;
+
+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_CRP:
</span><span class="cx"> repeat_last_command(s);
</span><span class="lines">@@ -3740,8 +3849,10 @@
</span><span class="cx"> static void process_state_iv_pps_null(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><span class="cx"> t4_stats_t stats;
</span><ins>+ uint8_t fcf;
</ins><span class="cx">
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_MCF:
</span><span class="cx"> s->retries = 0;
</span><span class="lines">@@ -3765,7 +3876,7 @@
</span><span class="cx"> case T30_PRI_MPS:
</span><span class="cx"> tx_end_page(s);
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_MCF);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> if (tx_start_page(s))
</span><span class="cx"> {
</span><span class="cx"> /* TODO: recover */
</span><span class="lines">@@ -3783,7 +3894,7 @@
</span><span class="cx"> case T30_EOS:
</span><span class="cx"> tx_end_page(s);
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_MCF);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> t4_tx_release(&(s->t4));
</span><span class="cx"> s->operation_in_progress = OPERATION_IN_PROGRESS_NONE;
</span><span class="cx"> if (span_log_test(&s->logging, SPAN_LOG_FLOW))
</span><span class="lines">@@ -3797,7 +3908,7 @@
</span><span class="cx"> case T30_PRI_EOP:
</span><span class="cx"> tx_end_page(s);
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_MCF);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> t4_tx_release(&(s->t4));
</span><span class="cx"> s->operation_in_progress = OPERATION_IN_PROGRESS_NONE;
</span><span class="cx"> send_dcn(s);
</span><span class="lines">@@ -3842,8 +3953,10 @@
</span><span class="cx"> static void process_state_iv_pps_q(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><span class="cx"> t4_stats_t stats;
</span><ins>+ uint8_t fcf;
</ins><span class="cx">
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_MCF:
</span><span class="cx"> s->retries = 0;
</span><span class="lines">@@ -3867,7 +3980,7 @@
</span><span class="cx"> case T30_PRI_MPS:
</span><span class="cx"> tx_end_page(s);
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_MCF);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> if (tx_start_page(s))
</span><span class="cx"> {
</span><span class="cx"> /* TODO: recover */
</span><span class="lines">@@ -3885,7 +3998,7 @@
</span><span class="cx"> case T30_EOS:
</span><span class="cx"> tx_end_page(s);
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_MCF);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> t4_tx_release(&(s->t4));
</span><span class="cx"> s->operation_in_progress = OPERATION_IN_PROGRESS_NONE;
</span><span class="cx"> if (span_log_test(&s->logging, SPAN_LOG_FLOW))
</span><span class="lines">@@ -3899,7 +4012,7 @@
</span><span class="cx"> case T30_PRI_EOP:
</span><span class="cx"> tx_end_page(s);
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_MCF);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> t4_tx_release(&(s->t4));
</span><span class="cx"> s->operation_in_progress = OPERATION_IN_PROGRESS_NONE;
</span><span class="cx"> send_dcn(s);
</span><span class="lines">@@ -3923,7 +4036,7 @@
</span><span class="cx"> s->retries = 0;
</span><span class="cx"> if (s->phase_d_handler)
</span><span class="cx"> {
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_PIP);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3);
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="lines">@@ -3931,7 +4044,7 @@
</span><span class="cx"> s->retries = 0;
</span><span class="cx"> if (s->phase_d_handler)
</span><span class="cx"> {
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_PIN);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3);
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="lines">@@ -3960,8 +4073,10 @@
</span><span class="cx"> static void process_state_iv_pps_rnr(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><span class="cx"> t4_stats_t stats;
</span><ins>+ uint8_t fcf;
</ins><span class="cx">
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_MCF:
</span><span class="cx"> s->retries = 0;
</span><span class="lines">@@ -3985,7 +4100,7 @@
</span><span class="cx"> case T30_PRI_MPS:
</span><span class="cx"> tx_end_page(s);
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_MCF);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> if (tx_start_page(s))
</span><span class="cx"> {
</span><span class="cx"> /* TODO: recover */
</span><span class="lines">@@ -4003,7 +4118,7 @@
</span><span class="cx"> case T30_EOS:
</span><span class="cx"> tx_end_page(s);
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_MCF);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> t4_tx_release(&(s->t4));
</span><span class="cx"> s->operation_in_progress = OPERATION_IN_PROGRESS_NONE;
</span><span class="cx"> if (span_log_test(&s->logging, SPAN_LOG_FLOW))
</span><span class="lines">@@ -4017,7 +4132,7 @@
</span><span class="cx"> case T30_PRI_EOP:
</span><span class="cx"> tx_end_page(s);
</span><span class="cx"> if (s->phase_d_handler)
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_MCF);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> t4_tx_release(&(s->t4));
</span><span class="cx"> s->operation_in_progress = OPERATION_IN_PROGRESS_NONE;
</span><span class="cx"> send_dcn(s);
</span><span class="lines">@@ -4041,7 +4156,7 @@
</span><span class="cx"> s->retries = 0;
</span><span class="cx"> if (s->phase_d_handler)
</span><span class="cx"> {
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_PIP);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3);
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="lines">@@ -4049,7 +4164,7 @@
</span><span class="cx"> s->retries = 0;
</span><span class="cx"> if (s->phase_d_handler)
</span><span class="cx"> {
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_PIN);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3);
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="lines">@@ -4073,7 +4188,10 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_iv_ctc(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ uint8_t fcf;
+
+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_CTR:
</span><span class="cx"> /* Valid response to a CTC received */
</span><span class="lines">@@ -4100,7 +4218,10 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_iv_eor(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ uint8_t fcf;
+
+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_RNR:
</span><span class="cx"> if (s->timer_t5 == 0)
</span><span class="lines">@@ -4113,7 +4234,7 @@
</span><span class="cx"> s->retries = 0;
</span><span class="cx"> if (s->phase_d_handler)
</span><span class="cx"> {
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_PIN);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3);
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="lines">@@ -4138,7 +4259,10 @@
</span><span class="cx">
</span><span class="cx"> static void process_state_iv_eor_rnr(t30_state_t *s, const uint8_t *msg, int len)
</span><span class="cx"> {
</span><del>- switch (msg[2] & 0xFE)
</del><ins>+ uint8_t fcf;
+
+ fcf = msg[2] & 0xFE;
+ switch (fcf)
</ins><span class="cx"> {
</span><span class="cx"> case T30_RNR:
</span><span class="cx"> if (s->timer_t5 == 0)
</span><span class="lines">@@ -4151,7 +4275,7 @@
</span><span class="cx"> s->retries = 0;
</span><span class="cx"> if (s->phase_d_handler)
</span><span class="cx"> {
</span><del>- s->phase_d_handler(s, s->phase_d_user_data, T30_PIN);
</del><ins>+ s->phase_d_handler(s, s->phase_d_user_data, fcf);
</ins><span class="cx"> s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3);
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="lines">@@ -4257,7 +4381,7 @@
</span><span class="cx"> }
</span><span class="cx"> else
</span><span class="cx"> {
</span><del>- unexpected_frame(s, msg, len);
</del><ins>+ unexpected_non_final_frame(s, msg, len);
</ins><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case (T30_SEP & 0xFE):
</span><span class="lines">@@ -4269,7 +4393,7 @@
</span><span class="cx"> }
</span><span class="cx"> else
</span><span class="cx"> {
</span><del>- unexpected_frame(s, msg, len);
</del><ins>+ unexpected_non_final_frame(s, msg, len);
</ins><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case (T30_PSA & 0xFE):
</span><span class="lines">@@ -4280,7 +4404,7 @@
</span><span class="cx"> }
</span><span class="cx"> else
</span><span class="cx"> {
</span><del>- unexpected_frame(s, msg, len);
</del><ins>+ unexpected_non_final_frame(s, msg, len);
</ins><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case (T30_CIA & 0xFE):
</span><span class="lines">@@ -4291,7 +4415,7 @@
</span><span class="cx"> }
</span><span class="cx"> else
</span><span class="cx"> {
</span><del>- unexpected_frame(s, msg, len);
</del><ins>+ unexpected_non_final_frame(s, msg, len);
</ins><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case (T30_ISP & 0xFE):
</span><span class="lines">@@ -4302,7 +4426,7 @@
</span><span class="cx"> }
</span><span class="cx"> else
</span><span class="cx"> {
</span><del>- unexpected_frame(s, msg, len);
</del><ins>+ unexpected_non_final_frame(s, msg, len);
</ins><span class="cx"> }
</span><span class="cx"> break;
</span><span class="cx"> case (T30_TSI & 0xFE):
</span><span class="lines">@@ -5956,8 +6080,8 @@
</span><span class="cx"> t->error_correcting_mode = s->error_correcting_mode;
</span><span class="cx"> t->error_correcting_mode_retries = s->error_correcting_mode_retries;
</span><span class="cx"> t4_get_transfer_statistics(&s->t4, &stats);
</span><del>- t->pages_tx = s->ecm_tx_page;
- t->pages_rx = s->ecm_rx_page;
</del><ins>+ t->pages_tx = s->tx_page_number;
+ t->pages_rx = s->rx_page_number;
</ins><span class="cx"> t->pages_in_file = stats.pages_in_file;
</span><span class="cx"> t->width = stats.width;
</span><span class="cx"> t->length = stats.length;
</span><span class="lines">@@ -5968,6 +6092,10 @@
</span><span class="cx"> t->encoding = stats.encoding;
</span><span class="cx"> t->image_size = stats.line_image_size;
</span><span class="cx"> t->current_status = s->current_status;
</span><ins>+#if 0
+ t->rtn_events = s->rtn_events;
+ t->rtp_events = s->rtp_events;
+#endif
</ins><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="cx">
</span><span class="lines">@@ -6000,9 +6128,13 @@
</span><span class="cx"> t30_build_dis_or_dtc(s);
</span><span class="cx"> memset(&s->rx_info, 0, sizeof(s->rx_info));
</span><span class="cx"> release_resources(s);
</span><del>- /* The ECM page number is only reset at call establishment */
- s->ecm_rx_page = 0;
- s->ecm_tx_page = 0;
</del><ins>+ /* The page number is only reset at call establishment */
+ s->rx_page_number = 0;
+ s->tx_page_number = 0;
+#if 0
+ s->rtn_events = 0;
+ s->rtp_events = 0;
+#endif
</ins><span class="cx"> s->far_end_detected = FALSE;
</span><span class="cx"> s->timer_t0_t1 = ms_to_samples(DEFAULT_TIMER_T0);
</span><span class="cx"> if (s->calling_party)
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrct31c"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/t31.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/t31.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/t31.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: t31.c,v 1.151 2009/07/14 13:54:22 steveu Exp $
</del><ins>+ * $Id: t31.c,v 1.153 2009/10/05 16:33:25 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -176,12 +176,15 @@
</span><span class="cx">
</span><span class="cx"> static int restart_modem(t31_state_t *s, int new_modem);
</span><span class="cx"> static void hdlc_accept_frame(void *user_data, const uint8_t *msg, int len, int ok);
</span><del>-static void set_rx_handler(t31_state_t *s, span_rx_handler_t *handler, void *user_data);
</del><ins>+static void set_rx_handler(t31_state_t *s, span_rx_handler_t *rx_handler, span_rx_fillin_handler_t *fillin_handler, void *user_data);
</ins><span class="cx"> static void set_tx_handler(t31_state_t *s, span_tx_handler_t *handler, void *user_data);
</span><span class="cx"> static void set_next_tx_handler(t31_state_t *s, span_tx_handler_t *handler, void *user_data);
</span><span class="cx"> static int v17_v21_rx(void *user_data, const int16_t amp[], int len);
</span><ins>+static int v17_v21_rx_fillin(void *user_data, int len);
</ins><span class="cx"> static int v27ter_v21_rx(void *user_data, const int16_t amp[], int len);
</span><ins>+static int v27ter_v21_rx_fillin(void *user_data, int len);
</ins><span class="cx"> static int v29_v21_rx(void *user_data, const int16_t amp[], int len);
</span><ins>+static int v29_v21_rx_fillin(void *user_data, int len);
</ins><span class="cx"> static int silence_rx(void *user_data, const int16_t amp[], int len);
</span><span class="cx"> static int cng_rx(void *user_data, const int16_t amp[], int len);
</span><span class="cx"> static void non_ecm_put_bit(void *user_data, int bit);
</span><span class="lines">@@ -1527,7 +1530,7 @@
</span><span class="cx"> s->at_state.rx_signal_present = FALSE;
</span><span class="cx"> s->at_state.rx_trained = FALSE;
</span><span class="cx"> s->rx_frame_received = FALSE;
</span><del>- set_rx_handler(s, (span_rx_handler_t *) &span_dummy_rx, NULL);
</del><ins>+ set_rx_handler(s, (span_rx_handler_t *) &span_dummy_rx, (span_rx_fillin_handler_t *) &span_dummy_rx_fillin, NULL);
</ins><span class="cx"> use_hdlc = FALSE;
</span><span class="cx"> switch (s->modem)
</span><span class="cx"> {
</span><span class="lines">@@ -1546,7 +1549,7 @@
</span><span class="cx"> /* Do V.21/HDLC receive in parallel. The other end may send its
</span><span class="cx"> first message at any time. The CNG tone will continue until
</span><span class="cx"> we get a valid preamble. */
</span><del>- set_rx_handler(s, (span_rx_handler_t *) &cng_rx, s);
</del><ins>+ set_rx_handler(s, (span_rx_handler_t *) &cng_rx, (span_rx_fillin_handler_t *) &span_dummy_rx_fillin, s);
</ins><span class="cx"> t31_v21_rx(s);
</span><span class="cx"> set_tx_handler(s, (span_tx_handler_t *) &modem_connect_tones_tx, &t->connect_tx);
</span><span class="cx"> set_next_tx_handler(s, (span_tx_handler_t *) NULL, NULL);
</span><span class="lines">@@ -1559,7 +1562,7 @@
</span><span class="cx"> }
</span><span class="cx"> else
</span><span class="cx"> {
</span><del>- set_rx_handler(s, (span_rx_handler_t *) &cng_rx, s);
</del><ins>+ set_rx_handler(s, (span_rx_handler_t *) &cng_rx, (span_rx_fillin_handler_t *) &span_dummy_rx_fillin, s);
</ins><span class="cx"> t31_v21_rx(s);
</span><span class="cx"> silence_gen_set(&t->silence_gen, 0);
</span><span class="cx"> set_tx_handler(s, (span_tx_handler_t *) &silence_gen, &t->silence_gen);
</span><span class="lines">@@ -1610,7 +1613,7 @@
</span><span class="cx"> }
</span><span class="cx"> else
</span><span class="cx"> {
</span><del>- set_rx_handler(s, (span_rx_handler_t *) &fsk_rx, &t->v21_rx);
</del><ins>+ set_rx_handler(s, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &t->v21_rx);
</ins><span class="cx"> t31_v21_rx(s);
</span><span class="cx"> }
</span><span class="cx"> break;
</span><span class="lines">@@ -1652,7 +1655,7 @@
</span><span class="cx"> case FAX_MODEM_V17_RX:
</span><span class="cx"> if (!s->t38_mode)
</span><span class="cx"> {
</span><del>- set_rx_handler(s, (span_rx_handler_t *) &v17_v21_rx, s);
</del><ins>+ set_rx_handler(s, (span_rx_handler_t *) &v17_v21_rx, (span_rx_fillin_handler_t *) &v17_v21_rx_fillin, s);
</ins><span class="cx"> v17_rx_restart(&t->v17_rx, s->bit_rate, s->short_train);
</span><span class="cx"> /* Allow for +FCERROR/+FRH:3 */
</span><span class="cx"> t31_v21_rx(s);
</span><span class="lines">@@ -1689,7 +1692,7 @@
</span><span class="cx"> case FAX_MODEM_V27TER_RX:
</span><span class="cx"> if (!s->t38_mode)
</span><span class="cx"> {
</span><del>- set_rx_handler(s, (span_rx_handler_t *) &v27ter_v21_rx, s);
</del><ins>+ set_rx_handler(s, (span_rx_handler_t *) &v27ter_v21_rx, (span_rx_fillin_handler_t *) &v27ter_v21_rx_fillin, s);
</ins><span class="cx"> v27ter_rx_restart(&t->v27ter_rx, s->bit_rate, FALSE);
</span><span class="cx"> /* Allow for +FCERROR/+FRH:3 */
</span><span class="cx"> t31_v21_rx(s);
</span><span class="lines">@@ -1726,7 +1729,7 @@
</span><span class="cx"> case FAX_MODEM_V29_RX:
</span><span class="cx"> if (!s->t38_mode)
</span><span class="cx"> {
</span><del>- set_rx_handler(s, (span_rx_handler_t *) &v29_v21_rx, s);
</del><ins>+ set_rx_handler(s, (span_rx_handler_t *) &v29_v21_rx, (span_rx_fillin_handler_t *) &v29_v21_rx_fillin, s);
</ins><span class="cx"> v29_rx_restart(&t->v29_rx, s->bit_rate, FALSE);
</span><span class="cx"> /* Allow for +FCERROR/+FRH:3 */
</span><span class="cx"> t31_v21_rx(s);
</span><span class="lines">@@ -1752,7 +1755,7 @@
</span><span class="cx"> case FAX_MODEM_SILENCE_RX:
</span><span class="cx"> if (!s->t38_mode)
</span><span class="cx"> {
</span><del>- set_rx_handler(s, (span_rx_handler_t *) &silence_rx, s);
</del><ins>+ set_rx_handler(s, (span_rx_handler_t *) &silence_rx, (span_rx_fillin_handler_t *) &span_dummy_rx_fillin, s);
</ins><span class="cx"> silence_gen_set(&t->silence_gen, 0);
</span><span class="cx"> set_tx_handler(s, (span_tx_handler_t *) &silence_gen, &t->silence_gen);
</span><span class="cx"> set_next_tx_handler(s, (span_tx_handler_t *) NULL, NULL);
</span><span class="lines">@@ -2113,7 +2116,7 @@
</span><span class="cx"> s->at_state.rx_data_bytes = 0;
</span><span class="cx"> s->at_state.transmit = FALSE;
</span><span class="cx"> s->modem = FAX_MODEM_SILENCE_TX;
</span><del>- set_rx_handler(s, (span_rx_handler_t *) &span_dummy_rx, NULL);
</del><ins>+ set_rx_handler(s, (span_rx_handler_t *) &span_dummy_rx, (span_rx_fillin_handler_t *) &span_dummy_rx_fillin, NULL);
</ins><span class="cx"> t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND);
</span><span class="cx"> at_put_response_code(&s->at_state, AT_RESPONSE_CODE_OK);
</span><span class="cx"> }
</span><span class="lines">@@ -2136,9 +2139,13 @@
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="cx">
</span><del>-static void set_rx_handler(t31_state_t *s, span_rx_handler_t *handler, void *user_data)
</del><ins>+static void set_rx_handler(t31_state_t *s,
+ span_rx_handler_t *rx_handler,
+ span_rx_fillin_handler_t *fillin_handler,
+ void *user_data)
</ins><span class="cx"> {
</span><del>- s->audio.modems.rx_handler = handler;
</del><ins>+ s->audio.modems.rx_handler = rx_handler;
+ s->audio.modems.rx_fillin_handler = fillin_handler;
</ins><span class="cx"> s->audio.modems.rx_user_data = user_data;
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="lines">@@ -2208,7 +2215,7 @@
</span><span class="cx"> /* The fast modem has trained, so we no longer need to run the slow
</span><span class="cx"> one in parallel. */
</span><span class="cx"> span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.17 + V.21 to V.17 (%.2fdBm0)\n", v17_rx_signal_power(&s->v17_rx));
</span><del>- set_rx_handler(t, (span_rx_handler_t *) &v17_rx, &s->v17_rx);
</del><ins>+ set_rx_handler(t, (span_rx_handler_t *) &v17_rx, (span_rx_fillin_handler_t *) &v17_rx_fillin, &s->v17_rx);
</ins><span class="cx"> }
</span><span class="cx"> else
</span><span class="cx"> {
</span><span class="lines">@@ -2218,13 +2225,26 @@
</span><span class="cx"> /* We have received something, and the fast modem has not trained. We must
</span><span class="cx"> be receiving valid V.21 */
</span><span class="cx"> span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.17 + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx));
</span><del>- set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, &s->v21_rx);
</del><ins>+ set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &s->v21_rx);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> return len;
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="cx">
</span><ins>+static int v17_v21_rx_fillin(void *user_data, int len)
+{
+ t31_state_t *t;
+ fax_modems_state_t *s;
+
+ t = (t31_state_t *) user_data;
+ s = &t->audio.modems;
+ v17_rx_fillin(&s->v17_rx, len);
+ fsk_rx_fillin(&s->v21_rx, len);
+ return 0;
+}
+/*- End of function --------------------------------------------------------*/
+
</ins><span class="cx"> static int v27ter_v21_rx(void *user_data, const int16_t amp[], int len)
</span><span class="cx"> {
</span><span class="cx"> t31_state_t *t;
</span><span class="lines">@@ -2238,7 +2258,7 @@
</span><span class="cx"> /* The fast modem has trained, so we no longer need to run the slow
</span><span class="cx"> one in parallel. */
</span><span class="cx"> span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.27ter + V.21 to V.27ter (%.2fdBm0)\n", v27ter_rx_signal_power(&s->v27ter_rx));
</span><del>- set_rx_handler(t, (span_rx_handler_t *) &v27ter_rx, &s->v27ter_rx);
</del><ins>+ set_rx_handler(t, (span_rx_handler_t *) &v27ter_rx, (span_rx_fillin_handler_t *) &v27ter_rx_fillin, &s->v27ter_rx);
</ins><span class="cx"> }
</span><span class="cx"> else
</span><span class="cx"> {
</span><span class="lines">@@ -2248,13 +2268,26 @@
</span><span class="cx"> /* We have received something, and the fast modem has not trained. We must
</span><span class="cx"> be receiving valid V.21 */
</span><span class="cx"> span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.27ter + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx));
</span><del>- set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, &s->v21_rx);
</del><ins>+ set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &s->v21_rx);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> return len;
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="cx">
</span><ins>+static int v27ter_v21_rx_fillin(void *user_data, int len)
+{
+ t31_state_t *t;
+ fax_modems_state_t *s;
+
+ t = (t31_state_t *) user_data;
+ s = &t->audio.modems;
+ v27ter_rx_fillin(&s->v27ter_rx, len);
+ fsk_rx_fillin(&s->v21_rx, len);
+ return 0;
+}
+/*- End of function --------------------------------------------------------*/
+
</ins><span class="cx"> static int v29_v21_rx(void *user_data, const int16_t amp[], int len)
</span><span class="cx"> {
</span><span class="cx"> t31_state_t *t;
</span><span class="lines">@@ -2268,7 +2301,7 @@
</span><span class="cx"> /* The fast modem has trained, so we no longer need to run the slow
</span><span class="cx"> one in parallel. */
</span><span class="cx"> span_log(&s->logging, SPAN_LOG_FLOW, "Switching from V.29 + V.21 to V.29 (%.2fdBm0)\n", v29_rx_signal_power(&s->v29_rx));
</span><del>- set_rx_handler(t, (span_rx_handler_t *) &v29_rx, &s->v29_rx);
</del><ins>+ set_rx_handler(t, (span_rx_handler_t *) &v29_rx, (span_rx_fillin_handler_t *) &v29_rx_fillin, &s->v29_rx);
</ins><span class="cx"> }
</span><span class="cx"> else
</span><span class="cx"> {
</span><span class="lines">@@ -2278,13 +2311,26 @@
</span><span class="cx"> /* We have received something, and the fast modem has not trained. We must
</span><span class="cx"> be receiving valid V.21 */
</span><span class="cx"> span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.29 + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx));
</span><del>- set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, &s->v21_rx);
</del><ins>+ set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &s->v21_rx);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> return len;
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="cx">
</span><ins>+static int v29_v21_rx_fillin(void *user_data, int len)
+{
+ t31_state_t *t;
+ fax_modems_state_t *s;
+
+ t = (t31_state_t *) user_data;
+ s = &t->audio.modems;
+ v29_rx_fillin(&s->v29_rx, len);
+ fsk_rx_fillin(&s->v21_rx, len);
+ return 0;
+}
+/*- End of function --------------------------------------------------------*/
+
</ins><span class="cx"> SPAN_DECLARE(int) t31_rx(t31_state_t *s, int16_t amp[], int len)
</span><span class="cx"> {
</span><span class="cx"> int i;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrct38_non_ecm_bufferc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/t38_non_ecm_buffer.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/t38_non_ecm_buffer.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/t38_non_ecm_buffer.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: t38_non_ecm_buffer.c,v 1.8 2009/02/10 13:06:46 steveu Exp $
</del><ins>+ * $Id: t38_non_ecm_buffer.c,v 1.9 2009/10/05 16:33:25 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -46,9 +46,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> #include "floating_fudge.h"
</span><span class="cx"> #include <assert.h>
</span><del>-#if defined(LOG_FAX_AUDIO)
-#include <unistd.h>
-#endif
</del><span class="cx">
</span><span class="cx"> #include "spandsp/telephony.h"
</span><span class="cx"> #include "spandsp/logging.h"
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandspsrct38_terminalc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/t38_terminal.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/t38_terminal.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/src/t38_terminal.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> * License along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: t38_terminal.c,v 1.127 2009/07/14 13:54:22 steveu Exp $
</del><ins>+ * $Id: t38_terminal.c,v 1.128 2009/09/04 14:38:46 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -93,9 +93,9 @@
</span><span class="cx">
</span><span class="cx"> enum
</span><span class="cx"> {
</span><del>- T38_CHUNKING_MERGE_FCS_WITH_DATA = 0x0001,
- T38_CHUNKING_WHOLE_FRAMES = 0x0002,
- T38_CHUNKING_ALLOW_TEP_TIME = 0x0004
</del><ins>+ T38_CHUNKING_MERGE_FCS_WITH_DATA = 0x0001,
+ T38_CHUNKING_WHOLE_FRAMES = 0x0002,
+ T38_CHUNKING_ALLOW_TEP_TIME = 0x0004
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> enum
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandsptestsMakefileam"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/Makefile.am (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/Makefile.am        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/Makefile.am        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -16,7 +16,7 @@
</span><span class="cx"> ## along with this program; if not, write to the Free Software
</span><span class="cx"> ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> ##
</span><del>-## $Id: Makefile.am,v 1.116 2009/05/30 15:23:13 steveu Exp $
</del><ins>+## $Id: Makefile.am,v 1.117 2009/09/22 13:11:04 steveu Exp $
</ins><span class="cx">
</span><span class="cx"> AM_CFLAGS = $(COMP_VENDOR_CFLAGS)
</span><span class="cx"> AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS)
</span><span class="lines">@@ -99,6 +99,7 @@
</span><span class="cx"> sig_tone_tests \
</span><span class="cx"> super_tone_rx_tests \
</span><span class="cx"> super_tone_tx_tests \
</span><ins>+ swept_tone_tests \
</ins><span class="cx"> t4_tests \
</span><span class="cx"> t31_tests \
</span><span class="cx"> t38_core_tests \
</span><span class="lines">@@ -273,6 +274,9 @@
</span><span class="cx"> super_tone_tx_tests_SOURCES = super_tone_tx_tests.c
</span><span class="cx"> super_tone_tx_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp
</span><span class="cx">
</span><ins>+swept_tone_tests_SOURCES = swept_tone_tests.c
+swept_tone_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp
+
</ins><span class="cx"> t4_tests_SOURCES = t4_tests.c
</span><span class="cx"> t4_tests_LDADD = $(LIBDIR) -lspandsp
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandsptestsfax_decodec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/fax_decode.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/fax_decode.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/fax_decode.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> * along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: fax_decode.c,v 1.56 2009/05/30 15:23:13 steveu Exp $
</del><ins>+ * $Id: fax_decode.c,v 1.57 2009/09/15 14:01:53 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \page fax_decode_page FAX decoder
</span><span class="lines">@@ -124,7 +124,7 @@
</span><span class="cx"> type = fr[2] & 0xFE;
</span><span class="cx"> if (type == T30_DIS || type == T30_DTC || type == T30_DCS)
</span><span class="cx"> t30_decode_dis_dtc_dcs(&t30_dummy, fr, frlen);
</span><del>- if (type == T30_NSF)
</del><ins>+ if (type == T30_NSF || type == T30_NSS || type == T30_NSC)
</ins><span class="cx"> {
</span><span class="cx"> if (t35_decode(&fr[3], frlen - 3, &country, &vendor, &model))
</span><span class="cx"> {
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandsptestsline_model_testsc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/line_model_tests.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/line_model_tests.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/line_model_tests.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> * along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: line_model_tests.c,v 1.27 2009/05/30 15:23:14 steveu Exp $
</del><ins>+ * $Id: line_model_tests.c,v 1.28 2009/09/23 16:02:59 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \page line_model_tests_page Telephony line model tests
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx"> #define IN_FILE_NAME1 "line_model_test_in1.wav"
</span><span class="cx"> #define IN_FILE_NAME2 "line_model_test_in2.wav"
</span><span class="cx"> #define OUT_FILE_NAME1 "line_model_one_way_test_out.wav"
</span><del>-#define OUT_FILE_NAME "line_model_test_out.wav"
</del><ins>+#define OUT_FILE_NAME2 "line_model_two_way_test_out.wav"
</ins><span class="cx">
</span><span class="cx"> int channel_codec;
</span><span class="cx"> int rbs_pattern;
</span><span class="lines">@@ -128,11 +128,18 @@
</span><span class="cx">
</span><span class="cx"> awgn_init_dbm0(&noise1, 1234567, -10.0f);
</span><span class="cx">
</span><del>- if ((inhandle1 = sf_open_telephony_read(IN_FILE_NAME1, 1)) == NULL)
</del><ins>+ if (speech_test)
</ins><span class="cx"> {
</span><del>- fprintf(stderr, " Cannot open audio file '%s'\n", IN_FILE_NAME1);
- exit(2);
</del><ins>+ if ((inhandle1 = sf_open_telephony_read(IN_FILE_NAME1, 1)) == NULL)
+ {
+ fprintf(stderr, " Cannot open audio file '%s'\n", IN_FILE_NAME1);
+ exit(2);
+ }
</ins><span class="cx"> }
</span><ins>+ else
+ {
+ inhandle1 = NULL;
+ }
</ins><span class="cx"> if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME1, 1)) == NULL)
</span><span class="cx"> {
</span><span class="cx"> fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME1);
</span><span class="lines">@@ -167,10 +174,13 @@
</span><span class="cx"> exit(2);
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>- if (sf_close(inhandle1))
</del><ins>+ if (speech_test)
</ins><span class="cx"> {
</span><del>- fprintf(stderr, " Cannot close audio file '%s'\n", IN_FILE_NAME1);
- exit(2);
</del><ins>+ if (sf_close(inhandle1))
+ {
+ fprintf(stderr, " Cannot close audio file '%s'\n", IN_FILE_NAME1);
+ exit(2);
+ }
</ins><span class="cx"> }
</span><span class="cx"> if (sf_close(outhandle))
</span><span class="cx"> {
</span><span class="lines">@@ -208,19 +218,27 @@
</span><span class="cx"> awgn_init_dbm0(&noise1, 1234567, -10.0f);
</span><span class="cx"> awgn_init_dbm0(&noise2, 1234567, -10.0f);
</span><span class="cx">
</span><del>- if ((inhandle1 = sf_open_telephony_read(IN_FILE_NAME1, 1)) == NULL)
</del><ins>+ if (speech_test)
</ins><span class="cx"> {
</span><del>- fprintf(stderr, " Cannot open audio file '%s'\n", IN_FILE_NAME1);
- exit(2);
</del><ins>+ if ((inhandle1 = sf_open_telephony_read(IN_FILE_NAME1, 1)) == NULL)
+ {
+ fprintf(stderr, " Cannot open audio file '%s'\n", IN_FILE_NAME1);
+ exit(2);
+ }
+ if ((inhandle2 = sf_open_telephony_read(IN_FILE_NAME2, 1)) == NULL)
+ {
+ fprintf(stderr, " Cannot open audio file '%s'\n", IN_FILE_NAME2);
+ exit(2);
+ }
</ins><span class="cx"> }
</span><del>- if ((inhandle2 = sf_open_telephony_read(IN_FILE_NAME2, 1)) == NULL)
</del><ins>+ else
</ins><span class="cx"> {
</span><del>- fprintf(stderr, " Cannot open audio file '%s'\n", IN_FILE_NAME2);
- exit(2);
</del><ins>+ inhandle1 =
+ inhandle2 = NULL;
</ins><span class="cx"> }
</span><del>- if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME, 2)) == NULL)
</del><ins>+ if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME2, 2)) == NULL)
</ins><span class="cx"> {
</span><del>- fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME);
</del><ins>+ fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME2);
</ins><span class="cx"> exit(2);
</span><span class="cx"> }
</span><span class="cx"> for (i = 0; i < 10000; i++)
</span><span class="lines">@@ -261,25 +279,80 @@
</span><span class="cx"> exit(2);
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>- if (sf_close(inhandle1))
</del><ins>+ if (speech_test)
</ins><span class="cx"> {
</span><del>- fprintf(stderr, " Cannot close audio file '%s'\n", IN_FILE_NAME1);
- exit(2);
</del><ins>+ if (sf_close(inhandle1))
+ {
+ fprintf(stderr, " Cannot close audio file '%s'\n", IN_FILE_NAME1);
+ exit(2);
+ }
+ if (sf_close(inhandle2))
+ {
+ fprintf(stderr, " Cannot close audio file '%s'\n", IN_FILE_NAME2);
+ exit(2);
+ }
</ins><span class="cx"> }
</span><del>- if (sf_close(inhandle2))
- {
- fprintf(stderr, " Cannot close audio file '%s'\n", IN_FILE_NAME2);
- exit(2);
- }
</del><span class="cx"> if (sf_close(outhandle))
</span><span class="cx"> {
</span><del>- fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME);
</del><ins>+ fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME2);
</ins><span class="cx"> exit(2);
</span><span class="cx"> }
</span><span class="cx"> both_ways_line_model_release(model);
</span><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="cx">
</span><ins>+static void test_line_filter(int line_model_no)
+{
+ float out;
+ double sumin;
+ double sumout;
+ int i;
+ int j;
+ int p;
+ int ptr;
+ int len;
+ swept_tone_state_t *s;
+ float filter[129];
+ int16_t buf[BLOCK_LEN];
+
+ s = swept_tone_init(NULL, 200.0f, 3900.0f, -10.0f, 120*SAMPLE_RATE, 0);
+ for (j = 0; j < 129; j++)
+ filter[j] = 0.0f;
+ ptr = 0;
+ for (;;)
+ {
+ if ((len = swept_tone(s, buf, BLOCK_LEN)) <= 0)
+ break;
+ sumin = 0.0;
+ sumout = 0.0;
+ for (i = 0; i < len; i++)
+ {
+ /* Add the sample in the filter buffer */
+ p = ptr;
+ filter[p] = buf[i];
+ if (++p == 129)
+ p = 0;
+ ptr = p;
+
+ /* Apply the filter */
+ out = 0.0f;
+ for (j = 0; j < 129; j++)
+ {
+ out += line_models[line_model_no][128 - j]*filter[p];
+ if (++p >= 129)
+ p = 0;
+ }
+ sumin += buf[i]*buf[i];
+ sumout += out*out;
+ }
+ /*endfor*/
+ printf("%7.1f %f\n", swept_tone_current_frequency(s), 10.0*log10(sumout/sumin));
+ }
+ /*endfor*/
+ swept_tone_free(s);
+}
+/*- End of function --------------------------------------------------------*/
+
</ins><span class="cx"> int main(int argc, char *argv[])
</span><span class="cx"> {
</span><span class="cx"> int line_model_no;
</span><span class="lines">@@ -319,6 +392,7 @@
</span><span class="cx"> complexify_tests();
</span><span class="cx"> test_one_way_model(line_model_no, speech_test);
</span><span class="cx"> test_both_ways_model(line_model_no, speech_test);
</span><ins>+ test_line_filter(line_model_no);
</ins><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="cx"> /*- End of file ------------------------------------------------------------*/
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandsptestsregression_testssh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/regression_tests.sh (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/regression_tests.sh        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/regression_tests.sh        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -17,7 +17,7 @@
</span><span class="cx"> # License along with this program; if not, write to the Free Software
</span><span class="cx"> # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> #
</span><del>-# $Id: regression_tests.sh,v 1.58 2009/05/19 14:47:02 steveu Exp $
</del><ins>+# $Id: regression_tests.sh,v 1.59 2009/09/22 13:28:18 steveu Exp $
</ins><span class="cx"> #
</span><span class="cx">
</span><span class="cx"> ITUTESTS_TIF=../test-data/itu/fax/itutests.tif
</span><span class="lines">@@ -468,6 +468,16 @@
</span><span class="cx"> #echo super_tone_tx_tests completed OK
</span><span class="cx"> echo super_tone_tx_tests not enabled
</span><span class="cx">
</span><ins>+#./swept_tone_tests >$STDOUT_DEST 2>$STDERR_DEST
+#RETVAL=$?
+#if [ $RETVAL != 0 ]
+#then
+# echo swept_tone_tests failed!
+# exit $RETVAL
+#fi
+#echo swept_tone_tests completed OK
+echo swept_tone_tests not enabled
+
</ins><span class="cx"> ./t31_tests -r >$STDOUT_DEST 2>$STDERR_DEST
</span><span class="cx"> RETVAL=$?
</span><span class="cx"> if [ $RETVAL != 0 ]
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandsptestssig_tone_testsc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/sig_tone_tests.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/sig_tone_tests.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/sig_tone_tests.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> * along with this program; if not, write to the Free Software
</span><span class="cx"> * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
</span><span class="cx"> *
</span><del>- * $Id: sig_tone_tests.c,v 1.25 2009/05/30 15:23:14 steveu Exp $
</del><ins>+ * $Id: sig_tone_tests.c,v 1.27 2009/09/23 16:02:59 steveu Exp $
</ins><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /*! \file */
</span><span class="lines">@@ -58,112 +58,97 @@
</span><span class="cx"> static int sampleno = 0;
</span><span class="cx"> static int tone_1_present = 0;
</span><span class="cx"> static int tone_2_present = 0;
</span><del>-static int ping = 0;
</del><ins>+static int tx_section = 0;
+static int dial_pulses = 0;
</ins><span class="cx">
</span><del>-void map_frequency_response(sig_tone_rx_state_t *s);
-
-static int tx_handler(void *user_data, int what)
</del><ins>+static void tx_handler(void *user_data, int what, int level, int duration)
</ins><span class="cx"> {
</span><del>- //printf("What - %d\n", what);
- if ((what & SIG_TONE_UPDATE_REQUEST))
</del><ins>+ sig_tone_tx_state_t *s;
+
+ s = (sig_tone_tx_state_t *) user_data;
+ //printf("What - %d, duration - %d\n", what, duration);
+ if ((what & SIG_TONE_TX_UPDATE_REQUEST))
</ins><span class="cx"> {
</span><span class="cx"> printf("Tx: update request\n");
</span><del>- /* The signaling processor wants to know what to do next */
- if (sampleno < ms_to_samples(100))
</del><ins>+ /* The sig tone transmit side wants to know what to do next */
+ switch (tx_section)
</ins><span class="cx"> {
</span><del>- /* 100ms off-hook */
- printf("100ms off-hook - %d samples\n", 800 - sampleno);
- return 0x02 | ((ms_to_samples(100) - sampleno) << 16);
- }
- else if (sampleno < ms_to_samples(600))
- {
- /* 500ms idle */
- printf("500ms idle - %d samples\n", ms_to_samples(600) - sampleno);
- return 0x02 | SIG_TONE_1_PRESENT | ((ms_to_samples(600) - sampleno) << 16);
- }
- else if (sampleno < ms_to_samples(700))
- {
- /* 100ms seize */
- printf("100ms seize - %d samples\n", ms_to_samples(700) - sampleno);
- return 0x02 | ((ms_to_samples(700) - sampleno) << 16);
- }
- else if (sampleno < ms_to_samples(1700))
- {
- if (ping)
- {
- printf("33ms break - %d samples\n", ms_to_samples(33));
- ping = !ping;
- return 0x02 | (ms_to_samples(33) << 16);
- }
</del><ins>+ case 0:
+ printf("33ms break - %d samples\n", ms_to_samples(33));
+ tx_section++;
+ sig_tone_tx_set_mode(s, SIG_TONE_1_PRESENT, ms_to_samples(33));
+ break;
+ case 1:
+ printf("67ms make - %d samples\n", ms_to_samples(67));
+ if (++dial_pulses == 9)
+ tx_section++;
</ins><span class="cx"> else
</span><del>- {
- printf("67ms make - %d samples\n", ms_to_samples(67));
- ping = !ping;
- return 0x02 | SIG_TONE_1_PRESENT | (ms_to_samples(67) << 16);
- }
- /*endif*/
</del><ins>+ tx_section--;
+ sig_tone_tx_set_mode(s, 0, ms_to_samples(67));
+ break;
+ case 2:
+ tx_section++;
+ sig_tone_tx_set_mode(s, SIG_TONE_1_PRESENT, ms_to_samples(600));
+ break;
+ case 3:
+ sig_tone_tx_set_mode(s, SIG_TONE_1_PRESENT | SIG_TONE_TX_PASSTHROUGH, 0);
+ break;
</ins><span class="cx"> }
</span><del>- else
- {
- return 0x02 | SIG_TONE_1_PRESENT | ((ms_to_samples(700) - sampleno) << 16) | SIG_TONE_TX_PASSTHROUGH;
- }
- /*endif*/
</del><ins>+ /*endswitch*/
</ins><span class="cx"> }
</span><span class="cx"> /*endif*/
</span><del>- return 0;
</del><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="cx">
</span><del>-static int rx_handler(void *user_data, int what)
</del><ins>+static void rx_handler(void *user_data, int what, int level, int duration)
</ins><span class="cx"> {
</span><del>- //printf("What - %d\n", what);
</del><ins>+ float ms;
+
+ ms = 1000.0f*(float) duration/(float) SAMPLE_RATE;
+ printf("What - %d, duration - %d\n", what, duration);
</ins><span class="cx"> if ((what & SIG_TONE_1_CHANGE))
</span><span class="cx"> {
</span><span class="cx"> tone_1_present = what & SIG_TONE_1_PRESENT;
</span><del>- printf("Rx: tone 1 is %s after %d samples\n", (tone_1_present) ? "on" : "off", (what >> 16) & 0xFFFF);
</del><ins>+ printf("Rx: tone 1 is %s after %d samples (%fms)\n", (tone_1_present) ? "on" : "off", duration, ms);
</ins><span class="cx"> }
</span><span class="cx"> /*endif*/
</span><span class="cx"> if ((what & SIG_TONE_2_CHANGE))
</span><span class="cx"> {
</span><span class="cx"> tone_2_present = what & SIG_TONE_2_PRESENT;
</span><del>- printf("Rx: tone 2 is %s after %d samples\n", (tone_2_present) ? "on" : "off", (what >> 16) & 0xFFFF);
</del><ins>+ printf("Rx: tone 2 is %s after %d samples (%fms)\n", (tone_2_present) ? "on" : "off", duration, ms);
</ins><span class="cx"> }
</span><span class="cx"> /*endif*/
</span><del>- return 0;
</del><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="cx">
</span><del>-void map_frequency_response(sig_tone_rx_state_t *s)
</del><ins>+static void map_frequency_response(sig_tone_rx_state_t *s)
</ins><span class="cx"> {
</span><span class="cx"> int16_t buf[8192];
</span><del>- awgn_state_t noise_source;
</del><span class="cx"> int i;
</span><del>- int f;
- uint32_t phase_acc;
- int32_t phase_rate;
- int32_t scaling;
- double sum;
</del><ins>+ int len;
+ double sumin;
+ double sumout;
+ swept_tone_state_t *swept;
</ins><span class="cx">
</span><span class="cx"> /* Things like noise don't highlight the frequency response of the high Q notch
</span><span class="cx"> very well. We use a slowly swept frequency to check it. */
</span><del>- awgn_init_dbm0(&noise_source, 1234567, -10.0f);
- for (f = 1; f < 4000; f++)
</del><ins>+ swept = swept_tone_init(NULL, 200.0f, 3900.0f, -10.0f, 120*SAMPLE_RATE, 0);
+ for (;;)
</ins><span class="cx"> {
</span><del>- phase_rate = dds_phase_rate(f);
- scaling = dds_scaling_dbm0(-10);
- phase_acc = 0;
- for (i = 0; i < 8192; i++)
- buf[i] = dds_mod(&phase_acc, phase_rate, scaling, 0);
</del><ins>+ if ((len = swept_tone(swept, buf, SAMPLES_PER_CHUNK)) <= 0)
+ break;
+ sumin = 0.0;
+ for (i = 0; i < len; i++)
+ sumin += (double) buf[i]*(double) buf[i];
+ sig_tone_rx(s, buf, len);
+ sumout = 0.0;
+ for (i = 0; i < len; i++)
+ sumout += (double) buf[i]*(double) buf[i];
</ins><span class="cx"> /*endfor*/
</span><del>- sig_tone_rx(s, buf, 8192);
- sum = 0.0;
- for (i = 1000; i < 8192; i++)
- sum += (double) buf[i]*(double) buf[i];
- /*endfor*/
- sum = sqrt(sum);
- printf("%7d %f\n", f, sum);
</del><ins>+ printf("%7.1f %f\n", swept_tone_current_frequency(swept), 10.0*log10(sumout/sumin));
</ins><span class="cx"> }
</span><span class="cx"> /*endfor*/
</span><ins>+ swept_tone_free(swept);
</ins><span class="cx"> }
</span><span class="cx"> /*- End of function --------------------------------------------------------*/
</span><span class="cx">
</span><span class="lines">@@ -189,45 +174,56 @@
</span><span class="cx"> }
</span><span class="cx"> /*endif*/
</span><span class="cx">
</span><del>- awgn_init_dbm0(&noise_source, 1234567, -10.0f);
</del><ins>+ awgn_init_dbm0(&noise_source, 1234567, -20.0f);
</ins><span class="cx">
</span><span class="cx"> for (type = 1; type <= 3; type++)
</span><span class="cx"> {
</span><span class="cx"> sampleno = 0;
</span><span class="cx"> tone_1_present = 0;
</span><span class="cx"> tone_2_present = 0;
</span><del>- ping = 0;
</del><ins>+ tx_section = 0;
</ins><span class="cx"> munge = NULL;
</span><span class="cx"> switch (type)
</span><span class="cx"> {
</span><span class="cx"> case 1:
</span><span class="cx"> printf("2280Hz tests.\n");
</span><span class="cx"> munge = codec_munge_init(MUNGE_CODEC_ALAW, 0);
</span><del>- sig_tone_tx_init(&tx_state, SIG_TONE_2280HZ, tx_handler, NULL);
- sig_tone_rx_init(&rx_state, SIG_TONE_2280HZ, rx_handler, NULL);
</del><ins>+ sig_tone_tx_init(&tx_state, SIG_TONE_2280HZ, tx_handler, &tx_state);
+ sig_tone_rx_init(&rx_state, SIG_TONE_2280HZ, rx_handler, &rx_state);
</ins><span class="cx"> rx_state.current_rx_tone |= SIG_TONE_RX_PASSTHROUGH;
</span><span class="cx"> break;
</span><span class="cx"> case 2:
</span><del>- printf("26000Hz tests.\n");
</del><ins>+ printf("2600Hz tests.\n");
</ins><span class="cx"> munge = codec_munge_init(MUNGE_CODEC_ULAW, 0);
</span><del>- sig_tone_tx_init(&tx_state, SIG_TONE_2600HZ, tx_handler, NULL);
- sig_tone_rx_init(&rx_state, SIG_TONE_2600HZ, rx_handler, NULL);
</del><ins>+ sig_tone_tx_init(&tx_state, SIG_TONE_2600HZ, tx_handler, &tx_state);
+ sig_tone_rx_init(&rx_state, SIG_TONE_2600HZ, rx_handler, &rx_state);
</ins><span class="cx"> rx_state.current_rx_tone |= SIG_TONE_RX_PASSTHROUGH;
</span><span class="cx"> break;
</span><span class="cx"> case 3:
</span><del>- printf("2400Hz/26000Hz tests.\n");
</del><ins>+ printf("2400Hz/2600Hz tests.\n");
</ins><span class="cx"> munge = codec_munge_init(MUNGE_CODEC_ULAW, 0);
</span><del>- sig_tone_tx_init(&tx_state, SIG_TONE_2400HZ_2600HZ, tx_handler, NULL);
- sig_tone_rx_init(&rx_state, SIG_TONE_2400HZ_2600HZ, rx_handler, NULL);
</del><ins>+ sig_tone_tx_init(&tx_state, SIG_TONE_2400HZ_2600HZ, tx_handler, &tx_state);
+ sig_tone_rx_init(&rx_state, SIG_TONE_2400HZ_2600HZ, rx_handler, &rx_state);
</ins><span class="cx"> rx_state.current_rx_tone |= SIG_TONE_RX_PASSTHROUGH;
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> /*endswitch*/
</span><del>-
- //map_frequency_response(&rx_state);
</del><ins>+ /* Set to the default of hook condition */
+ sig_tone_rx_set_mode(&rx_state, SIG_TONE_RX_PASSTHROUGH | SIG_TONE_RX_FILTER_TONE, 0);
+ sig_tone_tx_set_mode(&tx_state, SIG_TONE_1_PRESENT | SIG_TONE_2_PRESENT | SIG_TONE_TX_PASSTHROUGH, 0);
</ins><span class="cx">
</span><del>- for (sampleno = 0; sampleno < 20000; sampleno += SAMPLES_PER_CHUNK)
</del><ins>+ map_frequency_response(&rx_state);
+
+ sig_tone_rx_set_mode(&rx_state, SIG_TONE_RX_PASSTHROUGH, 0);
+ for (sampleno = 0; sampleno < 30000; sampleno += SAMPLES_PER_CHUNK)
</ins><span class="cx"> {
</span><ins>+ if (sampleno == 8000)
+ {
+ /* 100ms seize */
+ printf("100ms seize - %d samples\n", ms_to_samples(100));
+ dial_pulses = 0;
+ sig_tone_tx_set_mode(&tx_state, 0, ms_to_samples(100));
+ }
</ins><span class="cx"> for (i = 0; i < SAMPLES_PER_CHUNK; i++)
</span><span class="cx"> amp[i] = awgn(&noise_source);
</span><span class="cx"> /*endfor*/
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsspandsptestsswept_tone_testscfromrev15313freeswitchtrunklibsspandsptestsswept_tone_testsc"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/swept_tone_tests.c (from rev 15313, freeswitch/trunk/libs/spandsp/tests/swept_tone_tests.c) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/swept_tone_tests.c         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/spandsp/tests/swept_tone_tests.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,101 @@
</span><ins>+/*
+ * SpanDSP - a series of DSP components for telephony
+ *
+ * swept_tone_tests.c
+ *
+ * Written by Steve Underwood <steveu@coppice.org>
+ *
+ * Copyright (C) 2009 Steve Underwood
+ *
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2, as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id: swept_tone_tests.c,v 1.2 2009/09/22 13:28:18 steveu Exp $
+ */
+
+/*! \file */
+
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <memory.h>
+#include <sndfile.h>
+
+#include "spandsp.h"
+#include "spandsp-sim.h"
+
+#define OUTPUT_FILE_NAME "swept_tone.wav"
+
+#define BLOCK_LEN 160
+
+int main(int argc, char *argv[])
+{
+ int i;
+ int j;
+ int outframes;
+ int len;
+ SNDFILE *outhandle;
+ power_meter_t meter;
+ swept_tone_state_t *s;
+ int16_t buf[BLOCK_LEN];
+
+ power_meter_init(&meter, 10);
+
+ if ((outhandle = sf_open_telephony_write(OUTPUT_FILE_NAME, 1)) == NULL)
+ {
+ fprintf(stderr, " Cannot create audio file '%s'\n", OUTPUT_FILE_NAME);
+ exit(2);
+ }
+
+ printf("Test with swept tone.\n");
+ s = swept_tone_init(NULL, 200.0f, 3900.0f, -10.0f, 60*SAMPLE_RATE, 1);
+ for (j = 0; j < 60*SAMPLE_RATE; j += BLOCK_LEN)
+ {
+ len = swept_tone(s, buf, BLOCK_LEN);
+ for (i = 0; i < len; i++)
+ power_meter_update(&meter, buf[i]);
+ outframes = sf_writef_short(outhandle, buf, len);
+ if (outframes != len)
+ {
+ fprintf(stderr, " Error writing audio file\n");
+ exit(2);
+ }
+#if 0
+ printf("Current freq %.1fHz, Level is %fdBOv/%fdBm0\n",
+ swept_tone_current_frequency(s),
+ power_meter_current_dbov(&meter),
+ power_meter_current_dbm0(&meter));
+#else
+ printf("%.1f %f\n",
+ swept_tone_current_frequency(s),
+ power_meter_current_dbm0(&meter));
+#endif
+ }
+
+ if (sf_close(outhandle) != 0)
+ {
+ fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME);
+ exit(2);
+ }
+
+ printf("Tests passed.\n");
+ return 0;
+}
+/*- End of function --------------------------------------------------------*/
+/*- End of file ------------------------------------------------------------*/
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - config.log
</span><span class="cx">config.status
</span><span class="cx">libtool
</span><span class="cx">Makefile
</span><span class="cx"> + config.log
</span><span class="cx">config.status
</span><span class="cx">libtool
</span><span class="cx">Makefile
</span><span class="cx">configure
</span><span class="cx">Makefile.in
</span><span class="cx">autom4te.cache
</span><span class="cx">aclocal.m4
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382update"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/.update (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/.update        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/.update        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -1 +1 @@
</span><del>-Wed Jul 22 15:05:52 EDT 2009
</del><ins>+Mon Oct 5 09:57:20 CDT 2009
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382Makefileam"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/Makefile.am (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/Makefile.am        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/Makefile.am        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> docdir = $(LIBTIFF_DOCDIR)
</span><span class="cx">
</span><span class="cx"> AUTOMAKE_OPTIONS = dist-zip foreign
</span><del>-ACLOCAL_AMFLAGS = -I ./m4
</del><ins>+ACLOCAL_AMFLAGS = -I m4
</ins><span class="cx">
</span><span class="cx"> docfiles = \
</span><span class="cx">         COPYRIGHT \
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382Makefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382acincludem4fromrev15313freeswitchtrunklibstiff382acincludem4"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/acinclude.m4 (from rev 15313, freeswitch/trunk/libs/tiff-3.8.2/acinclude.m4) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/acinclude.m4         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/acinclude.m4        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,669 @@
</span><ins>+dnl ---------------------------------------------------------------------------
+dnl Message output
+dnl ---------------------------------------------------------------------------
+AC_DEFUN([LOC_MSG],[echo "$1"])
+
+dnl ---------------------------------------------------------------------------
+dnl Available from the GNU Autoconf Macro Archive at:
+dnl http://www.gnu.org/software/ac-archive/vl_prog_cc_warnings.html
+dnl ---------------------------------------------------------------------------
+
+dnl @synopsis VL_PROG_CC_WARNINGS([ANSI])
+dnl
+dnl Enables a reasonable set of warnings for the C compiler.
+dnl Optionally, if the first argument is nonempty, turns on flags which
+dnl enforce and/or enable proper ANSI C if such are known with the
+dnl compiler used.
+dnl
+dnl Currently this macro knows about GCC, Solaris C compiler, Digital
+dnl Unix C compiler, C for AIX Compiler, HP-UX C compiler, IRIX C
+dnl compiler, NEC SX-5 (Super-UX 10) C compiler, and Cray J90 (Unicos
+dnl 10.0.0.8) C compiler.
+dnl
+dnl @category C
+dnl @author Ville Laurikari <vl@iki.fi>
+dnl @version 2002-04-04
+dnl @license AllPermissive
+
+AC_DEFUN([VL_PROG_CC_WARNINGS], [
+ ansi=$1
+ if test -z "$ansi"; then
+ msg="for C compiler warning flags"
+ else
+ msg="for C compiler warning and ANSI conformance flags"
+ fi
+ AC_CACHE_CHECK($msg, vl_cv_prog_cc_warnings, [
+ if test -n "$CC"; then
+ cat > conftest.c <<EOF
+int main(int argc, char **argv) { return 0; }
+EOF
+
+ dnl GCC. -W option has been renamed in -wextra in latest gcc versions.
+ if test "$GCC" = "yes"; then
+ if test -z "$ansi"; then
+ vl_cv_prog_cc_warnings="-Wall -W"
+ else
+ vl_cv_prog_cc_warnings="-Wall -W -ansi -pedantic"
+ fi
+
+ dnl Most compilers print some kind of a version string with some command
+ dnl line options (often "-V"). The version string should be checked
+ dnl before doing a test compilation run with compiler-specific flags.
+ dnl This is because some compilers (like the Cray compiler) only
+ dnl produce a warning message for unknown flags instead of returning
+ dnl an error, resulting in a false positive. Also, compilers may do
+ dnl erratic things when invoked with flags meant for a different
+ dnl compiler.
+
+ dnl Solaris C compiler
+ elif $CC -V 2>&1 | grep -i "WorkShop" > /dev/null 2>&1 &&
+ $CC -c -v -Xc conftest.c > /dev/null 2>&1 &&
+ test -f conftest.o; then
+ if test -z "$ansi"; then
+ vl_cv_prog_cc_warnings="-v"
+ else
+ vl_cv_prog_cc_warnings="-v -Xc"
+ fi
+
+ dnl Digital Unix C compiler
+ elif $CC -V 2>&1 | grep -i "Digital UNIX Compiler" > /dev/null 2>&1 &&
+ $CC -c -verbose -w0 -warnprotos -std1 conftest.c > /dev/null 2>&1 &&
+ test -f conftest.o; then
+ if test -z "$ansi"; then
+ vl_cv_prog_cc_warnings="-verbose -w0 -warnprotos"
+ else
+ vl_cv_prog_cc_warnings="-verbose -w0 -warnprotos -std1"
+ fi
+
+ dnl C for AIX Compiler
+ elif $CC 2>&1 | grep -i "C for AIX Compiler" > /dev/null 2>&1 &&
+ $CC -c -qlanglvl=ansi -qinfo=all conftest.c > /dev/null 2>&1 &&
+ test -f conftest.o; then
+ if test -z "$ansi"; then
+ vl_cv_prog_cc_warnings="-qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd"
+ else
+ vl_cv_prog_cc_warnings="-qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd -qlanglvl=ansi"
+ fi
+
+ dnl IRIX C compiler
+ elif $CC -version 2>&1 | grep -i "MIPSpro Compilers" > /dev/null 2>&1 &&
+ $CC -c -fullwarn -ansi -ansiE conftest.c > /dev/null 2>&1 &&
+ test -f conftest.o; then
+ if test -z "$ansi"; then
+ vl_cv_prog_cc_warnings="-fullwarn"
+ else
+ vl_cv_prog_cc_warnings="-fullwarn -ansi -ansiE"
+ fi
+
+ dnl HP-UX C compiler
+ elif what $CC 2>&1 | grep -i "HP C Compiler" > /dev/null 2>&1 &&
+ $CC -c -Aa +w1 conftest.c > /dev/null 2>&1 &&
+ test -f conftest.o; then
+ if test -z "$ansi"; then
+ vl_cv_prog_cc_warnings="+w1"
+ else
+ vl_cv_prog_cc_warnings="+w1 -Aa"
+ fi
+
+ dnl The NEC SX-5 (Super-UX 10) C compiler
+ elif $CC -V 2>&1 | grep "/SX" > /dev/null 2>&1 &&
+ $CC -c -pvctl[,]fullmsg -Xc conftest.c > /dev/null 2>&1 &&
+ test -f conftest.o; then
+ if test -z "$ansi"; then
+ vl_cv_prog_cc_warnings="-pvctl[,]fullmsg"
+ else
+ vl_cv_prog_cc_warnings="-pvctl[,]fullmsg -Xc"
+ fi
+
+ dnl The Cray C compiler (Unicos)
+ elif $CC -V 2>&1 | grep -i "Cray" > /dev/null 2>&1 &&
+ $CC -c -h msglevel 2 conftest.c > /dev/null 2>&1 &&
+ test -f conftest.o; then
+ if test -z "$ansi"; then
+ vl_cv_prog_cc_warnings="-h msglevel 2"
+ else
+ vl_cv_prog_cc_warnings="-h msglevel 2 -h conform"
+ fi
+
+ fi
+ rm -f conftest.*
+ fi
+ if test -n "$vl_cv_prog_cc_warnings"; then
+ CFLAGS="$CFLAGS $vl_cv_prog_cc_warnings"
+ else
+ vl_cv_prog_cc_warnings="unknown"
+ fi
+ ])
+])dnl
+
+dnl ---------------------------------------------------------------------------
+dnl Available from the GNU Autoconf Macro Archive at:
+dnl http://autoconf-archive.cryp.to/ax_lang_compiler_ms.html
+dnl ---------------------------------------------------------------------------
+
+dnl @synopsis AX_LANG_COMPILER_MS
+dnl
+dnl Check whether the compiler for the current language is Microsoft.
+dnl
+dnl This macro is modeled after _AC_LANG_COMPILER_GNU in the GNU
+dnl Autoconf implementation.
+dnl
+dnl @category InstalledPackages
+dnl @author Braden McDaniel <braden@endoframe.com>
+dnl @version 2004-11-15
+dnl @license AllPermissive
+
+AC_DEFUN([AX_LANG_COMPILER_MS],
+[AC_CACHE_CHECK([whether we are using the Microsoft _AC_LANG compiler],
+ [ax_cv_[]_AC_LANG_ABBREV[]_compiler_ms],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef _MSC_VER
+ choke me
+#endif
+]])],
+ [ax_compiler_ms=yes],
+ [ax_compiler_ms=no])
+ax_cv_[]_AC_LANG_ABBREV[]_compiler_ms=$ax_compiler_ms
+])])
+
+dnl ---------------------------------------------------------------------------
+dnl Available from the GNU Autoconf Macro Archive at:
+dnl http://www.gnu.org/software/ac-archive/ax_check_gl.html
+dnl ---------------------------------------------------------------------------
+
+dnl @synopsis AX_CHECK_GL
+dnl
+dnl Check for an OpenGL implementation. If GL is found, the required
+dnl compiler and linker flags are included in the output variables
+dnl "GL_CFLAGS" and "GL_LIBS", respectively. This macro adds the
+dnl configure option "--with-apple-opengl-framework", which users can
+dnl use to indicate that Apple's OpenGL framework should be used on Mac
+dnl OS X. If Apple's OpenGL framework is used, the symbol
+dnl "HAVE_APPLE_OPENGL_FRAMEWORK" is defined. If no GL implementation
+dnl is found, "no_gl" is set to "yes".
+dnl
+dnl @category InstalledPackages
+dnl @author Braden McDaniel <braden@endoframe.com>
+dnl @version 2004-11-15
+dnl @license AllPermissive
+
+AC_DEFUN([AX_CHECK_GL],
+[AC_REQUIRE([AC_PATH_X])dnl
+AC_REQUIRE([ACX_PTHREAD])dnl
+
+#
+# There isn't a reliable way to know we should use the Apple OpenGL framework
+# without a configure option. A Mac OS X user may have installed an
+# alternative GL implementation (e.g., Mesa), which may or may not depend on X.
+#
+AC_ARG_WITH([apple-opengl-framework],
+ [AC_HELP_STRING([--with-apple-opengl-framework],
+ [use Apple OpenGL framework (Mac OS X only)])])
+if test "X$with_apple_opengl_framework" = "Xyes"; then
+ AC_DEFINE([HAVE_APPLE_OPENGL_FRAMEWORK], [1],
+ [Use the Apple OpenGL framework.])
+ GL_LIBS="-framework OpenGL"
+else
+ AC_LANG_PUSH(C)
+
+ AX_LANG_COMPILER_MS
+ if test X$ax_compiler_ms = Xno; then
+ GL_CFLAGS="${PTHREAD_CFLAGS}"
+ GL_LIBS="${PTHREAD_LIBS} -lm"
+ fi
+
+ #
+ # Use x_includes and x_libraries if they have been set (presumably by
+ # AC_PATH_X).
+ #
+ if test "X$no_x" != "Xyes"; then
+ if test -n "$x_includes"; then
+ GL_CFLAGS="-I${x_includes} ${GL_CFLAGS}"
+ fi
+ if test -n "$x_libraries"; then
+ GL_LIBS="-L${x_libraries} -lX11 ${GL_LIBS}"
+ fi
+ fi
+
+ AC_CHECK_HEADERS([windows.h])
+
+ AC_CACHE_CHECK([for OpenGL library], [ax_cv_check_gl_libgl],
+ [ax_cv_check_gl_libgl="no"
+ ax_save_CPPFLAGS="${CPPFLAGS}"
+ CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
+ ax_save_LIBS="${LIBS}"
+ LIBS=""
+ ax_check_libs="-lopengl32 -lGL"
+ for ax_lib in ${ax_check_libs}; do
+ if test X$ax_compiler_ms = Xyes; then
+ ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`
+ else
+ ax_try_lib="${ax_lib}"
+ fi
+ LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[
+# if HAVE_WINDOWS_H && defined(_WIN32)
+# include <windows.h>
+# endif
+# include <GL/gl.h>]],
+ [[glBegin(0)]])],
+ [ax_cv_check_gl_libgl="${ax_try_lib}"; break])
+ done
+ LIBS=${ax_save_LIBS}
+ CPPFLAGS=${ax_save_CPPFLAGS}])
+
+ if test "X${ax_cv_check_gl_libgl}" = "Xno"; then
+ no_gl="yes"
+ GL_CFLAGS=""
+ GL_LIBS=""
+ else
+ GL_LIBS="${ax_cv_check_gl_libgl} ${GL_LIBS}"
+ fi
+ AC_LANG_POP(C)
+fi
+
+AC_SUBST([GL_CFLAGS])
+AC_SUBST([GL_LIBS])
+])dnl
+
+dnl ---------------------------------------------------------------------------
+dnl Available from the GNU Autoconf Macro Archive at:
+dnl http://www.gnu.org/software/ac-archive/ax_check_glu.html
+dnl ---------------------------------------------------------------------------
+
+dnl @synopsis AX_CHECK_GLU
+dnl
+dnl Check for GLU. If GLU is found, the required preprocessor and
+dnl linker flags are included in the output variables "GLU_CFLAGS" and
+dnl "GLU_LIBS", respectively. This macro adds the configure option
+dnl "--with-apple-opengl-framework", which users can use to indicate
+dnl that Apple's OpenGL framework should be used on Mac OS X. If
+dnl Apple's OpenGL framework is used, the symbol
+dnl "HAVE_APPLE_OPENGL_FRAMEWORK" is defined. If no GLU implementation
+dnl is found, "no_glu" is set to "yes".
+dnl
+dnl @category InstalledPackages
+dnl @author Braden McDaniel <braden@endoframe.com>
+dnl @version 2004-11-15
+dnl @license AllPermissive
+
+AC_DEFUN([AX_CHECK_GLU],
+[AC_REQUIRE([AX_CHECK_GL])dnl
+AC_REQUIRE([AC_PROG_CXX])dnl
+GLU_CFLAGS="${GL_CFLAGS}"
+if test "X${with_apple_opengl_framework}" != "Xyes"; then
+ AC_CACHE_CHECK([for OpenGL Utility library], [ax_cv_check_glu_libglu],
+ [ax_cv_check_glu_libglu="no"
+ ax_save_CPPFLAGS="${CPPFLAGS}"
+ CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
+ ax_save_LIBS="${LIBS}"
+ LIBS=""
+ ax_check_libs="-lglu32 -lGLU"
+ for ax_lib in ${ax_check_libs}; do
+ if test X$ax_compiler_ms = Xyes; then
+ ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`
+ else
+ ax_try_lib="${ax_lib}"
+ fi
+ LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
+ #
+ # libGLU typically links with libstdc++ on POSIX platforms. However,
+ # setting the language to C++ means that test program source is named
+ # "conftest.cc"; and Microsoft cl doesn't know what to do with such a
+ # file.
+ #
+ AC_LANG_PUSH([C++])
+ if test X$ax_compiler_ms = Xyes; then
+ AC_LANG_PUSH([C])
+ fi
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[
+# if HAVE_WINDOWS_H && defined(_WIN32)
+# include <windows.h>
+# endif
+# include <GL/glu.h>]],
+ [[gluBeginCurve(0)]])],
+ [ax_cv_check_glu_libglu="${ax_try_lib}"; break])
+ if test X$ax_compiler_ms = Xyes; then
+ AC_LANG_POP([C])
+ fi
+ AC_LANG_POP([C++])
+ done
+ LIBS=${ax_save_LIBS}
+ CPPFLAGS=${ax_save_CPPFLAGS}])
+ if test "X${ax_cv_check_glu_libglu}" = "Xno"; then
+ no_glu="yes"
+ GLU_CFLAGS=""
+ GLU_LIBS=""
+ else
+ GLU_LIBS="${ax_cv_check_glu_libglu} ${GL_LIBS}"
+ fi
+fi
+AC_SUBST([GLU_CFLAGS])
+AC_SUBST([GLU_LIBS])
+])
+
+dnl ---------------------------------------------------------------------------
+dnl Available from the GNU Autoconf Macro Archive at:
+dnl http://www.gnu.org/software/ac-archive/ax_check_glut.html
+dnl ---------------------------------------------------------------------------
+
+dnl @synopsis AX_CHECK_GLUT
+dnl
+dnl Check for GLUT. If GLUT is found, the required compiler and linker
+dnl flags are included in the output variables "GLUT_CFLAGS" and
+dnl "GLUT_LIBS", respectively. This macro adds the configure option
+dnl "--with-apple-opengl-framework", which users can use to indicate
+dnl that Apple's OpenGL framework should be used on Mac OS X. If
+dnl Apple's OpenGL framework is used, the symbol
+dnl "HAVE_APPLE_OPENGL_FRAMEWORK" is defined. If GLUT is not found,
+dnl "no_glut" is set to "yes".
+dnl
+dnl @category InstalledPackages
+dnl @author Braden McDaniel <braden@endoframe.com>
+dnl @version 2004-11-15
+dnl @license AllPermissive
+
+AC_DEFUN([AX_CHECK_GLUT],
+[AC_REQUIRE([AX_CHECK_GLU])dnl
+AC_REQUIRE([AC_PATH_XTRA])dnl
+
+if test "X$with_apple_opengl_framework" = "Xyes"; then
+ GLUT_CFLAGS="${GLU_CFLAGS}"
+ GLUT_LIBS="-framework GLUT -lobjc ${GL_LIBS}"
+else
+ GLUT_CFLAGS=${GLU_CFLAGS}
+ GLUT_LIBS=${GLU_LIBS}
+
+ #
+ # If X is present, assume GLUT depends on it.
+ #
+ if test "X${no_x}" != "Xyes"; then
+ GLUT_LIBS="${X_PRE_LIBS} -lXmu -lXi ${X_EXTRA_LIBS} ${GLUT_LIBS}"
+ fi
+
+ AC_LANG_PUSH(C)
+
+ ax_save_CPPFLAGS="${CPPFLAGS}"
+ CPPFLAGS="${GLUT_CFLAGS} ${CPPFLAGS}"
+
+ AC_CACHE_CHECK([for GLUT library], [ax_cv_check_glut_libglut],
+ [ax_cv_check_glut_libglut="no"
+ ax_save_LIBS="${LIBS}"
+ LIBS=""
+ ax_check_libs="-lglut32 -lglut"
+ for ax_lib in ${ax_check_libs}; do
+ if test X$ax_compiler_ms = Xyes; then
+ ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`
+ else
+ ax_try_lib="${ax_lib}"
+ fi
+ LIBS="${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[
+# if HAVE_WINDOWS_H && defined(_WIN32)
+# include <windows.h>
+# endif
+# include <GL/glut.h>]],
+ [[glutMainLoop()]])],
+ [ax_cv_check_glut_libglut="${ax_try_lib}"; break])
+
+ done
+ LIBS=${ax_save_LIBS}
+ ])
+ CPPFLAGS="${ax_save_CPPFLAGS}"
+ AC_LANG_POP(C)
+
+ if test "X${ax_cv_check_glut_libglut}" = "Xno"; then
+ no_glut="yes"
+ GLUT_CFLAGS=""
+ GLUT_LIBS=""
+ else
+ GLUT_LIBS="${ax_cv_check_glut_libglut} ${GLUT_LIBS}"
+ fi
+fi
+
+AC_SUBST([GLUT_CFLAGS])
+AC_SUBST([GLUT_LIBS])
+])dnl
+
+dnl ---------------------------------------------------------------------------
+dnl Available from the GNU Autoconf Macro Archive at:
+dnl http://www.gnu.org/software/ac-archive/acx_pthread.html
+dnl ---------------------------------------------------------------------------
+
+dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+dnl
+dnl This macro figures out how to build C programs using POSIX threads.
+dnl It sets the PTHREAD_LIBS output variable to the threads library and
+dnl linker flags, and the PTHREAD_CFLAGS output variable to any special
+dnl C compiler flags that are needed. (The user can also force certain
+dnl compiler flags/libs to be tested by setting these environment
+dnl variables.)
+dnl
+dnl Also sets PTHREAD_CC to any special C compiler that is needed for
+dnl multi-threaded programs (defaults to the value of CC otherwise).
+dnl (This is necessary on AIX to use the special cc_r compiler alias.)
+dnl
+dnl NOTE: You are assumed to not only compile your program with these
+dnl flags, but also link it with them as well. e.g. you should link
+dnl with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
+dnl $LIBS
+dnl
+dnl If you are only building threads programs, you may wish to use
+dnl these variables in your default LIBS, CFLAGS, and CC:
+dnl
+dnl LIBS="$PTHREAD_LIBS $LIBS"
+dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+dnl CC="$PTHREAD_CC"
+dnl
+dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
+dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
+dnl that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+dnl
+dnl ACTION-IF-FOUND is a list of shell commands to run if a threads
+dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to
+dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the
+dnl default action will define HAVE_PTHREAD.
+dnl
+dnl Please let the authors know if this macro fails on any platform, or
+dnl if you have any other suggestions or comments. This macro was based
+dnl on work by SGJ on autoconf scripts for FFTW (www.fftw.org) (with
+dnl help from M. Frigo), as well as ac_pthread and hb_pthread macros
+dnl posted by Alejandro Forero Cuervo to the autoconf macro repository.
+dnl We are also grateful for the helpful feedback of numerous users.
+dnl
+dnl @category InstalledPackages
+dnl @author Steven G. Johnson <stevenj@alum.mit.edu>
+dnl @version 2005-01-14
+dnl @license GPLWithACException
+
+AC_DEFUN([ACX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_SAVE
+AC_LANG_C
+acx_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
+ AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
+ AC_MSG_RESULT($acx_pthread_ok)
+ if test x"$acx_pthread_ok" = xno; then
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+ fi
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try. Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important. Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+# other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+# doesn't hurt to check since this sometimes defines pthreads too;
+# also defines -D_REENTRANT)
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case "${host_cpu}-${host_os}" in
+ *solaris*)
+
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthread or
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+
+ acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
+ ;;
+esac
+
+if test x"$acx_pthread_ok" = xno; then
+for flag in $acx_pthread_flags; do
+
+ case $flag in
+ none)
+ AC_MSG_CHECKING([whether pthreads work without any flags])
+ ;;
+
+ -*)
+ AC_MSG_CHECKING([whether pthreads work with $flag])
+ PTHREAD_CFLAGS="$flag"
+ ;;
+
+                pthread-config)
+                AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
+                if test x"$acx_pthread_config" = xno; then continue; fi
+                PTHREAD_CFLAGS="`pthread-config --cflags`"
+                PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+                ;
+
+ *)
+ AC_MSG_CHECKING([for the pthreads library -l$flag])
+ PTHREAD_LIBS="-l$flag"
+ ;;
+ esac
+
+ save_LIBS="$LIBS"
+ save_CFLAGS="$CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Check for various functions. We must include pthread.h,
+ # since some functions may be macros. (On the Sequent, we
+ # need a special flag -Kthread to make this header compile.)
+ # We check for pthread_join because it is in -lpthread on IRIX
+ # while pthread_create is in libc. We check for pthread_attr_init
+ # due to DEC craziness with -lpthreads. We check for
+ # pthread_cleanup_push because it is one of the few pthread
+ # functions on Solaris that doesn't have a non-functional libc stub.
+ # We try pthread_create on general principles.
+ AC_TRY_LINK([#include <pthread.h>],
+ [pthread_t th; pthread_join(th, 0);
+ pthread_attr_init(0); pthread_cleanup_push(0, 0);
+ pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
+ [acx_pthread_ok=yes])
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ AC_MSG_RESULT($acx_pthread_ok)
+ if test "x$acx_pthread_ok" = xyes; then
+ break;
+ fi
+
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$acx_pthread_ok" = xyes; then
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+        AC_MSG_CHECKING([for joinable pthread attribute])
+        attr_name=unknown
+        for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+         AC_TRY_LINK([#include <pthread.h>], [int attr=$attr;],
+ [attr_name=$attr; break])
+        done
+ AC_MSG_RESULT($attr_name)
+ if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+ AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
+ [Define to necessary symbol if this constant
+ uses a non-standard name on your system.])
+ fi
+
+ AC_MSG_CHECKING([if more special flags are required for pthreads])
+ flag=no
+ case "${host_cpu}-${host_os}" in
+ *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
+ *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+ esac
+ AC_MSG_RESULT(${flag})
+ if test "x$flag" != xno; then
+ PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+ fi
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ # More AIX lossage: must compile with cc_r
+ AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
+else
+ PTHREAD_CC="$CC"
+fi
+
+AC_SUBST(PTHREAD_LIBS)
+AC_SUBST(PTHREAD_CFLAGS)
+AC_SUBST(PTHREAD_CC)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$acx_pthread_ok" = xyes; then
+ ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+ :
+else
+ acx_pthread_ok=no
+ $2
+fi
+AC_LANG_RESTORE
+])dnl ACX_PTHREAD
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382aclocalm4"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/aclocal.m4</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382config"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/config</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> + config.guess
</span><span class="cx">config.sub
</span><span class="cx">ltmain.sh
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382configconfigguess"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/config/config.guess</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382configconfigsub"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/config/config.sub</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382configltmainsh"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/config/ltmain.sh</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382configmkinstalldirs"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/config/mkinstalldirs (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/config/mkinstalldirs        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/config/mkinstalldirs        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> #! /bin/sh
</span><span class="cx"> # mkinstalldirs --- make directory hierarchy
</span><span class="cx">
</span><del>-scriptversion=2004-02-15.20
</del><ins>+scriptversion=2005-06-29.22
</ins><span class="cx">
</span><span class="cx"> # Original author: Noah Friedman <friedman@prep.ai.mit.edu>
</span><span class="cx"> # Created: 1993-05-16
</span><span class="lines">@@ -12,7 +12,7 @@
</span><span class="cx"> # <automake-patches@gnu.org>.
</span><span class="cx">
</span><span class="cx"> errstatus=0
</span><del>-dirmode=""
</del><ins>+dirmode=
</ins><span class="cx">
</span><span class="cx"> usage="\
</span><span class="cx"> Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> case $1 in
</span><span class="cx"> -h | --help | --h*) # -h for help
</span><span class="cx"> echo "$usage"
</span><del>- exit 0
</del><ins>+ exit $?
</ins><span class="cx"> ;;
</span><span class="cx"> -m) # -m PERM arg
</span><span class="cx"> shift
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> ;;
</span><span class="cx"> --version)
</span><span class="cx"> echo "$0 $scriptversion"
</span><del>- exit 0
</del><ins>+ exit $?
</ins><span class="cx"> ;;
</span><span class="cx"> --) # stop option processing
</span><span class="cx"> shift
</span><span class="lines">@@ -103,13 +103,21 @@
</span><span class="cx">
</span><span class="cx"> for file
</span><span class="cx"> do
</span><del>- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
</del><ins>+ case $file in
+ /*) pathcomp=/ ;;
+ *) pathcomp= ;;
+ esac
+ oIFS=$IFS
+ IFS=/
+ set fnord $file
</ins><span class="cx"> shift
</span><ins>+ IFS=$oIFS
</ins><span class="cx">
</span><del>- pathcomp=
</del><span class="cx"> for d
</span><span class="cx"> do
</span><del>- pathcomp="$pathcomp$d"
</del><ins>+ test "x$d" = x && continue
+
+ pathcomp=$pathcomp$d
</ins><span class="cx"> case $pathcomp in
</span><span class="cx"> -*) pathcomp=./$pathcomp ;;
</span><span class="cx"> esac
</span><span class="lines">@@ -124,7 +132,7 @@
</span><span class="cx"> else
</span><span class="cx">         if test ! -z "$dirmode"; then
</span><span class="cx">          echo "chmod $dirmode $pathcomp"
</span><del>-         lasterr=""
</del><ins>+         lasterr=
</ins><span class="cx">          chmod "$dirmode" "$pathcomp" || lasterr=$?
</span><span class="cx">
</span><span class="cx">          if test ! -z "$lasterr"; then
</span><span class="lines">@@ -134,7 +142,7 @@
</span><span class="cx"> fi
</span><span class="cx"> fi
</span><span class="cx">
</span><del>- pathcomp="$pathcomp/"
</del><ins>+ pathcomp=$pathcomp/
</ins><span class="cx"> done
</span><span class="cx"> done
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382configure"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/configure</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contrib"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - Makefile
</span><span class="cx"> + Makefile
</span><span class="cx">Makefile.in
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribacorn"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/acorn</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - Makefile
</span><span class="cx"> + Makefile
</span><span class="cx">Makefile.in
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribacornMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/acorn/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribaddtiffo"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/addtiffo</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - .deps
</span><span class="cx">Makefile
</span><span class="cx"> + .deps
</span><span class="cx">Makefile
</span><span class="cx">addtiffo
</span><span class="cx">Makefile.in
</span><span class="cx">.libs
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribaddtiffoMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/addtiffo/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribdbs"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/dbs</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - .deps
</span><span class="cx">Makefile
</span><span class="cx"> + .deps
</span><span class="cx">Makefile
</span><span class="cx">tiff-bi
</span><span class="cx">Makefile.in
</span><span class="cx">tiff-palette
</span><span class="cx">tiff-rgb
</span><span class="cx">tiff-grayscale
</span><span class="cx">.libs
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribdbsMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/dbs/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribdbsxtiff"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/dbs/xtiff</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - Makefile
</span><span class="cx"> + Makefile
</span><span class="cx">Makefile.in
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribdbsxtiffMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/dbs/xtiff/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribiptcutil"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/iptcutil</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - .deps
</span><span class="cx">Makefile
</span><span class="cx"> + .deps
</span><span class="cx">Makefile
</span><span class="cx">Makefile.in
</span><span class="cx">.libs
</span><span class="cx">iptcutil
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribiptcutilMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/iptcutil/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribmaccw"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/mac-cw</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - Makefile
</span><span class="cx"> + Makefile
</span><span class="cx">Makefile.in
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribmaccwMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/mac-cw/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribmacmpw"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/mac-mpw</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - Makefile
</span><span class="cx"> + Makefile
</span><span class="cx">Makefile.in
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribmacmpwMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/mac-mpw/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribmfs"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/mfs</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - Makefile
</span><span class="cx"> + Makefile
</span><span class="cx">Makefile.in
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribmfsMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/mfs/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribojpeg"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/ojpeg</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - Makefile
</span><span class="cx"> + Makefile
</span><span class="cx">Makefile.in
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribojpegMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/ojpeg/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribpds"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/pds</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - Makefile
</span><span class="cx"> + Makefile
</span><span class="cx">Makefile.in
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribpdsMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/pds/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribras"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/ras</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - Makefile
</span><span class="cx"> + Makefile
</span><span class="cx">Makefile.in
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribrasMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/ras/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribstream"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/stream</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - Makefile
</span><span class="cx"> + Makefile
</span><span class="cx">Makefile.in
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribstreamMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/stream/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribtags"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/tags</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - Makefile
</span><span class="cx"> + Makefile
</span><span class="cx">Makefile.in
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribtagsMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/tags/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribwin_dib"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/win_dib</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - Makefile
</span><span class="cx"> + Makefile
</span><span class="cx">Makefile.in
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382contribwin_dibMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/contrib/win_dib/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382html"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/html</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - Makefile
</span><span class="cx"> + Makefile
</span><span class="cx">Makefile.in
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382htmlMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/html/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382htmlimages"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/html/images</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - Makefile
</span><span class="cx"> + Makefile
</span><span class="cx">Makefile.in
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382htmlimagesMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/html/images/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382htmlman"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/html/man</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - Makefile
</span><span class="cx"> + Makefile
</span><span class="cx">Makefile.in
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382htmlmanMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/html/man/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382libtiff"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/libtiff</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - tif_config.h
</span><span class="cx">tiffconf.h
</span><span class="cx">.deps
</span><span class="cx">Makefile
</span><span class="cx">stamp-h1
</span><span class="cx">stamp-h2
</span><span class="cx"> + tif_config.h
</span><span class="cx">tiffconf.h
</span><span class="cx">.deps
</span><span class="cx">Makefile
</span><span class="cx">stamp-h1
</span><span class="cx">stamp-h2
</span><span class="cx">Makefile.in
</span><span class="cx">tif_config.h.in
</span><span class="cx">.libs
</span><span class="cx">mkg3states
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382libtiffMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/libtiff/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382libtifftif_confighin"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/libtiff/tif_config.h.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382libtifftif_fax3c"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/libtiff/tif_fax3.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/libtiff/tif_fax3.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/libtiff/tif_fax3.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -85,6 +85,8 @@
</span><span class="cx">         unsigned char*        refline;        /* reference line for 2d decoding */
</span><span class="cx">         int        k;                        /* #rows left that can be 2d encoded */
</span><span class="cx">         int        maxk;                        /* max #rows that can be 2d encoded */
</span><ins>+
+        int line;
</ins><span class="cx"> } Fax3CodecState;
</span><span class="cx"> #define        DecoderState(tif)        ((Fax3CodecState*) Fax3State(tif))
</span><span class="cx"> #define        EncoderState(tif)        ((Fax3CodecState*) Fax3State(tif))
</span><span class="lines">@@ -167,6 +169,7 @@
</span><span class="cx">                 sp->refruns[0] = (uint32) sp->b.rowpixels;
</span><span class="cx">                 sp->refruns[1] = 0;
</span><span class="cx">         }
</span><ins>+        sp->line = 0;
</ins><span class="cx">         return (1);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -184,7 +187,7 @@
</span><span class="cx">          (unsigned long) (isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip),
</span><span class="cx">          (unsigned long) a0);
</span><span class="cx"> }
</span><del>-#define        unexpected(table, a0)        Fax3Unexpected(module, tif, line, a0)
</del><ins>+#define        unexpected(table, a0)        Fax3Unexpected(module, tif, sp->line, a0)
</ins><span class="cx">
</span><span class="cx"> static void
</span><span class="cx"> Fax3Extension(const char* module, TIFF* tif, uint32 line, uint32 a0)
</span><span class="lines">@@ -195,7 +198,7 @@
</span><span class="cx"> (unsigned long) (isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip),
</span><span class="cx"> (unsigned long) a0);
</span><span class="cx"> }
</span><del>-#define        extension(a0)        Fax3Extension(module, tif, line, a0)
</del><ins>+#define        extension(a0)        Fax3Extension(module, tif, sp->line, a0)
</ins><span class="cx">
</span><span class="cx"> static void
</span><span class="cx"> Fax3BadLength(const char* module, TIFF* tif, uint32 line, uint32 a0, uint32 lastx)
</span><span class="lines">@@ -207,7 +210,7 @@
</span><span class="cx"> (unsigned long) (isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip),
</span><span class="cx"> (unsigned long) a0, lastx);
</span><span class="cx"> }
</span><del>-#define        badlength(a0,lastx)        Fax3BadLength(module, tif, line, a0, lastx)
</del><ins>+#define        badlength(a0,lastx)        Fax3BadLength(module, tif, sp->line, a0, lastx)
</ins><span class="cx">
</span><span class="cx"> static void
</span><span class="cx"> Fax3PrematureEOF(const char* module, TIFF* tif, uint32 line, uint32 a0)
</span><span class="lines">@@ -218,7 +221,7 @@
</span><span class="cx"> (unsigned long) (isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip),
</span><span class="cx"> (unsigned long) a0);
</span><span class="cx"> }
</span><del>-#define        prematureEOF(a0)        Fax3PrematureEOF(module, tif, line, a0)
</del><ins>+#define        prematureEOF(a0)        Fax3PrematureEOF(module, tif, sp->line, a0)
</ins><span class="cx">
</span><span class="cx"> #define        Nop
</span><span class="cx">
</span><span class="lines">@@ -229,7 +232,6 @@
</span><span class="cx"> Fax3Decode1D(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
</span><span class="cx"> {
</span><span class="cx">         DECLARE_STATE(tif, sp, "Fax3Decode1D");
</span><del>- int line = 0;
</del><span class="cx">
</span><span class="cx">         (void) s;
</span><span class="cx">         CACHE_STATE(tif, sp);
</span><span class="lines">@@ -248,7 +250,7 @@
</span><span class="cx">                 (*sp->fill)(buf, thisrun, pa, lastx);
</span><span class="cx">                 buf += sp->b.rowbytes;
</span><span class="cx">                 occ -= sp->b.rowbytes;
</span><del>- line++;
</del><ins>+                sp->line++;
</ins><span class="cx">                 continue;
</span><span class="cx">         EOF1D:                                /* premature EOF */
</span><span class="cx">                 CLEANUP_RUNS();
</span><span class="lines">@@ -269,7 +271,6 @@
</span><span class="cx"> Fax3Decode2D(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
</span><span class="cx"> {
</span><span class="cx">         DECLARE_STATE_2D(tif, sp, "Fax3Decode2D");
</span><del>- int line = 0;
</del><span class="cx">         int is1D;                        /* current line is 1d/2d-encoded */
</span><span class="cx">
</span><span class="cx">         (void) s;
</span><span class="lines">@@ -302,7 +303,7 @@
</span><span class="cx">                 SWAP(uint32*, sp->curruns, sp->refruns);
</span><span class="cx">                 buf += sp->b.rowbytes;
</span><span class="cx">                 occ -= sp->b.rowbytes;
</span><del>- line++;
</del><ins>+                sp->line++;
</ins><span class="cx">                 continue;
</span><span class="cx">         EOF2D:                                /* premature EOF */
</span><span class="cx">                 CLEANUP_RUNS();
</span><span class="lines">@@ -492,14 +493,14 @@
</span><span class="cx">         );
</span><span class="cx">
</span><span class="cx">         nruns = needsRefLine ? 2*TIFFroundup(rowpixels,32) : rowpixels;
</span><del>-
-        dsp->runs = (uint32*) _TIFFCheckMalloc(tif, 2*nruns+3, sizeof (uint32),
</del><ins>+        nruns += 3;
+        dsp->runs = (uint32*) _TIFFCheckMalloc(tif, 2*nruns, sizeof (uint32),
</ins><span class="cx">                                          "for Group 3/4 run arrays");
</span><span class="cx">         if (dsp->runs == NULL)
</span><span class="cx">                 return (0);
</span><span class="cx">         dsp->curruns = dsp->runs;
</span><span class="cx">         if (needsRefLine)
</span><del>-                dsp->refruns = dsp->runs + (nruns>>1);
</del><ins>+                dsp->refruns = dsp->runs + nruns;
</ins><span class="cx">         else
</span><span class="cx">                 dsp->refruns = NULL;
</span><span class="cx">         if (td->td_compression == COMPRESSION_CCITTFAX3
</span><span class="lines">@@ -718,6 +719,7 @@
</span><span class="cx">                 sp->k = sp->maxk-1;
</span><span class="cx">         } else
</span><span class="cx">                 sp->k = sp->maxk = 0;
</span><ins>+        sp->line = 0;
</ins><span class="cx">         return (1);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1378,7 +1380,6 @@
</span><span class="cx"> Fax4Decode(TIFF* tif, tidata_t buf, tsize_t occ, tsample_t s)
</span><span class="cx"> {
</span><span class="cx">         DECLARE_STATE_2D(tif, sp, "Fax4Decode");
</span><del>- int line = 0;
</del><span class="cx">
</span><span class="cx">         (void) s;
</span><span class="cx">         CACHE_STATE(tif, sp);
</span><span class="lines">@@ -1401,7 +1402,7 @@
</span><span class="cx">                 SWAP(uint32*, sp->curruns, sp->refruns);
</span><span class="cx">                 buf += sp->b.rowbytes;
</span><span class="cx">                 occ -= sp->b.rowbytes;
</span><del>- line++;
</del><ins>+                sp->line++;
</ins><span class="cx">                 continue;
</span><span class="cx">         EOFG4:
</span><span class="cx"> NeedBits16( 13, BADG4 );
</span><span class="lines">@@ -1487,7 +1488,6 @@
</span><span class="cx"> {
</span><span class="cx">         DECLARE_STATE(tif, sp, "Fax3DecodeRLE");
</span><span class="cx">         int mode = sp->b.mode;
</span><del>- int line = 0;
</del><span class="cx">
</span><span class="cx">         (void) s;
</span><span class="cx">         CACHE_STATE(tif, sp);
</span><span class="lines">@@ -1517,7 +1517,7 @@
</span><span class="cx">                 }
</span><span class="cx">                 buf += sp->b.rowbytes;
</span><span class="cx">                 occ -= sp->b.rowbytes;
</span><del>- line++;
</del><ins>+                sp->line++;
</ins><span class="cx">                 continue;
</span><span class="cx">         EOFRLE:                                /* premature EOF */
</span><span class="cx">                 (*sp->fill)(buf, thisrun, pa, lastx);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382m4acincludem4"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/m4/acinclude.m4</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382m4libtoolm4"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/m4/libtool.m4</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382m4ltoptionsm4"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/m4/ltoptions.m4</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382m4ltsugarm4"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/m4/ltsugar.m4</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382m4ltversionm4"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/m4/ltversion.m4</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382man"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/man</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - Makefile
</span><span class="cx"> + Makefile
</span><span class="cx">Makefile.in
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382manMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/man/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382port"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/port</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - .deps
</span><span class="cx">Makefile
</span><span class="cx"> + .deps
</span><span class="cx">Makefile
</span><span class="cx">Makefile.in
</span><span class="cx">.libs
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382portMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/port/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382test"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/test</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - .deps
</span><span class="cx">Makefile
</span><span class="cx"> + .deps
</span><span class="cx">Makefile
</span><span class="cx">Makefile.in
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382testMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/test/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382tools"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/tools</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> - .deps
</span><span class="cx">Makefile
</span><span class="cx"> + .deps
</span><span class="cx">Makefile
</span><span class="cx">ras2tiff
</span><span class="cx">Makefile.in
</span><span class="cx">raw2tiff
</span><span class="cx">tiffdither
</span><span class="cx">fax2ps
</span><span class="cx">tiffsplit
</span><span class="cx">bmp2tiff
</span><span class="cx">fax2tiff
</span><span class="cx">tiffcp
</span><span class="cx">tiff2ps
</span><span class="cx">tiffcmp
</span><span class="cx">gif2tiff
</span><span class="cx">tiffset
</span><span class="cx">tiffdump
</span><span class="cx">thumbnail
</span><span class="cx">ppm2tiff
</span><span class="cx">tiff2bw
</span><span class="cx">tiff2pdf
</span><span class="cx">tiff2rgba
</span><span class="cx">tiffmedian
</span><span class="cx">.libs
</span><span class="cx">rgb2ycbcr
</span><span class="cx">pal2rgb
</span><span class="cx">tiffinfo
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibstiff382toolsMakefilein"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/tiff-3.8.2/tools/Makefile.in</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsunimrcppluginsmrcpflite"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/unimrcp/plugins/mrcp-flite</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> + Makefile.in
</span><span class="cx">.deps
</span><span class="cx">Makefile
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibsunimrcppluginsmrcppocketsphinx"></a>
<div class="propset"><h4>Property changes: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/unimrcp/plugins/mrcp-pocketsphinx</h4>
<pre class="diff"><span>
<span class="cx">Name: svn:ignore
</span><span class="cx"> + Makefile.in
</span><span class="cx">.deps
</span><span class="cx">Makefile
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorlibswin32DownloadTIFF2008vcproj"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/libs/win32/Download TIFF.2008.vcproj</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorpatchesmod_portaudio_snow_leoparddifffromrev15313freeswitchtrunkpatchesmod_portaudio_snow_leoparddiff"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/patches/mod_portaudio_snow_leopard.diff (from rev 15313, freeswitch/trunk/patches/mod_portaudio_snow_leopard.diff) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/patches/mod_portaudio_snow_leopard.diff         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/patches/mod_portaudio_snow_leopard.diff        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,170 @@
</span><ins>+Index: libs/portaudio/src/hostapi/coreaudio/pa_mac_core.c
+===================================================================
+--- libs/portaudio/src/hostapi/coreaudio/pa_mac_core.c        (revision 14988)
++++ libs/portaudio/src/hostapi/coreaudio/pa_mac_core.c        (working copy)
+@@ -801,8 +801,8 @@
+ const double sampleRate,
+ void *refCon )
+ {
+- ComponentDescription desc;
+- Component comp;
++ AudioComponentDescription desc;
++ AudioComponent comp;
+ /*An Apple TN suggests using CAStreamBasicDescription, but that is C++*/
+ AudioStreamBasicDescription desiredFormat;
+ OSStatus result = noErr;
+@@ -873,7 +873,7 @@
+ desc.componentFlags = 0;
+ desc.componentFlagsMask = 0;
+ /* -- find the component -- */
+- comp = FindNextComponent( NULL, &desc );
++ comp = AudioComponentFindNext( NULL, &desc );
+ if( !comp )
+ {
+ DBUG( ( "AUHAL component not found." ) );
+@@ -882,7 +882,7 @@
+ return paUnanticipatedHostError;
+ }
+ /* -- open it -- */
+- result = OpenAComponent( comp, audioUnit );
++ result = AudioComponentInstanceNew( comp, audioUnit );
+ if( result )
+ {
+ DBUG( ( "Failed to open AUHAL component." ) );
+@@ -1224,7 +1224,7 @@
+ #undef ERR_WRAP
+
+ error:
+- CloseComponent( *audioUnit );
++ AudioComponentInstanceDispose( *audioUnit );
+ *audioUnit = NULL;
+ if( result )
+ return PaMacCore_SetError( result, line, 1 );
+@@ -2146,13 +2146,13 @@
+ xrunCallback );
+ if( stream->outputUnit && stream->outputUnit != stream->inputUnit ) {
+ AudioUnitUninitialize( stream->outputUnit );
+- CloseComponent( stream->outputUnit );
++ AudioComponentInstanceDispose( stream->outputUnit );
+ }
+ stream->outputUnit = NULL;
+ if( stream->inputUnit )
+ {
+ AudioUnitUninitialize( stream->inputUnit );
+- CloseComponent( stream->inputUnit );
++ AudioComponentInstanceDispose( stream->inputUnit );
+ stream->inputUnit = NULL;
+ }
+ if( stream->inputRingBuffer.buffer )
+@@ -2211,12 +2211,12 @@
+
+ // it's not clear from appl's docs that this really waits
+ // until all data is flushed.
+-static ComponentResult BlockWhileAudioUnitIsRunning( AudioUnit audioUnit, AudioUnitElement element )
++static OSStatus BlockWhileAudioUnitIsRunning( AudioUnit audioUnit, AudioUnitElement element )
+ {
+ Boolean isRunning = 1;
+ while( isRunning ) {
+ UInt32 s = sizeof( isRunning );
+- ComponentResult err = AudioUnitGetProperty( audioUnit, kAudioOutputUnitProperty_IsRunning, kAudioUnitScope_Global, element, &isRunning, &s );
++ OSStatus err = AudioUnitGetProperty( audioUnit, kAudioOutputUnitProperty_IsRunning, kAudioUnitScope_Global, element, &isRunning, &s );
+ if( err )
+ return err;
+ Pa_Sleep( 100 );
+Index: libs/portaudio/src/common/pa_types.h
+===================================================================
+--- libs/portaudio/src/common/pa_types.h        (revision 14988)
++++ libs/portaudio/src/common/pa_types.h        (working copy)
+@@ -62,7 +62,11 @@
+ #endif
+
+ #ifndef SIZEOF_LONG
++#ifdef __LP64__
++#define SIZEOF_LONG 8
++#else
+ #define SIZEOF_LONG 4
++#endif /* __LP64__ */
+ #endif
+
+
+Index: libs/libsndfile/M4/ltsugar.m4
+===================================================================
+--- libs/libsndfile/M4/ltsugar.m4        (revision 14988)
++++ libs/libsndfile/M4/ltsugar.m4        (working copy)
+@@ -1,13 +1,13 @@
+ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+ #
+-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+-# Written by Gary V. Vaughan, 2004
++# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
++# Written by Gary V. Vaughan, 2004
+ #
+ # This file is free software; the Free Software Foundation gives
+ # unlimited permission to copy and/or distribute it, with or without
+ # modifications, as long as this notice is preserved.
+
+-# serial 6 ltsugar.m4
++# serial 5 ltsugar.m4
+
+ # This is to help aclocal find these macros, as it can't see m4_define.
+ AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+@@ -63,14 +63,14 @@
+ # Produce a SEP delimited list of all paired combinations of elements of
+ # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+ # has the form PREFIXmINFIXSUFFIXn.
+-# Needed until we can rely on m4_combine added in Autoconf 2.62.
+ m4_define([lt_combine],
+-[m4_if(m4_eval([$# > 3]), [1],
+- [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+-[[m4_foreach([_Lt_prefix], [$2],
+-         [m4_foreach([_Lt_suffix],
+-                ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+-        [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
++[m4_if([$2], [], [],
++ [m4_if([$4], [], [],
++ [lt_join(m4_quote(m4_default([$1], [[, ]])),
++ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_prefix, [$2],
++                 [m4_foreach(_Lt_suffix, lt_car([m4_shiftn(3, $@)]),
++                         [_Lt_prefix[]$3[]_Lt_suffix ])])))))])])dnl
++])
+
+
+ # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+Index: libs/libsndfile/M4/ltversion.m4
+===================================================================
+--- libs/libsndfile/M4/ltversion.m4        (revision 14988)
++++ libs/libsndfile/M4/ltversion.m4        (working copy)
+@@ -9,15 +9,15 @@
+
+ # Generated from ltversion.in.
+
+-# serial 3012 ltversion.m4
++# serial 2976 ltversion.m4
+ # This file is part of GNU Libtool
+
+-m4_define([LT_PACKAGE_VERSION], [2.2.6])
+-m4_define([LT_PACKAGE_REVISION], [1.3012])
++m4_define([LT_PACKAGE_VERSION], [2.2.4])
++m4_define([LT_PACKAGE_REVISION], [1.2976])
+
+ AC_DEFUN([LTVERSION_VERSION],
+-[macro_version='2.2.6'
+-macro_revision='1.3012'
++[macro_version='2.2.4'
++macro_revision='1.2976'
+ _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+ _LT_DECL(, macro_revision, 0)
+ ])
+Index: libs/libsndfile/M4/ltoptions.m4
+===================================================================
+--- libs/libsndfile/M4/ltoptions.m4        (revision 14988)
++++ libs/libsndfile/M4/ltoptions.m4        (working copy)
+@@ -125,7 +125,7 @@
+ [enable_win32_dll=yes
+
+ case $host in
+-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
++*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorscriptsperlwplookupcgifromrev15313freeswitchtrunkscriptsperlwplookupcgi"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/scripts/perl/wplookup.cgi (from rev 15313, freeswitch/trunk/scripts/perl/wplookup.cgi) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/scripts/perl/wplookup.cgi         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/scripts/perl/wplookup.cgi        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+#!/usr/bin/perl
+#
+# see http://developer.whitepages.com/ for details
+#
+
+use Data::Dumper;
+use Net::WhitePages;
+use CGI qw/:standard/;
+
+my $wp = Net::WhitePages->new(TOKEN => "API_TOKEN");
+
+
+$caller_id = param('caller_id');
+
+print header("text/plain");
+my $res = $wp->reverse_phone(phone => $caller_id);
+foreach $entry (@{$res->{listings}}) {
+ if($entry->{business}) {
+ print uc("$entry->{business}->{businessname}");
+ } elsif ($entry->{displayname}) {
+ print uc("$entry->{displayname}");
+ } else {
+ print uc("$entry->{address}->{city}, $entry->{address}->{state}");
+ }
+ last;
+};
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcincludeswitch_bufferh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_buffer.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_buffer.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_buffer.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -137,6 +137,8 @@
</span><span class="cx"> */
</span><span class="cx"> SWITCH_DECLARE(void) switch_buffer_zero(_In_ switch_buffer_t *buffer);
</span><span class="cx">
</span><ins>+SWITCH_DECLARE(switch_size_t) switch_buffer_slide_write(switch_buffer_t *buffer, const void *data, switch_size_t datalen);
+
</ins><span class="cx"> /*! \brief Destroy the buffer
</span><span class="cx"> * \param buffer buffer to destroy
</span><span class="cx"> * \note only neccessary on dynamic buffers (noop on pooled ones)
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcincludeswitch_callerh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_caller.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_caller.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_caller.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -67,6 +67,10 @@
</span><span class="cx">         const char *caller_id_name;
</span><span class="cx">         /*! Caller ID Number */
</span><span class="cx">         const char *caller_id_number;
</span><ins>+        /*! Callee ID Name */
+        const char *callee_id_name;
+        /*! Callee ID Number */
+        const char *callee_id_number;
</ins><span class="cx">         uint8_t caller_ton;
</span><span class="cx">         uint8_t caller_numplan;
</span><span class="cx">         /*! Caller Network Address (when applicable) */
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcincludeswitch_channelh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_channel.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_channel.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_channel.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -80,6 +80,7 @@
</span><span class="cx"> #define switch_channel_media_ready(_channel) switch_channel_test_ready(_channel, SWITCH_TRUE)
</span><span class="cx"> #define switch_channel_up(_channel) (switch_channel_get_state(_channel) < CS_HANGUP)
</span><span class="cx"> #define switch_channel_down(_channel) (switch_channel_get_state(_channel) >= CS_HANGUP)
</span><ins>+#define switch_channel_media_ack(_channel) (!switch_channel_test_cap(_channel, CC_MEDIA_ACK) || switch_channel_test_flag(_channel, CF_MEDIA_ACK))
</ins><span class="cx">
</span><span class="cx"> SWITCH_DECLARE(void) switch_channel_wait_for_state(switch_channel_t *channel, switch_channel_t *other_channel, switch_channel_state_t want_state);
</span><span class="cx"> SWITCH_DECLARE(void) switch_channel_wait_for_state_timeout(switch_channel_t *other_channel, switch_channel_state_t want_state, uint32_t timeout);
</span><span class="lines">@@ -228,6 +229,8 @@
</span><span class="cx"> \returns SWITCH_STATUS_SUCCESS if successful
</span><span class="cx"> */
</span><span class="cx">
</span><ins>+SWITCH_DECLARE(switch_status_t) switch_channel_set_profile_var(switch_channel_t *channel, const char *name, const char *val);
+
</ins><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_var_check(switch_channel_t *channel,
</span><span class="cx">                                                                                                                                          const char *varname, const char *value, switch_bool_t var_check);
</span><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_printf(switch_channel_t *channel, const char *varname, const char *fmt, ...);
</span><span class="lines">@@ -249,6 +252,8 @@
</span><span class="cx"> SWITCH_DECLARE(const char *) switch_channel_get_variable(switch_channel_t *channel, const char *varname);
</span><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_channel_get_variables(switch_channel_t *channel, switch_event_t **event);
</span><span class="cx">
</span><ins>+SWITCH_DECLARE(switch_status_t) switch_channel_pass_callee_id(switch_channel_t *channel, switch_channel_t *other_channel);
+
</ins><span class="cx"> /*!
</span><span class="cx"> * \brief Start iterating over the entries in the channel variable list.
</span><span class="cx"> * \param channel the channel to iterate the variables for
</span><span class="lines">@@ -262,6 +267,11 @@
</span><span class="cx"> */
</span><span class="cx"> SWITCH_DECLARE(void) switch_channel_variable_last(switch_channel_t *channel);
</span><span class="cx">
</span><ins>+
+SWITCH_DECLARE(void) switch_channel_restart(switch_channel_t *channel);
+
+SWITCH_DECLARE(switch_status_t) switch_channel_caller_extension_masquerade(switch_channel_t *orig_channel, switch_channel_t *new_channel, uint32_t offset);
+
</ins><span class="cx"> /*!
</span><span class="cx"> \brief Assign a caller extension to a given channel
</span><span class="cx"> \param channel channel to assign extension to
</span><span class="lines">@@ -292,6 +302,10 @@
</span><span class="cx"> SWITCH_DECLARE(void) switch_channel_set_flag(switch_channel_t *channel, switch_channel_flag_t flag);
</span><span class="cx"> SWITCH_DECLARE(void) switch_channel_set_flag_recursive(switch_channel_t *channel, switch_channel_flag_t flag);
</span><span class="cx">
</span><ins>+SWITCH_DECLARE(void) switch_channel_set_cap(switch_channel_t *channel, switch_channel_cap_t cap);
+SWITCH_DECLARE(void) switch_channel_clear_cap(switch_channel_t *channel, switch_channel_cap_t cap);
+SWITCH_DECLARE(uint32_t) switch_channel_test_cap(switch_channel_t *channel, switch_channel_cap_t cap);
+
</ins><span class="cx"> /*!
</span><span class="cx"> \brief Set given flag(s) on a given channel's bridge partner
</span><span class="cx"> \param channel channel to derive the partner channel to set flag on
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcincludeswitch_coreh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_core.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_core.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_core.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -59,6 +59,9 @@
</span><span class="cx">         struct switch_app_log *next;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+#define MESSAGE_STAMP_FFL(_m) _m->_file = __FILE__; _m->_func = __SWITCH_FUNC__; _m->_line = __LINE__
+
+#define MESSAGE_STRING_ARG_MAX 10
</ins><span class="cx"> /*! \brief A message object designed to allow unlike technologies to exchange data */
</span><span class="cx"> struct switch_core_session_message {
</span><span class="cx">         /*! uuid of the sender (for replies) */
</span><span class="lines">@@ -92,7 +95,8 @@
</span><span class="cx">         const char *_file;
</span><span class="cx">         const char *_func;
</span><span class="cx">         int _line;
</span><del>-
</del><ins>+        const char *string_array_arg[MESSAGE_STRING_ARG_MAX];
+        time_t delivery_time;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> /*! \brief A generic object to pass as a thread's session object to allow mutiple arguements and a pool */
</span><span class="lines">@@ -634,6 +638,7 @@
</span><span class="cx"> /*!
</span><span class="cx"> \brief Signal a session's state machine thread that a state change has occured
</span><span class="cx"> */
</span><ins>+SWITCH_DECLARE(void) switch_core_session_wake_session_thread(_In_ switch_core_session_t *session);
</ins><span class="cx"> SWITCH_DECLARE(void) switch_core_session_signal_state_change(_In_ switch_core_session_t *session);
</span><span class="cx">
</span><span class="cx"> /*!
</span><span class="lines">@@ -653,6 +658,10 @@
</span><span class="cx"> SWITCH_DECLARE(switch_core_session_t *) switch_core_session_perform_locate(const char *uuid_str, const char *file, const char *func, int line);
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#ifdef SWITCH_DEBUG_RWLOCKS
+SWITCH_DECLARE(switch_core_session_t *) switch_core_session_perform_force_locate(const char *uuid_str, const char *file, const char *func, int line);
+#endif
+
</ins><span class="cx"> /*!
</span><span class="cx"> \brief Locate a session based on it's uuid
</span><span class="cx"> \param uuid_str the unique id of the session you want to find
</span><span class="lines">@@ -737,6 +746,8 @@
</span><span class="cx"> */
</span><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_core_session_queue_message(_In_ switch_core_session_t *session, _In_ switch_core_session_message_t *message);
</span><span class="cx">
</span><ins>+SWITCH_DECLARE(void) switch_core_session_free_message(switch_core_session_message_t **message);
+
</ins><span class="cx"> /*!
</span><span class="cx"> \brief pass an indication message on a session
</span><span class="cx"> \param session the session to pass the message across
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcincludeswitch_cpph"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_cpp.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_cpp.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_cpp.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -20,19 +20,8 @@
</span><span class="cx">         tts_name = NULL;                                                                        \
</span><span class="cx">         voice_name = NULL;                                                                        \
</span><span class="cx">         xml_cdr_text = NULL;                                                                \
</span><del>-        memset(&caller_profile, 0, sizeof(caller_profile)); \
</del><span class="cx">         memset(&args, 0, sizeof(args));                                                \
</span><span class="cx">         ap = NULL;                                                                                        \
</span><del>-        caller_profile.source = "mod_unknown";                                \
-        caller_profile.dialplan = "";                                                \
-        caller_profile.context = "";                                                \
-        caller_profile.caller_id_name = "";                                        \
-        caller_profile.caller_id_number = "";                                \
-        caller_profile.network_addr = "";                                        \
-        caller_profile.ani = "";                                                        \
-        caller_profile.aniii = "";                                                        \
-        caller_profile.rdnis = "";                                                        \
-        caller_profile.username = "";                                                \
</del><span class="cx">         flags = 0;                                                                                        \
</span><span class="cx">         on_hangup = NULL;                                                                        \
</span><span class="cx">         memset(&cb_state, 0, sizeof(cb_state));                                \
</span><span class="lines">@@ -199,7 +188,6 @@
</span><span class="cx">                  switch_input_args_t args;        // holds ptr to cb function and input_callback_state struct
</span><span class="cx">                  // which has a language specific callback function
</span><span class="cx">                  switch_input_args_t *ap;        // ptr to args .. (is this really needed?)
</span><del>-                 switch_caller_profile_t caller_profile;        // avoid passing so many args to originate,
</del><span class="cx">                  // instead set them here first
</span><span class="cx">                  char *xml_cdr_text;
</span><span class="cx">                  void store_file_handle(switch_file_handle_t *fh);
</span><span class="lines">@@ -247,12 +235,10 @@
</span><span class="cx">          */
</span><span class="cx">                  SWITCH_DECLARE(int) recordFile(char *file_name, int time_limit = 0, int silence_threshold = 0, int silence_hits = 0);
</span><span class="cx">
</span><del>-
</del><span class="cx">         /** \brief Set attributes of caller data for purposes of outgoing calls
</span><span class="cx">          * \param var - the variable name, eg, "caller_id_name"
</span><span class="cx">          * \param val - the data to set, eg, "bob"
</span><span class="cx">          */
</span><del>-                 SWITCH_DECLARE(void) setCallerData(char *var, char *val);
</del><span class="cx">
</span><span class="cx">         /** \brief Originate a call to a destination
</span><span class="cx">          *
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcincludeswitch_ivrh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_ivr.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_ivr.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_ivr.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -102,6 +102,7 @@
</span><span class="cx"> */
</span><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_events(switch_core_session_t *session);
</span><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_ivr_parse_next_event(switch_core_session_t *session);
</span><ins>+SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_messages(switch_core_session_t *session);
</ins><span class="cx">
</span><span class="cx"> /*!
</span><span class="cx"> \brief Wait for time to pass for a specified number of milliseconds
</span><span class="lines">@@ -408,6 +409,8 @@
</span><span class="cx">                                                                                                          switch_originate_flag_t flags
</span><span class="cx">                                                                                                          );
</span><span class="cx">
</span><ins>+SWITCH_DECLARE(void) switch_ivr_bridge_display(switch_core_session_t *session, switch_core_session_t *peer_session);
+
</ins><span class="cx"> /*!
</span><span class="cx"> \brief Bridge Audio from one session to another
</span><span class="cx"> \param session one session
</span><span class="lines">@@ -800,6 +803,8 @@
</span><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_ivr_set_user(switch_core_session_t *session, const char *data);
</span><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_ivr_sound_test(switch_core_session_t *session);
</span><span class="cx"> SWITCH_DECLARE(void) switch_process_import(switch_core_session_t *session, switch_channel_t *peer_channel, const char *varname);
</span><ins>+SWITCH_DECLARE(switch_bool_t) switch_ivr_uuid_exists(const char *uuid);
+
</ins><span class="cx"> /** @} */
</span><span class="cx">
</span><span class="cx"> SWITCH_END_EXTERN_C
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcincludeswitch_loadable_moduleh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_loadable_module.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_loadable_module.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_loadable_module.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -335,7 +335,7 @@
</span><span class="cx">                 if (ptime < 120) return 1;
</span><span class="cx">                 break;
</span><span class="cx">         case 48000:
</span><del>-                max_ms = 20;
</del><ins>+                max_ms = 40;
</ins><span class="cx">                 ptime_div = 2;
</span><span class="cx">                 break;
</span><span class="cx">         case 32000:
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcincludeswitch_typesh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_types.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_types.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_types.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -111,6 +111,7 @@
</span><span class="cx"> #define SWITCH_PATH_SEPARATOR "/"
</span><span class="cx"> #endif
</span><span class="cx"> #define SWITCH_URL_SEPARATOR "://"
</span><ins>+#define SWITCH_IGNORE_DISPLAY_UPDATES_VARIABLE "ignore_display_updates"
</ins><span class="cx"> #define SWITCH_AUDIO_SPOOL_PATH_VARIABLE "audio_spool_path"
</span><span class="cx"> #define SWITCH_BRIDGE_HANGUP_CAUSE_VARIABLE "bridge_hangup_cause"
</span><span class="cx"> #define SWITCH_READ_TERMINATOR_USED_VARIABLE "read_terminator_used"
</span><span class="lines">@@ -125,9 +126,13 @@
</span><span class="cx"> #define SWITCH_CURRENT_APPLICATION_VARIABLE "current_application"
</span><span class="cx"> #define SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE "proto_specific_hangup_cause"
</span><span class="cx"> #define SWITCH_CHANNEL_EXECUTE_ON_ANSWER_VARIABLE "execute_on_answer"
</span><ins>+#define SWITCH_CHANNEL_EXECUTE_ON_PRE_ANSWER_VARIABLE "execute_on_pre_answer"
+#define SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE "execute_on_media"
+#define SWITCH_CHANNEL_API_ON_ANSWER_VARIABLE "api_on_answer"
</ins><span class="cx"> #define SWITCH_CHANNEL_EXECUTE_ON_RING_VARIABLE "execute_on_ring"
</span><span class="cx"> #define SWITCH_CALL_TIMEOUT_VARIABLE "call_timeout"
</span><span class="cx"> #define SWITCH_HOLDING_UUID_VARIABLE "holding_uuid"
</span><ins>+#define SWITCH_SOFT_HOLDING_UUID_VARIABLE "soft_holding_uuid"
</ins><span class="cx"> #define SWITCH_API_BRIDGE_END_VARIABLE "api_after_bridge"
</span><span class="cx"> #define SWITCH_API_HANGUP_HOOK_VARIABLE "api_hangup_hook"
</span><span class="cx"> #define SWITCH_SESSION_IN_HANGUP_HOOK_VARIABLE "session_in_hangup_hook"
</span><span class="lines">@@ -508,7 +513,9 @@
</span><span class="cx">         SWITCH_ZRTP_FLAG_SECURE_SEND = (1 << 23),
</span><span class="cx">         SWITCH_ZRTP_FLAG_SECURE_RECV = (1 << 24),
</span><span class="cx">         SWITCH_ZRTP_FLAG_SECURE_MITM_SEND = (1 << 25),
</span><del>-        SWITCH_ZRTP_FLAG_SECURE_MITM_RECV = (1 << 26)
</del><ins>+        SWITCH_ZRTP_FLAG_SECURE_MITM_RECV = (1 << 26),
+        SWITCH_RTP_FLAG_DEBUG_RTP_READ = (1 << 27),
+        SWITCH_RTP_FLAG_DEBUG_RTP_WRITE = (1 << 28)
</ins><span class="cx"> } switch_rtp_flag_enum_t;
</span><span class="cx"> typedef uint32_t switch_rtp_flag_t;
</span><span class="cx">
</span><span class="lines">@@ -659,6 +666,9 @@
</span><span class="cx">         SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY,
</span><span class="cx">         SWITCH_MESSAGE_INDICATE_AUDIO_SYNC,
</span><span class="cx">         SWITCH_MESSAGE_INDICATE_REQUEST_IMAGE_MEDIA,
</span><ins>+        SWITCH_MESSAGE_INDICATE_UUID_CHANGE,
+        SWITCH_MESSAGE_INDICATE_WARNING,
+        SWITCH_MESSAGE_INDICATE_DEBUG_AUDIO,
</ins><span class="cx">         SWITCH_MESSAGE_INVALID
</span><span class="cx"> } switch_core_session_message_types_t;
</span><span class="cx">
</span><span class="lines">@@ -866,10 +876,18 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> typedef enum {
</span><ins>+        CC_MEDIA_ACK = 1,
+        CC_BYPASS_MEDIA,
+        CC_PROXY_MEDIA,
+        /* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
+        CC_FLAG_MAX
+} switch_channel_cap_t;
+
+typedef enum {
</ins><span class="cx">         CF_ANSWERED = 1,
</span><span class="cx">         CF_OUTBOUND,
</span><span class="cx">         CF_EARLY_MEDIA,
</span><del>-        CF_ORIGINATOR,
</del><ins>+        CF_BRIDGE_ORIGINATOR,
</ins><span class="cx">         CF_TRANSFER,
</span><span class="cx">         CF_ACCEPT_CNG,
</span><span class="cx">         CF_REDIRECT,
</span><span class="lines">@@ -903,6 +921,12 @@
</span><span class="cx">         CF_REPORTING,
</span><span class="cx">         CF_PARK,
</span><span class="cx">         CF_TIMESTAMP_SET,
</span><ins>+        CF_ORIGINATOR,
+        CF_XFER_ZOMBIE,
+        CF_MEDIA_ACK,
+        CF_THREAD_SLEEPING,
+        CF_DISABLE_RINGBACK,
+        CF_NOT_READY,
</ins><span class="cx">         /* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
</span><span class="cx">         CF_FLAG_MAX
</span><span class="cx"> } switch_channel_flag_t;
</span><span class="lines">@@ -1101,7 +1125,7 @@
</span><span class="cx">         SMBF_READ_REPLACE = (1 << 3),
</span><span class="cx">         SMBF_READ_PING = (1 << 4),
</span><span class="cx">         SMBF_STEREO = (1 << 5),
</span><del>-        SMBF_RECORD_ANSWER_REQ = (1 << 6),
</del><ins>+        SMBF_ANSWER_REQ = (1 << 6),
</ins><span class="cx">         SMBF_THREAD_LOCK = (1 << 7)
</span><span class="cx"> } switch_media_bug_flag_enum_t;
</span><span class="cx"> typedef uint32_t switch_media_bug_flag_t;
</span><span class="lines">@@ -1287,6 +1311,7 @@
</span><span class="cx">         SWITCH_EVENT_NAT,
</span><span class="cx">         SWITCH_EVENT_RECORD_START,
</span><span class="cx">         SWITCH_EVENT_RECORD_STOP,
</span><ins>+        SWITCH_EVENT_CALL_UPDATE,
</ins><span class="cx">         SWITCH_EVENT_ALL
</span><span class="cx"> } switch_event_types_t;
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcincludeswitch_utilsh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_utils.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_utils.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/include/switch_utils.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -74,11 +74,11 @@
</span><span class="cx"> \param s the string to test
</span><span class="cx"> \return true value if the string is NULL or zero length
</span><span class="cx"> */
</span><del>-#define switch_strlen_zero(s) (!s || *(s) == '\0')
-#define switch_strlen_zero_buf(s) (*(s) == '\0')
</del><ins>+#define zstr(s) (!s || *(s) == '\0')
+#define zstr_buf(s) (*(s) == '\0')
</ins><span class="cx"> static inline switch_bool_t switch_is_moh(const char *s)
</span><span class="cx"> {
</span><del>-        if (switch_strlen_zero(s) || !strcasecmp(s, "silence") || !strcasecmp(s, "indicate_hold")) {
</del><ins>+        if (zstr(s) || !strcasecmp(s, "silence") || !strcasecmp(s, "indicate_hold")) {
</ins><span class="cx">                 return SWITCH_FALSE;
</span><span class="cx">         }
</span><span class="cx">         return SWITCH_TRUE;
</span><span class="lines">@@ -186,6 +186,9 @@
</span><span class="cx"> */
</span><span class="cx"> SWITCH_DECLARE(char *) get_addr(char *buf, switch_size_t len, struct sockaddr *sa, socklen_t salen);
</span><span class="cx">
</span><ins>+SWITCH_DECLARE(int) get_addr_int(switch_sockaddr_t *sa);
+SWITCH_DECLARE(int) switch_cmp_addr(switch_sockaddr_t *sa1, switch_sockaddr_t *sa2);
+
</ins><span class="cx"> /*!
</span><span class="cx"> \brief get the port number of an ip address
</span><span class="cx"> \param sa the struct sockaddr * to get the port from
</span><span class="lines">@@ -355,7 +358,7 @@
</span><span class="cx">         char *p;
</span><span class="cx">         for (p = s; p && *p; p++) {
</span><span class="cx">                 uint8_t x = (uint8_t) *p;
</span><del>-                if ((x < 32 || x > 127) && x != '\n' && x != '\r') {
</del><ins>+                if ((x < 32) && x != '\n' && x != '\r') {
</ins><span class="cx">                         *p = ' ';
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -555,7 +558,13 @@
</span><span class="cx"> #define SWITCH_READ_ACCEPTABLE(status) (status == SWITCH_STATUS_SUCCESS || status == SWITCH_STATUS_BREAK)
</span><span class="cx"> SWITCH_DECLARE(size_t) switch_url_encode(const char *url, char *buf, size_t len);
</span><span class="cx"> SWITCH_DECLARE(char *) switch_url_decode(char *s);
</span><del>-SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to, const char *from, const char *headers, const char *body, const char *file);
</del><ins>+SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to,
+                                                                                                 const char *from,
+                                                                                                 const char *headers,
+                                                                                                 const char *body,
+                                                                                                 const char *file,
+                                                                                                 const char *convert_cmd,
+                                                                                                 const char *convert_ext);
</ins><span class="cx"> SWITCH_DECLARE(char *) switch_find_end_paren(const char *s, char open, char close);
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_cidlookupmod_cidlookupc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_cidlookup/mod_cidlookup.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_cidlookup/mod_cidlookup.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_cidlookup/mod_cidlookup.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -46,6 +46,8 @@
</span><span class="cx">
</span><span class="cx"> static struct {
</span><span class="cx">         char *url;
</span><ins>+        
+        char *whitepages_apikey;
</ins><span class="cx">
</span><span class="cx">         switch_bool_t cache;
</span><span class="cx">         int cache_expire;
</span><span class="lines">@@ -95,11 +97,11 @@
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         if ((callback_type == CONFIG_LOAD || callback_type == CONFIG_RELOAD) && changed) {
</span><del>-                odbc_dsn = strdup(newvalue);
</del><span class="cx">
</span><del>-                if(switch_strlen_zero(odbc_dsn)) {
</del><ins>+                if(zstr(newvalue)) {
</ins><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "No local database defined.\n");
</span><span class="cx">                 } else {
</span><ins>+                        odbc_dsn = strdup(newvalue);
</ins><span class="cx">                         if ((odbc_user = strchr(odbc_dsn, ':'))) {
</span><span class="cx">                                 *odbc_user++ = '\0';
</span><span class="cx">                                 if ((odbc_pass = strchr(odbc_user, ':'))) {
</span><span class="lines">@@ -145,6 +147,7 @@
</span><span class="cx"> static switch_xml_config_item_t instructions[] = {
</span><span class="cx">         /* parameter name type reloadable pointer default value options structure */
</span><span class="cx">         SWITCH_CONFIG_ITEM_STRING_STRDUP("url", CONFIG_RELOAD, &globals.url, NULL, "http://server.example.com/app?number=${caller_id_number}", "URL for the CID lookup service"),
</span><ins>+        SWITCH_CONFIG_ITEM_STRING_STRDUP("whitepages-apikey", CONFIG_RELOAD, &globals.whitepages_apikey, NULL, "api key for whitepages.com", "api key for whitepages.com"),
</ins><span class="cx">         SWITCH_CONFIG_ITEM("cache", SWITCH_CONFIG_BOOL, CONFIG_RELOAD, &globals.cache, SWITCH_FALSE, NULL, "true|false", "whether to cache via cidlookup"),
</span><span class="cx">         SWITCH_CONFIG_ITEM("cache-expire", SWITCH_CONFIG_INT, CONFIG_RELOAD, &globals.cache_expire, (void *)300, NULL, "expire", "seconds to preserve num->name cache"),
</span><span class="cx">         SWITCH_CONFIG_ITEM_STRING_STRDUP("sql", CONFIG_RELOAD, &globals.sql, "", "sql whre number=${caller_id_number}", "SQL to run if overriding CID"),
</span><span class="lines">@@ -286,9 +289,8 @@
</span><span class="cx">         return realsize;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static char *do_lookup_url(switch_memory_pool_t *pool, switch_event_t *event, const char *num) {
</del><ins>+static char *do_lookup_url(switch_memory_pool_t *pool, switch_event_t *event, const char *query) {
</ins><span class="cx">         char *name = NULL;
</span><del>-        char *newurl = NULL;
</del><span class="cx">         
</span><span class="cx">         CURL *curl_handle = NULL;
</span><span class="cx">         long httpRes = 0;
</span><span class="lines">@@ -298,24 +300,22 @@
</span><span class="cx">         
</span><span class="cx">         memset(&http_data, 0, sizeof(http_data));
</span><span class="cx">         
</span><del>-        http_data.max_bytes = 1024;
</del><ins>+        http_data.max_bytes = 10240;
</ins><span class="cx">         SWITCH_STANDARD_STREAM(http_data.stream);
</span><span class="cx">
</span><span class="cx">         gethostname(hostname, sizeof(hostname));
</span><span class="cx">         
</span><del>-        newurl = switch_event_expand_headers(event, globals.url);
-        
-        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "url: %s\n", newurl);
</del><ins>+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "url: %s\n", query);
</ins><span class="cx">         curl_handle = curl_easy_init();
</span><span class="cx">         
</span><del>-        if (!strncasecmp(newurl, "https", 5)) {
</del><ins>+        if (!strncasecmp(query, "https", 5)) {
</ins><span class="cx">                 curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0);
</span><span class="cx">                 curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0);
</span><span class="cx">         }
</span><span class="cx">         curl_easy_setopt(curl_handle, CURLOPT_POST, SWITCH_FALSE);
</span><span class="cx">         curl_easy_setopt(curl_handle, CURLOPT_FOLLOWLOCATION, 1);
</span><span class="cx">         curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, 10);
</span><del>-        curl_easy_setopt(curl_handle, CURLOPT_URL, newurl);
</del><ins>+        curl_easy_setopt(curl_handle, CURLOPT_URL, query);
</ins><span class="cx">         curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, file_callback);
</span><span class="cx">         curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *) &http_data);
</span><span class="cx">         curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "freeswitch-cidlookup/1.0");
</span><span class="lines">@@ -325,19 +325,89 @@
</span><span class="cx">         curl_easy_cleanup(curl_handle);
</span><span class="cx">         
</span><span class="cx">         if (        http_data.stream.data &&
</span><del>-                        !switch_strlen_zero((char *)http_data.stream.data) &&
</del><ins>+                        !zstr((char *)http_data.stream.data) &&
</ins><span class="cx">                         strcmp(" ", http_data.stream.data) ) {
</span><span class="cx">                 
</span><span class="cx">                 name = switch_core_strdup(pool, http_data.stream.data);
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        if (newurl != globals.url) {
-                switch_safe_free(newurl);
-        }
</del><span class="cx">         switch_safe_free(http_data.stream.data);
</span><span class="cx">         return name;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static char *do_whitepages_lookup(switch_memory_pool_t *pool, switch_event_t *event, const char *num, switch_bool_t *areaonly)
+{
+        char *xml_s = NULL;
+        char *query = NULL;
+        char *name = NULL;
+        char *city = NULL;
+        char *state = NULL;
+        switch_xml_t xml = NULL;
+        switch_xml_t node = NULL;
+
+        /* NANPA check */
+        if (strlen(num) == 11 && num[0] == '1') {
+                num++; /* skip past leading 1 */
+        } else {
+                goto done;
+        }
+        
+        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "whitepages-cid", num);
+        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "whitepages-api-key", globals.whitepages_apikey);
+        
+        query = switch_event_expand_headers(event, "http://api.whitepages.com/reverse_phone/1.0/?phone=${whitepages-cid};api_key=${whitepages-api-key}");
+        xml_s = do_lookup_url(pool, event, query);
+        
+        xml = switch_xml_parse_str_dup(xml_s);
+        
+        if (!xml) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to parse XML: %s\n", xml_s);
+                goto done;
+        }
+
+        *areaonly = SWITCH_FALSE;
+        
+        /* try for bizname first */
+        node = switch_xml_get(xml, "wp:listings", 0, "wp:listing", 0, "wp:business", 0, "wp:businessname", -1);
+        if (node) {
+                name = switch_core_strdup(pool, switch_xml_txt(node));
+                goto done;
+        }
+        
+        node = switch_xml_get(xml, "wp:listings", 0, "wp:listing", 0, "wp:displayname", -1);
+        if (node) {
+                name = switch_core_strdup(pool, switch_xml_txt(node));
+                goto done;
+        }
+        
+        node = switch_xml_get(xml, "wp:listings", 0, "wp:listing", 0, "wp:address", 0, "wp:city", -1);
+        if (node) {
+                city = switch_xml_txt(node);
+        }
+
+        node = switch_xml_get(xml, "wp:listings", 0, "wp:listing", 0, "wp:address", 0, "wp:state", -1);
+        if (node) {
+                state = switch_xml_txt(node);
+        }
+        
+        if (city || state) {
+                *areaonly = SWITCH_TRUE;
+                name = switch_core_sprintf(pool, "%s %s", city ? city : "", state ? state : "");
+        }
+
+done:
+
+        if (query) {
+                switch_safe_free(query);
+        }
+        if (xml) {
+                switch_xml_free(xml);
+        }
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "whitepages XML: %s\n", xml_s);
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "whitepages name: %s\n", name ? name : "(null)");
+        return name;
+}
+
</ins><span class="cx"> static char *do_db_lookup(switch_memory_pool_t *pool, switch_event_t *event, const char *num, const char *sql) {
</span><span class="cx">         char *name = NULL;
</span><span class="cx">         char *newsql = NULL;
</span><span class="lines">@@ -362,6 +432,10 @@
</span><span class="cx"> static char *do_lookup(switch_memory_pool_t *pool, switch_event_t *event, const char *num, switch_bool_t skipurl, switch_bool_t skipcitystate) {
</span><span class="cx">         char *number = NULL;
</span><span class="cx">         char *name = NULL;
</span><ins>+        char *area = NULL;
+        char *url_query = NULL;
+        char *src = NULL;
+        switch_bool_t areaonly = SWITCH_FALSE;
</ins><span class="cx">         
</span><span class="cx">         number = string_digitsonly(pool, num);
</span><span class="cx">         switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "caller_id_number", number);
</span><span class="lines">@@ -369,25 +443,55 @@
</span><span class="cx">         /* database always wins */
</span><span class="cx">         if (switch_odbc_available() && globals.master_odbc && globals.sql) {
</span><span class="cx">                 name = do_db_lookup(pool, event, number, globals.sql);
</span><ins>+                src = "database";
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         if (!name && globals.url) {
</span><span class="cx">                 if (globals.cache) {
</span><span class="cx">                         name = check_cache(pool, number);
</span><ins>+                        src = "cache";
</ins><span class="cx">                 }
</span><span class="cx">                 if (!skipurl && !name) {
</span><del>-                        name = do_lookup_url(pool, event, number);
</del><ins>+                        name = do_whitepages_lookup(pool, event, number, &areaonly);
+                        src = "whitepages";
+                        if (areaonly) {
+                                if (!skipcitystate) {
+                                        area = name; /* preserve if we're not skipping city/state */
+                                }
+                                name = NULL; /* always clear out name */
+                        }
</ins><span class="cx">                         if (globals.cache && name) {
</span><span class="cx">                                 set_cache(pool, number, name);
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><ins>+                if (!skipurl && !name) {
+                        url_query = switch_event_expand_headers(event, globals.url);
+                        name = do_lookup_url(pool, event, url_query);
+                        src = "url";
+                        if (url_query != globals.url) {
+                                switch_safe_free(url_query);
+                        }
+                        
+                        /* store and use preserved area info */
+                        if (!name && area) {
+                                src = "whitepages";
+                                name = area;
+                        }
+                        if (globals.cache && name) {
+                                set_cache(pool, number, name);
+                        }
+                }
</ins><span class="cx">         }
</span><span class="cx">         /* only do the below if it is a nanpa number */
</span><span class="cx">         if (!skipcitystate && strlen(number) == 11 && number[0] == '1' &&
</span><span class="cx">                 !name && switch_odbc_available() && globals.master_odbc && globals.citystate_sql) {
</span><span class="cx">                 
</span><span class="cx">                 name = do_db_lookup(pool, event, number, globals.citystate_sql);
</span><ins>+                src = "npanxx";
</ins><span class="cx">         }
</span><ins>+
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "cidlookup source: %s\n", src);
+        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "cidlookup_source", src);
</ins><span class="cx">         return name;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -443,6 +547,9 @@
</span><span class="cx">         
</span><span class="cx">         if (name && channel) {
</span><span class="cx">                 switch_channel_set_variable(channel, "original_caller_id_name", switch_core_strdup(pool, profile->caller_id_name));
</span><ins>+                if (!zstr(switch_event_get_header(event, "cidlookup_source"))) {
+                        switch_channel_set_variable(channel, "cidlookup_source", switch_core_strdup(pool, switch_event_get_header(event, "cidlookup_source")));
+                }
</ins><span class="cx">                 profile->caller_id_name = switch_core_strdup(profile->pool, name);;
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="lines">@@ -470,7 +577,7 @@
</span><span class="cx">         switch_bool_t skipurl = SWITCH_FALSE;
</span><span class="cx">         switch_bool_t skipcitystate = SWITCH_FALSE;
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 switch_goto_status(SWITCH_STATUS_SUCCESS, usage);
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_commandsmod_commandsc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_commands/mod_commands.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_commands/mod_commands.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_commands/mod_commands.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -45,11 +45,20 @@
</span><span class="cx"> SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_commands_shutdown);
</span><span class="cx"> SWITCH_MODULE_DEFINITION(mod_commands, mod_commands_load, mod_commands_shutdown, NULL);
</span><span class="cx">
</span><ins>+SWITCH_STANDARD_API(hostname_api_function)
+{
+        char hostname[256]="";
+        gethostname(hostname, sizeof(hostname));
+        stream->write_function(stream, "%s",hostname);
+        return SWITCH_STATUS_SUCCESS;
+}
+
+
</ins><span class="cx"> SWITCH_STANDARD_API(host_lookup_function)
</span><span class="cx"> {
</span><span class="cx">         char host[256] = "";
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "%s", "parameter missing\n");
</span><span class="cx">         } else {
</span><span class="cx">                 if (switch_resolve_host(cmd, host, sizeof(host)) == SWITCH_STATUS_SUCCESS) {
</span><span class="lines">@@ -146,7 +155,7 @@
</span><span class="cx">         int diff;
</span><span class="cx">         int max = 10;
</span><span class="cx">         char *p;
</span><del>-        if (switch_strlen_zero(cmd)){
</del><ins>+        if (zstr(cmd)){
</ins><span class="cx">                 stream->write_function(stream, "parameter missing\n");
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -189,7 +198,7 @@
</span><span class="cx">         char *fp = NULL;
</span><span class="cx">         const char *call_delim = ",";
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 goto end;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -224,7 +233,7 @@
</span><span class="cx">                 domain = switch_core_get_variable("domain");
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        if (!switch_strlen_zero(domain)) {
</del><ins>+        if (!zstr(domain)) {
</ins><span class="cx">                 switch_xml_t xml, x_domain, x_group;
</span><span class="cx">                 switch_event_t *params;
</span><span class="cx">                 switch_stream_handle_t dstream = { 0 };
</span><span class="lines">@@ -377,7 +386,7 @@
</span><span class="cx">         const char *rval = "false";
</span><span class="cx">         char *group;
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(cmd) || !(mydata = strdup(cmd))) {
</del><ins>+        if (zstr(cmd) || !(mydata = strdup(cmd))) {
</ins><span class="cx">                 goto end;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -427,7 +436,7 @@
</span><span class="cx">         const char *container = "params", *elem = "param";
</span><span class="cx">         switch_event_t *params = NULL;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd) || !(mydata = strdup(cmd))) {
</del><ins>+        if (zstr(cmd) || !(mydata = strdup(cmd))) {
</ins><span class="cx">                 goto end;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -580,7 +589,7 @@
</span><span class="cx"> {
</span><span class="cx">         char digest[SWITCH_MD5_DIGEST_STRING_SIZE] = { 0 };
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "%s", "!err!");
</span><span class="cx">         } else {
</span><span class="cx">                 switch_md5_string(digest, (void *) cmd, strlen(cmd));
</span><span class="lines">@@ -595,7 +604,7 @@
</span><span class="cx">         char *reply = "";
</span><span class="cx">         char *data = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd)) {
</del><ins>+        if (!zstr(cmd)) {
</ins><span class="cx">                 data = strdup(cmd);
</span><span class="cx">                 switch_url_decode(data);
</span><span class="cx">                 reply = data;
</span><span class="lines">@@ -627,7 +636,7 @@
</span><span class="cx">
</span><span class="cx">         ip = ip_buf;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "%s", "-STUN Failed! NO STUN SERVER\n");
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -658,7 +667,7 @@
</span><span class="cx">
</span><span class="cx">         switch_core_new_memory_pool(&pool);
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(stun_ip)) {
</del><ins>+        if (zstr(stun_ip)) {
</ins><span class="cx">                 stream->write_function(stream, "%s", "-STUN Failed! NO STUN SERVER\n");
</span><span class="cx">         } else {
</span><span class="cx">                 if ((switch_stun_lookup(&ip, &port, stun_ip, stun_port, &error, pool)) == SWITCH_STATUS_SUCCESS && ip && port) {
</span><span class="lines">@@ -684,7 +693,7 @@
</span><span class="cx">         switch_core_session_t *xsession;
</span><span class="cx">         char uuid[80] = "";
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "-ERR, no input\n");
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -699,7 +708,7 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(mycmd)) {
</del><ins>+        if (zstr(mycmd)) {
</ins><span class="cx">                 stream->write_function(stream, "-ERR, no input\n");
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -739,7 +748,7 @@
</span><span class="cx">         char uuid[80] = "";
</span><span class="cx">         const char *p, *input = cmd;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "%s", "");
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -751,7 +760,7 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(input)) {
</del><ins>+        if (zstr(input)) {
</ins><span class="cx">                 stream->write_function(stream, "%s", "");
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -778,7 +787,7 @@
</span><span class="cx">
</span><span class="cx"> SWITCH_STANDARD_API(module_exists_function)
</span><span class="cx"> {
</span><del>-        if (!switch_strlen_zero(cmd)) {
</del><ins>+        if (!zstr(cmd)) {
</ins><span class="cx">                 if (switch_loadable_module_exists(cmd) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                         stream->write_function(stream, "true");
</span><span class="cx">                 } else {
</span><span class="lines">@@ -793,7 +802,7 @@
</span><span class="cx"> {
</span><span class="cx">         switch_xml_t root = NULL, domain = NULL;
</span><span class="cx">         
</span><del>-        if (!switch_strlen_zero(cmd)) {        
</del><ins>+        if (!zstr(cmd)) {        
</ins><span class="cx">                 if (switch_xml_locate_domain(cmd, NULL, &root, &domain) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                         stream->write_function(stream, "true");
</span><span class="cx">                         switch_xml_free(root);
</span><span class="lines">@@ -811,7 +820,7 @@
</span><span class="cx">         char *data = NULL;
</span><span class="cx">         int len = 0 ;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd)) {
</del><ins>+        if (!zstr(cmd)) {
</ins><span class="cx">                 len = (strlen(cmd) * 3) + 1;
</span><span class="cx">                 switch_zmalloc(data, len);
</span><span class="cx">                 switch_url_encode(cmd, data, len);
</span><span class="lines">@@ -1249,7 +1258,7 @@
</span><span class="cx">         char *mydata, *argv[5];
</span><span class="cx">         int32_t arg = 0;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", CTL_SYNTAX);
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -1374,7 +1383,7 @@
</span><span class="cx"> {
</span><span class="cx">         const char *err;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", LOAD_SYNTAX);
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -1395,7 +1404,7 @@
</span><span class="cx">         switch_bool_t force = SWITCH_FALSE;
</span><span class="cx">         const char *p = cmd;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", UNLOAD_SYNTAX);
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -1419,7 +1428,7 @@
</span><span class="cx">         }
</span><span class="cx"> end:
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", UNLOAD_SYNTAX);
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -1439,7 +1448,7 @@
</span><span class="cx">         switch_bool_t force = SWITCH_FALSE;
</span><span class="cx">         const char *p = cmd;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", UNLOAD_SYNTAX);
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -1462,7 +1471,7 @@
</span><span class="cx">         }
</span><span class="cx"> end:
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", UNLOAD_SYNTAX);
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -1504,7 +1513,7 @@
</span><span class="cx">         char *mycmd = NULL, *kcause = NULL;
</span><span class="cx">         switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd) || !(mycmd = strdup(cmd))) {
</del><ins>+        if (zstr(cmd) || !(mycmd = strdup(cmd))) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", KILL_SYNTAX);
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -1513,11 +1522,11 @@
</span><span class="cx">                 *kcause++ = '\0';
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(mycmd) || !(ksession = switch_core_session_locate(mycmd))) {
</del><ins>+        if (zstr(mycmd) || !(ksession = switch_core_session_locate(mycmd))) {
</ins><span class="cx">                 stream->write_function(stream, "-ERR No Such Channel!\n");
</span><span class="cx">         } else {
</span><span class="cx">                 switch_channel_t *channel = switch_core_session_get_channel(ksession);
</span><del>-                if (!switch_strlen_zero(kcause)){
</del><ins>+                if (!zstr(kcause)){
</ins><span class="cx">                         cause = switch_channel_str2cause(kcause);
</span><span class="cx">                 }
</span><span class="cx">                 switch_channel_hangup(channel, cause);
</span><span class="lines">@@ -1536,7 +1545,7 @@
</span><span class="cx">         char *mycmd = NULL, *argv[3] = { 0 };
</span><span class="cx">         int argc = 0;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd) || !(mycmd = strdup(cmd))) {
</del><ins>+        if (zstr(cmd) || !(mycmd = strdup(cmd))) {
</ins><span class="cx">                 goto usage;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1590,7 +1599,7 @@
</span><span class="cx">         int argc = 0;
</span><span class="cx">         char *tuuid, *dest, *dp, *context, *arg = NULL;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd) || !(mycmd = strdup(cmd))) {
</del><ins>+        if (zstr(cmd) || !(mycmd = strdup(cmd))) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", TRANSFER_SYNTAX);
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -1606,7 +1615,7 @@
</span><span class="cx">         dp = argv[2];
</span><span class="cx">         context = argv[3];
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(tuuid) || !(tsession = switch_core_session_locate(tuuid))) {
</del><ins>+        if (zstr(tuuid) || !(tsession = switch_core_session_locate(tuuid))) {
</ins><span class="cx">                 stream->write_function(stream, "-ERR No Such Channel!\n");
</span><span class="cx">                 goto done;
</span><span class="cx">         }
</span><span class="lines">@@ -1734,13 +1743,13 @@
</span><span class="cx">         switch_core_session_t *tsession = NULL;
</span><span class="cx">         char *uuid = NULL, *text = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (uuid = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (uuid = strdup(cmd))) {
</ins><span class="cx">                 if ((text = strchr(uuid, ' '))) {
</span><span class="cx">                         *text++ = '\0';
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(uuid) || switch_strlen_zero(text)) {
</del><ins>+        if (zstr(uuid) || zstr(text)) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", UUID_CHAT_SYNTAX);
</span><span class="cx">         } else {
</span><span class="cx">                 if ((tsession = switch_core_session_locate(uuid))) {
</span><span class="lines">@@ -1772,13 +1781,13 @@
</span><span class="cx">         switch_core_session_t *tsession = NULL;
</span><span class="cx">         char *uuid = NULL, *text = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (uuid = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (uuid = strdup(cmd))) {
</ins><span class="cx">                 if ((text = strchr(uuid, ' '))) {
</span><span class="cx">                         *text++ = '\0';
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(uuid) || switch_strlen_zero(text)) {
</del><ins>+        if (zstr(uuid) || zstr(text)) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", UUID_DEFLECT_SYNTAX);
</span><span class="cx">         } else {
</span><span class="cx">                 if ((tsession = switch_core_session_locate(uuid))) {
</span><span class="lines">@@ -1807,11 +1816,11 @@
</span><span class="cx">         char *mycmd = NULL, *argv[6] = { 0 };
</span><span class="cx">         int argc = 0;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd) || argc < 2 || argc > 5 || switch_strlen_zero(argv[0])) {
</del><ins>+        if (zstr(cmd) || argc < 2 || argc > 5 || zstr(argv[0])) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", SCHED_TRANSFER_SYNTAX);
</span><span class="cx">         } else {
</span><span class="cx">                 char *uuid = argv[1];
</span><span class="lines">@@ -1846,11 +1855,11 @@
</span><span class="cx">         char *mycmd = NULL, *argv[4] = { 0 };
</span><span class="cx">         int argc = 0;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd) || argc < 1 || switch_strlen_zero(argv[0])) {
</del><ins>+        if (zstr(cmd) || argc < 1 || zstr(argv[0])) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", SCHED_HANGUP_SYNTAX);
</span><span class="cx">         } else {
</span><span class="cx">                 char *uuid = argv[1];
</span><span class="lines">@@ -1888,11 +1897,11 @@
</span><span class="cx">         int argc = 0;
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_FALSE;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd) || argc < 1 || switch_strlen_zero(argv[0])) {
</del><ins>+        if (zstr(cmd) || argc < 1 || zstr(argv[0])) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", MEDIA_SYNTAX);
</span><span class="cx">         } else {
</span><span class="cx">                 if (!strcasecmp(argv[0], "off")) {
</span><span class="lines">@@ -1919,11 +1928,11 @@
</span><span class="cx">         int argc = 0;
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_FALSE;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd) || argc < 2) {
</del><ins>+        if (zstr(cmd) || argc < 2) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", BROADCAST_SYNTAX);
</span><span class="cx">         } else {
</span><span class="cx">                 switch_media_flag_t flags = SMF_NONE;
</span><span class="lines">@@ -1955,11 +1964,11 @@
</span><span class="cx">         int argc = 0;
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_FALSE;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd) || argc < 3 || switch_strlen_zero(argv[0])) {
</del><ins>+        if (zstr(cmd) || argc < 3 || zstr(argv[0])) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", SCHED_BROADCAST_SYNTAX);
</span><span class="cx">         } else {
</span><span class="cx">                 switch_media_flag_t flags = SMF_NONE;
</span><span class="lines">@@ -1998,11 +2007,11 @@
</span><span class="cx">         int argc = 0;
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_FALSE;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd) || argc < 1 || switch_strlen_zero(argv[0])) {
</del><ins>+        if (zstr(cmd) || argc < 1 || zstr(argv[0])) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", HOLD_SYNTAX);
</span><span class="cx">         } else {
</span><span class="cx">                 if (!strcasecmp(argv[0], "off")) {
</span><span class="lines">@@ -2029,11 +2038,11 @@
</span><span class="cx">         int argc = 0;
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_FALSE;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd) || argc < 2 || switch_strlen_zero(argv[0]) || switch_strlen_zero(argv[1])) {
</del><ins>+        if (zstr(cmd) || argc < 2 || zstr(argv[0]) || zstr(argv[1])) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", DISPLAY_SYNTAX);
</span><span class="cx">         } else {
</span><span class="cx">                 switch_core_session_message_t msg = { 0 };
</span><span class="lines">@@ -2059,17 +2068,93 @@
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#define WARNING_SYNTAX "<uuid> <warning>"
+SWITCH_STANDARD_API(uuid_warning_function)
+{
+        char *mycmd = NULL, *argv[2] = { 0 };
+        int argc = 0;
+        switch_status_t status = SWITCH_STATUS_FALSE;
+
+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
+                argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
+        }
+
+        if (zstr(cmd) || argc < 2 || zstr(argv[0]) || zstr(argv[1])) {
+                stream->write_function(stream, "-USAGE: %s\n", WARNING_SYNTAX);
+        } else {
+                switch_core_session_message_t msg = { 0 };
+                switch_core_session_t *lsession = NULL;
+
+                msg.message_id = SWITCH_MESSAGE_INDICATE_WARNING;
+                msg.string_arg = argv[1];
+                msg.from = __FILE__;
+
+                if ((lsession = switch_core_session_locate(argv[0]))) {
+                        status = switch_core_session_receive_message(lsession, &msg);
+                        switch_core_session_rwunlock(lsession);
+                }
+        }
+
+        if (status == SWITCH_STATUS_SUCCESS) {
+                stream->write_function(stream, "+OK Success\n");
+        } else {
+                stream->write_function(stream, "-ERR Operation Failed\n");
+        }
+
+        switch_safe_free(mycmd);
+        return SWITCH_STATUS_SUCCESS;
+}
+
+
+#define DEBUG_AUDIO_SYNTAX "<uuid> <read|write|both> <on|off>"
+SWITCH_STANDARD_API(uuid_debug_audio_function)
+{
+        char *mycmd = NULL, *argv[3] = { 0 };
+        int argc = 0;
+        switch_status_t status = SWITCH_STATUS_FALSE;
+
+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
+                argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
+        }
+
+        if (zstr(cmd) || argc < 3 || zstr(argv[0]) || zstr(argv[1]) || zstr(argv[2])) {
+                stream->write_function(stream, "-USAGE: %s\n", DEBUG_AUDIO_SYNTAX);
+        } else {
+                switch_core_session_message_t msg = { 0 };
+                switch_core_session_t *lsession = NULL;
+                
+                msg.message_id = SWITCH_MESSAGE_INDICATE_DEBUG_AUDIO;
+                msg.string_array_arg[0] = argv[1];
+                msg.string_array_arg[1] = argv[2];
+                msg.from = __FILE__;
+
+                if ((lsession = switch_core_session_locate(argv[0]))) {
+                        status = switch_core_session_receive_message(lsession, &msg);
+                        switch_core_session_rwunlock(lsession);
+                }
+        }
+
+        if (status == SWITCH_STATUS_SUCCESS) {
+                stream->write_function(stream, "+OK Success\n");
+        } else {
+                stream->write_function(stream, "-ERR Operation Failed\n");
+        }
+
+        switch_safe_free(mycmd);
+        return SWITCH_STATUS_SUCCESS;
+}
+
</ins><span class="cx"> #define UUID_SYNTAX "<uuid> <other_uuid>"
</span><span class="cx"> SWITCH_STANDARD_API(uuid_bridge_function)
</span><span class="cx"> {
</span><span class="cx">         char *mycmd = NULL, *argv[4] = { 0 };
</span><span class="cx">         int argc = 0;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd) || argc < 2) {
</del><ins>+        if (zstr(cmd) || argc < 2) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", UUID_SYNTAX);
</span><span class="cx">         } else {
</span><span class="cx">                 switch_status_t status;
</span><span class="lines">@@ -2105,7 +2190,7 @@
</span><span class="cx">         int argc = 0;
</span><span class="cx">         uint32_t limit = 0;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 goto usage;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -2122,7 +2207,7 @@
</span><span class="cx">         path = argv[2];
</span><span class="cx">         limit = argv[3] ? atoi(argv[3]) : 0;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(uuid) || switch_strlen_zero(action) || switch_strlen_zero(path)) {
</del><ins>+        if (zstr(uuid) || zstr(action) || zstr(path)) {
</ins><span class="cx">                 goto usage;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -2171,7 +2256,7 @@
</span><span class="cx">         uint32_t limit = 0;
</span><span class="cx">         char *flags = NULL;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd) || !(mycmd = strdup(cmd))) {
</del><ins>+        if (zstr(cmd) || !(mycmd = strdup(cmd))) {
</ins><span class="cx">                 goto usage;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -2185,7 +2270,7 @@
</span><span class="cx">         limit = argv[3] ? atoi(argv[3]) : 0;
</span><span class="cx">         flags = argv[4];
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(uuid) || switch_strlen_zero(action) || switch_strlen_zero(path)) {
</del><ins>+        if (zstr(uuid) || zstr(action) || zstr(path)) {
</ins><span class="cx">                 goto usage;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -2232,7 +2317,7 @@
</span><span class="cx">         switch_channel_t *channel = NULL;
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", BREAK_SYNTAX);
</span><span class="cx">                 goto done;
</span><span class="cx">         }
</span><span class="lines">@@ -2277,11 +2362,11 @@
</span><span class="cx">         char *mycmd = NULL, *argv[4] = { 0 };
</span><span class="cx">         int argc = 0;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd) || argc < 2 || switch_strlen_zero(argv[0])) {
</del><ins>+        if (zstr(cmd) || argc < 2 || zstr(argv[0])) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", PAUSE_SYNTAX);
</span><span class="cx">         } else {
</span><span class="cx">                 char *uuid = argv[0];
</span><span class="lines">@@ -2320,7 +2405,7 @@
</span><span class="cx">         uint8_t machine = 1;
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">
</span><del>-        if (session || switch_strlen_zero(cmd)) {
</del><ins>+        if (session || zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "-USAGE %s\n", ORIGINATE_SYNTAX);
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -3000,7 +3085,7 @@
</span><span class="cx">         /* switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "SQL: %s.\n", sql); */
</span><span class="cx">         
</span><span class="cx">         if (!strcasecmp(as, "delim") || !strcasecmp(as, "csv")) {
</span><del>-                if (switch_strlen_zero(holder.delim)) {
</del><ins>+                if (zstr(holder.delim)) {
</ins><span class="cx">                         if (!(holder.delim = argv[3])) {
</span><span class="cx">                                 holder.delim = ",";
</span><span class="cx">                         }
</span><span class="lines">@@ -3075,7 +3160,7 @@
</span><span class="cx"> {
</span><span class="cx">         char showcmd[1024];
</span><span class="cx">         int all = 0;
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 sprintf(showcmd, "help");
</span><span class="cx">                 all = 1;
</span><span class="cx">         } else {
</span><span class="lines">@@ -3100,7 +3185,7 @@
</span><span class="cx">         switch_core_session_t *l_session = NULL;
</span><span class="cx">         int x = 0, sched = 0;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd) || !(mycmd = strdup(cmd))) {
</del><ins>+        if (zstr(cmd) || !(mycmd = strdup(cmd))) {
</ins><span class="cx">                 goto error;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -3158,7 +3243,7 @@
</span><span class="cx"> {
</span><span class="cx">         switch_core_session_t *fsession;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (fsession = switch_core_session_locate(cmd))) {
</del><ins>+        if (!zstr(cmd) && (fsession = switch_core_session_locate(cmd))) {
</ins><span class="cx">                 switch_channel_flush_dtmf(switch_core_session_get_channel(fsession));
</span><span class="cx">                 switch_core_session_rwunlock(fsession);
</span><span class="cx">                 stream->write_function(stream, "+OK\n");
</span><span class="lines">@@ -3176,9 +3261,9 @@
</span><span class="cx">         char *mycmd = NULL, *argv[3] = { 0 };
</span><span class="cx">         int argc = 0;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><del>-                if ((argc == 2 || argc == 3) && !switch_strlen_zero(argv[0])) {
</del><ins>+                if ((argc == 2 || argc == 3) && !zstr(argv[0])) {
</ins><span class="cx">                         char *uuid = argv[0];
</span><span class="cx">                         char *var_name = argv[1];
</span><span class="cx">                         char *var_value = NULL;
</span><span class="lines">@@ -3191,7 +3276,7 @@
</span><span class="cx">                                 switch_channel_t *channel;
</span><span class="cx">                                 channel = switch_core_session_get_channel(psession);
</span><span class="cx">
</span><del>-                                if (switch_strlen_zero(var_name)) {
</del><ins>+                                if (zstr(var_name)) {
</ins><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No variable name specified.\n");
</span><span class="cx">                                         stream->write_function(stream, "-ERR No variable specified\n");
</span><span class="cx">                                 } else {
</span><span class="lines">@@ -3224,7 +3309,7 @@
</span><span class="cx">         int argc = 0;
</span><span class="cx">         char *var_name, *var_value = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 char *uuid = mycmd;
</span><span class="cx">                 if (!(vars = strchr(uuid, ' '))) {
</span><span class="cx">                         goto done;
</span><span class="lines">@@ -3241,7 +3326,7 @@
</span><span class="cx">                                 if (var_name && (var_value = strchr(var_name, '='))) {
</span><span class="cx">                                         *var_value++ = '\0';
</span><span class="cx">                                 }
</span><del>-                                if (switch_strlen_zero(var_name)) {
</del><ins>+                                if (zstr(var_name)) {
</ins><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No variable name specified.\n");
</span><span class="cx">                                         stream->write_function(stream, "-ERR No variable specified\n");
</span><span class="cx">                                 } else {
</span><span class="lines">@@ -3267,19 +3352,15 @@
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#define EXISTS_SYNTAX "<uuid> <var>"
</del><ins>+#define EXISTS_SYNTAX "<uuid>"
</ins><span class="cx"> SWITCH_STANDARD_API(uuid_exists_function)
</span><span class="cx"> {
</span><del>-        int exists = 0;
-        
- if (cmd) {
-                switch_core_session_t *psession = NULL;
-                if ((psession = switch_core_session_locate(cmd))) {
-                        switch_core_session_rwunlock(psession);
-                        exists = 1;
-                }
- }
</del><ins>+        switch_bool_t exists = SWITCH_FALSE;
</ins><span class="cx">
</span><ins>+        if (cmd) {
+                exists = switch_ivr_uuid_exists(cmd);
+        }
+
</ins><span class="cx">         stream->write_function(stream, "%s", exists ? "true" : "false");
</span><span class="cx">
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="lines">@@ -3293,9 +3374,9 @@
</span><span class="cx">         char *mycmd = NULL, *argv[4] = { 0 };
</span><span class="cx">         int argc = 0;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><del>-                if (argc >= 2 && !switch_strlen_zero(argv[0])) {
</del><ins>+                if (argc >= 2 && !zstr(argv[0])) {
</ins><span class="cx">                         char *uuid = argv[0];
</span><span class="cx">                         char *var_name = argv[1];
</span><span class="cx">                         const char *var_value = NULL;
</span><span class="lines">@@ -3304,7 +3385,7 @@
</span><span class="cx">                                 switch_channel_t *channel;
</span><span class="cx">                                 channel = switch_core_session_get_channel(psession);
</span><span class="cx">
</span><del>-                                if (switch_strlen_zero(var_name)) {
</del><ins>+                                if (zstr(var_name)) {
</ins><span class="cx">                                         stream->write_function(stream, "-ERR No variable name specified!\n");
</span><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No variable name specified.\n");
</span><span class="cx">                                 } else {
</span><span class="lines">@@ -3340,7 +3421,7 @@
</span><span class="cx">         char *uuid = NULL, *dtmf_data = NULL;
</span><span class="cx">         int argc = 0;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 goto usage;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -3354,7 +3435,7 @@
</span><span class="cx">
</span><span class="cx">         uuid = argv[0];
</span><span class="cx">         dtmf_data = argv[1];
</span><del>-        if (switch_strlen_zero(uuid) || switch_strlen_zero(dtmf_data)) {
</del><ins>+        if (zstr(uuid) || zstr(dtmf_data)) {
</ins><span class="cx">                 goto usage;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -3385,9 +3466,9 @@
</span><span class="cx">         char *mycmd = NULL, *argv[4] = { 0 };
</span><span class="cx">         int argc = 0;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><del>-                if (argc >= 0 && !switch_strlen_zero(argv[0])) {
</del><ins>+                if (argc >= 0 && !zstr(argv[0])) {
</ins><span class="cx">                         char *uuid = argv[0];
</span><span class="cx">                         char *format = argv[1];
</span><span class="cx">
</span><span class="lines">@@ -3449,13 +3530,13 @@
</span><span class="cx">         char *mycmd = NULL, *argv[2] = { 0 };
</span><span class="cx">         int argc = 0;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 argc = switch_separate_string(mycmd, '=', argv, (sizeof(argv) / sizeof(argv[0])));
</span><del>-                if (argc > 0 && !switch_strlen_zero(argv[0])) {
</del><ins>+                if (argc > 0 && !zstr(argv[0])) {
</ins><span class="cx">                         char *var_name = argv[0];
</span><span class="cx">                         char *var_value = argv[1];
</span><span class="cx">
</span><del>-                        if (switch_strlen_zero(var_value)) {
</del><ins>+                        if (zstr(var_value)) {
</ins><span class="cx">                                 var_value = NULL;
</span><span class="cx">                         }
</span><span class="cx">                         switch_core_set_variable(var_name, var_value);
</span><span class="lines">@@ -3474,7 +3555,7 @@
</span><span class="cx"> #define GLOBAL_GETVAR_SYNTAX "<var>"
</span><span class="cx"> SWITCH_STANDARD_API(global_getvar_function)
</span><span class="cx"> {
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 switch_core_dump_variables(stream);
</span><span class="cx">         } else {
</span><span class="cx">                 stream->write_function(stream, "%s", switch_str_nil(switch_core_get_variable(cmd)));
</span><span class="lines">@@ -3485,7 +3566,7 @@
</span><span class="cx"> #define SYSTEM_SYNTAX "<command>"
</span><span class="cx"> SWITCH_STANDARD_API(system_function)
</span><span class="cx"> {
</span><del>- if (switch_strlen_zero(cmd)) {
</del><ins>+ if (zstr(cmd)) {
</ins><span class="cx"> stream->write_function(stream, "-USAGE: %s\n", SYSTEM_SYNTAX);
</span><span class="cx"> return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="lines">@@ -3502,7 +3583,7 @@
</span><span class="cx"> #define SYSTEM_SYNTAX "<command>"
</span><span class="cx"> SWITCH_STANDARD_API(bg_system_function)
</span><span class="cx"> {
</span><del>- if (switch_strlen_zero(cmd)) {
</del><ins>+ if (zstr(cmd)) {
</ins><span class="cx"> stream->write_function(stream, "-USAGE: %s\n", SYSTEM_SYNTAX);
</span><span class="cx"> return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="lines">@@ -3521,7 +3602,7 @@
</span><span class="cx">         const char *tz_name = NULL;
</span><span class="cx">         char date[80] = "";
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd)) {
</del><ins>+        if (!zstr(cmd)) {
</ins><span class="cx">                 format = strchr(cmd, ' ');
</span><span class="cx">                 tz_name = cmd;
</span><span class="cx">                 if (format) {
</span><span class="lines">@@ -3546,7 +3627,7 @@
</span><span class="cx">         char *val = NULL;
</span><span class="cx">         switch_call_cause_t cause = SWITCH_CAUSE_MANAGER_REQUEST;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">                 switch_assert(argv[0]);
</span><span class="cx">                 if ((cause = switch_channel_str2cause(argv[0])) == SWITCH_CAUSE_NONE) {
</span><span class="lines">@@ -3560,13 +3641,13 @@
</span><span class="cx">                 var = NULL;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(var)) {
</del><ins>+        if (zstr(var)) {
</ins><span class="cx">                 switch_core_session_hupall(cause);
</span><span class="cx">         } else {
</span><span class="cx">                 switch_core_session_hupall_matching_var(var, val, cause);
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(var)) {
</del><ins>+        if (zstr(var)) {
</ins><span class="cx">                 stream->write_function(stream, "+OK hangup all channels with cause %s\n", switch_channel_cause2str(cause));
</span><span class="cx">         } else {
</span><span class="cx">                 stream->write_function(stream, "+OK hangup all channels matching [%s]=[%s] with cause: %s\n", var, val, switch_channel_cause2str(cause));
</span><span class="lines">@@ -3638,6 +3719,15 @@
</span><span class="cx">         switch_console_set_complete("add show channels");
</span><span class="cx">         switch_console_set_complete("add show aliases");
</span><span class="cx">         switch_console_set_complete("add show complete");
</span><ins>+        switch_console_set_complete("add show distinct_channels");
+        switch_console_set_complete("add show chat");
+        switch_console_set_complete("add show endpoint");
+        switch_console_set_complete("add show management");
+        switch_console_set_complete("add show modules");
+        switch_console_set_complete("add show nat_map");
+        switch_console_set_complete("add show say");
+        switch_console_set_complete("add show interfaces");
+        switch_console_set_complete("add show interface_types");
</ins><span class="cx">         SWITCH_ADD_API(commands_api_interface, "complete", "Complete", complete_function, COMPLETE_SYNTAX);
</span><span class="cx">         switch_console_set_complete("add complete add");
</span><span class="cx">         switch_console_set_complete("add complete del");
</span><span class="lines">@@ -3659,6 +3749,8 @@
</span><span class="cx">         SWITCH_ADD_API(commands_api_interface, "uuid_broadcast", "broadcast", uuid_broadcast_function, BROADCAST_SYNTAX);
</span><span class="cx">         SWITCH_ADD_API(commands_api_interface, "uuid_hold", "hold", uuid_hold_function, HOLD_SYNTAX);
</span><span class="cx">         SWITCH_ADD_API(commands_api_interface, "uuid_display", "change display", uuid_display_function, DISPLAY_SYNTAX);
</span><ins>+        SWITCH_ADD_API(commands_api_interface, "uuid_warning", "send popup", uuid_warning_function, WARNING_SYNTAX);
+        SWITCH_ADD_API(commands_api_interface, "uuid_debug_audio", "debug audio", uuid_debug_audio_function, DEBUG_AUDIO_SYNTAX);
</ins><span class="cx">         SWITCH_ADD_API(commands_api_interface, "uuid_media", "media", uuid_media_function, MEDIA_SYNTAX);
</span><span class="cx">         SWITCH_ADD_API(commands_api_interface, "fsctl", "control messages", ctl_function, CTL_SYNTAX);
</span><span class="cx">         switch_console_set_complete("add fsctl hupall");
</span><span class="lines">@@ -3717,6 +3809,7 @@
</span><span class="cx">         SWITCH_ADD_API(commands_api_interface, "time_test", "time_test", time_test_function, "<mss>");
</span><span class="cx">         SWITCH_ADD_API(commands_api_interface, "nat_map", "nat_map", nat_map_function, "[status|republish|reinit] | [add|del] <port> [tcp|udp] [static]");
</span><span class="cx">         SWITCH_ADD_API(commands_api_interface, "host_lookup", "host_lookup", host_lookup_function, "<hostname>");
</span><ins>+        SWITCH_ADD_API(commands_api_interface, "hostname", "Returns the system hostname", hostname_api_function, "");
</ins><span class="cx">
</span><span class="cx">         /* indicate that the module should continue to be loaded */
</span><span class="cx">         return SWITCH_STATUS_NOUNLOAD;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_conferencemod_conferencec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_conference/mod_conference.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_conference/mod_conference.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_conference/mod_conference.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> * Dale Thatcher <freeswitch at dalethatcher dot com>
</span><span class="cx"> * Chris Danielson <chris at maxpowersoft dot com>
</span><span class="cx"> * Rupa Schomaker <rupa@rupa.com>
</span><ins>+ * David Weekly <david@weekly.org>
</ins><span class="cx"> *
</span><span class="cx"> * mod_conference.c -- Software Conference Bridge
</span><span class="cx"> *
</span><span class="lines">@@ -287,6 +288,7 @@
</span><span class="cx">         switch_byte_t *not_talking_buf;
</span><span class="cx">         uint32_t not_talking_buf_len;
</span><span class="cx">         int comfort_noise_level;
</span><ins>+        int is_recording;
</ins><span class="cx">         int video_running;
</span><span class="cx">         uint32_t eflags;
</span><span class="cx">         uint32_t verbose_events;
</span><span class="lines">@@ -674,7 +676,7 @@
</span><span class="cx">                         switch_snprintf(saymsg, sizeof(saymsg), "Auto Calling %d parties", call_list->itteration);
</span><span class="cx">                         conference_member_say(member, saymsg, 0);
</span><span class="cx">                 } else {
</span><del>-                        if (switch_strlen_zero(conference->special_announce)) {
</del><ins>+                        if (zstr(conference->special_announce)) {
</ins><span class="cx">                                 /* announce the total number of members in the conference */
</span><span class="cx">                                 if (conference->count >= conference->announce_count && conference->announce_count > 1) {
</span><span class="cx">                                         switch_snprintf(msg, sizeof(msg), "There are %d callers", conference->count);
</span><span class="lines">@@ -962,28 +964,9 @@
</span><span class="cx">         switch_mutex_lock(globals.hash_mutex);
</span><span class="cx">         globals.threads++;
</span><span class="cx">         switch_mutex_unlock(globals.hash_mutex);
</span><ins>+
+        conference->is_recording = 0;
</ins><span class="cx">         
</span><del>-        if (conference->auto_record) {
-                uint32_t sanity = 1200;
-
-                while (!conference->members && --sanity) {
-                        switch_yield(100000);
-                }
-
-                imember = conference->members;
-                if (imember) {
-                        switch_channel_t *channel = switch_core_session_get_channel(imember->session);
-                        char *rfile = switch_channel_expand_variables(channel, conference->auto_record);
-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Auto recording file: %s\n", rfile);
-                        launch_conference_record_thread(conference, rfile);
-                        if (rfile != conference->auto_record) {
-                                switch_safe_free(rfile);
-                        }
-                } else {
-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Auto Record Failed. No members in conference.\n");
-                }
-        }
-
</del><span class="cx">         while (globals.running && !switch_test_flag(conference, CFLAG_DESTRUCT)) {
</span><span class="cx">                 switch_size_t file_sample_len = samples;
</span><span class="cx">                 switch_size_t file_data_len = samples * 2;
</span><span class="lines">@@ -991,7 +974,7 @@
</span><span class="cx">
</span><span class="cx">                 if (conference->perpetual_sound && !conference->async_fnode) {
</span><span class="cx">                         conference_play_file(conference, conference->perpetual_sound, CONF_DEFAULT_LEADIN, NULL, 1);
</span><del>-                } else if (conference->moh_sound && conference->count == 1 && !conference->async_fnode) {
</del><ins>+                } else if (conference->moh_sound && (conference->count == 1 || switch_test_flag(conference, CFLAG_WAIT_MOD)) && !conference->async_fnode) {
</ins><span class="cx">                         conference_play_file(conference, conference->moh_sound, CONF_DEFAULT_LEADIN, NULL, 1);
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -1026,6 +1009,24 @@
</span><span class="cx">                         switch_mutex_unlock(imember->audio_in_mutex);
</span><span class="cx">                 }
</span><span class="cx">
</span><ins>+                /* Start recording if there's more than one participant. */
+                if (ready > 1 && conference->auto_record && !conference->is_recording){
+                        conference->is_recording = 1;
+                        imember = conference->members;
+                        if (imember) {
+                                switch_channel_t *channel = switch_core_session_get_channel(imember->session);
+                                char *rfile = switch_channel_expand_variables(channel, conference->auto_record);
+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Auto recording file: %s\n", rfile);
+                                launch_conference_record_thread(conference, rfile);
+                                if (rfile != conference->auto_record) {
+                                        switch_safe_free(rfile);
+                                }
+                        } else {
+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Auto Record Failed. No members in conference.\n");
+                        }
+                }
+
+
</ins><span class="cx">                 if (members_with_video && conference->video_running != 1) {
</span><span class="cx">                         launch_conference_video_thread(conference);
</span><span class="cx">                 }
</span><span class="lines">@@ -1881,7 +1882,7 @@
</span><span class="cx">                                                 
</span><span class="cx">                                                 if (switch_test_flag(member, MFLAG_MUTE_DETECT) && !switch_test_flag(member, MFLAG_CAN_SPEAK)) {
</span><span class="cx">
</span><del>-                                                        if (!switch_strlen_zero(member->conference->mute_detect_sound)) {
</del><ins>+                                                        if (!zstr(member->conference->mute_detect_sound)) {
</ins><span class="cx">                                                                 conference_member_play_file(member, member->conference->mute_detect_sound, 0);
</span><span class="cx">                                                         }
</span><span class="cx">
</span><span class="lines">@@ -2358,6 +2359,8 @@
</span><span class="cx">                         switch_channel_clear_app_flag(channel, CF_APP_TAGGED);
</span><span class="cx">                         switch_set_flag_locked(member, MFLAG_FLUSH_BUFFER);
</span><span class="cx">                         switch_core_session_set_read_codec(member->session, &member->read_codec);
</span><ins>+                } else {
+                        switch_ivr_parse_all_messages(member->session);
</ins><span class="cx">                 }
</span><span class="cx">                 
</span><span class="cx">                 if (use_timer) {
</span><span class="lines">@@ -2779,7 +2782,7 @@
</span><span class="cx">                 expanded = NULL;
</span><span class="cx">         }
</span><span class="cx">         if (!strncasecmp(file, "say:", 4)) {
</span><del>-                if (!switch_strlen_zero(file + 4)) {
</del><ins>+                if (!zstr(file + 4)) {
</ins><span class="cx">                         status = conference_member_say(member, file + 4, leadin);
</span><span class="cx">                 }
</span><span class="cx">                 goto done;
</span><span class="lines">@@ -2790,7 +2793,7 @@
</span><span class="cx">                                 goto done;
</span><span class="cx">                         }
</span><span class="cx">                         file = dfile;
</span><del>-                } else if (!switch_strlen_zero(file)) {
</del><ins>+                } else if (!zstr(file)) {
</ins><span class="cx">                         status = conference_member_say(member, file, leadin);
</span><span class="cx">                         goto done;
</span><span class="cx">                 }
</span><span class="lines">@@ -2850,7 +2853,7 @@
</span><span class="cx">         switch_speech_flag_t flags = SWITCH_SPEECH_FLAG_NONE;
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_FALSE;
</span><span class="cx">
</span><del>-        if (member == NULL || switch_strlen_zero(text))
</del><ins>+        if (member == NULL || zstr(text))
</ins><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">
</span><span class="cx">         switch_assert(conference != NULL);
</span><span class="lines">@@ -2932,7 +2935,7 @@
</span><span class="cx">
</span><span class="cx">         switch_assert(conference != NULL);
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(text)) {
</del><ins>+        if (zstr(text)) {
</ins><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -3120,7 +3123,7 @@
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">
</span><span class="cx">         switch_clear_flag_locked(member, MFLAG_CAN_SPEAK);
</span><del>-        if (!switch_strlen_zero(member->conference->muted_sound)) {
</del><ins>+        if (!zstr(member->conference->muted_sound)) {
</ins><span class="cx">                 conference_member_play_file(member, member->conference->muted_sound, 0);
</span><span class="cx">         } else {
</span><span class="cx">                 char msg[512];
</span><span class="lines">@@ -3152,7 +3155,7 @@
</span><span class="cx">         if (stream != NULL) {
</span><span class="cx">                 stream->write_function(stream, "OK unmute %u\n", member->id);
</span><span class="cx">         }
</span><del>-        if (!switch_strlen_zero(member->conference->unmuted_sound)) {
</del><ins>+        if (!zstr(member->conference->unmuted_sound)) {
</ins><span class="cx">                 conference_member_play_file(member, member->conference->unmuted_sound, 0);
</span><span class="cx">         } else {
</span><span class="cx">                 char msg[512];
</span><span class="lines">@@ -3247,7 +3250,7 @@
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(dtmf)) {
</del><ins>+        if (zstr(dtmf)) {
</ins><span class="cx">                 stream->write_function(stream, "Invalid input!\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span><span class="lines">@@ -3389,9 +3392,12 @@
</span><span class="cx">                         switch_hash_this(hi, NULL, NULL, &val);
</span><span class="cx">                         conference = (conference_obj_t *) val;
</span><span class="cx">
</span><del>-                        stream->write_function(stream, "Conference %s (%u member%s%s)\n",
</del><ins>+                        stream->write_function(stream, "Conference %s (%u member%s rate: %u%s)\n",
</ins><span class="cx">                                                                  conference->name,
</span><del>-                                                                 conference->count, conference->count == 1 ? "" : "s", switch_test_flag(conference, CFLAG_LOCKED) ? " locked" : "");
</del><ins>+                                                                 conference->count,
+                                                                 conference->count == 1 ? "" : "s",
+                                                                 conference->rate,
+                                                                 switch_test_flag(conference, CFLAG_LOCKED) ? " locked" : "");
</ins><span class="cx">                         count++;
</span><span class="cx">                         if (!summary) {
</span><span class="cx">                                 if (pretty) {
</span><span class="lines">@@ -3449,11 +3455,41 @@
</span><span class="cx">         switch_xml_set_attr_d(x_conference, "name", conference->name);
</span><span class="cx">         switch_snprintf(i, sizeof(i), "%d", conference->count);
</span><span class="cx">         switch_xml_set_attr_d(x_conference, "member-count", ival);
</span><ins>+        switch_snprintf(i, sizeof(i), "%u", conference->rate);
+        switch_xml_set_attr_d(x_conference, "rate", ival);
</ins><span class="cx">
</span><span class="cx">         if (switch_test_flag(conference, CFLAG_LOCKED)) {
</span><span class="cx">                 switch_xml_set_attr_d(x_conference, "locked", "true");
</span><span class="cx">         }
</span><ins>+        
+        if (switch_test_flag(conference, CFLAG_DESTRUCT)) {
+                switch_xml_set_attr_d(x_conference, "destruct", "true");
+        }
</ins><span class="cx">
</span><ins>+        if (switch_test_flag(conference, CFLAG_WAIT_MOD)) {
+                switch_xml_set_attr_d(x_conference, "wait_mod", "true");
+        }
+
+        if (switch_test_flag(conference, CFLAG_RUNNING)) {
+                switch_xml_set_attr_d(x_conference, "running", "true");
+        }
+
+        if (switch_test_flag(conference, CFLAG_ANSWERED)) {
+                switch_xml_set_attr_d(x_conference, "answered", "true");
+        }
+
+        if (switch_test_flag(conference, CFLAG_ENFORCE_MIN)) {
+                switch_xml_set_attr_d(x_conference, "enforce_min", "true");
+        }
+
+        if (switch_test_flag(conference, CFLAG_BRIDGE_TO)) {
+                switch_xml_set_attr_d(x_conference, "bridge_to", "true");
+        }
+
+        if (switch_test_flag(conference, CFLAG_DYNAMIC)) {
+                switch_xml_set_attr_d(x_conference, "dynamic", "true");
+        }
+
</ins><span class="cx">         x_members = switch_xml_add_child_d(x_conference, "members", 0);
</span><span class="cx">         switch_assert(x_members);
</span><span class="cx">         
</span><span class="lines">@@ -3507,6 +3543,12 @@
</span><span class="cx">                 x_tag = switch_xml_add_child_d(x_flags, "has_floor", count++);
</span><span class="cx">                 switch_xml_set_txt_d(x_tag, (member == member->conference->floor_holder) ? "true" : "false");
</span><span class="cx">                 
</span><ins>+                x_tag = switch_xml_add_child_d(x_flags, "is_moderator", count++);
+                switch_xml_set_txt_d(x_tag, switch_test_flag(member, MFLAG_MOD) ? "true" : "false");
+                
+                x_tag = switch_xml_add_child_d(x_flags, "end_conference", count++);
+                switch_xml_set_txt_d(x_tag, switch_test_flag(member, MFLAG_ENDCONF) ? "true" : "false");
+                
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         switch_mutex_unlock(conference->member_mutex);
</span><span class="lines">@@ -3612,7 +3654,7 @@
</span><span class="cx"> {
</span><span class="cx">         switch_event_t *event;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(text)) {
</del><ins>+        if (zstr(text)) {
</ins><span class="cx">                 stream->write_function(stream, "(say) Error! No text.\n");
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span><span class="lines">@@ -3642,7 +3684,7 @@
</span><span class="cx">         conference_member_t *member;
</span><span class="cx">         switch_event_t *event;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(text)) {
</del><ins>+        if (zstr(text)) {
</ins><span class="cx">                 stream->write_function(stream, "(saymember) No Text!\n");
</span><span class="cx">                 goto done;
</span><span class="cx">         }
</span><span class="lines">@@ -3659,7 +3701,7 @@
</span><span class="cx">
</span><span class="cx">         id = atoi(workspace);
</span><span class="cx">
</span><del>-        if (!id || switch_strlen_zero(text)) {
</del><ins>+        if (!id || zstr(text)) {
</ins><span class="cx">                 stream->write_function(stream, "(saymember) No Text!\n");
</span><span class="cx">                 goto done;
</span><span class="cx">         }
</span><span class="lines">@@ -3902,7 +3944,7 @@
</span><span class="cx">         switch_assert(conference != NULL);
</span><span class="cx">         switch_assert(stream != NULL);
</span><span class="cx">
</span><del>-        if (argc > 3 && !switch_strlen_zero(argv[2])) {
</del><ins>+        if (argc > 3 && !zstr(argv[2])) {
</ins><span class="cx">                 int x;
</span><span class="cx">
</span><span class="cx">                 conf_name = strdup(argv[2]);
</span><span class="lines">@@ -4266,7 +4308,7 @@
</span><span class="cx">                                         const char *modified_cmdline = cmdline;
</span><span class="cx">                                         const char *cmd = conf_api_sub_commands[i].pname;
</span><span class="cx">
</span><del>-                                        if (!switch_strlen_zero(modified_cmdline) && (start_text = strstr(modified_cmdline, cmd))) {
</del><ins>+                                        if (!zstr(modified_cmdline) && (start_text = strstr(modified_cmdline, cmd))) {
</ins><span class="cx">                                                 modified_cmdline = start_text + strlen(cmd);
</span><span class="cx">                                                 while (modified_cmdline && (*modified_cmdline == ' ' || *modified_cmdline == '\t')) {
</span><span class="cx">                                                         modified_cmdline++;
</span><span class="lines">@@ -4413,11 +4455,11 @@
</span><span class="cx">                 caller_channel = switch_core_session_get_channel(session);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cid_name)) {
</del><ins>+        if (zstr(cid_name)) {
</ins><span class="cx">                 cid_name = conference->caller_id_name;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cid_num)) {
</del><ins>+        if (zstr(cid_num)) {
</ins><span class="cx">                 cid_num = conference->caller_id_number;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -4802,7 +4844,7 @@
</span><span class="cx">
</span><span class="cx">         call_list = switch_channel_get_private(channel, "_conference_autocall_list_");
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 call_list = NULL;
</span><span class="cx">         } else {
</span><span class="cx">                 np = switch_core_session_alloc(session, sizeof(*np));
</span><span class="lines">@@ -4956,7 +4998,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "Invalid arguments\n");
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="lines">@@ -5113,11 +5155,11 @@
</span><span class="cx">                         switch_channel_set_variable(channel, "conference_name", conference->name);
</span><span class="cx">
</span><span class="cx">                         /* Set MOH from variable if not set */
</span><del>-                        if(switch_strlen_zero(conference->moh_sound)) {
</del><ins>+                        if(zstr(conference->moh_sound)) {
</ins><span class="cx">                                 conference->moh_sound = switch_core_strdup(conference->pool, switch_channel_get_variable(channel, "conference_moh_sound"));
</span><span class="cx">                         }
</span><span class="cx">                         /* Set perpetual-sound from variable if not set */
</span><del>-                        if(switch_strlen_zero(conference->perpetual_sound)) {
</del><ins>+                        if(zstr(conference->perpetual_sound)) {
</ins><span class="cx">                                 conference->perpetual_sound = switch_core_strdup(conference->pool, switch_channel_get_variable(channel, "conference_perpetual_sound"));
</span><span class="cx">                         }
</span><span class="cx">                         
</span><span class="lines">@@ -5147,7 +5189,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">                 /* if this is not an outbound call, deal with conference pins */
</span><del>-                if (enforce_security && !switch_strlen_zero(dpin)) {
</del><ins>+                if (enforce_security && !zstr(dpin)) {
</ins><span class="cx">                         char pin_buf[80] = "";
</span><span class="cx">                         int pin_retries = 3;        /* XXX - this should be configurable - i'm too lazy to do it right now... */
</span><span class="cx">                         int pin_valid = 0;
</span><span class="lines">@@ -5251,7 +5293,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* if we're using "bridge:" make an outbound call and bridge it in */
</span><del>-        if (!switch_strlen_zero(bridgeto) && strcasecmp(bridgeto, "none")) {
</del><ins>+        if (!zstr(bridgeto) && strcasecmp(bridgeto, "none")) {
</ins><span class="cx">                 switch_call_cause_t cause;
</span><span class="cx">                 if (conference_outcall(conference, NULL, session, bridgeto, 60, NULL, NULL, NULL, &cause) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                         goto done;
</span><span class="lines">@@ -5504,7 +5546,7 @@
</span><span class="cx">         switch_assert(conference != NULL);
</span><span class="cx">
</span><span class="cx">         for (i = 0, status = SWITCH_STATUS_SUCCESS; status == SWITCH_STATUS_SUCCESS && i < CCFNTBL_QTY; i++) {
</span><del>-                if (!switch_strlen_zero(ccfntbl[i].digits)) {
</del><ins>+                if (!zstr(ccfntbl[i].digits)) {
</ins><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
</span><span class="cx">                                                          "Installing default caller control action '%s' bound to '%s'.\n", ccfntbl[i].key, ccfntbl[i].digits);
</span><span class="cx">                         action = (caller_control_action_t *) switch_core_alloc(conference->pool, sizeof(caller_control_action_t));
</span><span class="lines">@@ -5540,7 +5582,7 @@
</span><span class="cx">                 char *val = (char *) switch_xml_attr(xml_kvp, "digits");
</span><span class="cx">                 char *data = (char *) switch_xml_attr_soft(xml_kvp, "data");
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(key) && !switch_strlen_zero(val)) {
</del><ins>+                if (!zstr(key) && !zstr(val)) {
</ins><span class="cx">                         uint32_t i;
</span><span class="cx">
</span><span class="cx">                         /* scan through all of the valid actions, and if found, */
</span><span class="lines">@@ -5632,7 +5674,7 @@
</span><span class="cx">         char *auto_record = NULL;
</span><span class="cx">
</span><span class="cx">         /* Validate the conference name */
</span><del>-        if (switch_strlen_zero(name)) {
</del><ins>+        if (zstr(name)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Record! no name.\n");
</span><span class="cx">                 return NULL;
</span><span class="cx">         }
</span><span class="lines">@@ -5657,14 +5699,14 @@
</span><span class="cx">                         var = buf;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!strcasecmp(var, "rate") && !switch_strlen_zero(val)) {
</del><ins>+                if (!strcasecmp(var, "rate") && !zstr(val)) {
</ins><span class="cx">                         uint32_t tmp = atoi(val);
</span><span class="cx">                         if (tmp == 8000 || tmp == 16000 || tmp == 32000 || tmp == 48000) {
</span><span class="cx">                                 rate = tmp;
</span><span class="cx">                         }
</span><del>-                } else if (!strcasecmp(var, "domain") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "domain") && !zstr(val)) {
</ins><span class="cx">                         domain = val;
</span><del>-                } else if (!strcasecmp(var, "interval") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "interval") && !zstr(val)) {
</ins><span class="cx">                         uint32_t tmp = atoi(val);
</span><span class="cx">                         if (SWITCH_ACCEPTABLE_INTERVAL(tmp)) {
</span><span class="cx">                                 interval = tmp;
</span><span class="lines">@@ -5672,59 +5714,59 @@
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
</span><span class="cx">                                                                  "Interval must be multipe of 10 and less than %d, Using default of 20\n", SWITCH_MAX_INTERVAL);
</span><span class="cx">                         }
</span><del>-                } else if (!strcasecmp(var, "timer-name") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "timer-name") && !zstr(val)) {
</ins><span class="cx">                         timer_name = val;
</span><del>-                } else if (!strcasecmp(var, "tts-engine") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "tts-engine") && !zstr(val)) {
</ins><span class="cx">                         tts_engine = val;
</span><del>-                } else if (!strcasecmp(var, "tts-voice") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "tts-voice") && !zstr(val)) {
</ins><span class="cx">                         tts_voice = val;
</span><del>-                } else if (!strcasecmp(var, "enter-sound") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "enter-sound") && !zstr(val)) {
</ins><span class="cx">                         enter_sound = val;
</span><del>-                } else if (!strcasecmp(var, "exit-sound") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "exit-sound") && !zstr(val)) {
</ins><span class="cx">                         exit_sound = val;
</span><del>-                } else if (!strcasecmp(var, "alone-sound") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "alone-sound") && !zstr(val)) {
</ins><span class="cx">                         alone_sound = val;
</span><del>-                } else if (!strcasecmp(var, "perpetual-sound") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "perpetual-sound") && !zstr(val)) {
</ins><span class="cx">                         perpetual_sound = val;
</span><del>-                } else if (!strcasecmp(var, "moh-sound") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "moh-sound") && !zstr(val)) {
</ins><span class="cx">                         moh_sound = val;
</span><del>-                } else if (!strcasecmp(var, "ack-sound") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "ack-sound") && !zstr(val)) {
</ins><span class="cx">                         ack_sound = val;
</span><del>-                } else if (!strcasecmp(var, "nack-sound") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "nack-sound") && !zstr(val)) {
</ins><span class="cx">                         nack_sound = val;
</span><del>-                } else if (!strcasecmp(var, "muted-sound") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "muted-sound") && !zstr(val)) {
</ins><span class="cx">                         muted_sound = val;
</span><del>-                } else if (!strcasecmp(var, "mute-detect-sound") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "mute-detect-sound") && !zstr(val)) {
</ins><span class="cx">                         mute_detect_sound = val;
</span><del>-                } else if (!strcasecmp(var, "unmuted-sound") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "unmuted-sound") && !zstr(val)) {
</ins><span class="cx">                         unmuted_sound = val;
</span><del>-                } else if (!strcasecmp(var, "locked-sound") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "locked-sound") && !zstr(val)) {
</ins><span class="cx">                         locked_sound = val;
</span><del>-                } else if (!strcasecmp(var, "is-locked-sound") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "is-locked-sound") && !zstr(val)) {
</ins><span class="cx">                         is_locked_sound = val;
</span><del>-                } else if (!strcasecmp(var, "is-unlocked-sound") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "is-unlocked-sound") && !zstr(val)) {
</ins><span class="cx">                         is_unlocked_sound = val;
</span><del>-                } else if (!strcasecmp(var, "member-flags") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "member-flags") && !zstr(val)) {
</ins><span class="cx">                         member_flags = val;
</span><del>-                } else if (!strcasecmp(var, "conference-flags") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "conference-flags") && !zstr(val)) {
</ins><span class="cx">                         conference_flags = val;
</span><del>-                } else if (!strcasecmp(var, "kicked-sound") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "kicked-sound") && !zstr(val)) {
</ins><span class="cx">                         kicked_sound = val;
</span><del>-                } else if (!strcasecmp(var, "pin") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "pin") && !zstr(val)) {
</ins><span class="cx">                         pin = val;
</span><del>-                } else if (!strcasecmp(var, "pin-sound") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "pin-sound") && !zstr(val)) {
</ins><span class="cx">                         pin_sound = val;
</span><del>-                } else if (!strcasecmp(var, "bad-pin-sound") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "bad-pin-sound") && !zstr(val)) {
</ins><span class="cx">                         bad_pin_sound = val;
</span><del>-                } else if (!strcasecmp(var, "energy-level") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "energy-level") && !zstr(val)) {
</ins><span class="cx">                         energy_level = val;
</span><del>-                } else if (!strcasecmp(var, "caller-id-name") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "caller-id-name") && !zstr(val)) {
</ins><span class="cx">                         caller_id_name = val;
</span><del>-                } else if (!strcasecmp(var, "caller-id-number") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "caller-id-number") && !zstr(val)) {
</ins><span class="cx">                         caller_id_number = val;
</span><del>-                } else if (!strcasecmp(var, "caller-controls") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "caller-controls") && !zstr(val)) {
</ins><span class="cx">                         caller_controls = val;
</span><del>-                } else if (!strcasecmp(var, "comfort-noise") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "comfort-noise") && !zstr(val)) {
</ins><span class="cx">                         int tmp;
</span><span class="cx">                         tmp = atoi(val);
</span><span class="cx">                         if (tmp > 1 && tmp < 10000) {
</span><span class="lines">@@ -5732,9 +5774,9 @@
</span><span class="cx">                         } else if (switch_true(val)) {
</span><span class="cx">                                 comfort_noise_level = 1400;
</span><span class="cx">                         }
</span><del>-                } else if (!strcasecmp(var, "sound-prefix") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "sound-prefix") && !zstr(val)) {
</ins><span class="cx">                         sound_prefix = val;
</span><del>-                } else if (!strcasecmp(var, "max-members") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "max-members") && !zstr(val)) {
</ins><span class="cx">                         errno = 0;                        /* sanity first */
</span><span class="cx">                         max_members = strtol(val, NULL, 0);        /* base 0 lets 0x... for hex 0... for octal and base 10 otherwise through */
</span><span class="cx">                         if (errno == ERANGE || errno == EINVAL || max_members < 0 || max_members == 1) {
</span><span class="lines">@@ -5744,20 +5786,20 @@
</span><span class="cx">                                 max_members = 0;        /* set to 0 to disable max counts */
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "max-members %s is invalid, not setting a limit\n", val);
</span><span class="cx">                         }
</span><del>-                } else if (!strcasecmp(var, "max-members-sound") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "max-members-sound") && !zstr(val)) {
</ins><span class="cx">                         maxmember_sound = val;
</span><del>-                } else if (!strcasecmp(var, "announce-count") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "announce-count") && !zstr(val)) {
</ins><span class="cx">                         errno = 0;                        /* safety first */
</span><span class="cx">                         announce_count = strtol(val, NULL, 0);
</span><span class="cx">                         if (errno == ERANGE || errno == EINVAL) {
</span><span class="cx">                                 announce_count = 0;
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "announce-count is invalid, not anouncing member counts\n");
</span><span class="cx">                         }
</span><del>-                } else if (!strcasecmp(var, "suppress-events") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "suppress-events") && !zstr(val)) {
</ins><span class="cx">                         suppress_events = val;
</span><del>-                } else if (!strcasecmp(var, "verbose-events") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "verbose-events") && !zstr(val)) {
</ins><span class="cx">                         verbose_events = val;
</span><del>-                } else if (!strcasecmp(var, "auto-record") && !switch_strlen_zero(val)) {
</del><ins>+                } else if (!strcasecmp(var, "auto-record") && !zstr(val)) {
</ins><span class="cx">                         auto_record = val;
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -5765,17 +5807,17 @@
</span><span class="cx">         /* Set defaults and various paramaters */
</span><span class="cx">
</span><span class="cx">         /* Timer module to use */
</span><del>-        if (switch_strlen_zero(timer_name)) {
</del><ins>+        if (zstr(timer_name)) {
</ins><span class="cx">                 timer_name = "soft";
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* Caller ID Name */
</span><del>-        if (switch_strlen_zero(caller_id_name)) {
</del><ins>+        if (zstr(caller_id_name)) {
</ins><span class="cx">                 caller_id_name = (char *) global_app_name;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* Caller ID Number */
</span><del>-        if (switch_strlen_zero(caller_id_number)) {
</del><ins>+        if (zstr(caller_id_number)) {
</ins><span class="cx">                 caller_id_number = "0000000000";
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -5815,13 +5857,13 @@
</span><span class="cx">         conference->caller_id_number = switch_core_strdup(conference->pool, caller_id_number);
</span><span class="cx">
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(perpetual_sound)) {
</del><ins>+        if (!zstr(perpetual_sound)) {
</ins><span class="cx">                 conference->perpetual_sound = switch_core_strdup(conference->pool, perpetual_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         conference->mflags = MFLAG_CAN_SPEAK | MFLAG_CAN_HEAR;
</span><span class="cx">         
</span><del>-        if (!switch_strlen_zero(moh_sound) && switch_is_moh(moh_sound)) {
</del><ins>+        if (!zstr(moh_sound) && switch_is_moh(moh_sound)) {
</ins><span class="cx">                 conference->moh_sound = switch_core_strdup(conference->pool, moh_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -5837,75 +5879,75 @@
</span><span class="cx">                 conference->sound_prefix = switch_core_strdup(conference->pool, sound_prefix);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(enter_sound)) {
</del><ins>+        if (!zstr(enter_sound)) {
</ins><span class="cx">                 conference->enter_sound = switch_core_strdup(conference->pool, enter_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(exit_sound)) {
</del><ins>+        if (!zstr(exit_sound)) {
</ins><span class="cx">                 conference->exit_sound = switch_core_strdup(conference->pool, exit_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(ack_sound)) {
</del><ins>+        if (!zstr(ack_sound)) {
</ins><span class="cx">                 conference->ack_sound = switch_core_strdup(conference->pool, ack_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(nack_sound)) {
</del><ins>+        if (!zstr(nack_sound)) {
</ins><span class="cx">                 conference->nack_sound = switch_core_strdup(conference->pool, nack_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(muted_sound)) {
</del><ins>+        if (!zstr(muted_sound)) {
</ins><span class="cx">                 conference->muted_sound = switch_core_strdup(conference->pool, muted_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(mute_detect_sound)) {
-                if (!switch_strlen_zero(muted_sound)) {
</del><ins>+        if (zstr(mute_detect_sound)) {
+                if (!zstr(muted_sound)) {
</ins><span class="cx">                         conference->mute_detect_sound = switch_core_strdup(conference->pool, muted_sound);
</span><span class="cx">                 }
</span><span class="cx">         } else {
</span><span class="cx">                 conference->mute_detect_sound = switch_core_strdup(conference->pool, mute_detect_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(unmuted_sound)) {
</del><ins>+        if (!zstr(unmuted_sound)) {
</ins><span class="cx">                 conference->unmuted_sound = switch_core_strdup(conference->pool, unmuted_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(kicked_sound)) {
</del><ins>+        if (!zstr(kicked_sound)) {
</ins><span class="cx">                 conference->kicked_sound = switch_core_strdup(conference->pool, kicked_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(pin_sound)) {
</del><ins>+        if (!zstr(pin_sound)) {
</ins><span class="cx">                 conference->pin_sound = switch_core_strdup(conference->pool, pin_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(bad_pin_sound)) {
</del><ins>+        if (!zstr(bad_pin_sound)) {
</ins><span class="cx">                 conference->bad_pin_sound = switch_core_strdup(conference->pool, bad_pin_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(pin)) {
</del><ins>+        if (!zstr(pin)) {
</ins><span class="cx">                 conference->pin = switch_core_strdup(conference->pool, pin);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(alone_sound)) {
</del><ins>+        if (!zstr(alone_sound)) {
</ins><span class="cx">                 conference->alone_sound = switch_core_strdup(conference->pool, alone_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(locked_sound)) {
</del><ins>+        if (!zstr(locked_sound)) {
</ins><span class="cx">                 conference->locked_sound = switch_core_strdup(conference->pool, locked_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(is_locked_sound)) {
</del><ins>+        if (!zstr(is_locked_sound)) {
</ins><span class="cx">                 conference->is_locked_sound = switch_core_strdup(conference->pool, is_locked_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(is_unlocked_sound)) {
</del><ins>+        if (!zstr(is_unlocked_sound)) {
</ins><span class="cx">                 conference->is_unlocked_sound = switch_core_strdup(conference->pool, is_unlocked_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(energy_level)) {
</del><ins>+        if (!zstr(energy_level)) {
</ins><span class="cx">                 conference->energy_level = atoi(energy_level);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(maxmember_sound)) {
</del><ins>+        if (!zstr(maxmember_sound)) {
</ins><span class="cx">                 conference->maxmember_sound = switch_core_strdup(conference->pool, maxmember_sound);
</span><span class="cx">         }
</span><span class="cx">         /* its going to be 0 by default, set to a value otherwise so this should be safe */
</span><span class="lines">@@ -5923,15 +5965,15 @@
</span><span class="cx">         conference->dtmf_parser = NULL;
</span><span class="cx">
</span><span class="cx">         conference->eflags = 0xFFFFFFFF;
</span><del>-        if (!switch_strlen_zero(suppress_events)) {
</del><ins>+        if (!zstr(suppress_events)) {
</ins><span class="cx">                 clear_eflags(suppress_events, &conference->eflags);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(auto_record)) {
</del><ins>+        if (!zstr(auto_record)) {
</ins><span class="cx">                 conference->auto_record = switch_core_strdup(conference->pool, auto_record);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(verbose_events) && switch_true(verbose_events)) {
</del><ins>+        if (!zstr(verbose_events) && switch_true(verbose_events)) {
</ins><span class="cx">                 conference->verbose_events = 1;
</span><span class="cx">         }
</span><span class="cx">         
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_curlmod_curlc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_curl/mod_curl.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_curl/mod_curl.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_curl/mod_curl.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx">         curl_easy_cleanup(curl_handle);
</span><span class="cx">         
</span><span class="cx">         if (        http_data->stream.data &&
</span><del>-                        !switch_strlen_zero((char *)http_data->stream.data) &&
</del><ins>+                        !zstr((char *)http_data->stream.data) &&
</ins><span class="cx">                         strcmp(" ", http_data->stream.data) ) {
</span><span class="cx">                 
</span><span class="cx">                 http_data->http_response = switch_core_strdup(pool, http_data->stream.data);
</span><span class="lines">@@ -185,7 +185,7 @@
</span><span class="cx">                         *data = '\0';
</span><span class="cx">                 }
</span><span class="cx">                 
</span><del>-                if switch_strlen_zero(header->data) {
</del><ins>+                if zstr(header->data) {
</ins><span class="cx">                         header = header->next;
</span><span class="cx">                         continue;
</span><span class="cx">                 }
</span><span class="lines">@@ -336,7 +336,7 @@
</span><span class="cx">
</span><span class="cx">         switch_memory_pool_t *pool = NULL;
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 switch_goto_status(SWITCH_STATUS_SUCCESS, usage);
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_directoryMakefilefromrev15313freeswitchtrunksrcmodapplicationsmod_directoryMakefile"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_directory/Makefile (from rev 15313, freeswitch/trunk/src/mod/applications/mod_directory/Makefile) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_directory/Makefile         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_directory/Makefile        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+BASE=../../../..
+include $(BASE)/build/modmake.rules
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_directorymod_directory2008vcprojfromrev15313freeswitchtrunksrcmodapplicationsmod_directorymod_directory2008vcproj"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_directory/mod_directory.2008.vcproj (from rev 15313, freeswitch/trunk/src/mod/applications/mod_directory/mod_directory.2008.vcproj) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_directory/mod_directory.2008.vcproj         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_directory/mod_directory.2008.vcproj        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,287 @@
</span><ins>+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+        ProjectType="Visual C++"
+        Version="9.00"
+        Name="mod_directory"
+        ProjectGUID="{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}"
+        RootNamespace="mod_directory"
+        Keyword="Win32Proj"
+        TargetFrameworkVersion="131072"
+        >
+        <Platforms>
+                <Platform
+                        Name="Win32"
+                />
+                <Platform
+                        Name="x64"
+                />
+        </Platforms>
+        <ToolFiles>
+        </ToolFiles>
+        <Configurations>
+                <Configuration
+                        Name="Debug|Win32"
+                        ConfigurationType="2"
+                        InheritedPropertySheets="..\..\..\..\w32\module_debug.vsprops"
+                        CharacterSet="2"
+                        >
+                        <Tool
+                                Name="VCPreBuildEventTool"
+                        />
+                        <Tool
+                                Name="VCCustomBuildTool"
+                        />
+                        <Tool
+                                Name="VCXMLDataGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCWebServiceProxyGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCMIDLTool"
+                        />
+                        <Tool
+                                Name="VCCLCompilerTool"
+                                UsePrecompiledHeader="0"
+                        />
+                        <Tool
+                                Name="VCManagedResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCPreLinkEventTool"
+                        />
+                        <Tool
+                                Name="VCLinkerTool"
+                                RandomizedBaseAddress="1"
+                                DataExecutionPrevention="0"
+                        />
+                        <Tool
+                                Name="VCALinkTool"
+                        />
+                        <Tool
+                                Name="VCManifestTool"
+                        />
+                        <Tool
+                                Name="VCXDCMakeTool"
+                        />
+                        <Tool
+                                Name="VCBscMakeTool"
+                        />
+                        <Tool
+                                Name="VCFxCopTool"
+                        />
+                        <Tool
+                                Name="VCAppVerifierTool"
+                        />
+                        <Tool
+                                Name="VCPostBuildEventTool"
+                        />
+                </Configuration>
+                <Configuration
+                        Name="Debug|x64"
+                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                        ConfigurationType="2"
+                        InheritedPropertySheets="..\..\..\..\w32\module_debug.vsprops"
+                        CharacterSet="2"
+                        >
+                        <Tool
+                                Name="VCPreBuildEventTool"
+                        />
+                        <Tool
+                                Name="VCCustomBuildTool"
+                        />
+                        <Tool
+                                Name="VCXMLDataGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCWebServiceProxyGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCMIDLTool"
+                                TargetEnvironment="3"
+                        />
+                        <Tool
+                                Name="VCCLCompilerTool"
+                                UsePrecompiledHeader="0"
+                        />
+                        <Tool
+                                Name="VCManagedResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCPreLinkEventTool"
+                        />
+                        <Tool
+                                Name="VCLinkerTool"
+                                OutputFile="$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll"
+                                RandomizedBaseAddress="1"
+                                DataExecutionPrevention="0"
+                                TargetMachine="17"
+                        />
+                        <Tool
+                                Name="VCALinkTool"
+                        />
+                        <Tool
+                                Name="VCManifestTool"
+                        />
+                        <Tool
+                                Name="VCXDCMakeTool"
+                        />
+                        <Tool
+                                Name="VCBscMakeTool"
+                        />
+                        <Tool
+                                Name="VCFxCopTool"
+                        />
+                        <Tool
+                                Name="VCAppVerifierTool"
+                        />
+                        <Tool
+                                Name="VCPostBuildEventTool"
+                        />
+                </Configuration>
+                <Configuration
+                        Name="Release|Win32"
+                        ConfigurationType="2"
+                        InheritedPropertySheets="..\..\..\..\w32\module_release.vsprops"
+                        CharacterSet="2"
+                        >
+                        <Tool
+                                Name="VCPreBuildEventTool"
+                        />
+                        <Tool
+                                Name="VCCustomBuildTool"
+                        />
+                        <Tool
+                                Name="VCXMLDataGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCWebServiceProxyGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCMIDLTool"
+                        />
+                        <Tool
+                                Name="VCCLCompilerTool"
+                                UsePrecompiledHeader="0"
+                        />
+                        <Tool
+                                Name="VCManagedResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCPreLinkEventTool"
+                        />
+                        <Tool
+                                Name="VCLinkerTool"
+                                RandomizedBaseAddress="1"
+                                DataExecutionPrevention="0"
+                        />
+                        <Tool
+                                Name="VCALinkTool"
+                        />
+                        <Tool
+                                Name="VCManifestTool"
+                        />
+                        <Tool
+                                Name="VCXDCMakeTool"
+                        />
+                        <Tool
+                                Name="VCBscMakeTool"
+                        />
+                        <Tool
+                                Name="VCFxCopTool"
+                        />
+                        <Tool
+                                Name="VCAppVerifierTool"
+                        />
+                        <Tool
+                                Name="VCPostBuildEventTool"
+                        />
+                </Configuration>
+                <Configuration
+                        Name="Release|x64"
+                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                        ConfigurationType="2"
+                        InheritedPropertySheets="..\..\..\..\w32\module_release.vsprops"
+                        CharacterSet="2"
+                        >
+                        <Tool
+                                Name="VCPreBuildEventTool"
+                        />
+                        <Tool
+                                Name="VCCustomBuildTool"
+                        />
+                        <Tool
+                                Name="VCXMLDataGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCWebServiceProxyGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCMIDLTool"
+                                TargetEnvironment="3"
+                        />
+                        <Tool
+                                Name="VCCLCompilerTool"
+                                UsePrecompiledHeader="0"
+                        />
+                        <Tool
+                                Name="VCManagedResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCPreLinkEventTool"
+                        />
+                        <Tool
+                                Name="VCLinkerTool"
+                                OutputFile="$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll"
+                                RandomizedBaseAddress="1"
+                                DataExecutionPrevention="0"
+                                TargetMachine="17"
+                        />
+                        <Tool
+                                Name="VCALinkTool"
+                        />
+                        <Tool
+                                Name="VCManifestTool"
+                        />
+                        <Tool
+                                Name="VCXDCMakeTool"
+                        />
+                        <Tool
+                                Name="VCBscMakeTool"
+                        />
+                        <Tool
+                                Name="VCFxCopTool"
+                        />
+                        <Tool
+                                Name="VCAppVerifierTool"
+                        />
+                        <Tool
+                                Name="VCPostBuildEventTool"
+                        />
+                </Configuration>
+        </Configurations>
+        <References>
+        </References>
+        <Files>
+                <File
+                        RelativePath=".\mod_directory.c"
+                        >
+                </File>
+        </Files>
+        <Globals>
+        </Globals>
+</VisualStudioProject>
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_directorymod_directorycfromrev15313freeswitchtrunksrcmodapplicationsmod_directorymod_directoryc"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_directory/mod_directory.c (from rev 15313, freeswitch/trunk/src/mod/applications/mod_directory/mod_directory.c) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_directory/mod_directory.c         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_directory/mod_directory.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,988 @@
</span><ins>+/*
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005-2009, 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/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Anthony Minessale II <anthm@freeswitch.org>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Marc Olivier Chouinard <mochouinard at moctel dot com>
+ *
+ *
+ * mod_directory.c -- Search by Name Directory IVR
+ *
+ */
+#include <switch.h>
+
+/* Prototypes */
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_directory_shutdown);
+SWITCH_MODULE_LOAD_FUNCTION(mod_directory_load);
+
+SWITCH_MODULE_DEFINITION(mod_directory, mod_directory_load, mod_directory_shutdown, NULL);
+
+static const char *global_cf = "directory.conf";
+
+static char dir_sql[] =
+"CREATE TABLE directory_search (\n"
+" hostname VARCHAR(255),\n"
+" uuid VARCHAR(255),\n"
+" extension VARCHAR(255),\n"
+" full_name VARCHAR(255),\n"
+" full_name_digit VARCHAR(255),\n"
+" first_name VARCHAR(255),\n"
+" first_name_digit VARCHAR(255),\n"
+" last_name VARCHAR(255),\n"
+" last_name_digit VARCHAR(255),\n"
+" name_visible INTEGER,\n"
+" exten_visible INTEGER\n"
+");\n";
+
+#define DIR_RESULT_ITEM "directory_result_item"
+#define DIR_RESULT_SAY_NAME "directory_result_say_name"
+#define DIR_RESULT_AT "directory_result_at"
+#define DIR_RESULT_MENU "directory_result_menu"
+#define DIR_INTRO "directory_intro"
+#define DIR_MIN_SEARCH_DIGITS "directory_min_search_digits"
+#define DIR_RESULT_COUNT "directory_result_count"
+#define DIR_RESULT_COUNT_TOO_LARGE "directory_result_count_too_large"
+#define DIR_RESULT_LAST "directory_result_last"
+
+static switch_xml_config_string_options_t config_dtmf = { NULL, 2, "[0-9#\\*]" };
+static switch_xml_config_int_options_t config_int_digit_timeout = { SWITCH_TRUE, 0, SWITCH_TRUE, 30000 };
+static switch_xml_config_int_options_t config_int_ht_0 = { SWITCH_TRUE, 0 };
+
+static struct {
+        switch_hash_t *profile_hash;
+        char hostname[256];
+        int integer;
+        int debug;
+        char *dbname;
+        switch_mutex_t *mutex;
+        switch_memory_pool_t *pool;
+} globals;
+
+#define DIR_PROFILE_CONFIGITEM_COUNT 100
+
+struct dir_profile {
+        char *name;
+
+        char next_key[2];
+        char prev_key[2];
+        char select_name_key[2];
+        char new_search_key[2];
+
+        char terminator_key[2];
+        char switch_order_key[2];
+
+        char *search_order;
+
+        uint32_t min_search_digits;
+        uint32_t max_menu_attempt;
+        uint32_t digit_timeout;
+        uint32_t max_result;
+        switch_mutex_t *mutex;
+
+        switch_thread_rwlock_t *rwlock;
+        switch_memory_pool_t *pool;
+
+        switch_xml_config_item_t config[DIR_PROFILE_CONFIGITEM_COUNT];
+        switch_xml_config_string_options_t config_str_pool;
+        uint32_t flags;
+};
+
+typedef struct dir_profile dir_profile_t;
+
+typedef enum {
+        PFLAG_DESTROY = 1 << 0
+} dir_flags_t;
+
+static int digit_matching_keypad(char letter) {
+        int result = -1;
+        switch(toupper(letter)) {
+                case 'A':
+                case 'B':
+                case 'C':
+                        result = 2;
+                        break;
+                case 'D':
+                case 'E':
+                case 'F':
+                        result = 3;
+                        break;
+                case 'G':
+                case 'H':
+                case 'I':
+                        result = 4;
+                        break;
+                case 'J':
+                case 'K':
+                case 'L':
+                        result = 5;
+                        break;
+                case 'M':
+                case 'N':
+                case 'O':
+                        result = 6;
+                        break;
+                case 'P':
+                case 'Q':
+                case 'R':
+                case 'S':
+                        result = 7;
+                        break;
+                case 'T':
+                case 'U':
+                case 'V':
+                        result = 8;
+                        break;
+                case 'W':
+                case 'X':
+                case 'Y':
+                case 'Z':
+                        result = 9;
+                        break;
+        }
+
+
+        return result;
+
+}
+
+char *string_to_keypad_digit(const char *in)
+{
+        const char *s = NULL;
+        char *dst = NULL;
+        char *d = NULL;
+
+        if (in) {
+                s = in;
+                dst = strdup(in);
+                d = dst;
+
+                while (*s) {
+                        char c;
+                        if ((c = digit_matching_keypad(*s++)) > 0) {
+                                *d++ = c + 48;
+                        }
+                }
+                if (*d) {
+                        *d = '\0';
+                }
+        }        
+        return dst;
+}
+
+static switch_status_t directory_execute_sql(char *sql, switch_mutex_t *mutex)
+{
+        switch_core_db_t *db;
+        switch_status_t status = SWITCH_STATUS_SUCCESS;
+
+        if (mutex) {
+                switch_mutex_lock(mutex);
+        }
+
+        if (!(db = switch_core_db_open_file(globals.dbname))) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB %s\n", globals.dbname);
+                status = SWITCH_STATUS_FALSE;
+                goto end;
+        }
+        status = switch_core_db_persistant_execute(db, sql, 1);
+        switch_core_db_close(db);
+
+end:
+        if (mutex) {
+                switch_mutex_unlock(mutex);
+        }
+
+        return status;
+}
+
+typedef enum {
+        ENTRY_MOVE_NEXT,
+        ENTRY_MOVE_PREV
+} entry_move_t;
+
+struct search_params {
+        char digits[255];
+        char transfer_to[255];
+        char domain[255];
+        char profile[255];
+        int search_by_last_name;
+        int timeout;
+        int try_again;
+};
+typedef struct search_params search_params_t;
+
+struct listing_callback {
+        char extension[255];
+        char fullname[255];
+        char first_name[255];
+        char last_name[255];
+        char transfer_to[255];
+        int name_visible;
+        int exten_visible;
+        int new_search;
+        int index;
+        int want;
+        entry_move_t move;
+        search_params_t *params;
+};
+typedef struct listing_callback listing_callback_t;
+
+static int listing_callback(void *pArg, int argc, char **argv, char **columnNames)
+{
+        listing_callback_t *cbt = (listing_callback_t *) pArg;
+        if (cbt->index++ != cbt->want) {
+                return 0;
+        }
+        switch_copy_string(cbt->extension, argv[0], 255);
+        switch_copy_string(cbt->fullname, argv[1], 255);
+        switch_copy_string(cbt->last_name, argv[2], 255);
+        switch_copy_string(cbt->first_name, argv[3], 255);
+        cbt->name_visible = atoi(argv[4]);
+        cbt->exten_visible = atoi(argv[5]);
+        return -1;
+}
+
+
+struct callback {
+        char *buf;
+        size_t len;
+        int matches;
+};
+typedef struct callback callback_t;
+
+static int sql2str_callback(void *pArg, int argc, char **argv, char **columnNames)
+{
+        callback_t *cbt = (callback_t *) pArg;
+
+        switch_copy_string(cbt->buf, argv[0], cbt->len);
+        cbt->matches++;
+        return 0;
+}
+
+static switch_bool_t directory_execute_sql_callback(switch_mutex_t *mutex, char *sql, switch_core_db_callback_func_t callback, void *pdata)
+{
+        switch_bool_t ret = SWITCH_FALSE;
+        switch_core_db_t *db;
+        char *errmsg = NULL;
+
+        if (mutex) {
+                switch_mutex_lock(mutex);
+        }
+
+        if (!(db = switch_core_db_open_file(globals.dbname))) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Opening DB %s\n", globals.dbname);
+                goto end;
+        }
+
+        switch_core_db_exec(db, sql, callback, pdata, &errmsg);
+
+        if (errmsg) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQL ERR: [%s] %s\n", sql, errmsg);
+                free(errmsg);
+        }
+
+        if (db) {
+                switch_core_db_close(db);
+        }
+
+end:
+        if (mutex) {
+                switch_mutex_unlock(mutex);
+        }
+
+        return ret;
+}
+
+#define DIR_DESC "directory"
+#define DIR_USAGE "<profile_name> <domain_name>"
+
+static void free_profile(dir_profile_t *profile)
+{
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Destroying Profile %s\n", profile->name);
+        switch_core_destroy_memory_pool(&profile->pool);
+}
+
+static void profile_rwunlock(dir_profile_t *profile)
+{
+        switch_thread_rwlock_unlock(profile->rwlock);
+        if (switch_test_flag(profile, PFLAG_DESTROY)) {
+                if (switch_thread_rwlock_tryrdlock(profile->rwlock) == SWITCH_STATUS_SUCCESS) {
+                        free_profile(profile);
+                }
+        }
+}
+
+dir_profile_t *profile_set_config(dir_profile_t *profile)
+{
+        int i = 0;
+
+        profile->config_str_pool.pool = profile->pool;
+
+        SWITCH_CONFIG_SET_ITEM(profile->config[i++], "next-key", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE,
+                        &profile->next_key, "6", &config_dtmf, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile->config[i++], "prev-key", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE,
+                        &profile->prev_key, "4", &config_dtmf, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile->config[i++], "terminator-key", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE,
+                        &profile->terminator_key, "#", &config_dtmf, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile->config[i++], "switch-order-key", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE,
+                        &profile->switch_order_key, "*", &config_dtmf, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile->config[i++], "select-name-key", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE,
+                        &profile->select_name_key, "1", &config_dtmf, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile->config[i++], "new-search-key", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE,
+                        &profile->new_search_key, "3", &config_dtmf, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile->config[i++], "search-order", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE,
+                        &profile->search_order, "last_name", &profile->config_str_pool, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile->config[i++], "digit-timeout", SWITCH_CONFIG_INT, CONFIG_RELOADABLE,
+                        &profile->digit_timeout, 3000, &config_int_digit_timeout, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile->config[i++], "min-search-digits", SWITCH_CONFIG_INT, CONFIG_RELOADABLE,
+                        &profile->min_search_digits, 3, &config_int_ht_0, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile->config[i++], "max-menu-attempts", SWITCH_CONFIG_INT, CONFIG_RELOADABLE,
+                        &profile->max_menu_attempt, 3, &config_int_ht_0, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile->config[i++], "max-result", SWITCH_CONFIG_INT, CONFIG_RELOADABLE,
+                        &profile->max_result, 5, &config_int_ht_0, NULL, NULL);
+
+        return profile;
+
+}
+
+static dir_profile_t * load_profile(const char *profile_name)
+{
+        dir_profile_t *profile = NULL;
+        switch_xml_t x_profiles, x_profile, cfg, xml = NULL;
+        switch_event_t *event = NULL;
+
+        if (!(xml = switch_xml_open_cfg(global_cf, &cfg, NULL))) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", global_cf);
+                return profile;
+        }
+        if (!(x_profiles = switch_xml_child(cfg, "profiles"))) {
+                goto end;
+        }
+
+        if ((x_profile = switch_xml_find_child(x_profiles, "profile", "name", profile_name))) {
+                switch_memory_pool_t *pool;
+                int count;
+
+                if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Pool Failure\n");
+                        goto end;
+                }
+
+                if (!(profile = switch_core_alloc(pool, sizeof(dir_profile_t)))) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Alloc Failure\n");
+                        switch_core_destroy_memory_pool(&pool);
+                        goto end;
+                }
+
+                profile->pool = pool;
+                profile_set_config(profile);
+
+                /* Add the params to the event structure */
+                count = switch_event_import_xml(switch_xml_child(x_profile, "param"), "name", "value", &event);
+
+                if (switch_xml_config_parse_event(event, count, SWITCH_FALSE, profile->config) != SWITCH_STATUS_SUCCESS) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to process configuration\n");
+                        switch_core_destroy_memory_pool(&pool);
+                        goto end;
+                }
+
+                switch_thread_rwlock_create(&profile->rwlock, pool);
+                profile->name = switch_core_strdup(pool, profile_name);
+
+                switch_mutex_init(&profile->mutex, SWITCH_MUTEX_NESTED, profile->pool);
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Added Profile %s\n", profile->name);
+                switch_core_hash_insert(globals.profile_hash, profile->name, profile);
+        }
+
+end:
+        switch_xml_free(xml);
+
+        return profile;
+}
+
+static switch_status_t load_config(switch_bool_t reload)
+{
+        switch_xml_t cfg, xml = NULL, settings, param, x_profiles, x_profile;
+
+        if (!(xml = switch_xml_open_cfg(global_cf, &cfg, NULL))) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", global_cf);
+                return SWITCH_STATUS_TERM;
+        }
+
+        switch_mutex_lock(globals.mutex);
+        if ((settings = switch_xml_child(cfg, "settings"))) {
+                for (param = switch_xml_child(settings, "param"); param; param = param->next) {
+                        char *var = (char *) switch_xml_attr_soft(param, "name");
+                        char *val = (char *) switch_xml_attr_soft(param, "value");
+
+                        if (!strcasecmp(var, "debug")) {
+                                globals.debug = atoi(val);
+                        }
+                }
+        }
+
+        if ((x_profiles = switch_xml_child(cfg, "profiles"))) {
+                for (x_profile = switch_xml_child(x_profiles, "profile"); x_profile; x_profile = x_profile->next) {
+                        load_profile(switch_xml_attr_soft(x_profile, "name"));
+                }
+        }
+        switch_mutex_unlock(globals.mutex);
+
+        switch_xml_free(xml);
+        return SWITCH_STATUS_SUCCESS;
+}
+
+static dir_profile_t * get_profile(const char *profile_name)
+{
+        dir_profile_t *profile = NULL;
+
+        switch_mutex_lock(globals.mutex);
+        if (!(profile = switch_core_hash_find(globals.profile_hash, profile_name))) {
+                profile = load_profile(profile_name);
+        }
+        if (profile) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "[%s] rwlock\n", profile->name);
+
+                switch_thread_rwlock_rdlock(profile->rwlock);
+        }
+        switch_mutex_unlock(globals.mutex);
+
+        return profile;
+}
+
+static switch_status_t populate_database(switch_core_session_t *session, dir_profile_t * profile, const char *domain_name) {
+        switch_status_t status = SWITCH_STATUS_SUCCESS;
+
+        char *sql = NULL;
+        char *sqlvalues = NULL;
+        char *sqltmp = NULL;
+
+        switch_xml_t xml_root = NULL, x_domain;
+        switch_xml_t ut;
+
+        switch_event_t *xml_params = NULL;
+        switch_xml_t group = NULL, groups = NULL, users = NULL, x_params = NULL, x_param = NULL, x_vars = NULL, x_var = NULL;
+        switch_event_create(&xml_params, SWITCH_EVENT_REQUEST_PARAMS);
+        switch_assert(xml_params);
+
+        if (switch_xml_locate_domain(domain_name, xml_params, &xml_root, &x_domain) != SWITCH_STATUS_SUCCESS) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot locate domain %s\n", domain_name);
+                status = SWITCH_STATUS_FALSE;
+                goto end;
+        }
+
+        if ((groups = switch_xml_child(x_domain, "groups"))) {
+                for (group = switch_xml_child(groups, "group"); group; group = group->next) {
+                        if ((users = switch_xml_child(group, "users"))) {
+                                for (ut = switch_xml_child(users, "user"); ut; ut = ut->next) {
+                                        int name_visible = 1;
+                                        int exten_visible = 1;
+                                        const char *type = switch_xml_attr_soft(ut, "type");
+                                        const char *id = switch_xml_attr_soft(ut, "id");
+                                        char *fullName = NULL;
+                                        char *caller_name = NULL;
+                                        char *caller_name_override = NULL;
+                                        char *firstName = NULL;
+                                        char *lastName = NULL;
+                                        char *fullNameDigit = NULL;
+                                        char *firstNameDigit = NULL;
+                                        char *lastNameDigit = NULL;
+
+                                        if (!strcasecmp(type, "pointer")) {
+                                                continue;
+                                        }
+                                        /* Check all the user params */
+                                        if ((x_params = switch_xml_child(ut, "params"))) {
+                                                for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) {
+                                                        const char *var = switch_xml_attr_soft(x_param, "name");
+                                                        const char *val = switch_xml_attr_soft(x_param, "value");
+                                                        if (!strcasecmp(var, "directory-visible")) {
+                                                                name_visible = switch_true(val);
+                                                        }
+                                                        if (!strcasecmp(var, "directory-exten-visible")) {
+                                                                exten_visible = switch_true(val);
+                                                        }
+
+                                                }
+                                        }
+                                        /* Check all the user variables */
+                                        if ((x_vars = switch_xml_child(ut, "variables"))) {
+                                                for (x_var = switch_xml_child(x_vars, "variable"); x_var; x_var = x_var->next) {
+                                                        const char *var = switch_xml_attr_soft(x_var, "name");
+                                                        const char *val = switch_xml_attr_soft(x_var, "value");
+                                                        if (!strcasecmp(var, "effective_caller_id_name")) {
+                                                                caller_name = switch_core_session_strdup(session, val);
+                                                        }
+                                                        if (!strcasecmp(var, "directory_full_name")) {
+                                                                caller_name_override = switch_core_session_strdup(session, val);
+                                                        }
+                                                }
+                                        }
+                                        if (caller_name_override) {
+                                                fullName = caller_name_override;
+                                        } else {
+                                                fullName = caller_name;
+                                        }
+                                        if (zstr(fullName)) {
+                                                continue;
+                                        }
+                                        firstName = switch_core_session_strdup(session, fullName);
+
+                                        if ((lastName = strrchr(firstName, ' '))) {
+                                                *lastName++ = '\0';
+                                        } else {
+                                                lastName = switch_core_session_strdup(session, firstName);
+                                        }
+
+                                        /* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "FullName %s firstName [%s] lastName [%s]\n", fullName, firstName, lastName); */
+
+                                        /* Generate Digits key mapping */
+                                        fullNameDigit = string_to_keypad_digit(fullName);
+                                        lastNameDigit = string_to_keypad_digit(lastName);
+                                        firstNameDigit = string_to_keypad_digit(firstName);
+
+                                        /* add user into DB */
+                                        sql = switch_mprintf("insert into directory_search values('%q','%q','%q','%q','%q','%q','%q','%q','%q','%d','%d')",
+                                                        globals.hostname, switch_core_session_get_uuid(session), id, fullName, fullNameDigit, firstName, firstNameDigit, lastName, lastNameDigit, name_visible, exten_visible);
+
+                                        if (sqlvalues) {
+                                                sqltmp = sqlvalues;
+                                                sqlvalues = switch_mprintf("%s;%s", sqlvalues, sql);
+                                                switch_safe_free(sqltmp);
+                                        } else {
+                                                sqlvalues = sql;
+                                                sql = NULL;
+                                        }
+                                        switch_safe_free(sql);
+                                        switch_safe_free(fullNameDigit);
+                                        switch_safe_free(lastNameDigit);
+                                        switch_safe_free(firstNameDigit);
+                                }
+                        }
+                }
+        }
+        sql = switch_mprintf("BEGIN;%s;COMMIT;",sqlvalues);
+        directory_execute_sql(sql, profile->mutex);
+
+end:
+        switch_safe_free(sql);
+        switch_safe_free(sqlvalues);
+        switch_event_destroy(&xml_params);
+        switch_xml_free(xml_root);
+
+        return status;
+}
+
+struct cb_result {
+        char digits[255];
+        char digit;
+        dir_profile_t *profile;
+};
+
+typedef struct cb_result cbr_t;
+
+static switch_status_t on_dtmf(switch_core_session_t *session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen)
+{
+        switch (itype) {
+                case SWITCH_INPUT_TYPE_DTMF:
+                        {
+                                switch_dtmf_t *dtmf = (switch_dtmf_t *) input;
+                                cbr_t *cbr = (cbr_t *) buf;
+                                cbr->digit = dtmf->digit;
+                                if (dtmf->digit == *cbr->profile->terminator_key || dtmf->digit == *cbr->profile->switch_order_key) {
+                                        return SWITCH_STATUS_BREAK;
+                                }
+
+                                if (strlen(cbr->digits) < sizeof(cbr->digits) - 2) {
+                                        int at = strlen(cbr->digits);
+                                        cbr->digits[at++] = dtmf->digit;
+                                        cbr->digits[at] = '\0';
+                                } else {
+                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "DTMF buffer is full\n");
+                                        return SWITCH_STATUS_BREAK;
+                                }
+                        }
+                        break;
+                default:
+                        break;
+        }
+
+        return SWITCH_STATUS_BREAK;
+}
+
+static switch_status_t listen_entry(switch_core_session_t *session, dir_profile_t *profile, listing_callback_t *cbt)
+{
+        char buf[2] = "";
+        char macro[256] = "";
+        char recorded_name[256] = "";
+
+        /* Try to use the recorded name from voicemail if it exist */
+        if (switch_loadable_module_exists("mod_voicemail") == SWITCH_STATUS_SUCCESS) {
+                char *cmd = NULL;
+                switch_stream_handle_t stream = { 0 };
+                SWITCH_STANDARD_STREAM(stream);
+
+                cmd = switch_core_session_sprintf(session, "%s/%s@%s|name_path", cbt->params->profile, cbt->extension, cbt->params->domain);
+                switch_api_execute("vm_prefs", cmd, session, &stream);
+                if (strncmp("-ERR", stream.data, 4)) {
+                        switch_copy_string(recorded_name, (char *) stream.data, sizeof(recorded_name));
+                }
+                switch_safe_free(stream.data);
+        }
+
+        if (zstr_buf(buf)) {
+                switch_snprintf(macro, sizeof(macro), "phrase:%s:%d", DIR_RESULT_ITEM, cbt->want+1);
+                switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile->terminator_key);
+        }
+
+        if (!zstr_buf(recorded_name) && zstr_buf(buf)) {
+ switch_ivr_read(session, 0, 1, recorded_name, NULL, buf, sizeof(buf), 1, profile->terminator_key);
+
+        }
+        if (zstr_buf(recorded_name) && zstr_buf(buf)) {
+                switch_snprintf(macro, sizeof(macro), "phrase:%s:%s", DIR_RESULT_SAY_NAME, cbt->fullname);
+                switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile->terminator_key);
+        }
+        if (cbt->exten_visible && zstr_buf(buf)) {
+                switch_snprintf(macro, sizeof(macro), "phrase:%s:%s", DIR_RESULT_AT, cbt->extension);
+                switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), 1, profile->terminator_key);
+        }
+        if (zstr_buf(buf)) {
+                switch_snprintf(macro, sizeof(macro), "phrase:%s:%c,%c,%c,%c", DIR_RESULT_MENU, *profile->select_name_key, *profile->next_key, *profile->prev_key, *profile->new_search_key);
+                switch_ivr_read(session, 0, 1, macro, NULL, buf, sizeof(buf), profile->digit_timeout, profile->terminator_key);
+        }
+
+        if (!zstr_buf(buf)) {
+                if (buf[0] == *profile->select_name_key) {
+                        switch_copy_string(cbt->transfer_to, cbt->extension, 255);
+                }
+                if (buf[0] == *profile->new_search_key) {
+                        cbt->new_search = 1;
+                }
+                if (buf[0] == *profile->prev_key) {
+                        cbt->move = ENTRY_MOVE_PREV;
+                }
+        } else {
+                return SWITCH_STATUS_TIMEOUT;
+        }
+
+        return SWITCH_STATUS_SUCCESS;
+}
+
+switch_status_t gather_name_digit(switch_core_session_t *session, dir_profile_t *profile, search_params_t *params) {
+        switch_channel_t *channel = switch_core_session_get_channel(session);
+        switch_status_t status = SWITCH_STATUS_SUCCESS;
+        cbr_t cbr;
+        int loop = 1;
+
+        switch_input_args_t args = { 0 };
+        args.input_callback = on_dtmf;
+        args.buf = &cbr;
+
+        while (switch_channel_ready(channel) && loop) {
+                char macro[255];
+                loop = 0;
+                memset(&cbr, 0, sizeof(cbr));
+                cbr.profile = profile;
+                params->timeout = 0;
+
+                /* Gather the user Name */
+
+                switch_snprintf(macro, sizeof(macro), "%s:%c", (params->search_by_last_name?"last_name":"first_name"), *profile->switch_order_key);
+                switch_ivr_phrase_macro(session, DIR_INTRO, macro, NULL, &args);
+
+                while (switch_channel_ready(channel)) {
+                        if (cbr.digit == *profile->terminator_key) {
+                                status = SWITCH_STATUS_BREAK;
+                                break;
+                        }
+                        if (cbr.digit == *profile->switch_order_key) {
+                                if (params->search_by_last_name) {
+                                        params->search_by_last_name = 0;
+                                } else {
+                                        params->search_by_last_name = 1;
+                                }
+                                loop = 1;
+                                break;
+                        }
+
+                        if (switch_ivr_collect_digits_callback(session, &args, profile->digit_timeout, 0) == SWITCH_STATUS_TIMEOUT) {
+                                params->timeout = 1;
+                                break;
+                        }
+
+                }
+        }
+        switch_copy_string(params->digits, cbr.digits, 255);
+
+        return status;
+}
+
+switch_status_t navigate_entrys(switch_core_session_t *session, dir_profile_t *profile, search_params_t *params) {
+        switch_status_t status = SWITCH_STATUS_SUCCESS;
+        char *sql = NULL;
+        char entry_count[80] = "";
+        callback_t cbt = { 0 };
+        int result_count;
+        char macro[256] = "";
+        listing_callback_t listing_cbt;
+        int cur_entry = 0;
+        cbt.buf = entry_count;
+        cbt.len = sizeof(entry_count);
+
+        sql = switch_mprintf("select count(*) from directory_search where hostname = '%q' and uuid = '%q' and name_visible = 1 and %s like '%q%%'", globals.hostname, switch_core_session_get_uuid(session), (params->search_by_last_name?"last_name_digit":"first_name_digit"), params->digits);
+
+        directory_execute_sql_callback(profile->mutex, sql, sql2str_callback, &cbt);
+        switch_safe_free(sql);
+
+        result_count = atoi(entry_count);
+
+        if (result_count == 0) {
+                switch_snprintf(macro, sizeof(macro), "%d", result_count);
+                switch_ivr_phrase_macro(session, DIR_RESULT_COUNT, macro, NULL, NULL);
+                params->try_again = 1;
+                return SWITCH_STATUS_BREAK;
+        } else if (profile->max_result != 0 && result_count > profile->max_result) {
+                switch_ivr_phrase_macro(session, DIR_RESULT_COUNT_TOO_LARGE, NULL, NULL, NULL);
+                params->try_again = 1;
+                return SWITCH_STATUS_BREAK;
+        } else {
+                switch_snprintf(macro, sizeof(macro), "%d", result_count);
+                switch_ivr_phrase_macro(session, DIR_RESULT_COUNT, macro, NULL, NULL);
+        }
+
+        memset(&listing_cbt, 0, sizeof(listing_cbt));
+        listing_cbt.params = params;
+
+        sql = switch_mprintf("select extension, full_name, last_name, first_name, name_visible, exten_visible from directory_search where hostname = '%q' and uuid = '%q' and name_visible = 1 and %s like '%q%%' order by last_name, first_name", globals.hostname, switch_core_session_get_uuid(session), (params->search_by_last_name?"last_name_digit":"first_name_digit"), params->digits);
+
+        for (cur_entry = 0; cur_entry < result_count; cur_entry++) {
+                listing_cbt.index = 0;
+                listing_cbt.want = cur_entry;
+                listing_cbt.move = ENTRY_MOVE_NEXT;
+                directory_execute_sql_callback(profile->mutex, sql, listing_callback, &listing_cbt);
+                status = listen_entry(session, profile, &listing_cbt);
+                if (!zstr(listing_cbt.transfer_to)) {
+                        switch_copy_string(params->transfer_to, listing_cbt.transfer_to, 255);
+                        break;
+                }
+                if (listing_cbt.new_search) {
+                        params->try_again = 1;
+                        goto end;
+
+                }
+                if (listing_cbt.move == ENTRY_MOVE_NEXT) {
+                        if (cur_entry == result_count - 1) {
+                                switch_snprintf(macro, sizeof(macro), "%d", result_count);
+                                switch_ivr_phrase_macro(session, DIR_RESULT_LAST, macro, NULL, NULL);
+                                cur_entry -= 1;
+                        }
+                }
+                if (listing_cbt.move == ENTRY_MOVE_PREV) {
+                        if (cur_entry <= 0) {
+                                cur_entry = -1;
+                        } else {
+                                cur_entry -= 2;
+                        }
+                }
+                if (status == SWITCH_STATUS_TIMEOUT) {
+                        goto end;
+                }
+                if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) {
+                        goto end;
+                }
+        }
+
+end:
+        switch_safe_free(sql);
+        return status;
+
+}
+
+SWITCH_STANDARD_APP(directory_function)
+{
+        switch_channel_t *channel = switch_core_session_get_channel(session);
+        int argc = 0;
+        char *argv[6] = { 0 };
+        char *mydata = NULL;
+        const char *profile_name = NULL;
+        const char *domain_name = NULL;
+        dir_profile_t * profile = NULL;
+        int x = 0;
+        char *sql = NULL;
+        search_params_t s_param;
+        int attempts = 3;
+        char macro[255];
+
+        if (zstr(data)) {
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missing profile name\n");
+                return;
+        }
+
+        mydata = switch_core_session_strdup(session, data);
+        argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
+
+        if (argv[x]) {
+                profile_name = argv[x++];
+        }
+
+        if (argv[x]) {
+                domain_name = argv[x++];
+        }
+
+        if (!(profile = get_profile(profile_name))) {
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error invalid profile %s\n", profile_name);
+                return;
+        }
+
+        populate_database(session, profile, domain_name);
+
+        memset(&s_param, 0, sizeof(s_param));
+        s_param.search_by_last_name = 1;
+        s_param.try_again = 1;
+        switch_copy_string(s_param.profile, profile_name, 255);
+        switch_copy_string(s_param.domain, domain_name, 255);
+
+        if (strcasecmp(profile->search_order, "last_name")) {
+                s_param.search_by_last_name = 0;
+        }
+        attempts = profile->max_menu_attempt;
+        s_param.try_again = 1;        
+        while (switch_channel_ready(channel) && (s_param.try_again && attempts-- > 0)) {
+                s_param.try_again = 0;
+                gather_name_digit(session, profile, &s_param);
+
+                if (zstr(s_param.digits)) {
+                        s_param.try_again = 1;
+                        continue;
+                }
+
+                if (strlen(s_param.digits) < profile->min_search_digits) {
+                        switch_snprintf(macro, sizeof(macro), "%d", profile->min_search_digits);
+                        switch_ivr_phrase_macro(session, DIR_MIN_SEARCH_DIGITS, macro, NULL, NULL);
+                        s_param.try_again = 1;
+                        continue;
+                }
+
+                navigate_entrys(session, profile, &s_param);
+        }
+
+        if (!zstr(s_param.transfer_to)) {
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Directory transfering call to : %s\n", s_param.transfer_to);
+                switch_ivr_session_transfer(session, s_param.transfer_to, "XML", domain_name);
+        }
+
+        /* Delete all sql entry for this call */
+        sql = switch_mprintf("delete from directory_search where hostname = '%q' and uuid = '%q'", globals.hostname, switch_core_session_get_uuid(session));
+        directory_execute_sql(sql, profile->mutex);
+        switch_safe_free(sql);
+        profile_rwunlock(profile);        
+}
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_directory_load)
+{
+        switch_application_interface_t *app_interface;
+        switch_status_t status;
+        switch_core_db_t *db = NULL;
+        char *sql = NULL;
+
+        memset(&globals, 0, sizeof(globals));
+        globals.pool = pool;
+
+        switch_core_hash_init(&globals.profile_hash, globals.pool);
+        switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, globals.pool);
+
+        if ((status = load_config(SWITCH_FALSE)) != SWITCH_STATUS_SUCCESS) {
+                return status;
+        }
+
+        /* connect my internal structure to the blank pointer passed to me */
+        *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+
+        gethostname(globals.hostname, sizeof(globals.hostname));
+
+        globals.dbname = switch_core_sprintf(pool, "directory");
+
+        if ((db = switch_core_db_open_file(globals.dbname))) {
+                switch_core_db_test_reactive(db, "select count(uuid),name_visible from directory_search", "drop table directory_search", dir_sql);
+                switch_core_db_close(db);
+        } else {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to open db name : %s\n", globals.dbname);
+                return SWITCH_STATUS_FALSE;
+        }
+
+        sql = switch_mprintf("delete from directory_search where hostname = '%q'", globals.hostname);
+        directory_execute_sql(sql, globals.mutex);
+        switch_safe_free(sql);
+
+        SWITCH_ADD_APP(app_interface, "directory", "directory", DIR_DESC, directory_function, DIR_USAGE, SAF_NONE);
+
+        /* indicate that the module should continue to be loaded */
+        return SWITCH_STATUS_SUCCESS;
+}
+
+/*
+ Called when the system shuts down
+ Macro expands to: switch_status_t mod_directory_shutdown() */
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_directory_shutdown)
+{
+        switch_hash_index_t *hi;
+        dir_profile_t *profile;
+        void *val = NULL;
+        const void *key;
+        switch_ssize_t keylen;
+        char *sql = NULL;
+
+        switch_mutex_lock(globals.mutex);
+
+        while((hi = switch_hash_first(NULL, globals.profile_hash))) {
+                switch_hash_this(hi, &key, &keylen, &val);
+                profile = (dir_profile_t *) val;
+
+                switch_core_hash_delete(globals.profile_hash, profile->name);
+
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Waiting for write lock (Profile %s)\n", profile->name);
+                switch_thread_rwlock_wrlock(profile->rwlock);
+
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Destroying Profile %s\n", profile->name);
+                switch_core_destroy_memory_pool(&profile->pool);
+                profile = NULL;
+        }
+
+        sql = switch_mprintf("delete from directory_search where hostname = '%q'", globals.hostname);
+        directory_execute_sql(sql, globals.mutex);
+        switch_safe_free(sql);
+
+        switch_mutex_unlock(globals.mutex);
+        return SWITCH_STATUS_SUCCESS;
+}
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4
+ */
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_directorymod_directoryvcprojfromrev15313freeswitchtrunksrcmodapplicationsmod_directorymod_directoryvcproj"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_directory/mod_directory.vcproj (from rev 15313, freeswitch/trunk/src/mod/applications/mod_directory/mod_directory.vcproj) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_directory/mod_directory.vcproj         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_directory/mod_directory.vcproj        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,153 @@
</span><ins>+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+        ProjectType="Visual C++"
+        Version="8.00"
+        Name="mod_directory"
+        ProjectGUID="{75DF7F29-2FBF-47F7-B5AF-5B4952DC1ABD}"
+        RootNamespace="mod_directory"
+        Keyword="Win32Proj"
+        >
+        <Platforms>
+                <Platform
+                        Name="Win32"
+                />
+        </Platforms>
+        <ToolFiles>
+        </ToolFiles>
+        <Configurations>
+                <Configuration
+                        Name="Debug|Win32"
+                        ConfigurationType="2"
+                        InheritedPropertySheets="..\..\..\..\w32\module_debug.vsprops"
+                        CharacterSet="2"
+                        >
+                        <Tool
+                                Name="VCPreBuildEventTool"
+                        />
+                        <Tool
+                                Name="VCCustomBuildTool"
+                        />
+                        <Tool
+                                Name="VCXMLDataGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCWebServiceProxyGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCMIDLTool"
+                        />
+                        <Tool
+                                Name="VCCLCompilerTool"
+                                UsePrecompiledHeader="0"
+                        />
+                        <Tool
+                                Name="VCManagedResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCPreLinkEventTool"
+                        />
+                        <Tool
+                                Name="VCLinkerTool"
+                        />
+                        <Tool
+                                Name="VCALinkTool"
+                        />
+                        <Tool
+                                Name="VCManifestTool"
+                        />
+                        <Tool
+                                Name="VCXDCMakeTool"
+                        />
+                        <Tool
+                                Name="VCBscMakeTool"
+                        />
+                        <Tool
+                                Name="VCFxCopTool"
+                        />
+                        <Tool
+                                Name="VCAppVerifierTool"
+                        />
+                        <Tool
+                                Name="VCWebDeploymentTool"
+                        />
+                        <Tool
+                                Name="VCPostBuildEventTool"
+                        />
+                </Configuration>
+                <Configuration
+                        Name="Release|Win32"
+                        ConfigurationType="2"
+                        InheritedPropertySheets="..\..\..\..\w32\module_release.vsprops"
+                        CharacterSet="2"
+                        >
+                        <Tool
+                                Name="VCPreBuildEventTool"
+                        />
+                        <Tool
+                                Name="VCCustomBuildTool"
+                        />
+                        <Tool
+                                Name="VCXMLDataGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCWebServiceProxyGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCMIDLTool"
+                        />
+                        <Tool
+                                Name="VCCLCompilerTool"
+                                UsePrecompiledHeader="0"
+                        />
+                        <Tool
+                                Name="VCManagedResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCPreLinkEventTool"
+                        />
+                        <Tool
+                                Name="VCLinkerTool"
+                        />
+                        <Tool
+                                Name="VCALinkTool"
+                        />
+                        <Tool
+                                Name="VCManifestTool"
+                        />
+                        <Tool
+                                Name="VCXDCMakeTool"
+                        />
+                        <Tool
+                                Name="VCBscMakeTool"
+                        />
+                        <Tool
+                                Name="VCFxCopTool"
+                        />
+                        <Tool
+                                Name="VCAppVerifierTool"
+                        />
+                        <Tool
+                                Name="VCWebDeploymentTool"
+                        />
+                        <Tool
+                                Name="VCPostBuildEventTool"
+                        />
+                </Configuration>
+        </Configurations>
+        <References>
+        </References>
+        <Files>
+                <File
+                        RelativePath=".\mod_directory.c"
+                        >
+                </File>
+        </Files>
+        <Globals>
+        </Globals>
+</VisualStudioProject>
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_dptoolsmod_dptoolsc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_dptools/mod_dptools.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_dptools/mod_dptools.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_dptools/mod_dptools.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -55,11 +55,11 @@
</span><span class="cx">                 abort();
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(target)) {
</del><ins>+        if (zstr(target)) {
</ins><span class="cx">                 target = caller_profile->destination_number;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(target) && (lbuf = switch_core_session_strdup(session, target))
</del><ins>+        if (!zstr(target) && (lbuf = switch_core_session_strdup(session, target))
</ins><span class="cx">                 && (argc = switch_separate_string(lbuf, ',', argv, (sizeof(argv) / sizeof(argv[0]))))) {
</span><span class="cx">         } else {
</span><span class="cx">                 return NULL;
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx">         int argc;
</span><span class="cx">         char *lbuf = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
</del><ins>+        if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
</ins><span class="cx">                 && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
</span><span class="cx">                 if (!strcasecmp(argv[0], "grammar") && argc >= 1) {
</span><span class="cx">                         switch_ivr_detect_speech_load_grammar(session, argv[1], argv[2]);
</span><span class="lines">@@ -154,7 +154,7 @@
</span><span class="cx">         int argc;
</span><span class="cx">         char *lbuf = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
</del><ins>+        if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
</ins><span class="cx">                 && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
</span><span class="cx">                 switch_core_session_execute_exten(session, argv[0], argv[1], argv[2]);
</span><span class="cx">         } else {
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx">         int argc;
</span><span class="cx">         char *lbuf = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
</del><ins>+        if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
</ins><span class="cx">                 && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) {
</span><span class="cx">                 switch_ivr_soft_hold(session, argv[0], argv[1], argv[2]);
</span><span class="cx">         } else {
</span><span class="lines">@@ -205,7 +205,7 @@
</span><span class="cx">         int argc;
</span><span class="cx">         char *lbuf = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
</del><ins>+        if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
</ins><span class="cx">                 && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) == 4) {
</span><span class="cx">                 int kval = atoi(argv[0]);
</span><span class="cx">                 switch_bind_flag_t bind_flags = 0;
</span><span class="lines">@@ -283,7 +283,7 @@
</span><span class="cx">         char *uuid;
</span><span class="cx">         switch_bool_t bleg = SWITCH_FALSE;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
</del><ins>+        if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
</ins><span class="cx">                 if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) {
</span><span class="cx">                         if (!strcasecmp(argv[0], "-bleg")) {
</span><span class="cx">                                 if (argv[1]) {
</span><span class="lines">@@ -327,7 +327,7 @@
</span><span class="cx"> #define eavesdrop_SYNTAX "[all | <uuid>]"
</span><span class="cx"> SWITCH_STANDARD_APP(eavesdrop_function)
</span><span class="cx"> {
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", eavesdrop_SYNTAX);
</span><span class="cx">         } else {
</span><span class="cx">                 switch_channel_t *channel = switch_core_session_get_channel(session);
</span><span class="lines">@@ -401,7 +401,7 @@
</span><span class="cx"> #define threeway_SYNTAX "<uuid>"
</span><span class="cx"> SWITCH_STANDARD_APP(three_way_function)
</span><span class="cx"> {
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", threeway_SYNTAX);
</span><span class="cx">         } else {
</span><span class="cx">                 switch_ivr_eavesdrop_session(session, data, NULL, ED_MUX_READ | ED_MUX_WRITE);
</span><span class="lines">@@ -458,7 +458,7 @@
</span><span class="cx">         char *mydata;
</span><span class="cx">         switch_call_cause_t cause = SWITCH_CAUSE_CALL_REJECTED;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
</del><ins>+        if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
</ins><span class="cx">                 if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) > 1) {
</span><span class="cx">                         if (!switch_check_network_list_ip(argv[0], argv[1])) {
</span><span class="cx">                                 switch_channel_t *channel = switch_core_session_get_channel(session);
</span><span class="lines">@@ -486,7 +486,7 @@
</span><span class="cx">         int bleg = 0, both = 0;
</span><span class="cx">
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
</del><ins>+        if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
</ins><span class="cx">                 if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) {
</span><span class="cx">                         bleg = !strcasecmp(argv[0], "-bleg");
</span><span class="cx">                         both = !strcasecmp(argv[0], "-both");
</span><span class="lines">@@ -521,7 +521,7 @@
</span><span class="cx">         char *argv[4] = { 0 };
</span><span class="cx">         char *mydata;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
</del><ins>+        if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
</ins><span class="cx">                 if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 2) {
</span><span class="cx">                         time_t when;
</span><span class="cx">
</span><span class="lines">@@ -544,7 +544,7 @@
</span><span class="cx">         char *argv[5] = { 0 };
</span><span class="cx">         char *mydata;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
</del><ins>+        if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
</ins><span class="cx">                 if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) {
</span><span class="cx">                         time_t when;
</span><span class="cx">                         switch_call_cause_t cause = SWITCH_CAUSE_ALLOTTED_TIMEOUT;
</span><span class="lines">@@ -577,7 +577,7 @@
</span><span class="cx">         char *argv[6] = { 0 };
</span><span class="cx">         char *mydata;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
</del><ins>+        if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
</ins><span class="cx">                 if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 2) {
</span><span class="cx">                         time_t when;
</span><span class="cx">                         switch_media_flag_t flags = SMF_NONE;
</span><span class="lines">@@ -611,7 +611,7 @@
</span><span class="cx"> {
</span><span class="cx">         uint32_t len = 0;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 len = 1000;
</span><span class="cx">         } else {
</span><span class="cx">                 len = atoi(data);
</span><span class="lines">@@ -630,7 +630,7 @@
</span><span class="cx"> {
</span><span class="cx">         switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data)) {
</del><ins>+        if (!zstr(data)) {
</ins><span class="cx">                 cause = switch_channel_str2cause(data);
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -640,7 +640,7 @@
</span><span class="cx"> SWITCH_STANDARD_APP(set_name_function)
</span><span class="cx"> {
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data)) {
</del><ins>+        if (!zstr(data)) {
</ins><span class="cx">                 switch_channel_set_name(switch_core_session_get_channel(session), (char *) data);
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="lines">@@ -660,7 +660,7 @@
</span><span class="cx">         char *mydata = NULL;
</span><span class="cx">         switch_channel_t *channel = switch_core_session_get_channel(session);
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(data) || !(mydata = switch_core_session_strdup(session, data))) {
</del><ins>+        if (zstr(data) || !(mydata = switch_core_session_strdup(session, data))) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "INVALID ARGS!\n");
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="lines">@@ -703,6 +703,17 @@
</span><span class="cx">         switch_core_session_receive_message(session, &msg);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+SWITCH_STANDARD_APP(warning_function)
+{
+        switch_core_session_message_t msg = { 0 };
+
+        /* Tell the channel to redirect */
+        msg.from = __FILE__;
+        msg.string_arg = data;
+        msg.message_id = SWITCH_MESSAGE_INDICATE_WARNING;
+        switch_core_session_receive_message(session, &msg);
+}
+
</ins><span class="cx"> SWITCH_STANDARD_APP(respond_function)
</span><span class="cx"> {
</span><span class="cx">         switch_core_session_message_t msg = { 0 };
</span><span class="lines">@@ -729,7 +740,7 @@
</span><span class="cx"> {
</span><span class="cx">         char *var, *val = NULL;
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No variable name specified.\n");
</span><span class="cx">         } else {
</span><span class="cx">                 switch_channel_t *channel = switch_core_session_get_channel(session);
</span><span class="lines">@@ -740,7 +751,7 @@
</span><span class="cx">
</span><span class="cx">                 if (val) {
</span><span class="cx">                         *val++ = '\0';
</span><del>-                        if (switch_strlen_zero(val)) {
</del><ins>+                        if (zstr(val)) {
</ins><span class="cx">                                 val = NULL;
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="lines">@@ -762,7 +773,7 @@
</span><span class="cx"> {
</span><span class="cx">         char *var, *val = NULL;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No variable name specified.\n");
</span><span class="cx">         } else {
</span><span class="cx">                 var = strdup(data);
</span><span class="lines">@@ -771,7 +782,7 @@
</span><span class="cx">
</span><span class="cx">                 if (val) {
</span><span class="cx">                         *val++ = '\0';
</span><del>-                        if (switch_strlen_zero(val)) {
</del><ins>+                        if (zstr(val)) {
</ins><span class="cx">                                 val = NULL;
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="lines">@@ -784,12 +795,9 @@
</span><span class="cx">
</span><span class="cx"> SWITCH_STANDARD_APP(set_profile_var_function)
</span><span class="cx"> {
</span><del>-        switch_caller_profile_t *caller_profile;
</del><span class="cx">         char *name, *val = NULL;
</span><span class="cx">
</span><del>-        caller_profile = switch_channel_get_caller_profile(switch_core_session_get_channel(session));
-
-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No variable name specified.\n");
</span><span class="cx">         } else {
</span><span class="cx">                 name = switch_core_session_strdup(session, data);
</span><span class="lines">@@ -797,64 +805,12 @@
</span><span class="cx">
</span><span class="cx">                 if (val) {
</span><span class="cx">                         *val++ = '\0';
</span><del>-                        if (switch_strlen_zero(val)) {
</del><ins>+                        if (zstr(val)) {
</ins><span class="cx">                                 val = NULL;
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-
-                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "SET_PROFILE_VAR [%s]=[%s]\n", name, val ? val : "UNDEF");
-
-                if (!strcasecmp(name, "dialplan")) {
-                        caller_profile->dialplan = val;
-                }
-                if (!strcasecmp(name, "username")) {
-                        caller_profile->username = val;
-                }
-                if (!strcasecmp(name, "caller_id_name")) {
-                        caller_profile->caller_id_name = val;
-                }
-                if (!strcasecmp(name, "caller_id_number")) {
-                        caller_profile->caller_id_number = val;
-                }
-                if (val && !strcasecmp(name, "caller_ton")) {
-                        caller_profile->caller_ton = (uint8_t) atoi(val);
-                }
-                if (val && !strcasecmp(name, "caller_numplan")) {
-                        caller_profile->caller_numplan = (uint8_t) atoi(val);
-                }
-                if (val && !strcasecmp(name, "destination_number_ton")) {
-                        caller_profile->destination_number_ton = (uint8_t) atoi(val);
-                }
-                if (val && !strcasecmp(name, "destination_number_numplan")) {
-                        caller_profile->destination_number_numplan = (uint8_t) atoi(val);
-                }
-                if (!strcasecmp(name, "ani")) {
-                        caller_profile->ani = val;
-                }
-                if (!strcasecmp(name, "aniii")) {
-                        caller_profile->aniii = val;
-                }
-                if (!strcasecmp(name, "network_addr")) {
-                        caller_profile->network_addr = val;
-                }
-                if (!strcasecmp(name, "rdnis")) {
-                        caller_profile->rdnis = val;
-                }
-                if (!strcasecmp(name, "destination_number")) {
-                        caller_profile->destination_number = val;
-                }
-                if (!strcasecmp(name, "uuid")) {
-                        caller_profile->uuid = val;
-                }
-                if (!strcasecmp(name, "source")) {
-                        caller_profile->source = val;
-                }
-                if (!strcasecmp(name, "context")) {
-                        caller_profile->context = val;
-                }
-                if (!strcasecmp(name, "chan_name")) {
-                        caller_profile->chan_name = val;
-                }
</del><ins>+                
+                switch_channel_set_profile_var(switch_core_session_get_channel(session), name, val);
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -865,7 +821,7 @@
</span><span class="cx">         char *new_exports = NULL, *new_exports_d = NULL, *var, *val = NULL, *var_name = NULL;
</span><span class="cx">         int local = 1;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No variable name specified.\n");
</span><span class="cx">         } else {
</span><span class="cx">                 exports = switch_channel_get_variable(channel, SWITCH_EXPORT_VARS_VARIABLE);
</span><span class="lines">@@ -882,7 +838,7 @@
</span><span class="cx">
</span><span class="cx">                 if (val) {
</span><span class="cx">                         *val++ = '\0';
</span><del>-                        if (switch_strlen_zero(val)) {
</del><ins>+                        if (zstr(val)) {
</ins><span class="cx">                                 val = NULL;
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="lines">@@ -908,7 +864,7 @@
</span><span class="cx">
</span><span class="cx"> SWITCH_STANDARD_APP(unset_function)
</span><span class="cx"> {
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No variable name specified.\n");
</span><span class="cx">         } else {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "UNSET [%s]\n", (char *) data);
</span><span class="lines">@@ -944,7 +900,7 @@
</span><span class="cx">         char *buf;
</span><span class="cx">         int level = SWITCH_LOG_INFO;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data)) {
</del><ins>+        if (!zstr(data)) {
</ins><span class="cx">                 level = switch_log_str2level(data);
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -971,7 +927,7 @@
</span><span class="cx">         char *lbuf;
</span><span class="cx">
</span><span class="cx">         if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_APPLICATION) == SWITCH_STATUS_SUCCESS) {
</span><del>-                if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
</del><ins>+                if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
</ins><span class="cx">                         && (argc = switch_separate_string(lbuf, ',', argv, (sizeof(argv) / sizeof(argv[0]))))) {
</span><span class="cx">                         int x = 0;
</span><span class="cx">
</span><span class="lines">@@ -1021,7 +977,7 @@
</span><span class="cx"> {
</span><span class="cx">         switch_caller_profile_t *caller_profile = switch_channel_get_caller_profile(switch_core_session_get_channel(session));
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No privacy mode specified.\n");
</span><span class="cx">         } else {
</span><span class="cx">                 switch_set_flag(caller_profile, SWITCH_CPF_SCREEN);
</span><span class="lines">@@ -1051,7 +1007,7 @@
</span><span class="cx">         int argc;
</span><span class="cx">         char *lbuf;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
</del><ins>+        if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
</ins><span class="cx">                 && (argc = switch_separate_string(lbuf, '=', argv, (sizeof(argv) / sizeof(argv[0])))) > 1) {
</span><span class="cx">                 switch_size_t retsize;
</span><span class="cx">                 switch_time_exp_t tm;
</span><span class="lines">@@ -1068,7 +1024,7 @@
</span><span class="cx"> {
</span><span class="cx">         switch_time_t out;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 out = switch_micro_time_now();
</span><span class="cx">         } else {
</span><span class="cx">                 out = switch_str_time(cmd);
</span><span class="lines">@@ -1086,14 +1042,14 @@
</span><span class="cx">         char date[80] = "";
</span><span class="cx">         switch_time_t thetime;
</span><span class="cx">         char *p;
</span><del>-        if (!switch_strlen_zero(cmd) && (p = strchr(cmd, '|'))) {
</del><ins>+        if (!zstr(cmd) && (p = strchr(cmd, '|'))) {
</ins><span class="cx">                 thetime = switch_time_make(atoi(cmd), 0);
</span><span class="cx">                 cmd = p + 1;
</span><span class="cx">         } else {
</span><span class="cx">                 thetime = switch_micro_time_now();
</span><span class="cx">         }
</span><span class="cx">         switch_time_exp_lt(&tm, thetime);
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 switch_strftime_nocheck(date, &retsize, sizeof(date), "%Y-%m-%d %T", &tm);
</span><span class="cx">         } else {
</span><span class="cx">                 switch_strftime(date, &retsize, sizeof(date), cmd, &tm);
</span><span class="lines">@@ -1113,7 +1069,7 @@
</span><span class="cx">         switch_event_types_t type = SWITCH_EVENT_PRESENCE_IN;
</span><span class="cx">         int need = 4;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (lbuf = strdup(cmd))
</del><ins>+        if (!zstr(cmd) && (lbuf = strdup(cmd))
</ins><span class="cx">                 && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) > 0) {
</span><span class="cx">
</span><span class="cx">                 if (!strcasecmp(argv[0], "out")) {
</span><span class="lines">@@ -1166,11 +1122,11 @@
</span><span class="cx">         char *lbuf = NULL, *argv[5];
</span><span class="cx">         int argc = 0;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (lbuf = strdup(cmd))
</del><ins>+        if (!zstr(cmd) && (lbuf = strdup(cmd))
</ins><span class="cx">                 && (argc = switch_separate_string(lbuf, '|', argv, (sizeof(argv) / sizeof(argv[0])))) >= 4) {
</span><span class="cx">
</span><span class="cx">                 if (switch_core_chat_send(argv[0], "dp", argv[1], argv[2], "", argv[3],
</span><del>-                                                                 !switch_strlen_zero(argv[4]) ? argv[4] : NULL , "") == SWITCH_STATUS_SUCCESS) {
</del><ins>+                                                                 !zstr(argv[4]) ? argv[4] : NULL , "") == SWITCH_STATUS_SUCCESS) {
</ins><span class="cx">                         stream->write_function(stream, "Sent");
</span><span class="cx">                 } else {
</span><span class="cx">                         stream->write_function(stream, "Error! Message Not Sent");
</span><span class="lines">@@ -1261,7 +1217,7 @@
</span><span class="cx"> {
</span><span class="cx">         switch_bool_t do_read = SWITCH_TRUE;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data)) {
</del><ins>+        if (!zstr(data)) {
</ins><span class="cx">                 if (!strcasecmp(data, "write")) {
</span><span class="cx">                         do_read = SWITCH_FALSE;
</span><span class="cx">                 }
</span><span class="lines">@@ -1295,7 +1251,7 @@
</span><span class="cx">         time_t to = 0;
</span><span class="cx">         int hits = 1;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(data) || !(mydata = switch_core_session_strdup(session, data))) {
</del><ins>+        if (zstr(data) || !(mydata = switch_core_session_strdup(session, data))) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "INVALID ARGS!\n");
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="lines">@@ -1417,7 +1373,7 @@
</span><span class="cx"> {
</span><span class="cx">         switch_channel_t *channel = switch_core_session_get_channel(session);
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No timeout specified.\n");
</span><span class="cx">         } else {
</span><span class="cx">                 uint32_t ms = atoi(data);
</span><span class="lines">@@ -1452,7 +1408,7 @@
</span><span class="cx">         char *mydata = NULL;
</span><span class="cx">         switch_input_args_t args = { 0 };
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(data) || !(mydata = switch_core_session_strdup(session, data))) {
</del><ins>+        if (zstr(data) || !(mydata = switch_core_session_strdup(session, data))) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Params!\n");
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="lines">@@ -1519,6 +1475,11 @@
</span><span class="cx">                         switch_channel_t *channel = switch_core_session_get_channel(session);
</span><span class="cx">                         switch_channel_t *peer_channel = switch_core_session_get_channel(peer_session);
</span><span class="cx">
</span><ins>+                        if (dtmf->digit == '*') {
+                                switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
+                                return SWITCH_STATUS_FALSE;
+                        }
+
</ins><span class="cx">                         if (dtmf->digit == '#') {
</span><span class="cx">                                 switch_channel_hangup(peer_channel, SWITCH_CAUSE_NORMAL_CLEARING);
</span><span class="cx">                                 return SWITCH_STATUS_FALSE;
</span><span class="lines">@@ -1528,7 +1489,7 @@
</span><span class="cx">                                 switch_caller_extension_t *extension = NULL;
</span><span class="cx">                                 const char *app = "three_way";
</span><span class="cx">                                 const char *app_arg = switch_core_session_get_uuid(session);
</span><del>-                                const char *holding = switch_channel_get_variable(channel, SWITCH_HOLDING_UUID_VARIABLE);
</del><ins>+                                const char *holding = switch_channel_get_variable(channel, SWITCH_SOFT_HOLDING_UUID_VARIABLE);
</ins><span class="cx">                                 switch_core_session_t *b_session;
</span><span class="cx">
</span><span class="cx">                                 if (holding && (b_session = switch_core_session_locate(holding))) {
</span><span class="lines">@@ -1584,12 +1545,10 @@
</span><span class="cx">
</span><span class="cx"> SWITCH_STANDARD_APP(att_xfer_function)
</span><span class="cx"> {
</span><del>-        const char *var;
</del><span class="cx">         switch_core_session_t *peer_session = NULL;
</span><span class="cx">         switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
</span><span class="cx">         switch_channel_t *channel, *peer_channel = NULL;
</span><span class="cx">         const char *bond = NULL;
</span><del>-        int timelimit = 60;
</del><span class="cx">         switch_core_session_t *b_session = NULL;
</span><span class="cx">
</span><span class="cx">         channel = switch_core_session_get_channel(session);
</span><span class="lines">@@ -1598,14 +1557,10 @@
</span><span class="cx">                 bond = switch_core_session_strdup(session, bond);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        switch_channel_set_variable(channel, SWITCH_HOLDING_UUID_VARIABLE, bond);
</del><ins>+        switch_channel_set_variable(channel, SWITCH_SOFT_HOLDING_UUID_VARIABLE, bond);
+        switch_channel_set_flag(channel, CF_XFER_ZOMBIE);
</ins><span class="cx">
</span><del>-
-        if ((var = switch_channel_get_variable(channel, SWITCH_CALL_TIMEOUT_VARIABLE))) {
-                timelimit = atoi(var);
-        }
-
-        if (switch_ivr_originate(session, &peer_session, &cause, data, timelimit, NULL, NULL, NULL, NULL, NULL, SOF_NONE)
</del><ins>+        if (switch_ivr_originate(session, &peer_session, &cause, data, 0, NULL, NULL, NULL, NULL, NULL, SOF_NONE)
</ins><span class="cx">                 != SWITCH_STATUS_SUCCESS || !peer_session) {
</span><span class="cx">                 goto end;
</span><span class="cx">         }
</span><span class="lines">@@ -1649,7 +1604,8 @@
</span><span class="cx">         switch_core_session_rwunlock(peer_session);
</span><span class="cx">
</span><span class="cx"> end:
</span><del>-        switch_channel_set_variable(channel, SWITCH_HOLDING_UUID_VARIABLE, NULL);
</del><ins>+        switch_channel_set_variable(channel, SWITCH_SOFT_HOLDING_UUID_VARIABLE, NULL);
+        switch_channel_clear_flag(channel, CF_XFER_ZOMBIE);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SWITCH_STANDARD_APP(read_function)
</span><span class="lines">@@ -1665,7 +1621,7 @@
</span><span class="cx">         const char *var_name = NULL;
</span><span class="cx">         const char *valid_terminators = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
</del><ins>+        if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
</ins><span class="cx">                 argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         } else {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No arguments specified.\n");
</span><span class="lines">@@ -1706,7 +1662,7 @@
</span><span class="cx">                 timeout = 1000;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(valid_terminators)) {
</del><ins>+        if (zstr(valid_terminators)) {
</ins><span class="cx">                 valid_terminators = "#";
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1729,7 +1685,7 @@
</span><span class="cx">         const char *valid_terminators = NULL;
</span><span class="cx">         const char *digits_regex = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
</del><ins>+        if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
</ins><span class="cx">                 argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         } else {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No arguments specified.\n");
</span><span class="lines">@@ -1782,7 +1738,7 @@
</span><span class="cx">                 timeout = 1000;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(valid_terminators)) {
</del><ins>+        if (zstr(valid_terminators)) {
</ins><span class="cx">                 valid_terminators = "#";
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1799,7 +1755,7 @@
</span><span class="cx">         switch_input_args_t args = { 0 };
</span><span class="cx">         switch_channel_t *channel = switch_core_session_get_channel(session);
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
</del><ins>+        if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
</ins><span class="cx">                 && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) == 4) {
</span><span class="cx">                 
</span><span class="cx">                 args.input_callback = on_dtmf;
</span><span class="lines">@@ -1821,7 +1777,7 @@
</span><span class="cx">         switch_channel_t *channel = switch_core_session_get_channel(session);
</span><span class="cx">         switch_status_t status;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
</del><ins>+        if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
</ins><span class="cx">                 const char *lang;
</span><span class="cx">                 char *macro = mydata;
</span><span class="cx">                 char *mdata = NULL;
</span><span class="lines">@@ -1901,6 +1857,37 @@
</span><span class="cx">
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+
+
+SWITCH_STANDARD_APP(endless_playback_function)
+{
+        switch_channel_t *channel = switch_core_session_get_channel(session);
+        switch_status_t status = SWITCH_STATUS_SUCCESS;
+        const char *file = data;
+        
+        while(switch_channel_ready(channel)) {
+                status = switch_ivr_play_file(session, NULL, file, NULL);
+
+                if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) {
+                        break;
+                }
+        }
+
+        switch (status) {
+        case SWITCH_STATUS_SUCCESS:
+        case SWITCH_STATUS_BREAK:
+                switch_channel_set_variable(channel, SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE, "FILE PLAYED");
+                break;
+        case SWITCH_STATUS_NOTFOUND:
+                switch_channel_set_variable(channel, SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE, "FILE NOT FOUND");
+                break;
+        default:
+                switch_channel_set_variable(channel, SWITCH_CURRENT_APPLICATION_RESPONSE_VARIABLE, "PLAYBACK ERROR");
+                break;
+        }
+
+}
+
</ins><span class="cx"> SWITCH_STANDARD_APP(gentones_function)
</span><span class="cx"> {
</span><span class="cx">         char *tone_script = NULL;
</span><span class="lines">@@ -1909,7 +1896,7 @@
</span><span class="cx">         int32_t loops = 0;
</span><span class="cx">         switch_channel_t *channel = switch_core_session_get_channel(session);
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(data) || !(tone_script = switch_core_session_strdup(session, data))) {
</del><ins>+        if (zstr(data) || !(tone_script = switch_core_session_strdup(session, data))) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Params!\n");
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="lines">@@ -1939,13 +1926,13 @@
</span><span class="cx">         char *lbuf = NULL;
</span><span class="cx">         char *flags = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
</del><ins>+        if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
</ins><span class="cx">                 && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
</span><span class="cx">                 path = argv[0];
</span><span class="cx">                 for (x = 1; x < argc; x++) {
</span><span class="cx">                         if (strchr(argv[x], '+')) {
</span><span class="cx">                                 limit = atoi(argv[x]);
</span><del>-                        } else if (!switch_strlen_zero(argv[x])) {
</del><ins>+                        } else if (!zstr(argv[x])) {
</ins><span class="cx">                                 flags = argv[x];
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="lines">@@ -1972,7 +1959,7 @@
</span><span class="cx">         const char *tmp;
</span><span class="cx">         int rate;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
</del><ins>+        if (!zstr(data) && (mydata = switch_core_session_strdup(session, data))) {
</ins><span class="cx">                 argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         } else {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No file specified.\n");
</span><span class="lines">@@ -2037,7 +2024,7 @@
</span><span class="cx">         char *path_end;
</span><span class="cx">         uint32_t limit = 0;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -2078,48 +2065,228 @@
</span><span class="cx"> /*                                                                Bridge Functions                                                                */
</span><span class="cx"> /********************************************************************************/
</span><span class="cx">
</span><ins>+static switch_status_t camp_fire(switch_core_session_t *session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen)
+{
+        switch (itype) {
+        case SWITCH_INPUT_TYPE_DTMF:
+                {
+                        switch_dtmf_t *dtmf = (switch_dtmf_t *) input;
+                        char *key = (char *) buf;
+
+                        if (dtmf->digit == *key) {
+                                return SWITCH_STATUS_BREAK;
+                        }
+                }
+        default:
+                break;
+        }
+
+        return SWITCH_STATUS_SUCCESS;
+}
+
+struct camping_stake {
+        switch_core_session_t *session;
+        int running;
+        int do_xfer;
+        const char *moh;
+};
+
+static void *SWITCH_THREAD_FUNC camp_music_thread(switch_thread_t *thread, void *obj)
+{
+        struct camping_stake *stake = (struct camping_stake *) obj;
+        switch_core_session_t *session = stake->session;
+        switch_channel_t *channel = switch_core_session_get_channel(stake->session);
+        const char *moh = stake->moh, *greet = NULL;
+        switch_input_args_t args = { 0 };
+        char dbuf[2] = "";
+        switch_status_t status = SWITCH_STATUS_FALSE;
+        const char *stop;
+
+        if ((stop = switch_channel_get_variable(channel, "campon_stop_key"))) {
+                *dbuf = *stop;
+        }
+
+        args.input_callback = camp_fire;
+        args.buf = dbuf;
+        args.buflen = sizeof(dbuf);
+        
+        switch_core_session_read_lock(session);
+
+        /* don't set this to a local_stream:// or you will not be happy */
+        if ((greet = switch_channel_get_variable(channel, "campon_announce_sound"))) {
+                status = switch_ivr_play_file(session, NULL, greet, &args);
+        }
+        
+        while(stake->running && switch_channel_ready(channel)) {
+                if (status != SWITCH_STATUS_BREAK) {
+                        if (!strcasecmp(moh, "silence")) {
+                                status = switch_ivr_collect_digits_callback(session, &args, 0, 0);
+                        } else {
+                                status = switch_ivr_play_file(session, NULL, stake->moh, &args);
+                        }
+                }
+
+                if (status == SWITCH_STATUS_BREAK) {
+                        switch_channel_set_flag(channel, CF_NOT_READY);
+                        stake->do_xfer = 1;
+                }
+        }
+        switch_core_session_rwunlock(session);
+
+        stake->running = 0;
+        return NULL;
+}
+
</ins><span class="cx"> SWITCH_STANDARD_APP(audio_bridge_function)
</span><span class="cx"> {
</span><span class="cx">         switch_channel_t *caller_channel = switch_core_session_get_channel(session);
</span><span class="cx">         switch_core_session_t *peer_session = NULL;
</span><del>-        unsigned int timelimit = 60;
-        const char *var, *continue_on_fail = NULL, *failure_causes = NULL;
</del><ins>+        const char *continue_on_fail = NULL, *failure_causes = NULL,
+                *v_campon = NULL, *v_campon_retries, *v_campon_sleep, *v_campon_timeout, *v_campon_fallback_exten = NULL;
</ins><span class="cx">         switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
</span><del>-
-        if (switch_strlen_zero(data)) {
</del><ins>+        int campon_retries = 100, campon_timeout = 10, campon_sleep = 10, tmp, camping = 0, fail = 0, thread_started = 0;
+        struct camping_stake stake = { 0 };
+        const char *moh = NULL;
+        switch_thread_t *thread = NULL;
+        switch_threadattr_t *thd_attr = NULL;
+        char *camp_data = NULL;
+        switch_status_t status;
+        
+        if (zstr(data)) {
</ins><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if ((var = switch_channel_get_variable(caller_channel, SWITCH_CALL_TIMEOUT_VARIABLE))) {
-                timelimit = atoi(var);
-        }
-
</del><span class="cx">         continue_on_fail = switch_channel_get_variable(caller_channel, "continue_on_fail");
</span><span class="cx">         failure_causes = switch_channel_get_variable(caller_channel, "failure_causes");
</span><span class="cx">
</span><del>-        if ((var = switch_channel_get_variable(caller_channel, SWITCH_PROXY_MEDIA_VARIABLE)) && switch_true(var)) {
-                switch_channel_set_flag(caller_channel, CF_PROXY_MEDIA);
-        }
</del><ins>+        if ((v_campon = switch_channel_get_variable(caller_channel, "campon")) && switch_true(v_campon)) {
+                const char *cid_name = NULL;
+                const char *cid_number = NULL;
+                
+                if (!(cid_name = switch_channel_get_variable(caller_channel, "effective_caller_id_name"))) {
+                        cid_name = switch_channel_get_variable(caller_channel, "caller_id_name");
+                }
</ins><span class="cx">
</span><del>-        if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE)
-                || ((var = switch_channel_get_variable(caller_channel, SWITCH_BYPASS_MEDIA_VARIABLE)) && switch_true(var))) {
-                if (!switch_channel_test_flag(caller_channel, CF_ANSWERED)
-                        && !switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA)) {
-                        switch_channel_set_flag(caller_channel, CF_PROXY_MODE);
</del><ins>+                if (!(cid_number = switch_channel_get_variable(caller_channel, "effective_caller_id_number"))) {
+                        cid_number = switch_channel_get_variable(caller_channel, "caller_id_number");
+                }
+
+                if (cid_name && !cid_number) {
+                        cid_number = cid_name;
+                }
+
+                if (cid_number && !cid_name) {
+                        cid_name = cid_number;
+                }
+
+                v_campon_retries = switch_channel_get_variable(caller_channel, "campon_retries");
+                v_campon_timeout = switch_channel_get_variable(caller_channel, "campon_timeout");
+                v_campon_sleep = switch_channel_get_variable(caller_channel, "campon_sleep");
+                v_campon_fallback_exten = switch_channel_get_variable(caller_channel, "campon_fallback_exten");
+                
+                if (v_campon_retries) {
+                        if ((tmp = atoi(v_campon_retries)) > 0) {
+                                campon_retries = tmp;
+                        }
+                }
+
+                if (v_campon_timeout) {
+                        if ((tmp = atoi(v_campon_timeout)) > 0) {
+                                campon_timeout = tmp;
+                        }
+                }
+
+                if (v_campon_sleep) {
+                        if ((tmp = atoi(v_campon_sleep)) > 0) {
+                                campon_sleep = tmp;
+                        }
+                }
+
+                switch_channel_answer(caller_channel);
+                camping = 1;
+
+                if (cid_name && cid_number) {
+                        camp_data = switch_core_session_sprintf(session, "{origination_caller_id_name='%s',origination_caller_id_number='%s'}%s",
+                                                                                                        cid_name, cid_number, data);
</ins><span class="cx">                 } else {
</span><del>-                        if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE)) {
-                                switch_ivr_media(switch_core_session_get_uuid(session), SMF_REBRIDGE);
-                                switch_channel_set_flag(caller_channel, CF_PROXY_MODE);
</del><ins>+                        camp_data = (char *)data;
+                }
+
+                if (!(moh = switch_channel_get_variable(caller_channel, "hold_music"))) {
+                        moh = switch_channel_get_variable(caller_channel, "campon_hold_music");
+                }
+
+                do {
+                        fail = 0;
+                        status = switch_ivr_originate(NULL, &peer_session, &cause, camp_data, campon_timeout, NULL, NULL, NULL, NULL, NULL, SOF_NONE);
+                        
+                        if (!switch_channel_ready(caller_channel)) {
+                                fail = 1;
+                                break;
+                        }
+                        
+                        if (status == SWITCH_STATUS_SUCCESS) {
+                                camping = 0;
+                                break;
</ins><span class="cx">                         } else {
</span><del>-                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Channel is already up, delaying proxy mode 'till both legs are answered.\n");
-                                switch_channel_set_variable(caller_channel, "bypass_media_after_bridge", "true");
-                                switch_channel_set_variable(caller_channel, SWITCH_BYPASS_MEDIA_VARIABLE, NULL);
-                                switch_channel_clear_flag(caller_channel, CF_PROXY_MODE);
</del><ins>+                                fail = 1;
</ins><span class="cx">                         }
</span><ins>+                        
+                        if (camping) {
+                                
+                                if (!thread_started && fail && moh && !switch_channel_test_flag(caller_channel, CF_PROXY_MODE) &&
+                                        !switch_channel_test_flag(caller_channel, CF_PROXY_MEDIA) &&
+                                        !switch_true(switch_channel_get_variable(caller_channel, "bypass_media"))) {
+                                        switch_threadattr_create(&thd_attr, switch_core_session_get_pool(session));
+                                        switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
+                                        stake.running = 1;
+                                        stake.moh = moh;
+                                        stake.session = session;
+                                        switch_thread_create(&thread, thd_attr, camp_music_thread, &stake, switch_core_session_get_pool(session));
+                                        thread_started = 1;
+                                }
+
+
+                                if (--campon_retries <= 0 || stake.do_xfer) {
+                                        camping = 0;
+                                        stake.do_xfer = 1;
+                                        break;
+                                }
+
+                                if (fail) {
+                                        int64_t wait = campon_sleep * 1000000;
+                                        
+                                        while(stake.running && wait > 0 && switch_channel_ready(caller_channel)) {
+                                                switch_yield(100000);
+                                                wait -= 100000;
+                                        }
+                                }
+                        }
+                } while (camping && switch_channel_ready(caller_channel));
+                
+                if (thread) {
+                        stake.running = 0;
+                        switch_channel_set_flag(caller_channel, CF_NOT_READY);
+                        switch_thread_join(&status, thread);
</ins><span class="cx">                 }
</span><ins>+
+                switch_channel_clear_flag(caller_channel, CF_NOT_READY);
+                
+                if (stake.do_xfer && !zstr(v_campon_fallback_exten)) {
+                        switch_ivr_session_transfer(session,
+                                                                                v_campon_fallback_exten,
+                                                                                switch_channel_get_variable(caller_channel, "campon_fallback_dialplan"),
+                                                                                switch_channel_get_variable(caller_channel, "campon_fallback_context"));
+                        return;
+                }
+
+        } else {
+                if ((status = switch_ivr_originate(session, &peer_session, &cause, data, 0, NULL, NULL, NULL, NULL, NULL, SOF_NONE)) != SWITCH_STATUS_SUCCESS) {
+                        fail = 1;
+                }
</ins><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_ivr_originate(session, &peer_session, &cause, data, timelimit, NULL, NULL, NULL, NULL, NULL, SOF_NONE) != SWITCH_STATUS_SUCCESS) {
</del><ins>+        if (fail) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Originate Failed. Cause: %s\n", switch_channel_cause2str(cause));
</span><span class="cx">
</span><span class="cx">                 /*
</span><span class="lines">@@ -2237,11 +2404,11 @@
</span><span class="cx">         switch_originate_flag_t myflags = SOF_NONE;
</span><span class="cx">         char *cid_name_override = NULL;
</span><span class="cx">         char *cid_num_override = NULL;
</span><del>-        const char *var, *skip = NULL;
-        unsigned int timelimit = 60;
</del><span class="cx">         char *domain = NULL;
</span><span class="cx">         switch_channel_t *new_channel = NULL;
</span><del>-        
</del><ins>+        unsigned int timelimit = 60;
+        const char *skip, *var;
+
</ins><span class="cx">         group = strdup(outbound_profile->destination_number);
</span><span class="cx">
</span><span class="cx">         if (!group) goto done;
</span><span class="lines">@@ -2359,7 +2526,7 @@
</span><span class="cx">         char stupid[128] = "";
</span><span class="cx">         const char *skip = NULL, *var = NULL;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(outbound_profile->destination_number)) {
</del><ins>+        if (zstr(outbound_profile->destination_number)) {
</ins><span class="cx">                 goto done;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -2590,7 +2757,7 @@
</span><span class="cx">         int argc;
</span><span class="cx">         char *lbuf = NULL;
</span><span class="cx">         
</span><del>-        if (!switch_strlen_zero(data) && (lbuf = switch_core_session_strdup(session, data))
</del><ins>+        if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
</ins><span class="cx">                 && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 3) {
</span><span class="cx">                 thresh = atoi(argv[0]);
</span><span class="cx">                 silence_hits = atoi(argv[1]);
</span><span class="lines">@@ -2667,7 +2834,7 @@
</span><span class="cx">
</span><span class="cx">                 if (proto) {
</span><span class="cx">                         switch_core_chat_send(proto, "api", to, hint && strchr(hint, '/') ? hint : from,
</span><del>-                                                                 !switch_strlen_zero(type) ? type : NULL, (char *) stream.data, NULL, NULL);
</del><ins>+                                                                 !zstr(type) ? type : NULL, (char *) stream.data, NULL, NULL);
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 switch_safe_free(stream.data);
</span><span class="lines">@@ -2765,6 +2932,8 @@
</span><span class="cx">                                  SAF_SUPPORT_NOMEDIA);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, "send_display", "Send session a new display", "Send session a new display.", display_function, "<text>",
</span><span class="cx">                                  SAF_SUPPORT_NOMEDIA);
</span><ins>+        SWITCH_ADD_APP(app_interface, "send_warning", "Send session a popup", "Send session a popup.", warning_function, "<text>",
+                                 SAF_SUPPORT_NOMEDIA);
</ins><span class="cx">         SWITCH_ADD_APP(app_interface, "respond", "Send session respond", "Send a respond message to a session.", respond_function, "<respond_data>",
</span><span class="cx">                                  SAF_SUPPORT_NOMEDIA);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, "deflect", "Send call deflect", "Send a call deflect.", deflect_function, "<deflect_data>", SAF_SUPPORT_NOMEDIA);
</span><span class="lines">@@ -2808,6 +2977,8 @@
</span><span class="cx">         SWITCH_ADD_APP(app_interface, "park_state", "Park State", "Park State", park_state_function, "", SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, "gentones", "Generate Tones", "Generate tones to the channel", gentones_function, "<tgml_script>[|<loops>]", SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, "playback", "Playback File", "Playback a file to the channel", playback_function, "<path>", SAF_NONE);
</span><ins>+        SWITCH_ADD_APP(app_interface, "endless_playback", "Playback File Endlessly", "Endlessly Playback a file to the channel",
+                                 endless_playback_function, "<path>", SAF_NONE);
</ins><span class="cx">         SWITCH_ADD_APP(app_interface, "att_xfer", "Attended Transfer", "Attended Transfer", att_xfer_function, "<channel_url>", SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, "read", "Read Digits", "Read Digits", read_function, "<min> <max> <file> <var_name> <timeout> <terminators>", SAF_NONE);
</span><span class="cx">         SWITCH_ADD_APP(app_interface, "play_and_get_digits", "Play and get Digits", "Play and get Digits",
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_easyroutemod_easyroutec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_easyroute/mod_easyroute.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_easyroute/mod_easyroute.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_easyroute/mod_easyroute.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -125,13 +125,13 @@
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx"> done:
</span><del>-        if (switch_strlen_zero(globals.db_username)) {
</del><ins>+        if (zstr(globals.db_username)) {
</ins><span class="cx">                 set_global_db_username("root");
</span><span class="cx">         }
</span><del>-        if (switch_strlen_zero(globals.db_password)) {
</del><ins>+        if (zstr(globals.db_password)) {
</ins><span class="cx">                 set_global_db_password("password");
</span><span class="cx">         }
</span><del>-        if (switch_strlen_zero(globals.db_dsn)) {
</del><ins>+        if (zstr(globals.db_dsn)) {
</ins><span class="cx">                 set_global_db_dsn("easyroute");
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -208,25 +208,25 @@
</span><span class="cx">                 char tmp_profile[129];
</span><span class="cx">                 char tmp_gateway[129];
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(pdata.limit)) {
</del><ins>+                if (zstr(pdata.limit)) {
</ins><span class="cx">                         switch_set_string(results->limit, "9999" );
</span><span class="cx">                 } else {
</span><span class="cx">                         switch_set_string(results->limit, pdata.limit );
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(pdata.techprofile)){
</del><ins>+                if (zstr(pdata.techprofile)){
</ins><span class="cx">                         switch_set_string(tmp_profile, globals.default_techprofile);
</span><span class="cx">                 } else {
</span><span class="cx">                         switch_set_string(tmp_profile, pdata.techprofile);
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(pdata.gateway)){
</del><ins>+                if (zstr(pdata.gateway)){
</ins><span class="cx">                         switch_set_string(tmp_gateway, globals.default_gateway);
</span><span class="cx">                 } else {
</span><span class="cx">                         switch_set_string(tmp_gateway, pdata.gateway);
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(pdata.translated)){
</del><ins>+                if (zstr(pdata.translated)){
</ins><span class="cx">                         switch_set_string(results->translated, dn);
</span><span class="cx">                 } else {
</span><span class="cx">                         switch_set_string(results->translated, pdata.translated);
</span><span class="lines">@@ -240,13 +240,13 @@
</span><span class="cx">                 }
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "THE ROUTE [%s]\n", results->dialstring);
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(pdata.group)){
</del><ins>+                if (zstr(pdata.group)){
</ins><span class="cx">                         switch_set_string(results->group, "");
</span><span class="cx">                 } else {
</span><span class="cx">                         switch_set_string(results->group, pdata.group);
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(pdata.acctcode)){
</del><ins>+                if (zstr(pdata.acctcode)){
</ins><span class="cx">                         switch_set_string(results->acctcode, "");
</span><span class="cx">                 } else {
</span><span class="cx">                         switch_set_string(results->acctcode, pdata.acctcode);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_enummod_enumc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_enum/mod_enum.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_enum/mod_enum.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_enum/mod_enum.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -471,7 +471,7 @@
</span><span class="cx">                 root = mroot;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(root)) {
</del><ins>+        if (zstr(root)) {
</ins><span class="cx">                 root = globals.root;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -675,7 +675,7 @@
</span><span class="cx">         char *last_delim = "|";
</span><span class="cx">         int ok = 0;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "%s", "none");
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_esfmod_esfc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_esf/mod_esf.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_esf/mod_esf.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_esf/mod_esf.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx">
</span><span class="cx"> switch_core_session_get_read_impl(session, &read_impl);
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero((char *) data)) {
</del><ins>+        if (!zstr((char *) data)) {
</ins><span class="cx">                 mydata = switch_core_session_strdup(session, data);
</span><span class="cx">                 assert(mydata != NULL);
</span><span class="cx">
</span><span class="lines">@@ -93,20 +93,20 @@
</span><span class="cx">                         mcast_ip = switch_core_session_strdup(session, var);
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(argv[0])) {
</del><ins>+                if (!zstr(argv[0])) {
</ins><span class="cx">                         mcast_ip = argv[0];
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(argv[1])) {
</del><ins>+                if (!zstr(argv[1])) {
</ins><span class="cx">                         mcast_port_str = argv[1];
</span><span class="cx">                         mcast_port = (switch_port_t) atoi(mcast_port_str);
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(argv[2])) {
</del><ins>+                if (!zstr(argv[2])) {
</ins><span class="cx">                         mcast_control_port = (switch_port_t) atoi(argv[2]);
</span><span class="cx">                 }
</span><span class="cx">                 
</span><del>-                if (!switch_strlen_zero(argv[3])) {
</del><ins>+                if (!zstr(argv[3])) {
</ins><span class="cx">                         mcast_ttl = atoi(argv[3]);
</span><span class="cx">                         if (mcast_ttl < 1 || mcast_ttl > 255) {
</span><span class="cx">                                 mcast_ttl = 1;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_exprmod_exprc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_expr/mod_expr.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_expr/mod_expr.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_expr/mod_expr.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">         size_t len;
</span><span class="cx">         int ec = 0;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 goto error;
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_faxmod_faxc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_fax/mod_fax.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_fax/mod_fax.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_fax/mod_fax.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -133,7 +133,7 @@
</span><span class="cx">                 break;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(msg)) {
</del><ins>+        if (!zstr(msg)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, fs_log_level, "%s", msg);
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="lines">@@ -511,7 +511,7 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data)) {
</del><ins>+        if (!zstr(data)) {
</ins><span class="cx">                 pvt->filename = switch_core_session_strdup(session, data);
</span><span class="cx">                 if (pvt->app_mode == FUNCTION_TX) {
</span><span class="cx">                         if ((switch_file_exists(pvt->filename, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS)) {
</span><span class="lines">@@ -706,11 +706,11 @@
</span><span class="cx">                                 const char *name = switch_xml_attr(x_list, "name");
</span><span class="cx">                                 const char *value = switch_xml_attr(x_list, "value");
</span><span class="cx">
</span><del>-                                if (switch_strlen_zero(name)) {
</del><ins>+                                if (zstr(name)) {
</ins><span class="cx">                                         continue;
</span><span class="cx">                                 }
</span><span class="cx">
</span><del>-                                if (switch_strlen_zero(value)) {
</del><ins>+                                if (zstr(value)) {
</ins><span class="cx">                                         continue;
</span><span class="cx">                                 }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_fifomod_fifoc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_fifo/mod_fifo.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_fifo/mod_fifo.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_fifo/mod_fifo.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -59,6 +59,23 @@
</span><span class="cx">
</span><span class="cx"> typedef struct fifo_node fifo_node_t;
</span><span class="cx">
</span><ins>+struct callback {
+        char *buf;
+        size_t len;
+        int matches;
+};
+typedef struct callback callback_t;
+
+static int sql2str_callback(void *pArg, int argc, char **argv, char **columnNames)
+{
+        callback_t *cbt = (callback_t *) pArg;
+
+        switch_copy_string(cbt->buf, argv[0], cbt->len);
+        cbt->matches++;
+        return 0;
+}
+
+
</ins><span class="cx"> static switch_status_t on_dtmf(switch_core_session_t *session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen)
</span><span class="cx"> {
</span><span class="cx">         switch_core_session_t *bleg = (switch_core_session_t *) buf;
</span><span class="lines">@@ -72,7 +89,7 @@
</span><span class="cx">
</span><span class="cx">                         const char *consumer_exit_key = switch_channel_get_variable(channel, "fifo_consumer_exit_key");
</span><span class="cx">
</span><del>-                        if (switch_channel_test_flag(switch_core_session_get_channel(session), CF_ORIGINATOR)) {
</del><ins>+                        if (switch_channel_test_flag(switch_core_session_get_channel(session), CF_BRIDGE_ORIGINATOR)) {
</ins><span class="cx">                                 if ( consumer_exit_key && dtmf->digit == *consumer_exit_key ) {
</span><span class="cx">                                         switch_channel_hangup(bchan, SWITCH_CAUSE_NORMAL_CLEARING);
</span><span class="cx">                                         return SWITCH_STATUS_BREAK;
</span><span class="lines">@@ -129,7 +146,7 @@
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#define check_string(s) if (!switch_strlen_zero(s) && !strcasecmp(s, "undef")) { s = NULL; }
</del><ins>+#define check_string(s) if (!zstr(s) && !strcasecmp(s, "undef")) { s = NULL; }
</ins><span class="cx">
</span><span class="cx"> static int node_consumer_wait_count(fifo_node_t *node)
</span><span class="cx"> {
</span><span class="lines">@@ -280,7 +297,7 @@
</span><span class="cx">                 if (switch_odbc_handle_exec(globals.master_odbc, sql, &stmt) != SWITCH_ODBC_SUCCESS) {
</span><span class="cx">                         
</span><span class="cx">                         err_str = switch_odbc_handle_get_error(globals.master_odbc, stmt);
</span><del>-                        if (!switch_strlen_zero(err_str)) {
</del><ins>+                        if (!zstr(err_str)) {
</ins><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERR: [%s]\n[%s]\n", sql, switch_str_nil(err_str));
</span><span class="cx">                         }
</span><span class="cx">                         switch_safe_free(err_str);
</span><span class="lines">@@ -349,11 +366,14 @@
</span><span class="cx">         return ret;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static fifo_node_t *create_node(const char *name, uint32_t importance)
</del><ins>+static fifo_node_t *create_node(const char *name, uint32_t importance, switch_mutex_t *mutex)
</ins><span class="cx"> {
</span><span class="cx">         fifo_node_t *node;
</span><span class="cx">         int x = 0;
</span><span class="cx">         switch_memory_pool_t *pool;
</span><ins>+        char outbound_count[80] = "";
+        callback_t cbt = { 0 };
+        char *sql = NULL;
</ins><span class="cx">
</span><span class="cx">         if (!globals.running) {
</span><span class="cx">                 return NULL;
</span><span class="lines">@@ -373,7 +393,17 @@
</span><span class="cx">         switch_core_hash_init(&node->consumer_hash, node->pool);
</span><span class="cx">         switch_thread_rwlock_create(&node->rwlock, node->pool);
</span><span class="cx">         switch_mutex_init(&node->mutex, SWITCH_MUTEX_NESTED, node->pool);
</span><ins>+        cbt.buf = outbound_count;
+        cbt.len = sizeof(outbound_count);
+        sql = switch_mprintf("select count(*) from fifo_outbound where fifo_name = '%q'", name);
+        fifo_execute_sql_callback(mutex, sql, sql2str_callback, &cbt);
+        if (atoi(outbound_count) > 0) {
+                node->has_outbound = 1;
+        }
+        switch_safe_free(sql);
+
</ins><span class="cx">         node->importance = importance;
</span><ins>+
</ins><span class="cx">         switch_mutex_lock(globals.mutex);
</span><span class="cx">         switch_core_hash_insert(globals.fifo_hash, name, node);
</span><span class="cx">         switch_mutex_unlock(globals.mutex);
</span><span class="lines">@@ -560,20 +590,22 @@
</span><span class="cx">                 switch_mutex_lock(globals.mutex);
</span><span class="cx">                 for (hi = switch_hash_first(NULL, globals.fifo_hash); hi; hi = switch_hash_next(hi)) {
</span><span class="cx">                         switch_hash_this(hi, &var, NULL, &val);
</span><del>-                        if ((node = (fifo_node_t *) val) && node->has_outbound && node->ready) {
</del><ins>+                        if ((node = (fifo_node_t *) val)) {
+                        if (node->has_outbound && node->ready) {
</ins><span class="cx">                                 switch_mutex_lock(node->mutex);
</span><span class="cx">                                 ppl_waiting = node_consumer_wait_count(node);
</span><span class="cx">                                 consumer_total = node->consumer_count;
</span><span class="cx">                                 idle_consumers = node_idle_consumers(node);
</span><span class="cx">
</span><del>-                                //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
-                                //"%s waiting %d consumer_total %d idle_consumers %d ring_consumers\n", node->name, ppl_waiting, consumer_total, idle_consumers, node->ring_consumer_count);
</del><ins>+                                /* switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
+                                "%s waiting %d consumer_total %d idle_consumers %d ring_consumers %d\n", node->name, ppl_waiting, consumer_total, idle_consumers, node->ring_consumer_count); */
</ins><span class="cx">                 
</span><span class="cx">                                 if ((ppl_waiting - node->ring_consumer_count > 0)&& (!consumer_total || !idle_consumers)) {
</span><span class="cx">                                         find_consumers(node);
</span><span class="cx">                                 }
</span><span class="cx">                                 switch_mutex_unlock(node->mutex);
</span><span class="cx">                         }
</span><ins>+                        }
</ins><span class="cx">                 }
</span><span class="cx">                 switch_mutex_unlock(globals.mutex);
</span><span class="cx">
</span><span class="lines">@@ -678,7 +710,8 @@
</span><span class="cx">
</span><span class="cx">         switch_mutex_lock(globals.mutex);
</span><span class="cx">         if (!(node = switch_core_hash_find(globals.fifo_hash, node_name))) {
</span><del>-                node = create_node(node_name, 0);
</del><ins>+                node = create_node(node_name, 0, globals.sql_mutex);
+                node->ready = 1;
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         send_presence(node);
</span><span class="lines">@@ -700,7 +733,7 @@
</span><span class="cx">         switch_mutex_lock(globals.mutex);
</span><span class="cx">
</span><span class="cx">         if (!(node = switch_core_hash_find(globals.fifo_hash, node_name))) {
</span><del>-                node = create_node(node_name, 0);
</del><ins>+                node = create_node(node_name, 0, globals.sql_mutex);
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         switch_mutex_unlock(globals.mutex);
</span><span class="lines">@@ -719,7 +752,7 @@
</span><span class="cx">         int argc;
</span><span class="cx">         uint32_t priority = 0;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 goto fail;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -786,7 +819,7 @@
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No Args\n");
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="lines">@@ -839,7 +872,8 @@
</span><span class="cx">
</span><span class="cx">                 
</span><span class="cx">                 if (!(node = switch_core_hash_find(globals.fifo_hash, nlist[i]))) {
</span><del>-                        node = create_node(nlist[i], importance);
</del><ins>+                        node = create_node(nlist[i], importance, globals.sql_mutex);
+                        node->ready = 1;
</ins><span class="cx">                 }
</span><span class="cx">                 node_list[node_count++] = node;
</span><span class="cx">         }
</span><span class="lines">@@ -1105,7 +1139,7 @@
</span><span class="cx">                 fifo_strategy_t strat = STRAT_WAITING_LONGER;
</span><span class="cx">                 char *url = NULL;
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(strat_str)) {
</del><ins>+                if (!zstr(strat_str)) {
</ins><span class="cx">                         if (!strcasecmp(strat_str, "more_ppl")) {
</span><span class="cx">                                 strat = STRAT_MORE_PPL;
</span><span class="cx">                         } else if (!strcasecmp(strat_str, "waiting_longer")) {
</span><span class="lines">@@ -1455,7 +1489,7 @@
</span><span class="cx">                                 fifo_consumer_wrapup_sound = switch_channel_get_variable(channel, "fifo_consumer_wrapup_sound");
</span><span class="cx">                                 fifo_consumer_wrapup_key = switch_channel_get_variable(channel, "fifo_consumer_wrapup_key");
</span><span class="cx">                                 sfifo_consumer_wrapup_time = switch_channel_get_variable(channel, "fifo_consumer_wrapup_time");
</span><del>-                                if (!switch_strlen_zero(sfifo_consumer_wrapup_time)){
</del><ins>+                                if (!zstr(sfifo_consumer_wrapup_time)){
</ins><span class="cx">                                         fifo_consumer_wrapup_time = atoi(sfifo_consumer_wrapup_time);
</span><span class="cx">                                 } else {
</span><span class="cx">                                         fifo_consumer_wrapup_time = 5000;
</span><span class="lines">@@ -1463,7 +1497,7 @@
</span><span class="cx">
</span><span class="cx">                                 memset(buf, 0, sizeof(buf));
</span><span class="cx">
</span><del>-                                if (fifo_consumer_wrapup_time || !switch_strlen_zero(fifo_consumer_wrapup_key)) {
</del><ins>+                                if (fifo_consumer_wrapup_time || !zstr(fifo_consumer_wrapup_key)) {
</ins><span class="cx">                                         switch_channel_set_variable(channel, "fifo_status", "WRAPUP");
</span><span class="cx">                                         if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                                 switch_channel_event_set_data(channel, event);
</span><span class="lines">@@ -1473,7 +1507,7 @@
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><span class="cx">
</span><del>-                                if (!switch_strlen_zero(fifo_consumer_wrapup_sound)) {
</del><ins>+                                if (!zstr(fifo_consumer_wrapup_sound)) {
</ins><span class="cx">                                         memset(&args, 0, sizeof(args));
</span><span class="cx">                                         args.buf = buf;
</span><span class="cx">                                         args.buflen = sizeof(buf);
</span><span class="lines">@@ -1484,7 +1518,7 @@
</span><span class="cx">                                         wrapup_time_started = switch_micro_time_now();
</span><span class="cx">                                 }
</span><span class="cx">
</span><del>-                                if (!switch_strlen_zero(fifo_consumer_wrapup_key) && strcmp(buf, fifo_consumer_wrapup_key)) {
</del><ins>+                                if (!zstr(fifo_consumer_wrapup_key) && strcmp(buf, fifo_consumer_wrapup_key)) {
</ins><span class="cx">                                         while(switch_channel_ready(channel)) {
</span><span class="cx">                                                 char terminator = 0;
</span><span class="cx">                                                 
</span><span class="lines">@@ -1503,7 +1537,7 @@
</span><span class="cx">                                                 }
</span><span class="cx">
</span><span class="cx">                                         }
</span><del>-                                } else if (fifo_consumer_wrapup_time && (switch_strlen_zero(fifo_consumer_wrapup_key) || !strcmp(buf, fifo_consumer_wrapup_key))) {
</del><ins>+                                } else if (fifo_consumer_wrapup_time && (zstr(fifo_consumer_wrapup_key) || !strcmp(buf, fifo_consumer_wrapup_key))) {
</ins><span class="cx">                                         while(switch_channel_ready(channel)) {
</span><span class="cx">                                                 wrapup_time_elapsed = (switch_micro_time_now() - wrapup_time_started) / 1000;
</span><span class="cx">                                                 if (wrapup_time_elapsed > fifo_consumer_wrapup_time) {
</span><span class="lines">@@ -1727,12 +1761,12 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd)) {
</del><ins>+        if (!zstr(cmd)) {
</ins><span class="cx">                 data = strdup(cmd);
</span><span class="cx">                 switch_assert(data);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd) || (argc = switch_separate_string(data, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) < 1 || !argv[0]) {
</del><ins>+        if (zstr(cmd) || (argc = switch_separate_string(data, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) < 1 || !argv[0]) {
</ins><span class="cx">                 stream->write_function(stream, "%s\n", FIFO_API_SYNTAX);
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -1846,6 +1880,7 @@
</span><span class="cx">         switch_core_db_t *db;
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_SUCCESS;        
</span><span class="cx">         char *sql;
</span><ins>+        switch_bool_t delete_all_outbound_member_on_startup = SWITCH_FALSE;
</ins><span class="cx">
</span><span class="cx">         gethostname(globals.hostname, sizeof(globals.hostname));
</span><span class="cx">
</span><span class="lines">@@ -1862,7 +1897,7 @@
</span><span class="cx">                         var = (char *) switch_xml_attr_soft(param, "name");
</span><span class="cx">                         val = (char *) switch_xml_attr_soft(param, "value");
</span><span class="cx">
</span><del>-                        if (!strcasecmp(var, "odbc-dsn") && !switch_strlen_zero(val)) {
</del><ins>+                        if (!strcasecmp(var, "odbc-dsn") && !zstr(val)) {
</ins><span class="cx">                                 if (switch_odbc_available()) {
</span><span class="cx">                                         globals.odbc_dsn = switch_core_strdup(globals.pool, val);
</span><span class="cx">                                         if ((odbc_user = strchr(globals.odbc_dsn, ':'))) {
</span><span class="lines">@@ -1874,12 +1909,13 @@
</span><span class="cx">                                 } else {
</span><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ODBC IS NOT AVAILABLE!\n");
</span><span class="cx">                                 }
</span><ins>+                        } else if (!strcasecmp(var, "delete-all-outbound-member-on-startup")) {
+                                delete_all_outbound_member_on_startup = switch_true(val);
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-
-        if (switch_strlen_zero(globals.odbc_dsn) || switch_strlen_zero(odbc_user) || switch_strlen_zero(odbc_pass)) {
</del><ins>+        if (zstr(globals.odbc_dsn) || zstr(odbc_user) || zstr(odbc_pass)) {
</ins><span class="cx">                 globals.dbname = "fifo";
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1903,7 +1939,7 @@
</span><span class="cx">                 }
</span><span class="cx">         } else {
</span><span class="cx">                 if ((db = switch_core_db_open_file(globals.dbname))) {
</span><del>-                        switch_core_db_test_reactive(db, "delete from fifo_outbound", NULL, (char *)outbound_sql);
</del><ins>+                        switch_core_db_test_reactive(db, "delete from fifo_outbound where static = 1", NULL, (char *)outbound_sql);
</ins><span class="cx">                 } else {
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot Open SQL Database!\n");
</span><span class="cx">                         status = SWITCH_STATUS_FALSE;
</span><span class="lines">@@ -1926,7 +1962,7 @@
</span><span class="cx">                 switch_mutex_unlock(globals.mutex);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (del_all) {
</del><ins>+        if ((reload && del_all) || (!reload && delete_all_outbound_member_on_startup) ) {
</ins><span class="cx">                 sql = switch_mprintf("delete from fifo_outbound where hostname='%q'", globals.hostname);
</span><span class="cx">         } else {
</span><span class="cx">                 sql = switch_mprintf("delete from fifo_outbound where static=1 and hostname='%q'", globals.hostname);
</span><span class="lines">@@ -1962,7 +1998,7 @@
</span><span class="cx">
</span><span class="cx">                         switch_mutex_lock(globals.mutex);
</span><span class="cx">                         if (!(node = switch_core_hash_find(globals.fifo_hash, name))) {
</span><del>-                                node = create_node(name, imp);
</del><ins>+                                node = create_node(name, imp, globals.sql_mutex);
</ins><span class="cx">                         }
</span><span class="cx">                         switch_mutex_unlock(globals.mutex);
</span><span class="cx">                         
</span><span class="lines">@@ -1999,16 +2035,27 @@
</span><span class="cx">                                 if ((p = strchr(name_dup, '@'))) {
</span><span class="cx">                                         *p = '\0';
</span><span class="cx">                                 }
</span><ins>+                                
+                                if (switch_stristr("origination_caller_id", member->txt)) {
+                                        sql = switch_mprintf("insert into fifo_outbound "
+                                                                                 "(uuid, fifo_name, originate_string, simo_count, use_count, timeout, lag, "
+                                                                                 "next_avail, expires, static, outbound_call_count, outbound_fail_count, hostname) "
+                                                                                 "values ('%q','%q',"
+                                                                                 "'{execute_on_answer=''unset fifo_hangup_check'',fifo_hangup_check=''%q''"
+                                                                                 "}%q',%d,%d,%d,%d,0,0,1,0,0,'%q')",
+                                                                                 digest, node->name, node->name, member->txt, simo_i, 0, timeout_i, lag_i, globals.hostname);
+                                } else {
</ins><span class="cx">
</span><del>-                                sql = switch_mprintf("insert into fifo_outbound "
-                                                                         "(uuid, fifo_name, originate_string, simo_count, use_count, timeout, lag, "
-                                                                         "next_avail, expires, static, outbound_call_count, outbound_fail_count, hostname) "
-                                                                         "values ('%q','%q',"
-                                                                         "'{execute_on_answer=''unset fifo_hangup_check'',fifo_hangup_check=''%q'',origination_caller_id_name=Queue,"
-                                                                         "origination_caller_id_number=''fifo+%q''}%q',%d,%d,%d,%d,0,0,1,0,0,'%q')",
-                                                                        
-                                                                         digest, node->name, node->name, name_dup, member->txt, simo_i, 0, timeout_i, lag_i, globals.hostname
-                                                                         );
</del><ins>+                                        sql = switch_mprintf("insert into fifo_outbound "
+                                                                                 "(uuid, fifo_name, originate_string, simo_count, use_count, timeout, lag, "
+                                                                                 "next_avail, expires, static, outbound_call_count, outbound_fail_count, hostname) "
+                                                                                 "values ('%q','%q',"
+                                                                                 "'{execute_on_answer=''unset fifo_hangup_check'',fifo_hangup_check=''%q'',origination_caller_id_name=Queue,"
+                                                                                 "origination_caller_id_number=''fifo+%q''}%q',%d,%d,%d,%d,0,0,1,0,0,'%q')",
+                                                                                 digest, node->name, node->name, name_dup, member->txt, simo_i, 0, timeout_i, lag_i, globals.hostname);
+                                                                                
+                                }
+
</ins><span class="cx">                                 switch_assert(sql);
</span><span class="cx">                                 fifo_execute_sql(sql, globals.sql_mutex);
</span><span class="cx">                                 free(sql);
</span><span class="lines">@@ -2086,7 +2133,8 @@
</span><span class="cx">         
</span><span class="cx">         switch_mutex_lock(globals.mutex);
</span><span class="cx">         if (!(node = switch_core_hash_find(globals.fifo_hash, fifo_name))) {
</span><del>-                node = create_node(fifo_name, 0);
</del><ins>+                node = create_node(fifo_name, 0, globals.sql_mutex);
+                node->ready = 1;
</ins><span class="cx">         }
</span><span class="cx">         switch_mutex_unlock(globals.mutex);
</span><span class="cx">
</span><span class="lines">@@ -2142,7 +2190,7 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)){
</del><ins>+        if (zstr(cmd)){
</ins><span class="cx">                 stream->write_function(stream, "-USAGE: %s\n", FIFO_MEMBER_API_SYNTAX);
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -2206,6 +2254,7 @@
</span><span class="cx"> {
</span><span class="cx">         switch_application_interface_t *app_interface;
</span><span class="cx">         switch_api_interface_t *commands_api_interface;
</span><ins>+        switch_status_t status;
</ins><span class="cx">
</span><span class="cx">         /* create/register custom event message type */
</span><span class="cx">         if (switch_event_reserve_subclass(FIFO_EVENT) != SWITCH_STATUS_SUCCESS) {
</span><span class="lines">@@ -2224,6 +2273,16 @@
</span><span class="cx">         switch_core_hash_init(&globals.fifo_hash, globals.pool);
</span><span class="cx">         switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, globals.pool);
</span><span class="cx">         switch_mutex_init(&globals.sql_mutex, SWITCH_MUTEX_NESTED, globals.pool);
</span><ins>+        
+        globals.running = 1;
+        
+        if ((status = load_config(0,1)) != SWITCH_STATUS_SUCCESS) {
+                switch_event_unbind(&globals.node);
+                switch_event_free_subclass(FIFO_EVENT);
+                switch_core_hash_destroy(&globals.fifo_hash);
+                switch_core_destroy_memory_pool(&globals.pool);
+                return status;
+        }
</ins><span class="cx">
</span><span class="cx">         /* connect my internal structure to the blank pointer passed to me */
</span><span class="cx">         *module_interface = switch_loadable_module_create_module_interface(pool, modname);
</span><span class="lines">@@ -2236,9 +2295,6 @@
</span><span class="cx">         switch_console_set_complete("add fifo count");
</span><span class="cx">         switch_console_set_complete("add fifo importance");
</span><span class="cx">
</span><del>-        globals.running = 1;
-
-        load_config(0,1);
</del><span class="cx">         start_node_thread(globals.pool);
</span><span class="cx">
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_lcrmod_lcrc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_lcr/mod_lcr.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_lcr/mod_lcr.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_lcr/mod_lcr.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -36,6 +36,8 @@
</span><span class="cx"> #define LCR_ADMIN_SYNTAX "lcr_admin show profiles"
</span><span class="cx">
</span><span class="cx"> /* SQL Query places */
</span><ins>+/* these now make up a map that describes the location of
+ the field based on name */
</ins><span class="cx"> #define LCR_DIGITS_PLACE 0
</span><span class="cx"> #define LCR_CARRIER_PLACE 1
</span><span class="cx"> #define LCR_RATE_PLACE 2
</span><span class="lines">@@ -47,9 +49,10 @@
</span><span class="cx"> #define LCR_SUFFIX_PLACE 8
</span><span class="cx"> #define LCR_CODEC_PLACE 9
</span><span class="cx"> #define LCR_CID_PLACE 10
</span><ins>+#define LCR_USER_RATE_PLACE 11
</ins><span class="cx">
</span><span class="cx"> #define LCR_QUERY_COLS_REQUIRED 9
</span><del>-#define LCR_QUERY_COLS 11
</del><ins>+#define LCR_QUERY_COLS 12
</ins><span class="cx">
</span><span class="cx"> #define LCR_HEADERS_COUNT 6
</span><span class="cx">
</span><span class="lines">@@ -83,6 +86,8 @@
</span><span class="cx">         char *dialstring;
</span><span class="cx">         float rate;
</span><span class="cx">         char *rate_str;
</span><ins>+        float user_rate;
+        char *user_rate_str;
</ins><span class="cx">         size_t lstrip;
</span><span class="cx">         size_t tstrip;
</span><span class="cx">         size_t digit_len;
</span><span class="lines">@@ -169,7 +174,7 @@
</span><span class="cx">         char *dst_regex = NULL;
</span><span class="cx">         switch_channel_t *channel = NULL;
</span><span class="cx">         
</span><del>-        if (!switch_strlen_zero(cid)) {
</del><ins>+        if (!zstr(cid)) {
</ins><span class="cx">                 len = strlen(cid);
</span><span class="cx">         } else {
</span><span class="cx">                 goto done;
</span><span class="lines">@@ -246,6 +251,7 @@
</span><span class="cx">         char *codec = NULL;
</span><span class="cx">         char *cid = NULL;
</span><span class="cx">         char *header = NULL;
</span><ins>+        char *user_rate = NULL;
</ins><span class="cx">
</span><span class="cx">         orig_destination_number = destination_number = switch_core_strdup(pool, dialed_number);
</span><span class="cx">         
</span><span class="lines">@@ -269,12 +275,12 @@
</span><span class="cx">                 }
</span><span class="cx">         }        
</span><span class="cx">         codec = "";
</span><del>-        if (!switch_strlen_zero(cur_route->codec)) {
</del><ins>+        if (!zstr(cur_route->codec)) {
</ins><span class="cx">                 codec = switch_core_sprintf(pool, ",absolute_codec_string=%s", cur_route->codec);
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         cid = "";
</span><del>-        if (!switch_strlen_zero(cur_route->cid)) {
</del><ins>+        if (!zstr(cur_route->cid)) {
</ins><span class="cx">                 cid = switch_core_sprintf(pool, ",origination_caller_id_number=%s",
</span><span class="cx">                                                                  do_cid(pool, cur_route->cid, caller_id, session));
</span><span class="cx">         }
</span><span class="lines">@@ -286,9 +292,15 @@
</span><span class="cx">                                                                          cur_route->carrier_name);
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        data = switch_core_sprintf(pool, "[lcr_carrier=%s,lcr_rate=%s%s%s%s]%s%s%s%s%s"
</del><ins>+        if (zstr(cur_route->user_rate_str)) {
+                user_rate = "";
+        } else {
+                user_rate = switch_core_sprintf(pool, ",lcr_user_rate=%s", cur_route->user_rate_str);
+        }
+        
+        data = switch_core_sprintf(pool, "[lcr_carrier=%s,lcr_rate=%s%s%s%s%s]%s%s%s%s%s"
</ins><span class="cx">                                                                 , cur_route->carrier_name, cur_route->rate_str
</span><del>-                                                                , codec, cid, header
</del><ins>+                                                                , user_rate, codec, cid, header
</ins><span class="cx">                                                                 , cur_route->gw_prefix, cur_route->prefix
</span><span class="cx">                                                                 , destination_number, cur_route->suffix, cur_route->gw_suffix);
</span><span class="cx">                         
</span><span class="lines">@@ -300,7 +312,7 @@
</span><span class="cx"> {
</span><span class="cx">         profile_t *profile = NULL;
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(profile_name)) {
</del><ins>+        if (zstr(profile_name)) {
</ins><span class="cx">                 profile = globals.default_profile;
</span><span class="cx">         } else if (!(profile = switch_core_hash_find(globals.profile_hash, profile_name))) {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error invalid profile %s\n", profile_name);
</span><span class="lines">@@ -543,7 +555,7 @@
</span><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(argv[LCR_GW_PREFIX_PLACE]) && switch_strlen_zero(argv[LCR_GW_SUFFIX_PLACE]) ) {
</del><ins>+        if (zstr(argv[LCR_GW_PREFIX_PLACE]) && zstr(argv[LCR_GW_SUFFIX_PLACE]) ) {
</ins><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
</span><span class="cx">                                                                 "There's no way to dial this Gateway: Carrier: \"%s\" Prefix: \"%s\", Suffix \"%s\"\n",
</span><span class="cx">                                                                 switch_str_nil(argv[LCR_CARRIER_PLACE]),
</span><span class="lines">@@ -571,6 +583,10 @@
</span><span class="cx">         if (argc > LCR_CID_PLACE) {
</span><span class="cx">                 additional->cid = switch_core_strdup(pool, switch_str_nil(argv[LCR_CID_PLACE]));
</span><span class="cx">         }
</span><ins>+        if (argc > LCR_USER_RATE_PLACE) {
+                additional->user_rate = (float)atof(switch_str_nil(argv[LCR_USER_RATE_PLACE]));
+                additional->user_rate_str = switch_core_sprintf(pool, "%0.5f", additional->user_rate);
+        }
</ins><span class="cx">         additional->dialstring = get_bridge_data(pool, cbt->lookup_number, cbt->cid, additional, cbt->profile, cbt->session);
</span><span class="cx">
</span><span class="cx">         if (cbt->head == NULL) {
</span><span class="lines">@@ -716,11 +732,12 @@
</span><span class="cx">         char *id_str;
</span><span class="cx">         char *safe_sql = NULL;
</span><span class="cx">         char *rate_field = NULL;
</span><ins>+        char *user_rate_field = NULL;
</ins><span class="cx">         
</span><span class="cx">         switch_assert(cb_struct->lookup_number != NULL);
</span><span class="cx">
</span><span class="cx">         digits_copy = string_digitsonly(cb_struct->pool, digits);
</span><del>-        if (switch_strlen_zero(digits_copy)) {
</del><ins>+        if (zstr(digits_copy)) {
</ins><span class="cx">                 return SWITCH_STATUS_GENERR;
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="lines">@@ -739,10 +756,13 @@
</span><span class="cx">         /* set our rate field based on env and profile */
</span><span class="cx">         if (cb_struct->intralata == SWITCH_TRUE && profile->profile_has_intralata == SWITCH_TRUE) {
</span><span class="cx">                 rate_field = switch_core_strdup(cb_struct->pool, "intralata_rate");
</span><ins>+                user_rate_field = switch_core_strdup(cb_struct->pool, "user_intralata_rate");
</ins><span class="cx">         } else if (cb_struct->intrastate == SWITCH_TRUE && profile->profile_has_intrastate == SWITCH_TRUE) {
</span><span class="cx">                 rate_field = switch_core_strdup(cb_struct->pool, "intrastate_rate");
</span><ins>+                user_rate_field = switch_core_strdup(cb_struct->pool, "user_intrastate_rate");
</ins><span class="cx">         } else {
</span><span class="cx">                 rate_field = switch_core_strdup(cb_struct->pool, "rate");
</span><ins>+                user_rate_field = switch_core_strdup(cb_struct->pool, "user_rate");
</ins><span class="cx">         }
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(cb_struct->session), SWITCH_LOG_DEBUG, "intra routing [state:%d lata:%d] so rate field is [%s]\n",
</span><span class="cx">                                          cb_struct->intrastate, cb_struct->intralata, rate_field);
</span><span class="lines">@@ -752,6 +772,7 @@
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(cb_struct->session), SWITCH_LOG_DEBUG, "we have a session\n");
</span><span class="cx">                 if ((channel = switch_core_session_get_channel(cb_struct->session))) {
</span><span class="cx">                         switch_channel_set_variable_var_check(channel, "lcr_rate_field", rate_field, SWITCH_FALSE);
</span><ins>+                        switch_channel_set_variable_var_check(channel, "lcr_user_rate_field", user_rate_field, SWITCH_FALSE);
</ins><span class="cx">                         switch_channel_set_variable_var_check(channel, "lcr_query_digits", digits_copy, SWITCH_FALSE);
</span><span class="cx">                         id_str = switch_core_sprintf(cb_struct->pool, "%d", cb_struct->profile->id);
</span><span class="cx">                         switch_channel_set_variable_var_check(channel, "lcr_query_profile", id_str, SWITCH_FALSE);
</span><span class="lines">@@ -761,6 +782,7 @@
</span><span class="cx">         if (cb_struct->event) {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(cb_struct->session), SWITCH_LOG_DEBUG, "we have an event\n");
</span><span class="cx">                 switch_event_add_header_string(cb_struct->event, SWITCH_STACK_BOTTOM, "lcr_rate_field", rate_field);
</span><ins>+                switch_event_add_header_string(cb_struct->event, SWITCH_STACK_BOTTOM, "lcr_user_rate_field", user_rate_field);
</ins><span class="cx">                 switch_event_add_header_string(cb_struct->event, SWITCH_STACK_BOTTOM, "lcr_query_digits", digits_copy);
</span><span class="cx">                 id_str = switch_core_sprintf(cb_struct->pool, "%d", cb_struct->profile->id);
</span><span class="cx">                 switch_event_add_header_string(cb_struct->event, SWITCH_STACK_BOTTOM, "lcr_query_profile", id_str);
</span><span class="lines">@@ -840,7 +862,7 @@
</span><span class="cx">                         char *val = NULL;
</span><span class="cx">                         var = (char *) switch_xml_attr_soft(param, "name");
</span><span class="cx">                         val = (char *) switch_xml_attr_soft(param, "value");
</span><del>-                        if (!strcasecmp(var, "odbc-dsn") && !switch_strlen_zero(val)) {
</del><ins>+                        if (!strcasecmp(var, "odbc-dsn") && !zstr(val)) {
</ins><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "odbc_dsn is %s\n", val);
</span><span class="cx">                                 globals.odbc_dsn = switch_core_strdup(globals.pool, val);
</span><span class="cx">                                 if ((odbc_user = strchr(globals.odbc_dsn, ':'))) {
</span><span class="lines">@@ -900,13 +922,13 @@
</span><span class="cx">                                 var = (char *) switch_xml_attr_soft(param, "name");
</span><span class="cx">                                 val = (char *) switch_xml_attr_soft(param, "value");
</span><span class="cx">                                 
</span><del>-                                if (!strcasecmp(var, "order_by") && !switch_strlen_zero(val)) {
</del><ins>+                                if (!strcasecmp(var, "order_by") && !zstr(val)) {
</ins><span class="cx">                                         thisorder = &order_by;
</span><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "param val is %s\n", val);
</span><span class="cx">                                         if ((argc = switch_separate_string(val, ',', argv, (sizeof(argv) / sizeof(argv[0]))))) {
</span><span class="cx">                                                 for (x=0; x<argc; x++) {
</span><span class="cx">                                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "arg #%d/%d is %s\n", x, argc, argv[x]);
</span><del>-                                                        if (!switch_strlen_zero(argv[x])) {
</del><ins>+                                                        if (!zstr(argv[x])) {
</ins><span class="cx">                                                                 if (!strcasecmp(argv[x], "quality")) {
</span><span class="cx">                                                                         thisorder->write_function(thisorder, "%s quality DESC", comma);
</span><span class="cx">                                                                 } else if (!strcasecmp(argv[x], "reliability")) {
</span><span class="lines">@@ -929,40 +951,40 @@
</span><span class="cx">                                                         thisorder->write_function(thisorder, "%s %s", comma, val);
</span><span class="cx">                                                 }
</span><span class="cx">                                         }
</span><del>-                                } else if (!strcasecmp(var, "id") && !switch_strlen_zero(val)) {
</del><ins>+                                } else if (!strcasecmp(var, "id") && !zstr(val)) {
</ins><span class="cx">                                         id_s = val;
</span><del>-                                } else if (!strcasecmp(var, "custom_sql") && !switch_strlen_zero(val)) {
</del><ins>+                                } else if (!strcasecmp(var, "custom_sql") && !zstr(val)) {
</ins><span class="cx">                                         custom_sql = val;
</span><del>-                                } else if (!strcasecmp(var, "reorder_by_rate") && !switch_strlen_zero(val)) {
</del><ins>+                                } else if (!strcasecmp(var, "reorder_by_rate") && !zstr(val)) {
</ins><span class="cx">                                         reorder_by_rate = val;
</span><del>-                                } else if (!strcasecmp(var, "info_in_headers") && !switch_strlen_zero(val)) {
</del><ins>+                                } else if (!strcasecmp(var, "info_in_headers") && !zstr(val)) {
</ins><span class="cx">                                         info_in_headers = val;
</span><del>-                                } else if (!strcasecmp(var, "quote_in_list") && !switch_strlen_zero(val)) {
</del><ins>+                                } else if (!strcasecmp(var, "quote_in_list") && !zstr(val)) {
</ins><span class="cx">                                         quote_in_list = val;
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                         
</span><del>-                        if (switch_strlen_zero(name)) {
</del><ins>+                        if (zstr(name)) {
</ins><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No name specified.\n");
</span><span class="cx">                         } else {
</span><span class="cx">                                 profile = switch_core_alloc(globals.pool, sizeof(*profile));
</span><span class="cx">                                 memset(profile, 0, sizeof(profile_t));
</span><span class="cx">                                 profile->name = switch_core_strdup(globals.pool, name);
</span><span class="cx">                                 
</span><del>-                                if (!switch_strlen_zero((char *)order_by.data)) {
</del><ins>+                                if (!zstr((char *)order_by.data)) {
</ins><span class="cx">                                         profile->order_by = switch_core_strdup(globals.pool, (char *)order_by.data);
</span><span class="cx">                                 } else {
</span><span class="cx">                                         /* default to rate */
</span><span class="cx">                                         profile->order_by = ", ${lcr_rate_field}";
</span><span class="cx">                                 }
</span><span class="cx">
</span><del>-                                if (!switch_strlen_zero(id_s)) {
</del><ins>+                                if (!zstr(id_s)) {
</ins><span class="cx">                                         profile->id = (uint16_t)atoi(id_s);
</span><span class="cx">                                 }
</span><span class="cx">                                 
</span><span class="cx">                                 /* SWITCH_STANDARD_STREAM doesn't use pools. but we only have to free sql_stream.data */
</span><span class="cx">                                 SWITCH_STANDARD_STREAM(sql_stream);
</span><del>-                                if (switch_strlen_zero(custom_sql)) {
</del><ins>+                                if (zstr(custom_sql)) {
</ins><span class="cx">                                         /* use default sql */
</span><span class="cx">                                         sql_stream.write_function(&sql_stream,
</span><span class="cx">                                                                                          "SELECT l.digits, c.carrier_name, l.${lcr_rate_field}, cg.prefix AS gw_prefix, cg.suffix AS gw_suffix, l.lead_strip, l.trail_strip, l.prefix, l.suffix "
</span><span class="lines">@@ -1024,15 +1046,15 @@
</span><span class="cx">                                 }
</span><span class="cx">                                 profile->custom_sql = switch_core_strdup(globals.pool, (char *)custom_sql);
</span><span class="cx">                                 
</span><del>-                                if (!switch_strlen_zero(reorder_by_rate)) {
</del><ins>+                                if (!zstr(reorder_by_rate)) {
</ins><span class="cx">                                         profile->reorder_by_rate = switch_true(reorder_by_rate);
</span><span class="cx">                                 }
</span><span class="cx">                                 
</span><del>-                                if (!switch_strlen_zero(info_in_headers)) {
</del><ins>+                                if (!zstr(info_in_headers)) {
</ins><span class="cx">                                         profile->info_in_headers = switch_true(info_in_headers);
</span><span class="cx">                                 }
</span><span class="cx">                                 
</span><del>-                                if (!switch_strlen_zero(quote_in_list)) {
</del><ins>+                                if (!zstr(quote_in_list)) {
</ins><span class="cx">                                         profile->quote_in_list = switch_true(quote_in_list);
</span><span class="cx">                                 }
</span><span class="cx">                                 
</span><span class="lines">@@ -1102,10 +1124,10 @@
</span><span class="cx">         intralata = switch_channel_get_variable(channel, "intralata");
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "intrastate channel var is [%s]\n", intrastate);
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "intralata channel var is [%s]\n", intralata);
</span><del>-        if (!switch_strlen_zero(intralata) && !strcasecmp((char *)intralata, "true")) {
</del><ins>+        if (!zstr(intralata) && !strcasecmp((char *)intralata, "true")) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Select routes based on intralata rates\n");
</span><span class="cx">                 routes.intralata = SWITCH_FALSE;
</span><del>-        } else if (!switch_strlen_zero(intrastate) && !strcasecmp((char *)intrastate, "true")) {
</del><ins>+        } else if (!zstr(intrastate) && !strcasecmp((char *)intrastate, "true")) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Select routes based on intrastate rates\n");
</span><span class="cx">                 routes.intrastate = SWITCH_TRUE;
</span><span class="cx">         } else {
</span><span class="lines">@@ -1192,8 +1214,8 @@
</span><span class="cx">
</span><span class="cx">         intra = switch_channel_get_variable(channel, "intrastate");
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "intrastate channel var is [%s]\n",
</span><del>-                                        switch_strlen_zero(intra) ? "undef" : intra);
-        if (switch_strlen_zero(intra) || strcasecmp((char *)intra, "true")) {
</del><ins>+                                        zstr(intra) ? "undef" : intra);
+        if (zstr(intra) || strcasecmp((char *)intra, "true")) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Select routes based on interstate rates\n");
</span><span class="cx">                 routes.intrastate = SWITCH_FALSE;
</span><span class="cx">         } else {
</span><span class="lines">@@ -1221,6 +1243,7 @@
</span><span class="cx">                                 routes.cid = (char *) caller_profile->caller_id_number;
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><ins>+
</ins><span class="cx">         
</span><span class="cx">                 if (!(routes.profile = locate_profile(lcr_profile))) {
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Unknown profile: %s\n", lcr_profile);
</span><span class="lines">@@ -1285,7 +1308,7 @@
</span><span class="cx">         switch_bool_t as_xml = SWITCH_FALSE;
</span><span class="cx">         int rowcount=0;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 goto usage;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1331,7 +1354,7 @@
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-                if (switch_strlen_zero(cb_struct.cid)) {
</del><ins>+                if (zstr(cb_struct.cid)) {
</ins><span class="cx">                         cb_struct.cid = "18005551212";
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING
</span><span class="cx">                                                          , "Using default CID [%s]\n", cb_struct.cid
</span><span class="lines">@@ -1457,7 +1480,7 @@
</span><span class="cx">         void *val;
</span><span class="cx">         profile_t *profile;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 goto usage;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1474,7 +1497,7 @@
</span><span class="cx">                                 profile = (profile_t *) val;
</span><span class="cx">                                 
</span><span class="cx">                                 stream->write_function(stream, "Name:\t\t%s\n", profile->name);
</span><del>-                                if (switch_strlen_zero(profile->custom_sql)) {
</del><ins>+                                if (zstr(profile->custom_sql)) {
</ins><span class="cx">                                         stream->write_function(stream, " ID:\t\t%d\n", profile->id);
</span><span class="cx">                                         stream->write_function(stream, " order by:\t%s\n", profile->order_by);
</span><span class="cx">                                 } else {
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_limitmod_limitc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_limit/mod_limit.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_limit/mod_limit.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_limit/mod_limit.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx">                 if (switch_odbc_handle_exec(globals.master_odbc, sql, &stmt) != SWITCH_ODBC_SUCCESS) {
</span><span class="cx">                         char *err_str;
</span><span class="cx">                         err_str = switch_odbc_handle_get_error(globals.master_odbc, stmt);
</span><del>-                        if (!switch_strlen_zero(err_str)) {
</del><ins>+                        if (!zstr(err_str)) {
</ins><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERR: [%s]\n[%s]\n", sql, switch_str_nil(err_str));
</span><span class="cx">                         }
</span><span class="cx">                         switch_safe_free(err_str);
</span><span class="lines">@@ -199,7 +199,7 @@
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(globals.odbc_dsn) || switch_strlen_zero(odbc_user) || switch_strlen_zero(odbc_pass)) {
</del><ins>+        if (zstr(globals.odbc_dsn) || zstr(odbc_user) || zstr(odbc_pass)) {
</ins><span class="cx">                 globals.dbname = "call_limit";
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -447,7 +447,7 @@
</span><span class="cx">
</span><span class="cx">         switch_mutex_lock(globals.mutex);
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd)) {
</del><ins>+        if (!zstr(cmd)) {
</ins><span class="cx">                 mydata = strdup(cmd);
</span><span class="cx">                 switch_assert(mydata);
</span><span class="cx">                 argc = switch_separate_string(mydata, '/', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="lines">@@ -518,7 +518,7 @@
</span><span class="cx">         char *mydata = NULL;
</span><span class="cx">         char *sql = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data)) {
</del><ins>+        if (!zstr(data)) {
</ins><span class="cx">                 mydata = switch_core_session_strdup(session, data);
</span><span class="cx">                 argc = switch_separate_string(mydata, '/', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="lines">@@ -567,7 +567,7 @@
</span><span class="cx">         
</span><span class="cx">         switch_mutex_lock(globals.db_hash_mutex);
</span><span class="cx">         
</span><del>-        if (!switch_strlen_zero(data)) {
</del><ins>+        if (!zstr(data)) {
</ins><span class="cx">                 mydata = strdup(data);
</span><span class="cx">                 switch_assert(mydata);
</span><span class="cx">                 argc = switch_separate_string(mydata, '/', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="lines">@@ -621,7 +621,7 @@
</span><span class="cx">
</span><span class="cx">         switch_mutex_lock(globals.db_hash_mutex);
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd)) {
</del><ins>+        if (!zstr(cmd)) {
</ins><span class="cx">                 mydata = strdup(cmd);
</span><span class="cx">                 switch_assert(mydata);
</span><span class="cx">                 argc = switch_separate_string(mydata, '/', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="lines">@@ -683,7 +683,7 @@
</span><span class="cx">
</span><span class="cx">         switch_mutex_lock(globals.mutex);
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd)) {
</del><ins>+        if (!zstr(cmd)) {
</ins><span class="cx">                 mydata = strdup(cmd);
</span><span class="cx">                 argc = switch_separate_string(mydata, ':', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="lines">@@ -766,7 +766,7 @@
</span><span class="cx">         char *mydata = NULL;
</span><span class="cx">         char *sql;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data)) {
</del><ins>+        if (!zstr(data)) {
</ins><span class="cx">                 mydata = switch_core_session_strdup(session, data);
</span><span class="cx">                 argc = switch_separate_string(mydata, ':', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="lines">@@ -865,7 +865,7 @@
</span><span class="cx">         int max = 0;
</span><span class="cx">         switch_channel_t *channel = switch_core_session_get_channel(session);
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data)) {
</del><ins>+        if (!zstr(data)) {
</ins><span class="cx">                 mydata = switch_core_session_strdup(session, data);
</span><span class="cx">                 argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="lines">@@ -931,7 +931,7 @@
</span><span class="cx">         int max = -1;
</span><span class="cx">
</span><span class="cx">         /* Parse application data */
</span><del>-        if (!switch_strlen_zero(data)) {
</del><ins>+        if (!zstr(data)) {
</ins><span class="cx">                 mydata = switch_core_session_strdup(session, data);
</span><span class="cx">                 argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="lines">@@ -958,7 +958,7 @@
</span><span class="cx">         app = argv[3];
</span><span class="cx">         app_arg = argv[4];
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(app)) {
</del><ins>+        if (zstr(app)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missing application\n");
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="lines">@@ -982,7 +982,7 @@
</span><span class="cx">         callback_t cbt = { 0 };
</span><span class="cx">
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd)) {
</del><ins>+        if (!zstr(cmd)) {
</ins><span class="cx">                 mydata = strdup(cmd);
</span><span class="cx">                 switch_assert(mydata);
</span><span class="cx">                 argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="lines">@@ -1158,7 +1158,7 @@
</span><span class="cx">         switch_channel_t *channel = switch_core_session_get_channel(session);
</span><span class="cx">
</span><span class="cx">         /* Parse application data */
</span><del>-        if (!switch_strlen_zero(data)) {
</del><ins>+        if (!zstr(data)) {
</ins><span class="cx">                 mydata = switch_core_session_strdup(session, data);
</span><span class="cx">                 argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="lines">@@ -1223,7 +1223,7 @@
</span><span class="cx">         int interval = 0;
</span><span class="cx">
</span><span class="cx">         /* Parse application data */
</span><del>-        if (!switch_strlen_zero(data)) {
</del><ins>+        if (!zstr(data)) {
</ins><span class="cx">                 mydata = switch_core_session_strdup(session, data);
</span><span class="cx">                 argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="lines">@@ -1258,7 +1258,7 @@
</span><span class="cx">         app = argv[3];
</span><span class="cx">         app_arg = argv[4];
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(app)) {
</del><ins>+        if (zstr(app)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missing application\n");
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="lines">@@ -1282,7 +1282,7 @@
</span><span class="cx">
</span><span class="cx">         switch_mutex_lock(globals.limit_hash_mutex);
</span><span class="cx">         
</span><del>-        if (!switch_strlen_zero(cmd)) {
</del><ins>+        if (!zstr(cmd)) {
</ins><span class="cx">                 mydata = strdup(cmd);
</span><span class="cx">                 switch_assert(mydata);
</span><span class="cx">                 argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="lines">@@ -1495,7 +1495,7 @@
</span><span class="cx">         switch_channel_t *channel = switch_core_session_get_channel(session);
</span><span class="cx">
</span><span class="cx">         /* Parse application data */
</span><del>-        if (!switch_strlen_zero(data)) {
</del><ins>+        if (!zstr(data)) {
</ins><span class="cx">                 mydata = switch_core_session_strdup(session, data);
</span><span class="cx">                 argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="lines">@@ -1556,7 +1556,7 @@
</span><span class="cx">         char *szinterval = NULL;
</span><span class="cx">
</span><span class="cx">         /* Parse application data */
</span><del>-        if (!switch_strlen_zero(data)) {
</del><ins>+        if (!zstr(data)) {
</ins><span class="cx">                 mydata = switch_core_session_strdup(session, data);
</span><span class="cx">                 argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="lines">@@ -1588,7 +1588,7 @@
</span><span class="cx">         app = argv[3];
</span><span class="cx">         app_arg = argv[4];
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(app)) {
</del><ins>+        if (zstr(app)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missing application\n");
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="lines">@@ -1619,7 +1619,7 @@
</span><span class="cx">                 goto end;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd)) {
</del><ins>+        if (!zstr(cmd)) {
</ins><span class="cx">                 mydata = strdup(cmd);
</span><span class="cx">                 switch_assert(mydata);
</span><span class="cx">                 argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_memcachemod_memcachec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_memcache/mod_memcache.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_memcache/mod_memcache.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_memcache/mod_memcache.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -160,7 +160,7 @@
</span><span class="cx">         memcached_stat_st *stat = NULL;
</span><span class="cx">         memcached_server_st *server_list;
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 goto usage;
</span><span class="cx">         }
</span><span class="cx">         
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_nibblebillmod_nibblebillc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_nibblebill/mod_nibblebill.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_nibblebill/mod_nibblebill.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_nibblebill/mod_nibblebill.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -189,22 +189,22 @@
</span><span class="cx">         
</span><span class="cx"> /* Set defaults for any variables still not set */
</span><span class="cx"> setdefaults:
</span><del>-        if (switch_strlen_zero(globals.db_username)) {
</del><ins>+        if (zstr(globals.db_username)) {
</ins><span class="cx">                 set_global_db_username("bandwidth.com");
</span><span class="cx">         }
</span><del>-        if (switch_strlen_zero(globals.db_password)) {
</del><ins>+        if (zstr(globals.db_password)) {
</ins><span class="cx">                 set_global_db_password("dev");
</span><span class="cx">         }
</span><del>-        if (switch_strlen_zero(globals.db_dsn)) {
</del><ins>+        if (zstr(globals.db_dsn)) {
</ins><span class="cx">                 set_global_db_dsn("bandwidth.com");
</span><span class="cx">         }
</span><del>-        if (switch_strlen_zero(globals.percall_action)) {
</del><ins>+        if (zstr(globals.percall_action)) {
</ins><span class="cx">                 set_global_percall_action("hangup");
</span><span class="cx">         }
</span><del>-        if (switch_strlen_zero(globals.lowbal_action)) {
</del><ins>+        if (zstr(globals.lowbal_action)) {
</ins><span class="cx">                 set_global_lowbal_action("play ding");
</span><span class="cx">         }
</span><del>-        if (switch_strlen_zero(globals.nobal_action)) {
</del><ins>+        if (zstr(globals.nobal_action)) {
</ins><span class="cx">                 set_global_nobal_action("hangup");
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -722,7 +722,7 @@
</span><span class="cx">         char *lbuf = NULL;
</span><span class="cx">         char *argv[3] = { 0 };
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (lbuf = strdup(data))
</del><ins>+        if (!zstr(data) && (lbuf = strdup(data))
</ins><span class="cx">                 && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
</span><span class="cx">                 if (!strcasecmp(argv[0], "adjust") && argc == 2) {
</span><span class="cx">                         nibblebill_adjust(session, (float)atof(argv[1]));
</span><span class="lines">@@ -751,9 +751,9 @@
</span><span class="cx">         char *mycmd = NULL, *argv[3] = { 0 };
</span><span class="cx">         int argc = 0;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><del>-                if ((argc == 2 || argc == 3) && !switch_strlen_zero(argv[0])) {
</del><ins>+                if ((argc == 2 || argc == 3) && !zstr(argv[0])) {
</ins><span class="cx">                         char *uuid = argv[0];
</span><span class="cx">                         if ((psession = switch_core_session_locate(uuid))) {
</span><span class="cx">                                 switch_channel_t *channel;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_rssmod_rssc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_rss/mod_rss.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_rss/mod_rss.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_rss/mod_rss.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -234,7 +234,7 @@
</span><span class="cx">
</span><span class="cx">         switch_channel_answer(channel);
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data)) {
</del><ins>+        if (!zstr(data)) {
</ins><span class="cx">                 if ((mydata = switch_core_session_strdup(session, data))) {
</span><span class="cx">                         argc = switch_separate_string(mydata, ' ', argv, sizeof(argv) / sizeof(argv[0]));
</span><span class="cx">
</span><span class="lines">@@ -394,7 +394,7 @@
</span><span class="cx">
</span><span class="cx">                 err = switch_xml_error(xml);
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(err)) {
</del><ins>+                if (!zstr(err)) {
</ins><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Error [%s]\n", err);
</span><span class="cx">                         goto finished;
</span><span class="cx">                 }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_snapshotfromrev15313freeswitchtrunksrcmodapplicationsmod_snapshot"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_snapshot (from rev 15313, freeswitch/trunk/src/mod/applications/mod_snapshot)</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_snapshotmod_snapshot2008vcproj"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_snapshot/mod_snapshot.2008.vcproj</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_snapshotmod_snapshot2008vcprojfromrev15313freeswitchtrunksrcmodapplicationsmod_snapshotmod_snapshot2008vcproj"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_snapshot/mod_snapshot.2008.vcproj (from rev 15313, freeswitch/trunk/src/mod/applications/mod_snapshot/mod_snapshot.2008.vcproj) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_snapshot/mod_snapshot.2008.vcproj         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_snapshot/mod_snapshot.2008.vcproj        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,287 @@
</span><ins>+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+        ProjectType="Visual C++"
+        Version="9.00"
+        Name="mod_snapshot"
+        ProjectGUID="{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}"
+        RootNamespace="mod_snapshot"
+        Keyword="Win32Proj"
+        TargetFrameworkVersion="131072"
+        >
+        <Platforms>
+                <Platform
+                        Name="Win32"
+                />
+                <Platform
+                        Name="x64"
+                />
+        </Platforms>
+        <ToolFiles>
+        </ToolFiles>
+        <Configurations>
+                <Configuration
+                        Name="Debug|Win32"
+                        ConfigurationType="2"
+                        InheritedPropertySheets="..\..\..\..\w32\module_debug.vsprops"
+                        CharacterSet="2"
+                        >
+                        <Tool
+                                Name="VCPreBuildEventTool"
+                        />
+                        <Tool
+                                Name="VCCustomBuildTool"
+                        />
+                        <Tool
+                                Name="VCXMLDataGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCWebServiceProxyGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCMIDLTool"
+                        />
+                        <Tool
+                                Name="VCCLCompilerTool"
+                                UsePrecompiledHeader="0"
+                        />
+                        <Tool
+                                Name="VCManagedResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCPreLinkEventTool"
+                        />
+                        <Tool
+                                Name="VCLinkerTool"
+                                RandomizedBaseAddress="1"
+                                DataExecutionPrevention="0"
+                        />
+                        <Tool
+                                Name="VCALinkTool"
+                        />
+                        <Tool
+                                Name="VCManifestTool"
+                        />
+                        <Tool
+                                Name="VCXDCMakeTool"
+                        />
+                        <Tool
+                                Name="VCBscMakeTool"
+                        />
+                        <Tool
+                                Name="VCFxCopTool"
+                        />
+                        <Tool
+                                Name="VCAppVerifierTool"
+                        />
+                        <Tool
+                                Name="VCPostBuildEventTool"
+                        />
+                </Configuration>
+                <Configuration
+                        Name="Debug|x64"
+                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                        ConfigurationType="2"
+                        InheritedPropertySheets="..\..\..\..\w32\module_debug.vsprops"
+                        CharacterSet="2"
+                        >
+                        <Tool
+                                Name="VCPreBuildEventTool"
+                        />
+                        <Tool
+                                Name="VCCustomBuildTool"
+                        />
+                        <Tool
+                                Name="VCXMLDataGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCWebServiceProxyGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCMIDLTool"
+                                TargetEnvironment="3"
+                        />
+                        <Tool
+                                Name="VCCLCompilerTool"
+                                UsePrecompiledHeader="0"
+                        />
+                        <Tool
+                                Name="VCManagedResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCPreLinkEventTool"
+                        />
+                        <Tool
+                                Name="VCLinkerTool"
+                                OutputFile="$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll"
+                                RandomizedBaseAddress="1"
+                                DataExecutionPrevention="0"
+                                TargetMachine="17"
+                        />
+                        <Tool
+                                Name="VCALinkTool"
+                        />
+                        <Tool
+                                Name="VCManifestTool"
+                        />
+                        <Tool
+                                Name="VCXDCMakeTool"
+                        />
+                        <Tool
+                                Name="VCBscMakeTool"
+                        />
+                        <Tool
+                                Name="VCFxCopTool"
+                        />
+                        <Tool
+                                Name="VCAppVerifierTool"
+                        />
+                        <Tool
+                                Name="VCPostBuildEventTool"
+                        />
+                </Configuration>
+                <Configuration
+                        Name="Release|Win32"
+                        ConfigurationType="2"
+                        InheritedPropertySheets="..\..\..\..\w32\module_release.vsprops"
+                        CharacterSet="2"
+                        >
+                        <Tool
+                                Name="VCPreBuildEventTool"
+                        />
+                        <Tool
+                                Name="VCCustomBuildTool"
+                        />
+                        <Tool
+                                Name="VCXMLDataGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCWebServiceProxyGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCMIDLTool"
+                        />
+                        <Tool
+                                Name="VCCLCompilerTool"
+                                UsePrecompiledHeader="0"
+                        />
+                        <Tool
+                                Name="VCManagedResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCPreLinkEventTool"
+                        />
+                        <Tool
+                                Name="VCLinkerTool"
+                                RandomizedBaseAddress="1"
+                                DataExecutionPrevention="0"
+                        />
+                        <Tool
+                                Name="VCALinkTool"
+                        />
+                        <Tool
+                                Name="VCManifestTool"
+                        />
+                        <Tool
+                                Name="VCXDCMakeTool"
+                        />
+                        <Tool
+                                Name="VCBscMakeTool"
+                        />
+                        <Tool
+                                Name="VCFxCopTool"
+                        />
+                        <Tool
+                                Name="VCAppVerifierTool"
+                        />
+                        <Tool
+                                Name="VCPostBuildEventTool"
+                        />
+                </Configuration>
+                <Configuration
+                        Name="Release|x64"
+                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                        ConfigurationType="2"
+                        InheritedPropertySheets="..\..\..\..\w32\module_release.vsprops"
+                        CharacterSet="2"
+                        >
+                        <Tool
+                                Name="VCPreBuildEventTool"
+                        />
+                        <Tool
+                                Name="VCCustomBuildTool"
+                        />
+                        <Tool
+                                Name="VCXMLDataGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCWebServiceProxyGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCMIDLTool"
+                                TargetEnvironment="3"
+                        />
+                        <Tool
+                                Name="VCCLCompilerTool"
+                                UsePrecompiledHeader="0"
+                        />
+                        <Tool
+                                Name="VCManagedResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCPreLinkEventTool"
+                        />
+                        <Tool
+                                Name="VCLinkerTool"
+                                OutputFile="$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll"
+                                RandomizedBaseAddress="1"
+                                DataExecutionPrevention="0"
+                                TargetMachine="17"
+                        />
+                        <Tool
+                                Name="VCALinkTool"
+                        />
+                        <Tool
+                                Name="VCManifestTool"
+                        />
+                        <Tool
+                                Name="VCXDCMakeTool"
+                        />
+                        <Tool
+                                Name="VCBscMakeTool"
+                        />
+                        <Tool
+                                Name="VCFxCopTool"
+                        />
+                        <Tool
+                                Name="VCAppVerifierTool"
+                        />
+                        <Tool
+                                Name="VCPostBuildEventTool"
+                        />
+                </Configuration>
+        </Configurations>
+        <References>
+        </References>
+        <Files>
+                <File
+                        RelativePath=".\mod_snapshot.c"
+                        >
+                </File>
+        </Files>
+        <Globals>
+        </Globals>
+</VisualStudioProject>
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_snapshotmod_snapshotc"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_snapshot/mod_snapshot.c</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_snapshotmod_snapshotcfromrev15313freeswitchtrunksrcmodapplicationsmod_snapshotmod_snapshotc"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_snapshot/mod_snapshot.c (from rev 15313, freeswitch/trunk/src/mod/applications/mod_snapshot/mod_snapshot.c) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_snapshot/mod_snapshot.c         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_snapshot/mod_snapshot.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,347 @@
</span><ins>+/*
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005-2009, 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/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Anthony Minessale II <anthm@freeswitch.org>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Anthony Minessale II <anthm@freeswitch.org>
+ *
+ *
+ * mod_snapshot.c -- record a sliding window of audio and take snapshots to disk
+ *
+ */
+#include <switch.h>
+
+/* Prototypes */
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_snapshot_runtime);
+SWITCH_MODULE_LOAD_FUNCTION(mod_snapshot_load);
+
+/* SWITCH_MODULE_DEFINITION(name, load, shutdown, runtime)
+ * Defines a switch_loadable_module_function_table_t and a static const char[] modname
+ */
+SWITCH_MODULE_DEFINITION(mod_snapshot, mod_snapshot_load, NULL, NULL);
+
+struct cap_cb {
+        switch_buffer_t *buffer;
+        switch_mutex_t *mutex;
+        char *base;
+};
+
+static switch_bool_t capture_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type)
+{
+        switch_core_session_t *session = switch_core_media_bug_get_session(bug);
+        switch_channel_t *channel = switch_core_session_get_channel(session);
+        struct cap_cb *cb = (struct cap_cb *) user_data;
+
+        switch (type) {
+        case SWITCH_ABC_TYPE_INIT:
+                break;
+        case SWITCH_ABC_TYPE_CLOSE:
+                {
+                        if (cb->buffer) {
+                                switch_buffer_destroy(&cb->buffer);
+                        }
+                        switch_channel_set_private(channel, "snapshot", NULL);
+                }
+
+                break;
+        case SWITCH_ABC_TYPE_READ:
+                
+                if (cb->buffer) {
+                        uint8_t data[SWITCH_RECOMMENDED_BUFFER_SIZE];
+                        switch_frame_t frame = { 0 };
+
+                        frame.data = data;
+                        frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE;
+                        
+                        if (switch_mutex_trylock(cb->mutex) == SWITCH_STATUS_SUCCESS) {
+                                while (switch_core_media_bug_read(bug, &frame, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS && !switch_test_flag((&frame), SFF_CNG)) {
+                                        if (frame.datalen) switch_buffer_slide_write(cb->buffer, frame.data, frame.datalen);
+                                }
+                                switch_mutex_unlock(cb->mutex);
+                        }
+
+                }
+                break;
+        case SWITCH_ABC_TYPE_WRITE:
+        default:
+                break;
+        }
+
+        return SWITCH_TRUE;
+}
+
+static switch_status_t start_capture(switch_core_session_t *session, unsigned int seconds, switch_media_bug_flag_t flags, const char *base)
+{
+        switch_channel_t *channel = switch_core_session_get_channel(session);
+        switch_media_bug_t *bug;
+        switch_status_t status;
+        switch_codec_implementation_t read_impl = {0};
+        struct cap_cb *cb;
+        switch_size_t bytes;
+        switch_bind_flag_t bind_flags = 0;
+
+        if (switch_channel_get_private(channel, "snapshot")) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Already Running.\n");
+                return SWITCH_STATUS_FALSE;
+        }
+
+        if (seconds < 5) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Must be at least 5 seconds!\n");
+                return SWITCH_STATUS_FALSE;
+        }
+        
+ switch_core_session_get_read_impl(session, &read_impl);
+
+        if (switch_channel_pre_answer(channel) != SWITCH_STATUS_SUCCESS) {
+                return SWITCH_STATUS_FALSE;
+        }
+
+        cb = switch_core_session_alloc(session, sizeof(*cb));
+        cb->base = switch_core_session_strdup(session, base);
+        
+        bytes = read_impl.samples_per_second * seconds * 2;
+
+        switch_buffer_create_dynamic(&cb->buffer, bytes, bytes, bytes);
+        switch_mutex_init(&cb->mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session));
+
+        if ((status = switch_core_media_bug_add(session, capture_callback, cb, 0, flags, &bug)) != SWITCH_STATUS_SUCCESS) {
+                return status;
+        }
+
+        bind_flags = SBF_DIAL_ALEG | SBF_EXEC_ALEG | SBF_EXEC_SAME;
+        switch_ivr_bind_dtmf_meta_session(session, 7, bind_flags, "snapshot::snap");
+
+        switch_channel_set_private(channel, "snapshot", bug);
+        
+        return SWITCH_STATUS_SUCCESS;
+}
+
+static switch_status_t do_snap(switch_core_session_t *session)
+{
+        switch_channel_t *channel = switch_core_session_get_channel(session);
+        switch_media_bug_t *bug = switch_channel_get_private(channel, "snapshot");
+        char *file;
+        switch_file_handle_t fh = {0};
+        switch_codec_implementation_t read_impl = {0};
+        switch_size_t bytes_read;
+        int16_t pdata[4096] = {0};
+                
+        if (bug) {
+                switch_time_exp_t tm;
+                switch_size_t retsize;
+                char date[80] = "";
+                struct cap_cb *cb = (struct cap_cb *) switch_core_media_bug_get_user_data(bug);
+
+                if (!cb) {
+                        return SWITCH_STATUS_FALSE;
+                }
+
+                switch_time_exp_lt(&tm, switch_time_make(switch_epoch_time_now(NULL), 0));
+                switch_strftime(date, &retsize, sizeof(date), "%Y_%m_%d_%H_%M_%S", &tm);
+                        
+                file = switch_core_session_sprintf(session, "%s%ssounds%s%s_%s.wav", SWITCH_GLOBAL_dirs.base_dir,
+                                                                                 SWITCH_PATH_SEPARATOR, SWITCH_PATH_SEPARATOR, cb->base, date);
+
+                switch_core_session_get_read_impl(session, &read_impl);
+                fh.channels = 0;
+                fh.native_rate = read_impl.actual_samples_per_second;
+                        
+                if (switch_core_file_open(&fh,
+                                                                 file,
+                                                                 0,
+                                                                 read_impl.actual_samples_per_second,
+                                                                 SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT, NULL) != SWITCH_STATUS_SUCCESS) {
+                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error opening %s\n", file);
+                        switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+                        switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE);
+                        return SWITCH_STATUS_FALSE;
+                }
+
+                switch_mutex_lock(cb->mutex);
+                while ((bytes_read = switch_buffer_read(cb->buffer, pdata, sizeof(pdata)))) {
+                        switch_size_t samples = bytes_read / 2;
+                                
+                        if (switch_core_file_write(&fh, pdata, &samples) != SWITCH_STATUS_SUCCESS) {
+                                break;
+                        }
+                }
+                switch_mutex_unlock(cb->mutex);
+                switch_core_file_close(&fh);
+                switch_core_set_variable("file", file);
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Wrote %s\n", file);
+        }
+
+        return SWITCH_STATUS_SUCCESS;
+
+}
+
+#define SNAP_SYNTAX "start <sec> <read|write>"
+SWITCH_STANDARD_APP(snapshot_app_function)
+{
+        char *argv[4] = { 0 };
+        int argc = 0;
+        char *lbuf = NULL;
+        switch_media_bug_flag_t flags = SMBF_READ_STREAM | SMBF_WRITE_STREAM | SMBF_READ_PING;
+
+        if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))) {
+                argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
+        }
+        
+        if (argc < 1) {
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", SNAP_SYNTAX);
+                return;
+        }
+
+        if (!strcasecmp(argv[0], "start")) {
+                char *sec = argv[1];
+                char *fl = argv[2];
+                const char *base = argv[3];
+                int seconds = 5;
+
+                if (sec) {
+                        int tmp = atoi(sec);
+                        if (tmp > 5) {
+                                seconds = tmp;
+                        }
+                }
+
+                if (fl) {
+                        flags = SMBF_READ_PING;
+                        if (switch_stristr("read", fl)) {
+                                flags |= SMBF_READ_STREAM;
+                        }
+                        if (switch_stristr("write", fl)) {
+                                flags |= SMBF_WRITE_STREAM;
+                        }
+                }
+
+                if (!base) {
+                        base = "mod_snapshot";
+                }
+
+                start_capture(session, seconds, flags, base);
+                
+        }
+
+        if (!strcasecmp(argv[0], "snap")) {
+                do_snap(session);
+                return;
+        }
+}
+
+
+#define SNAP_API_SYNTAX "<uuid> <warning>"
+SWITCH_STANDARD_API(snapshot_function)
+{
+        char *mycmd = NULL, *argv[5] = { 0 };
+        int argc = 0;
+        switch_status_t status = SWITCH_STATUS_FALSE;
+
+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
+                argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
+        }
+
+        if (zstr(cmd) || argc < 1 || zstr(argv[0])) {
+                stream->write_function(stream, "-USAGE: %s\n", SNAP_API_SYNTAX);
+                goto done;
+        } else {
+                switch_core_session_t *lsession = NULL;
+
+                if ((lsession = switch_core_session_locate(argv[0]))) {
+                        if (!strcasecmp(argv[1], "snap")) {
+                                status = do_snap(lsession);
+                        } else if (!strcasecmp(argv[1], "start")) {
+                                char *sec = argv[1];
+                                char *fl = argv[2];
+                                const char *base = argv[3];
+                                int seconds = 5;
+                                switch_media_bug_flag_t flags = SMBF_READ_STREAM | SMBF_WRITE_STREAM | SMBF_READ_PING;
+                                
+                                if (sec) {
+                                        int tmp = atoi(sec);
+                                        if (tmp > 5) {
+                                                seconds = tmp;
+                                        }
+                                }
+
+                                if (fl) {
+                                        flags = SMBF_READ_PING;
+                                        if (switch_stristr("read", fl)) {
+                                                flags |= SMBF_READ_STREAM;
+                                        }
+                                        if (switch_stristr("write", fl)) {
+                                                flags |= SMBF_WRITE_STREAM;
+                                        }
+                                }
+
+                                if (!base) {
+                                        base = "mod_snapshot";
+                                }
+                                
+                                status = start_capture(lsession, seconds, flags, base);
+                        }
+
+                        switch_core_session_rwunlock(lsession);
+                }
+        }
+
+        if (status == SWITCH_STATUS_SUCCESS) {
+                stream->write_function(stream, "+OK Success\n");
+        } else {
+                stream->write_function(stream, "-ERR Operation Failed\n");
+        }
+
+ done:
+
+        switch_safe_free(mycmd);
+        return SWITCH_STATUS_SUCCESS;
+}
+
+/* Macro expands to: switch_status_t mod_snapshot_load(switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool) */
+SWITCH_MODULE_LOAD_FUNCTION(mod_snapshot_load)
+{
+        switch_api_interface_t *api_interface;
+        switch_application_interface_t *app_interface;
+
+        /* connect my internal structure to the blank pointer passed to me */
+        *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Hello World!\n");
+        
+        SWITCH_ADD_API(api_interface, "uuid_snapshot", "Snapshot API", snapshot_function, SNAP_API_SYNTAX);
+        SWITCH_ADD_APP(app_interface, "snapshot", "", "", snapshot_app_function, SNAP_SYNTAX, SAF_SUPPORT_NOMEDIA);
+
+        /* indicate that the module should continue to be loaded */
+        return SWITCH_STATUS_SUCCESS;
+}
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4
+ */
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_soundtouchmod_soundtouchcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_soundtouch/mod_soundtouch.cpp        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -255,7 +255,7 @@
</span><span class="cx">         int x;
</span><span class="cx">
</span><span class="cx">         if ((bug = (switch_media_bug_t *) switch_channel_get_private(channel, "_soundtouch_"))) {
</span><del>-                if (!switch_strlen_zero(data) && !strcasecmp(data, "stop")) {
</del><ins>+                if (!zstr(data) && !strcasecmp(data, "stop")) {
</ins><span class="cx">                         switch_channel_set_private(channel, "_soundtouch_", NULL);
</span><span class="cx">                         switch_core_media_bug_remove(session, &bug);
</span><span class="cx">                 } else {
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_spymod_spyc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_spy/mod_spy.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_spy/mod_spy.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_spy/mod_spy.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -188,7 +188,7 @@
</span><span class="cx">         char* argv[2] = {0};
</span><span class="cx">         char* params = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data) && (params = switch_core_session_strdup(session,data))) {
</del><ins>+        if (!zstr(data) && (params = switch_core_session_strdup(session,data))) {
</ins><span class="cx">                 if ((argc = switch_separate_string(params, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) {
</span><span class="cx">
</span><span class="cx">                         switch_channel_t *channel = switch_core_session_get_channel(session);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_stressmod_stresscpp"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_stress/mod_stress.cpp (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_stress/mod_stress.cpp        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_stress/mod_stress.cpp        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -206,7 +206,7 @@
</span><span class="cx">         int x = 0;
</span><span class="cx">
</span><span class="cx">         if ((bug = (switch_media_bug_t *) switch_channel_get_private(channel, "_stress_"))) {
</span><del>-                if (!switch_strlen_zero(data) && !strcasecmp(data, "stop")) {
</del><ins>+                if (!zstr(data) && !strcasecmp(data, "stop")) {
</ins><span class="cx">                         switch_channel_set_private(channel, "_stress_", NULL);
</span><span class="cx">                         switch_core_media_bug_remove(session, &bug);
</span><span class="cx">                 } else {
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_valet_parkingfromrev15313freeswitchtrunksrcmodapplicationsmod_valet_parking"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_valet_parking (from rev 15313, freeswitch/trunk/src/mod/applications/mod_valet_parking)</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_valet_parkingmod_valet_parking2008vcproj"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_valet_parking/mod_valet_parking.2008.vcproj</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_valet_parkingmod_valet_parking2008vcprojfromrev15313freeswitchtrunksrcmodapplicationsmod_valet_parkingmod_valet_parking2008vcproj"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_valet_parking/mod_valet_parking.2008.vcproj (from rev 15313, freeswitch/trunk/src/mod/applications/mod_valet_parking/mod_valet_parking.2008.vcproj) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_valet_parking/mod_valet_parking.2008.vcproj         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_valet_parking/mod_valet_parking.2008.vcproj        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,287 @@
</span><ins>+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+        ProjectType="Visual C++"
+        Version="9.00"
+        Name="mod_valet_parking"
+        ProjectGUID="{432DB165-1EB2-4781-A9C0-71E62610B20A}"
+        RootNamespace="mod_valet_parking"
+        Keyword="Win32Proj"
+        TargetFrameworkVersion="131072"
+        >
+        <Platforms>
+                <Platform
+                        Name="Win32"
+                />
+                <Platform
+                        Name="x64"
+                />
+        </Platforms>
+        <ToolFiles>
+        </ToolFiles>
+        <Configurations>
+                <Configuration
+                        Name="Debug|Win32"
+                        ConfigurationType="2"
+                        InheritedPropertySheets="..\..\..\..\w32\module_debug.vsprops"
+                        CharacterSet="2"
+                        >
+                        <Tool
+                                Name="VCPreBuildEventTool"
+                        />
+                        <Tool
+                                Name="VCCustomBuildTool"
+                        />
+                        <Tool
+                                Name="VCXMLDataGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCWebServiceProxyGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCMIDLTool"
+                        />
+                        <Tool
+                                Name="VCCLCompilerTool"
+                                UsePrecompiledHeader="0"
+                        />
+                        <Tool
+                                Name="VCManagedResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCPreLinkEventTool"
+                        />
+                        <Tool
+                                Name="VCLinkerTool"
+                                RandomizedBaseAddress="1"
+                                DataExecutionPrevention="0"
+                        />
+                        <Tool
+                                Name="VCALinkTool"
+                        />
+                        <Tool
+                                Name="VCManifestTool"
+                        />
+                        <Tool
+                                Name="VCXDCMakeTool"
+                        />
+                        <Tool
+                                Name="VCBscMakeTool"
+                        />
+                        <Tool
+                                Name="VCFxCopTool"
+                        />
+                        <Tool
+                                Name="VCAppVerifierTool"
+                        />
+                        <Tool
+                                Name="VCPostBuildEventTool"
+                        />
+                </Configuration>
+                <Configuration
+                        Name="Debug|x64"
+                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                        ConfigurationType="2"
+                        InheritedPropertySheets="..\..\..\..\w32\module_debug.vsprops"
+                        CharacterSet="2"
+                        >
+                        <Tool
+                                Name="VCPreBuildEventTool"
+                        />
+                        <Tool
+                                Name="VCCustomBuildTool"
+                        />
+                        <Tool
+                                Name="VCXMLDataGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCWebServiceProxyGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCMIDLTool"
+                                TargetEnvironment="3"
+                        />
+                        <Tool
+                                Name="VCCLCompilerTool"
+                                UsePrecompiledHeader="0"
+                        />
+                        <Tool
+                                Name="VCManagedResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCPreLinkEventTool"
+                        />
+                        <Tool
+                                Name="VCLinkerTool"
+                                OutputFile="$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll"
+                                RandomizedBaseAddress="1"
+                                DataExecutionPrevention="0"
+                                TargetMachine="17"
+                        />
+                        <Tool
+                                Name="VCALinkTool"
+                        />
+                        <Tool
+                                Name="VCManifestTool"
+                        />
+                        <Tool
+                                Name="VCXDCMakeTool"
+                        />
+                        <Tool
+                                Name="VCBscMakeTool"
+                        />
+                        <Tool
+                                Name="VCFxCopTool"
+                        />
+                        <Tool
+                                Name="VCAppVerifierTool"
+                        />
+                        <Tool
+                                Name="VCPostBuildEventTool"
+                        />
+                </Configuration>
+                <Configuration
+                        Name="Release|Win32"
+                        ConfigurationType="2"
+                        InheritedPropertySheets="..\..\..\..\w32\module_release.vsprops"
+                        CharacterSet="2"
+                        >
+                        <Tool
+                                Name="VCPreBuildEventTool"
+                        />
+                        <Tool
+                                Name="VCCustomBuildTool"
+                        />
+                        <Tool
+                                Name="VCXMLDataGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCWebServiceProxyGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCMIDLTool"
+                        />
+                        <Tool
+                                Name="VCCLCompilerTool"
+                                UsePrecompiledHeader="0"
+                        />
+                        <Tool
+                                Name="VCManagedResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCPreLinkEventTool"
+                        />
+                        <Tool
+                                Name="VCLinkerTool"
+                                RandomizedBaseAddress="1"
+                                DataExecutionPrevention="0"
+                        />
+                        <Tool
+                                Name="VCALinkTool"
+                        />
+                        <Tool
+                                Name="VCManifestTool"
+                        />
+                        <Tool
+                                Name="VCXDCMakeTool"
+                        />
+                        <Tool
+                                Name="VCBscMakeTool"
+                        />
+                        <Tool
+                                Name="VCFxCopTool"
+                        />
+                        <Tool
+                                Name="VCAppVerifierTool"
+                        />
+                        <Tool
+                                Name="VCPostBuildEventTool"
+                        />
+                </Configuration>
+                <Configuration
+                        Name="Release|x64"
+                        OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+                        IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+                        ConfigurationType="2"
+                        InheritedPropertySheets="..\..\..\..\w32\module_release.vsprops"
+                        CharacterSet="2"
+                        >
+                        <Tool
+                                Name="VCPreBuildEventTool"
+                        />
+                        <Tool
+                                Name="VCCustomBuildTool"
+                        />
+                        <Tool
+                                Name="VCXMLDataGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCWebServiceProxyGeneratorTool"
+                        />
+                        <Tool
+                                Name="VCMIDLTool"
+                                TargetEnvironment="3"
+                        />
+                        <Tool
+                                Name="VCCLCompilerTool"
+                                UsePrecompiledHeader="0"
+                        />
+                        <Tool
+                                Name="VCManagedResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCResourceCompilerTool"
+                        />
+                        <Tool
+                                Name="VCPreLinkEventTool"
+                        />
+                        <Tool
+                                Name="VCLinkerTool"
+                                OutputFile="$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll"
+                                RandomizedBaseAddress="1"
+                                DataExecutionPrevention="0"
+                                TargetMachine="17"
+                        />
+                        <Tool
+                                Name="VCALinkTool"
+                        />
+                        <Tool
+                                Name="VCManifestTool"
+                        />
+                        <Tool
+                                Name="VCXDCMakeTool"
+                        />
+                        <Tool
+                                Name="VCBscMakeTool"
+                        />
+                        <Tool
+                                Name="VCFxCopTool"
+                        />
+                        <Tool
+                                Name="VCAppVerifierTool"
+                        />
+                        <Tool
+                                Name="VCPostBuildEventTool"
+                        />
+                </Configuration>
+        </Configurations>
+        <References>
+        </References>
+        <Files>
+                <File
+                        RelativePath=".\mod_valet_parking.c"
+                        >
+                </File>
+        </Files>
+        <Globals>
+        </Globals>
+</VisualStudioProject>
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_valet_parkingmod_valet_parkingc"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_valet_parking/mod_valet_parking.c</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_valet_parkingmod_valet_parkingcfromrev15313freeswitchtrunksrcmodapplicationsmod_valet_parkingmod_valet_parkingc"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_valet_parking/mod_valet_parking.c (from rev 15313, freeswitch/trunk/src/mod/applications/mod_valet_parking/mod_valet_parking.c) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_valet_parking/mod_valet_parking.c         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_valet_parking/mod_valet_parking.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,368 @@
</span><ins>+/*
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005-2009, 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/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Anthony Minessale II <anthm@freeswitch.org>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Anthony Minessale II <anthm@freeswitch.org>
+ *
+ * mod_valet_parking.c -- Valet Parking Module
+ *
+ */
+#include <switch.h>
+#define VALET_EVENT "valet_parking::info"
+/* Prototypes */
+SWITCH_MODULE_LOAD_FUNCTION(mod_valet_parking_load);
+
+/* SWITCH_MODULE_DEFINITION(name, load, shutdown, runtime)
+ * Defines a switch_loadable_module_function_table_t and a static const char[] modname
+ */
+SWITCH_MODULE_DEFINITION(mod_valet_parking, mod_valet_parking_load, NULL, NULL);
+
+typedef struct {
+        switch_hash_t *hash;
+        switch_mutex_t *mutex;
+        switch_memory_pool_t *pool;
+} valet_lot_t;
+
+static valet_lot_t globals = { 0 };
+
+
+static valet_lot_t *valet_find_lot(const char *name)
+{
+        valet_lot_t *lot;
+
+        switch_mutex_lock(globals.mutex);
+        if (!(lot = switch_core_hash_find(globals.hash, name))) {
+                switch_zmalloc(lot, sizeof(*lot));
+                switch_mutex_init(&lot->mutex, SWITCH_MUTEX_NESTED, globals.pool);
+                switch_core_hash_init(&lot->hash, NULL);
+                switch_core_hash_insert(globals.hash, name, lot);
+        }
+        switch_mutex_unlock(globals.mutex);
+        return lot;
+}
+
+static switch_status_t valet_on_dtmf(switch_core_session_t *session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen)
+{
+        switch (itype) {
+        case SWITCH_INPUT_TYPE_DTMF:
+                {
+                        switch_dtmf_t *dtmf = (switch_dtmf_t *) input;
+
+                        if (dtmf->digit == '#') {
+                                return SWITCH_STATUS_BREAK;
+                        }
+                }
+        default:
+                break;
+        }
+
+        return SWITCH_STATUS_SUCCESS;
+}
+
+
+
+static int next_id(valet_lot_t *lot, int min, int max, int in)
+{
+        int i, r = 0, m;
+        char buf[128] = "";
+
+        if (!min) min = 1;
+
+        switch_mutex_lock(globals.mutex);
+        for(i = min ; (i < max || max == 0) ; i++) {
+                switch_snprintf(buf, sizeof(buf), "%d", i);
+                m = !!switch_core_hash_find(lot->hash, buf);
+
+                if ((in && !m) || (!in && m)) {
+                        r = i;
+                        break;
+                }
+        }
+        switch_mutex_unlock(globals.mutex);
+
+        return r;
+}
+
+
+#define VALET_APP_SYNTAX "<lotname> <extension>|[ask [<min>] [<max>] [<to>] [<prompt>]]"
+SWITCH_STANDARD_APP(valet_parking_function)
+{
+        char *argv[6], *lbuf;
+        int argc;
+        switch_channel_t *channel = switch_core_session_get_channel(session);
+        switch_event_t *event;
+        char dtmf_buf[128] = "";
+        int is_auto = 0;
+
+        if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data))
+                && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 2) {
+                char *lot_name = argv[0];
+                char *ext = argv[1];
+                valet_lot_t *lot;
+                const char *uuid;
+                const char *music = "silence";
+                const char *tmp = NULL;
+                switch_status_t status;
+                switch_input_args_t args = { 0 };
+                char dbuf[10];
+                char *dest;
+
+                lot = valet_find_lot(lot_name);
+                switch_assert(lot);
+
+                if (!strcasecmp(ext, "auto")) {                
+                        const char *io = argv[2];
+                        const char *min = argv[3];
+                        const char *max = argv[4];
+                        int min_i, max_i, id, in = -1;
+
+                        if (argc < 5) {
+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", VALET_APP_SYNTAX);
+                                return;
+                        }
+
+                        if (io) {
+                                if (!strcasecmp(io, "in")) {
+                                        in = 1;
+                                        is_auto = 1;
+                                } else if (!strcasecmp(io, "out")) {
+                                        in = 0;
+                                }
+                        }
+
+                        if (in < 0) {
+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", VALET_APP_SYNTAX);
+                                switch_mutex_unlock(lot->mutex);
+                                return;
+                        }
+
+                        min_i = atoi(min);
+                        max_i = atoi(max);
+
+                        if (!(id = next_id(lot, min_i, max_i, in))) {
+                                switch_ivr_phrase_macro(session, in ? "valet_lot_full" : "valet_lot_empty", "", NULL, NULL);
+                                switch_mutex_unlock(lot->mutex);
+                                return;
+                        }
+                        
+                        switch_snprintf(dtmf_buf, sizeof(dtmf_buf), "%d", id);
+                        ext = dtmf_buf;
+                } else if (!strcasecmp(ext, "ask")) {
+                        const char *prompt = "ivr/ivr-enter_ext_pound.wav";
+                        int min = 1;
+                        int max = 11;
+                        int to = 10000;
+                        int i;
+                        
+                        tmp = argv[2] ? argv[2] : switch_channel_get_variable(channel, "valet_ext_min");
+                        if (tmp) {
+                                if ((i = atoi(tmp)) > 0) {
+                                        min = i;
+                                }
+                        }
+                        
+                        tmp = argv[3] ? argv[3] : switch_channel_get_variable(channel, "valet_ext_max");
+                        if (tmp) {
+                                if ((i = atoi(tmp)) > 0) {
+                                        max = i;
+                                }
+                        }
+                        
+                        tmp = argv[4] ? argv[4] : switch_channel_get_variable(channel, "valet_ext_to");
+                        if (tmp) {
+                                if ((i = atoi(tmp)) > 0) {
+                                        to = i;
+                                }
+                        }
+                        
+                        tmp = argv[5] ? argv[5] : switch_channel_get_variable(channel, "valet_ext_prompt");
+                        if (tmp) {
+                                prompt = tmp;
+                        }
+
+                        do {
+                                status = switch_ivr_read(session, min, max, prompt, NULL, dtmf_buf, sizeof(dtmf_buf), to, "#");
+                        } while (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_FALSE);
+
+                        if (status == SWITCH_STATUS_SUCCESS) {
+                                ext = dtmf_buf;
+                        } else {
+                                switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+                        }
+                }
+                
+                switch_mutex_lock(lot->mutex);
+                if ((uuid = switch_core_hash_find(lot->hash, ext))) {
+                        switch_core_session_t *b_session;
+                        if ((b_session = switch_core_session_locate(uuid))) {
+                                if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, VALET_EVENT) == SWITCH_STATUS_SUCCESS) {
+                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Valet-Lot-Name", lot_name);
+                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Valet-Extension", ext);
+                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "bridge");
+                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridge-To-UUID", switch_core_session_get_uuid(session));
+                                        switch_channel_event_set_data(switch_core_session_get_channel(b_session), event);
+                                        switch_event_fire(&event);
+                                        switch_core_session_rwunlock(b_session);
+                                        
+                                        switch_ivr_uuid_bridge(switch_core_session_get_uuid(session), uuid);
+                                        switch_mutex_unlock(lot->mutex);
+                                        return;
+                                }
+                        }
+                }
+
+                dest = switch_core_session_sprintf(session, "sleep:1000,valet_park:%s %s", lot_name, ext);
+                switch_channel_set_variable(channel, "inline_destination", dest);
+
+                if (is_auto) {
+                        char tmp[512] = "";
+                        switch_snprintf(tmp, sizeof(tmp), "%s:%s", lot_name, ext);
+
+                        if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
+                                switch_core_session_t *b_session;
+                                
+                                if ((b_session = switch_core_session_locate(uuid))) {
+                                        switch_ivr_phrase_macro(session, "valet_announce_ext", tmp, NULL, NULL);
+                                        switch_ivr_session_transfer(b_session, dest, "inline", NULL);
+                                        switch_mutex_unlock(lot->mutex);
+                                        switch_core_session_rwunlock(b_session);
+                                        switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
+                                        return;
+                                }
+                        }
+
+                        switch_ivr_phrase_macro(session, "valet_announce_ext", tmp, NULL, NULL);
+                }
+                
+                        
+                if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, VALET_EVENT) == SWITCH_STATUS_SUCCESS) {
+                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Valet-Lot-Name", lot_name);
+                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Valet-Extension", ext);
+                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "hold");
+                        switch_event_fire(&event);
+                }
+
+                
+                if (!(tmp = switch_channel_get_variable(channel, "valet_hold_music"))) {
+                        tmp = switch_channel_get_variable(channel, "hold_music");
+                }
+                if (tmp) music = tmp;
+                
+                switch_core_hash_insert(lot->hash, ext, switch_core_session_get_uuid(session));
+                
+                args.input_callback = valet_on_dtmf;
+                args.buf = dbuf;
+                args.buflen = sizeof(dbuf);
+
+                switch_mutex_unlock(lot->mutex);
+                if (!strcasecmp(music, "silence")) {
+                        switch_ivr_collect_digits_callback(session, &args, 0, 0);
+                } else {
+                        switch_ivr_play_file(session, NULL, music, &args);
+                }
+                switch_mutex_lock(lot->mutex);
+                switch_core_hash_delete(lot->hash, ext);
+                switch_mutex_unlock(lot->mutex);
+        } else {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", VALET_APP_SYNTAX);
+        }
+}
+
+SWITCH_STANDARD_API(valet_info_function)
+{
+        switch_hash_index_t *hi;
+        const void *var;
+ void *val;
+        char *name;
+        valet_lot_t *lot;
+
+        stream->write_function(stream, "<lots>\n");
+
+        switch_mutex_lock(globals.mutex);
+        for (hi = switch_hash_first(NULL, globals.hash); hi; hi = switch_hash_next(hi)) {
+                switch_hash_index_t *i_hi;
+                const void *i_var;
+                void *i_val;
+                char *i_ext;
+                char *i_uuid;
+
+                switch_hash_this(hi, &var, NULL, &val);
+                name = (char *) var;
+                lot = (valet_lot_t *) val;
+                
+                if (!zstr(cmd) && strcasecmp(cmd, name)) continue;
+                
+                stream->write_function(stream, " <lot name=\"%s\">\n", name);
+
+                for (i_hi = switch_hash_first(NULL, lot->hash); i_hi; i_hi = switch_hash_next(i_hi)) {
+                        switch_hash_this(i_hi, &i_var, NULL, &i_val);
+                        i_ext = (char *) i_var;
+                        i_uuid = (char *) i_val;
+                        stream->write_function(stream, " <extension uuid=\"%s\">%s</extension>\n", i_uuid, i_ext);
+                }
+                stream->write_function(stream, " </lot>\n");
+        }
+
+        stream->write_function(stream, "</lots>\n");
+
+        switch_mutex_unlock(globals.mutex);
+
+        return SWITCH_STATUS_SUCCESS;
+}
+
+/* Macro expands to: switch_status_t mod_valet_parking_load(switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool) */
+SWITCH_MODULE_LOAD_FUNCTION(mod_valet_parking_load)
+{
+        switch_application_interface_t *app_interface;
+        switch_api_interface_t *api_interface;
+
+        /* create/register custom event message type */
+        if (switch_event_reserve_subclass(VALET_EVENT) != SWITCH_STATUS_SUCCESS) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass %s!\n", VALET_EVENT);
+                return SWITCH_STATUS_TERM;
+        }
+
+        globals.pool = pool;
+        switch_core_hash_init(&globals.hash, NULL);
+        switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, globals.pool);
+
+        /* connect my internal structure to the blank pointer passed to me */
+        *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+
+        SWITCH_ADD_APP(app_interface, "valet_park", "valet_park", "valet_park", valet_parking_function, VALET_APP_SYNTAX, SAF_NONE);
+        SWITCH_ADD_API(api_interface, "valet_info", "Valet Parking Info", valet_info_function, "[<lot name>]");
+
+        return SWITCH_STATUS_NOUNLOAD;
+}
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4
+ */
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_vmdmod_vmdc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_vmd/mod_vmd.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_vmd/mod_vmd.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_vmd/mod_vmd.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -611,20 +611,20 @@
</span><span class="cx"> */
</span><span class="cx"> SWITCH_STANDARD_API(vmd_api_main)
</span><span class="cx"> {
</span><del>- switch_core_session_t *vmd_session;
</del><ins>+ switch_core_session_t *vmd_session = NULL;
</ins><span class="cx"> switch_media_bug_t *bug;
</span><span class="cx"> vmd_session_info_t *vmd_info;
</span><span class="cx"> switch_channel_t *channel;
</span><span class="cx"> switch_status_t status;
</span><span class="cx"> int argc;
</span><span class="cx"> char *argv[VMD_PARAMS];
</span><del>- char *ccmd;
</del><ins>+ char *ccmd = NULL;
</ins><span class="cx"> char *uuid;
</span><span class="cx"> char *command;
</span><span class="cx"> int i;
</span><span class="cx">
</span><span class="cx"> /* No command? Display usage */
</span><del>- if (cmd == NULL) {
</del><ins>+ if (zstr(cmd)) {
</ins><span class="cx"> stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX);
</span><span class="cx"> return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="lines">@@ -638,8 +638,7 @@
</span><span class="cx"> * display usage */
</span><span class="cx"> if (argc != VMD_PARAMS) {
</span><span class="cx"> stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX);
</span><del>- switch_safe_free(ccmd);
- return SWITCH_STATUS_SUCCESS;
</del><ins>+                goto end;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> uuid = argv[0];
</span><span class="lines">@@ -650,9 +649,8 @@
</span><span class="cx">
</span><span class="cx"> /* If the session was not found exit */
</span><span class="cx"> if (vmd_session == NULL) {
</span><del>- switch_safe_free(ccmd);
</del><span class="cx"> stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX);
</span><del>- return SWITCH_STATUS_FALSE;
</del><ins>+                goto end;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /* Get current channel of the session to tag the session
</span><span class="lines">@@ -669,21 +667,18 @@
</span><span class="cx"> switch_core_media_bug_remove(vmd_session, &bug);
</span><span class="cx"> switch_safe_free(ccmd);
</span><span class="cx"> stream->write_function(stream, "+OK\n");
</span><del>- return SWITCH_STATUS_SUCCESS;
</del><ins>+                        goto end;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /* We have already started */
</span><span class="cx"> switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Cannot run 2 at once on the same channel!\n");
</span><del>-
- switch_safe_free(ccmd);
- return SWITCH_STATUS_FALSE;
</del><ins>+                goto end;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /* If we don't see the expected start exit */
</span><span class="cx"> if (strcasecmp(command, "start") != 0) {
</span><del>- switch_safe_free(ccmd);
</del><span class="cx"> stream->write_function(stream, "-USAGE: %s\n", VMD_SYNTAX);
</span><del>- return SWITCH_STATUS_FALSE;
</del><ins>+                goto end;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /* Allocate memory attached to this FreeSWITCH session for
</span><span class="lines">@@ -712,9 +707,7 @@
</span><span class="cx"> /* If adding a media bug fails exit */
</span><span class="cx"> if (status != SWITCH_STATUS_SUCCESS) {
</span><span class="cx"> switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Failure hooking to stream\n");
</span><del>-
- switch_safe_free(ccmd);
- return SWITCH_STATUS_FALSE;
</del><ins>+ goto end;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /* Set the vmd tag to detect an existing vmd media bug */
</span><span class="lines">@@ -723,7 +716,15 @@
</span><span class="cx"> /* Everything went according to plan! Notify the user */
</span><span class="cx"> stream->write_function(stream, "+OK\n");
</span><span class="cx">
</span><ins>+
+ end:
+
+        if (vmd_session) {
+                switch_core_session_rwunlock(vmd_session);
+        }
+
</ins><span class="cx"> switch_safe_free(ccmd);
</span><ins>+
</ins><span class="cx"> return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodapplicationsmod_voicemailmod_voicemailc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_voicemail/mod_voicemail.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_voicemail/mod_voicemail.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/applications/mod_voicemail/mod_voicemail.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -130,6 +130,8 @@
</span><span class="cx">         char *web_tail;
</span><span class="cx">         char *email_from;
</span><span class="cx">         char *date_fmt;
</span><ins>+        char *convert_cmd;
+        char *convert_ext;
</ins><span class="cx">         date_location_t play_date_announcement;
</span><span class="cx">         uint32_t digit_timeout;
</span><span class="cx">         uint32_t max_login_attempts;
</span><span class="lines">@@ -553,7 +555,13 @@
</span><span class="cx">
</span><span class="cx">         SWITCH_CONFIG_SET_ITEM(profile->config[i++], "play-date-announcement", SWITCH_CONFIG_ENUM, CONFIG_RELOADABLE,
</span><span class="cx">                 &profile->play_date_announcement, VM_DATE_FIRST, &config_play_date_announcement, NULL, NULL);
</span><del>-                
</del><ins>+
+        SWITCH_CONFIG_SET_ITEM(profile->config[i++], "convert-cmd", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE,
+                                                 &profile->convert_cmd, NULL, &profile->config_str_pool, NULL, NULL);
+        SWITCH_CONFIG_SET_ITEM(profile->config[i++], "convert-ext", SWITCH_CONFIG_STRING, CONFIG_RELOADABLE,
+                                                 &profile->convert_ext, NULL, &profile->config_str_pool, NULL, NULL);
+
+        
</ins><span class="cx">         SWITCH_CONFIG_SET_ITEM(profile->config[i++], "digit-timeout", SWITCH_CONFIG_INT, CONFIG_RELOADABLE,
</span><span class="cx">                 &profile->digit_timeout, 10000, &config_int_digit_timeout, NULL, NULL);
</span><span class="cx">         SWITCH_CONFIG_SET_ITEM(profile->config[i++], "max-login-attempts", SWITCH_CONFIG_INT, CONFIG_RELOADABLE,
</span><span class="lines">@@ -661,7 +669,7 @@
</span><span class="cx">                 switch_thread_rwlock_create(&profile->rwlock, pool);
</span><span class="cx">                 profile->name = switch_core_strdup(pool, profile_name);
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(profile->odbc_dsn)) {
</del><ins>+                if (!zstr(profile->odbc_dsn)) {
</ins><span class="cx">                         if ((profile->odbc_user = strchr(profile->odbc_dsn, ':'))) {
</span><span class="cx">                                 *(profile->odbc_user++) = '\0';
</span><span class="cx">                                 if ((profile->odbc_pass = strchr(profile->odbc_user, ':'))) {
</span><span class="lines">@@ -771,6 +779,9 @@
</span><span class="cx">         if (xml) {
</span><span class="cx">                 switch_xml_free(xml);
</span><span class="cx">         }
</span><ins>+        if (event) {
+                switch_event_destroy(&event);
+        }
</ins><span class="cx">         return profile;
</span><span class="cx">
</span><span class="cx"> }
</span><span class="lines">@@ -1232,6 +1243,8 @@
</span><span class="cx">         int want;
</span><span class="cx">         msg_type_t type;
</span><span class="cx">         msg_move_t move;
</span><ins>+        char *convert_cmd;
+        char *convert_ext;
</ins><span class="cx"> };
</span><span class="cx"> typedef struct listen_callback listen_callback_t;
</span><span class="cx">
</span><span class="lines">@@ -1561,7 +1574,7 @@
</span><span class="cx">                                 char *sql = switch_mprintf("update voicemail_msgs set flags='delete' where uuid='%s'", cbt->uuid);
</span><span class="cx">                                 vm_execute_sql(profile, sql, profile->mutex);
</span><span class="cx">                                 switch_safe_free(sql);
</span><del>-                                if (!strcmp(input, profile->email_key) && !switch_strlen_zero(cbt->email)) {
</del><ins>+                                if (!strcmp(input, profile->email_key) && !zstr(cbt->email)) {
</ins><span class="cx">                                         switch_event_t *event;
</span><span class="cx">                                         char *from;
</span><span class="cx">                                         char *headers, *header_string;
</span><span class="lines">@@ -1621,13 +1634,13 @@
</span><span class="cx">                                         switch_channel_set_variable(channel, "voicemail_message_len", duration_str);
</span><span class="cx">                                         switch_channel_set_variable(channel, "voicemail_email", cbt->email);
</span><span class="cx">
</span><del>-                                        if (switch_strlen_zero(profile->email_headers)) {
</del><ins>+                                        if (zstr(profile->email_headers)) {
</ins><span class="cx">                                                 from = switch_core_session_sprintf(session, "%s@%s", cbt->user, cbt->domain);
</span><span class="cx">                                         } else {
</span><span class="cx">                                                 from = switch_channel_expand_variables(channel, profile->email_from);
</span><span class="cx">                                         }
</span><span class="cx">
</span><del>-                                        if (switch_strlen_zero(profile->email_headers)) {
</del><ins>+                                        if (zstr(profile->email_headers)) {
</ins><span class="cx">                                                 headers = switch_core_session_sprintf(session,
</span><span class="cx">                                                                                                                          "From: FreeSWITCH mod_voicemail <%s@%s>\nSubject: Voicemail from %s %s\nX-Priority: %d",
</span><span class="cx">                                                                                                                          cbt->user, cbt->domain, cbt->cid_name, cbt->cid_number, priority);
</span><span class="lines">@@ -1659,7 +1672,7 @@
</span><span class="cx">                                                 body = switch_mprintf("%u second Voicemail from %s %s", message_len, cbt->cid_name, cbt->cid_number);
</span><span class="cx">                                         }
</span><span class="cx">
</span><del>-                                        switch_simple_email(cbt->email, from, header_string, body, cbt->file_path);
</del><ins>+                                        switch_simple_email(cbt->email, from, header_string, body, cbt->file_path, cbt->convert_cmd, cbt->convert_ext);
</ins><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Sending message to %s\n", cbt->email);
</span><span class="cx">                                         switch_safe_free(body);
</span><span class="cx">                                         TRY_CODE(switch_ivr_phrase_macro(session, VM_ACK_MACRO, "emailed", NULL, NULL));
</span><span class="lines">@@ -1735,6 +1748,8 @@
</span><span class="cx">         int total_saved_urgent_messages = 0;
</span><span class="cx">         int heard_auto_saved = 0, heard_auto_new = 0;
</span><span class="cx">         char *vm_email = NULL;
</span><ins>+        char *convert_cmd = profile->convert_cmd;
+        char *convert_ext = profile->convert_ext;
</ins><span class="cx">         char *vm_storage_dir = NULL;
</span><span class="cx">         char global_buf[2] = "";
</span><span class="cx">         switch_input_args_t args = { 0 };
</span><span class="lines">@@ -1806,7 +1821,7 @@
</span><span class="cx">                                         switch_snprintf(msg_count, sizeof(msg_count), "%d:urgent-new", total_new_urgent_messages);
</span><span class="cx">                                         TRY_CODE(switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, &folder_args));
</span><span class="cx">                                         informed++;
</span><del>-                                        if (!switch_strlen_zero_buf(global_buf)) {
</del><ins>+                                        if (!zstr_buf(global_buf)) {
</ins><span class="cx">                                                 vm_check_state = VM_CHECK_MENU;
</span><span class="cx">                                                 continue;
</span><span class="cx">                                         }
</span><span class="lines">@@ -1815,7 +1830,7 @@
</span><span class="cx">                                         switch_snprintf(msg_count, sizeof(msg_count), "%d:new", total_new_messages);
</span><span class="cx">                                         TRY_CODE(switch_ivr_phrase_macro(session, VM_MESSAGE_COUNT_MACRO, msg_count, NULL, &folder_args));
</span><span class="cx">                                         informed++;
</span><del>-                                        if (!switch_strlen_zero_buf(global_buf)) {
</del><ins>+                                        if (!zstr_buf(global_buf)) {
</ins><span class="cx">                                                 vm_check_state = VM_CHECK_MENU;
</span><span class="cx">                                                 continue;
</span><span class="cx">                                         }
</span><span class="lines">@@ -1849,6 +1864,8 @@
</span><span class="cx">                                                          &total_new_urgent_messages, &total_saved_urgent_messages);
</span><span class="cx">                                 memset(&cbt, 0, sizeof(cbt));
</span><span class="cx">                                 cbt.email = vm_email;
</span><ins>+                                cbt.convert_cmd = convert_cmd;
+                                cbt.convert_ext = convert_ext;
</ins><span class="cx">                                 cbt.move = VM_MOVE_NEXT;
</span><span class="cx">                                 switch (play_msg_type) {
</span><span class="cx">                                 case MSG_NEW:
</span><span class="lines">@@ -2033,7 +2050,7 @@
</span><span class="cx">                                 char input[10] = "";
</span><span class="cx">                                 char key_buf[80] = "";
</span><span class="cx">                                 play_msg_type = MSG_NONE;
</span><del>-                                if (!switch_strlen_zero_buf(global_buf)) {
</del><ins>+                                if (!zstr_buf(global_buf)) {
</ins><span class="cx">                                         switch_set_string(input, global_buf);
</span><span class="cx">                                         *global_buf = '\0';
</span><span class="cx">                                         status = SWITCH_STATUS_SUCCESS;
</span><span class="lines">@@ -2143,8 +2160,8 @@
</span><span class="cx">                                         } else if (!auth && !thepass && !strcasecmp(var, "password")) {
</span><span class="cx">                                                 thepass = switch_core_session_strdup(session, val);
</span><span class="cx">                                         } else if (!auth && !strcasecmp(var, "vm-password")) {
</span><del>-                                                if (!switch_strlen_zero(val) && !strcasecmp(val, "user-choose")) {
-                                                        if (switch_strlen_zero(cbt.password)) {
</del><ins>+                                                if (!zstr(val) && !strcasecmp(val, "user-choose")) {
+                                                        if (zstr(cbt.password)) {
</ins><span class="cx">                                                                 auth = 1;
</span><span class="cx">                                                         } else {
</span><span class="cx">                                                                 thepass = switch_core_session_strdup(session, val);
</span><span class="lines">@@ -2154,9 +2171,13 @@
</span><span class="cx">                                                 }
</span><span class="cx">                                         } else if (!strcasecmp(var, "vm-mailto")) {
</span><span class="cx">                                                 vm_email = switch_core_session_strdup(session, val);
</span><ins>+                                        } else if (!strcasecmp(var, "vm-convert-cmd")) {
+                                                convert_cmd = switch_core_session_strdup(session, val);
+                                        } else if (!strcasecmp(var, "vm-convert-ext")) {
+                                                convert_ext = switch_core_session_strdup(session, val);
</ins><span class="cx">                                         } else if (!strcasecmp(var, "storage-dir")) {
</span><span class="cx">                                                 vm_storage_dir = switch_core_session_strdup(session, val);
</span><del>-
</del><ins>+                                                
</ins><span class="cx">                                         } else if (!strcasecmp(var, "timezone")) {
</span><span class="cx">                                                 switch_channel_set_variable(channel, var, val);
</span><span class="cx">                                         }
</span><span class="lines">@@ -2184,12 +2205,12 @@
</span><span class="cx">                                         thehash = vmhash;
</span><span class="cx">                                 }
</span><span class="cx">                                 
</span><del>-                                if (!auth && !thepass && !switch_strlen_zero(cbt.password)) {
</del><ins>+                                if (!auth && !thepass && !zstr(cbt.password)) {
</ins><span class="cx">                                         thepass = cbt.password;
</span><span class="cx">                                 }
</span><span class="cx">
</span><span class="cx">                                 if (!auth) {
</span><del>-                                        if (!switch_strlen_zero(cbt.password) && !strcmp(cbt.password, mypass)) {
</del><ins>+                                        if (!zstr(cbt.password) && !strcmp(cbt.password, mypass)) {
</ins><span class="cx">                                                 auth++;
</span><span class="cx">                                         } else if (!thepass) {
</span><span class="cx">                                                 auth++;
</span><span class="lines">@@ -2216,9 +2237,9 @@
</span><span class="cx">                                 
</span><span class="cx">                                 if (auth) {
</span><span class="cx">                                         if (!dir_path) {
</span><del>-                                                if (!switch_strlen_zero(vm_storage_dir)) {
</del><ins>+                                                if (!zstr(vm_storage_dir)) {
</ins><span class="cx">                                                         dir_path = switch_core_session_sprintf(session, "%s%s%s", vm_storage_dir, SWITCH_PATH_SEPARATOR, myid);
</span><del>-                                                } else if ( !switch_strlen_zero(profile->storage_dir) ) {
</del><ins>+                                                } else if ( !zstr(profile->storage_dir) ) {
</ins><span class="cx">                                                         dir_path = switch_core_session_sprintf(session, "%s%s%s%s%s", profile->storage_dir, SWITCH_PATH_SEPARATOR, domain_name, SWITCH_PATH_SEPARATOR, myid);
</span><span class="cx">                                                 } else {
</span><span class="cx">                                                         dir_path = switch_core_session_sprintf(session, "%s%svoicemail%s%s%s%s%s%s", SWITCH_GLOBAL_dirs.storage_dir,
</span><span class="lines">@@ -2304,7 +2325,9 @@
</span><span class="cx">         const char *tmp;
</span><span class="cx">         switch_event_t *local_event = NULL;
</span><span class="cx">         switch_status_t ret = SWITCH_STATUS_SUCCESS;
</span><del>-        
</del><ins>+        char *convert_cmd = profile->convert_cmd;
+        char *convert_ext = profile->convert_ext;
+
</ins><span class="cx">         if (!params) {
</span><span class="cx">                 switch_event_create(&local_event, SWITCH_EVENT_REQUEST_PARAMS);
</span><span class="cx">                 params = local_event;
</span><span class="lines">@@ -2357,6 +2380,10 @@
</span><span class="cx">                         insert_db = switch_true(val);
</span><span class="cx">                 } else if (!strcasecmp(var, "vm-attach-file")) {
</span><span class="cx">                         email_attach = switch_true(val);
</span><ins>+                } else if (!strcasecmp(var, "vm-convert-cmd")) {
+                        convert_cmd = switch_core_strdup(pool, val);
+                } else if (!strcasecmp(var, "vm-convert-ext")) {
+                        convert_ext = switch_core_strdup(pool, val);
</ins><span class="cx">                 } else if (!strcasecmp(var, "timezone")) {
</span><span class="cx">                         vm_timezone = switch_core_strdup(pool, val);
</span><span class="cx">                 }
</span><span class="lines">@@ -2365,9 +2392,9 @@
</span><span class="cx">
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Deliver VM to %s@%s\n", myid, domain_name);
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(vm_storage_dir)) {
</del><ins>+        if (!zstr(vm_storage_dir)) {
</ins><span class="cx">                 dir_path = switch_mprintf("%s%s%s", vm_storage_dir, SWITCH_PATH_SEPARATOR, myid);
</span><del>-        } else if (!switch_strlen_zero(profile->storage_dir)) {
</del><ins>+        } else if (!zstr(profile->storage_dir)) {
</ins><span class="cx">                 dir_path = switch_mprintf("%s%s%s%s%s", profile->storage_dir, SWITCH_PATH_SEPARATOR, domain_name, SWITCH_PATH_SEPARATOR, myid);
</span><span class="cx">         } else {
</span><span class="cx">                 dir_path = switch_mprintf("%s%svoicemail%s%s%s%s%s%s", SWITCH_GLOBAL_dirs.storage_dir,
</span><span class="lines">@@ -2426,7 +2453,7 @@
</span><span class="cx">                 update_mwi(profile, myid, domain_name, myfolder);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (send_mail && !switch_strlen_zero(vm_email) && switch_file_exists(file_path, pool) == SWITCH_STATUS_SUCCESS) {
</del><ins>+        if (send_mail && !zstr(vm_email) && switch_file_exists(file_path, pool) == SWITCH_STATUS_SUCCESS) {
</ins><span class="cx">                 switch_event_t *event;
</span><span class="cx">                 char *from;
</span><span class="cx">                 char *body;
</span><span class="lines">@@ -2448,7 +2475,7 @@
</span><span class="cx">                 message_count(profile, myid, domain_name, myfolder, &total_new_messages, &total_saved_messages,
</span><span class="cx">                                          &total_new_urgent_messages, &total_saved_urgent_messages);
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(vm_timezone) || (switch_strftime_tz(vm_timezone, profile->date_fmt, date, sizeof(date), 0) != SWITCH_STATUS_SUCCESS)) {
</del><ins>+                if (zstr(vm_timezone) || (switch_strftime_tz(vm_timezone, profile->date_fmt, date, sizeof(date), 0) != SWITCH_STATUS_SUCCESS)) {
</ins><span class="cx">                         switch_time_exp_lt(&tm, switch_micro_time_now());
</span><span class="cx">                         switch_strftime(date, &retsize, sizeof(date), profile->date_fmt, &tm);
</span><span class="cx">                 }
</span><span class="lines">@@ -2486,7 +2513,7 @@
</span><span class="cx">
</span><span class="cx">                 switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "voicemail_message_len", duration_str);
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(profile->email_from)) {
</del><ins>+                if (zstr(profile->email_from)) {
</ins><span class="cx">                         from = switch_core_sprintf(pool, "%s@%s", myid, domain_name);
</span><span class="cx">                 } else {
</span><span class="cx">                         from = switch_event_expand_headers(params, profile->email_from);
</span><span class="lines">@@ -2494,7 +2521,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">                 if (send_main) {
</span><del>-                        if (switch_strlen_zero(profile->email_headers)) {
</del><ins>+                        if (zstr(profile->email_headers)) {
</ins><span class="cx">                                 headers = switch_mprintf(
</span><span class="cx">                                                                                  "From: FreeSWITCH mod_voicemail <%s@%s>\n"
</span><span class="cx">                                                                                  "Subject: Voicemail from %s %s\nX-Priority: %d",
</span><span class="lines">@@ -2528,9 +2555,9 @@
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         if (email_attach) {
</span><del>-                                switch_simple_email(vm_email, from, header_string, body, file_path);
</del><ins>+                                switch_simple_email(vm_email, from, header_string, body, file_path, convert_cmd, convert_ext);
</ins><span class="cx">                         } else {
</span><del>-                                switch_simple_email(vm_email, from, header_string, body, NULL);
</del><ins>+                                switch_simple_email(vm_email, from, header_string, body, NULL, NULL, NULL);
</ins><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Sending message to %s\n", vm_email);
</span><span class="lines">@@ -2546,7 +2573,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">                 if (send_notify) {
</span><del>-                        if (switch_strlen_zero(profile->notify_email_headers)) {
</del><ins>+                        if (zstr(profile->notify_email_headers)) {
</ins><span class="cx">                                 headers = switch_mprintf(
</span><span class="cx">                                                                                  "From: FreeSWITCH mod_voicemail <%s@%s>\n"
</span><span class="cx">                                                                                  "Subject: Voicemail from %s %s\nX-Priority: %d",
</span><span class="lines">@@ -2579,7 +2606,7 @@
</span><span class="cx">                                 body = switch_mprintf("%u second Voicemail from %s %s", message_len, caller_id_name, caller_id_number);
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        switch_simple_email(vm_notify_email, from, header_string, body, NULL);
</del><ins>+                        switch_simple_email(vm_notify_email, from, header_string, body, NULL, NULL, NULL);
</ins><span class="cx">
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Sending notify message to %s\n", vm_notify_email);
</span><span class="cx">                         
</span><span class="lines">@@ -2624,7 +2651,7 @@
</span><span class="cx">         char *box, *path, *cid_num, *cid_name;
</span><span class="cx">         switch_memory_pool_t *pool = NULL;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 status = SWITCH_STATUS_FALSE;
</span><span class="cx">                 goto end;
</span><span class="cx">         }
</span><span class="lines">@@ -2826,6 +2853,11 @@
</span><span class="cx">         switch_event_t *vars = NULL;
</span><span class="cx">         const char *vm_cc = NULL, *vtmp, *vm_ext = NULL;
</span><span class="cx">         int disk_quota = 0;
</span><ins>+        switch_bool_t skip_greeting = switch_true(switch_channel_get_variable(channel, "skip_greeting"));
+        switch_bool_t skip_instructions = switch_true(switch_channel_get_variable(channel, "skip_instructions"));
+
+        switch_channel_set_variable(channel, "skip_greeting", NULL);
+        switch_channel_set_variable(channel, "skip_instructions", NULL);
</ins><span class="cx">         
</span><span class="cx">         if (!(caller_id_name = switch_channel_get_variable(channel, "effective_caller_id_name"))) {
</span><span class="cx">                 caller_id_name = caller_profile->caller_id_name;
</span><span class="lines">@@ -2877,17 +2909,17 @@
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if (send_main && switch_strlen_zero(vm_email) && !switch_strlen_zero(email_addr)) {
</del><ins>+                        if (send_main && zstr(vm_email) && !zstr(email_addr)) {
</ins><span class="cx">                                 vm_email = switch_core_session_strdup(session, email_addr);
</span><del>-                                if (switch_strlen_zero(vm_email)) {
</del><ins>+                                if (zstr(vm_email)) {
</ins><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "No email address, not going to send email.\n");
</span><span class="cx">                                         send_main = 0;
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if (send_notify && switch_strlen_zero(vm_notify_email)) {
</del><ins>+                        if (send_notify && zstr(vm_notify_email)) {
</ins><span class="cx">                                 vm_notify_email = vm_email;
</span><del>-                                if (switch_strlen_zero(vm_notify_email)) {
</del><ins>+                                if (zstr(vm_notify_email)) {
</ins><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "No notify email address, not going to notify.\n");
</span><span class="cx">                                         send_notify = 0;
</span><span class="cx">                                 }
</span><span class="lines">@@ -2915,9 +2947,9 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(vm_storage_dir)) {
</del><ins>+        if (!zstr(vm_storage_dir)) {
</ins><span class="cx">                 dir_path = switch_core_session_sprintf(session, "%s%s%s", vm_storage_dir, SWITCH_PATH_SEPARATOR, id);
</span><del>-        } else if (!switch_strlen_zero(profile->storage_dir)) {
</del><ins>+        } else if (!zstr(profile->storage_dir)) {
</ins><span class="cx">                 dir_path = switch_core_session_sprintf(session, "%s%s%s%s%s", profile->storage_dir, SWITCH_PATH_SEPARATOR, domain_name, SWITCH_PATH_SEPARATOR, id);
</span><span class="cx">         } else {
</span><span class="cx">                 dir_path = switch_core_session_sprintf(session, "%s%svoicemail%s%s%s%s%s%s", SWITCH_GLOBAL_dirs.storage_dir,
</span><span class="lines">@@ -2949,76 +2981,82 @@
</span><span class="cx">                 greet_path = cbt.greeting_path;
</span><span class="cx">         }
</span><span class="cx">
</span><del>- greet:
-        memset(buf, 0, sizeof(buf));
-        args.input_callback = cancel_on_dtmf;
-        args.buf = buf;
-        args.buflen = sizeof(buf);
</del><ins>+greet:
+        if (!skip_greeting) {
+                memset(buf, 0, sizeof(buf));
+                args.input_callback = cancel_on_dtmf;
+                args.buf = buf;
+                args.buflen = sizeof(buf);
</ins><span class="cx">
</span><del>-        switch_ivr_sleep(session, 100, SWITCH_TRUE, NULL);
</del><ins>+                switch_ivr_sleep(session, 100, SWITCH_TRUE, NULL);
</ins><span class="cx">
</span><del>-        if (!switch_strlen_zero(greet_path)) {
-                memset(buf, 0, sizeof(buf));
-                TRY_CODE(switch_ivr_play_file(session, NULL, greet_path, &args));
-        } else {
-                if (!switch_strlen_zero(cbt.name_path)) {
</del><ins>+                if (!zstr(greet_path)) {
</ins><span class="cx">                         memset(buf, 0, sizeof(buf));
</span><del>-                        TRY_CODE(switch_ivr_play_file(session, NULL, cbt.name_path, &args));
-                }
-                if (*buf == '\0') {
-                        if (!read_id) {
-                                if (!(read_id = switch_channel_get_variable(channel, "voicemail_alternate_greet_id"))) {
-                                        read_id = id;
</del><ins>+                        TRY_CODE(switch_ivr_play_file(session, NULL, greet_path, &args));
+                } else {
+                        if (!zstr(cbt.name_path)) {
+                                memset(buf, 0, sizeof(buf));
+                                TRY_CODE(switch_ivr_play_file(session, NULL, cbt.name_path, &args));
+                        }
+                        if (*buf == '\0') {
+                                if (!read_id) {
+                                        if (!(read_id = switch_channel_get_variable(channel, "voicemail_alternate_greet_id"))) {
+                                                read_id = id;
+                                        }
</ins><span class="cx">                                 }
</span><ins>+                                memset(buf, 0, sizeof(buf));
+                                TRY_CODE(switch_ivr_phrase_macro(session, VM_PLAY_GREETING_MACRO, read_id, NULL, &args));
</ins><span class="cx">                         }
</span><del>-                        memset(buf, 0, sizeof(buf));
-                        TRY_CODE(switch_ivr_phrase_macro(session, VM_PLAY_GREETING_MACRO, read_id, NULL, &args));
</del><span class="cx">                 }
</span><del>-        }
</del><span class="cx">
</span><del>-        if (*buf != '\0') {
- greet_key_press:
-                if (switch_stristr(buf, profile->login_keys)) {
-                        voicemail_check_main(session, profile, domain_name, id, 0);
-                } else if (!strcasecmp(buf, profile->operator_key) && !switch_strlen_zero(profile->operator_key)) {
-                        int argc;
-                        char *argv[4];
-                        char *mycmd;
</del><ins>+ if (*buf != '\0') {
+greet_key_press:
+ if (switch_stristr(buf, profile->login_keys)) {
+ voicemail_check_main(session, profile, domain_name, id, 0);
+ } else if (!strcasecmp(buf, profile->operator_key) && !zstr(profile->operator_key)) {
+ int argc;
+ char *argv[4];
+ char *mycmd;
</ins><span class="cx">
</span><del>-                        if (!switch_strlen_zero(profile->operator_ext) && (mycmd = switch_core_session_strdup(session, profile->operator_ext))) {
-                                argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
-                                if (argc >= 1 && argc <= 4) {
-                                        switch_ivr_session_transfer(session, argv[0], argv[1], argv[2]);
-                                        /* the application still runs after we leave it so we need to make sure that we don't do anything evil */
-                                        send_mail = 0;
-                                        goto end;
-                                }
-                        }
-                } else if (!strcasecmp(buf, profile->vmain_key) && !switch_strlen_zero(profile->vmain_key)) {
-                        int argc;
-                        char *argv[4];
-                        char *mycmd;
</del><ins>+ if (!zstr(profile->operator_ext) && (mycmd = switch_core_session_strdup(session, profile->operator_ext))) {
+ argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
+ if (argc >= 1 && argc <= 4) {
+ switch_ivr_session_transfer(session, argv[0], argv[1], argv[2]);
+ /* the application still runs after we leave it so we need to make sure that we don't do anything evil */
+ send_mail = 0;
+ goto end;
+ }
+ }
+ } else if (!strcasecmp(buf, profile->vmain_key) && !zstr(profile->vmain_key)) {
+ int argc;
+ char *argv[4];
+ char *mycmd;
</ins><span class="cx">
</span><del>-                        if (!switch_strlen_zero(profile->vmain_ext) && (mycmd = switch_core_session_strdup(session, profile->vmain_ext))) {
-                                argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
-                                if (argc >= 1 && argc <= 4) {
-                                        switch_ivr_session_transfer(session, argv[0], argv[1], argv[2]);
-                                        /* the application still runs after we leave it so we need to make sure that we don't do anything evil */
-                                        send_mail = 0;
-                                        goto end;
-                                }
</del><ins>+ if (!zstr(profile->vmain_ext) && (mycmd = switch_core_session_strdup(session, profile->vmain_ext))) {
+ argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
+ if (argc >= 1 && argc <= 4) {
+ switch_ivr_session_transfer(session, argv[0], argv[1], argv[2]);
+ /* the application still runs after we leave it so we need to make sure that we don't do anything evil */
+ send_mail = 0;
+ goto end;
+ }
+ }
+                        } else if (*profile->skip_greet_key && !strcasecmp(buf, profile->skip_greet_key)) {
+                                skip_instructions = SWITCH_TRUE;
+                        } else {
+                                goto greet;
</ins><span class="cx">                         }
</span><del>-                } else if (*profile->skip_greet_key && !strcasecmp(buf, profile->skip_greet_key)) {
-                        record_macro = NULL;
-                } else {
-                        goto greet;
</del><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        if (skip_instructions) {
+                record_macro = NULL;
+        }
+
</ins><span class="cx">         if (disk_quota) {
</span><span class="cx">                 callback_t callback = { 0 };
</span><span class="cx">                 char sqlstmt[256];
</span><del>-                char disk_usage[256];
</del><ins>+                char disk_usage[256] = "";
</ins><span class="cx">
</span><span class="cx">                 callback.buf = disk_usage;
</span><span class="cx">                 callback.len = sizeof(disk_usage);
</span><span class="lines">@@ -3026,7 +3064,7 @@
</span><span class="cx">                 switch_snprintf(sqlstmt, sizeof(sqlstmt),
</span><span class="cx">                                                 "select sum(message_len) from voicemail_msgs where username='%s' and domain='%s'",
</span><span class="cx">                                                 id, domain_name);
</span><del>-                vm_execute_sql_callback(profile, profile->mutex, sql, sql2str_callback, &callback);
</del><ins>+                vm_execute_sql_callback(profile, profile->mutex, sqlstmt, sql2str_callback, &callback);
</ins><span class="cx">
</span><span class="cx">                 if (atoi(disk_usage) >= disk_quota) {
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Voicemail disk quota is exceeded for %s\n", id);
</span><span class="lines">@@ -3142,7 +3180,7 @@
</span><span class="cx">         int x = 0, check = 0, auth = 0;
</span><span class="cx">         switch_channel_t *channel = switch_core_session_get_channel(session);
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data)) {
</del><ins>+        if (!zstr(data)) {
</ins><span class="cx">                 mydata = switch_core_session_strdup(session, data);
</span><span class="cx">                 argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="lines">@@ -3175,19 +3213,19 @@
</span><span class="cx">                 auth = 1;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(profile_name)) {
</del><ins>+        if (zstr(profile_name)) {
</ins><span class="cx">                 profile_name = switch_channel_get_variable(channel, "voicemail_profile_name");
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(domain_name)) {
</del><ins>+        if (zstr(domain_name)) {
</ins><span class="cx">                 domain_name = switch_channel_get_variable(channel, "voicemail_domain_name");
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(id)) {
</del><ins>+        if (zstr(id)) {
</ins><span class="cx">                 id = switch_channel_get_variable(channel, "voicemail_id");
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(profile_name) || switch_strlen_zero(domain_name)) {
</del><ins>+        if (zstr(profile_name) || zstr(domain_name)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error Usage: %s\n", VM_USAGE);
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="lines">@@ -3219,7 +3257,7 @@
</span><span class="cx">         vm_profile_t *profile;
</span><span class="cx">         char *id, *domain, *p, *profilename = NULL;
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "%d", 0);        
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -3236,7 +3274,7 @@
</span><span class="cx">                 id += 4;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(id)) {
</del><ins>+        if (zstr(id)) {
</ins><span class="cx">                 stream->write_function(stream, "%d", 0);
</span><span class="cx">                 goto done;
</span><span class="cx">         }
</span><span class="lines">@@ -3248,7 +3286,7 @@
</span><span class="cx">                         how = p;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(profilename)) {
</del><ins>+                if (!zstr(profilename)) {
</ins><span class="cx">                         if ((profile = get_profile(profilename))) {
</span><span class="cx">                                 message_count(profile, id, domain, "inbox", &total_new_messages, &total_saved_messages,
</span><span class="cx">                                                          &total_new_urgent_messages, &total_saved_urgent_messages);
</span><span class="lines">@@ -3289,7 +3327,77 @@
</span><span class="cx">         switch_safe_free(dup);
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><ins>+#define PREFS_SYNTAX "[profile/]<user>@<domain>[|[name_path|greeting_path|password]]"
+SWITCH_STANDARD_API(prefs_api_function)
+{
+        char *dup = NULL;
+        const char *how = "greeting_path";
+        vm_profile_t *profile = NULL;
+        char *id, *domain, *p, *profilename = NULL;
+        char sql[256];
+        prefs_callback_t cbt = {{0}};
</ins><span class="cx">
</span><ins>+        if (zstr(cmd)) {
+                stream->write_function(stream, "%d", 0);
+                goto done;
+        }
+
+        id = dup = strdup(cmd);
+
+        if ((p = strchr(dup, '/'))) {
+                *p++ = '\0';
+                id = p;
+                profilename = dup;
+        }
+
+        if (!strncasecmp(id, "sip:", 4)) {
+                id += 4;
+        }
+
+        if (zstr(id)) {
+                stream->write_function(stream, "%d", 0);
+                goto done;
+        }
+
+        if ((domain = strchr(id, '@'))) {
+                *domain++ = '\0';
+                if ((p = strchr(domain, '|'))) {
+                        *p++ = '\0';
+                        how = p;
+                }
+
+                if (!zstr(profilename) && !(profile = get_profile(profilename))) {
+                        stream->write_function(stream, "-ERR No such profile\n");
+                        goto done;
+                }
+                if (!(profile = get_profile("default"))) {
+                        stream->write_function(stream, "-ERR profile 'default' doesn't exist\n");
+                        goto done;
+                }
+        } else {
+                stream->write_function(stream, "-ERR No domain specified\n");
+                goto done;
+
+        }
+
+        switch_snprintf(sql, sizeof(sql), "select * from voicemail_prefs where username='%s' and domain='%s'", id, domain);
+        vm_execute_sql_callback(profile, profile->mutex, sql, prefs_callback, &cbt);
+
+        if (!strcasecmp(how, "greeting_path")) {
+                stream->write_function(stream, "%s", cbt.greeting_path);
+        } else if (!strcasecmp(how, "name_path")) {
+                stream->write_function(stream, "%s", cbt.name_path);
+        } else if (!strcasecmp(how, "password")) {
+                stream->write_function(stream, "%s", cbt.password);
+        } else {
+                stream->write_function(stream, "%s:%s:%s", cbt.greeting_path, cbt.name_path, cbt.password);
+        }
+        profile_rwunlock(profile);
+done:
+        switch_safe_free(dup);
+        return SWITCH_STATUS_SUCCESS;
+}
+
</ins><span class="cx"> #define parse_profile() {\
</span><span class="cx">                 total_new_messages = total_saved_messages = 0;                                        \
</span><span class="cx">                 message_count(profile, id, domain, "inbox", &total_new_messages, &total_saved_messages,        \
</span><span class="lines">@@ -3853,7 +3961,7 @@
</span><span class="cx">                 path_info = switch_event_get_header(stream->param_event, "http-path-info");
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd)) {
</del><ins>+        if (!zstr(cmd)) {
</ins><span class="cx">                 mydata = strdup(cmd);
</span><span class="cx">                 switch_assert(mydata);
</span><span class="cx">                 argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="lines">@@ -4012,8 +4120,8 @@
</span><span class="cx">         SWITCH_ADD_API(commands_api_interface, "voicemail", "voicemail", voicemail_api_function, VOICEMAIL_SYNTAX);
</span><span class="cx">         SWITCH_ADD_API(commands_api_interface, "voicemail_inject", "voicemail_inject", voicemail_inject_api_function, VM_INJECT_USAGE);
</span><span class="cx">         SWITCH_ADD_API(commands_api_interface, "vm_boxcount", "vm_boxcount", boxcount_api_function, BOXCOUNT_SYNTAX);
</span><ins>+        SWITCH_ADD_API(commands_api_interface, "vm_prefs", "vm_prefs", prefs_api_function, PREFS_SYNTAX);
</ins><span class="cx">
</span><del>-
</del><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodasr_ttsmod_cepstralmod_cepstralc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/asr_tts/mod_cepstral/mod_cepstral.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/asr_tts/mod_cepstral/mod_cepstral.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/asr_tts/mod_cepstral/mod_cepstral.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -146,7 +146,7 @@
</span><span class="cx">                 voice_name = NULL;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(voice_name)) {
</del><ins>+        if (zstr(voice_name)) {
</ins><span class="cx">                 /* Find the first voice on the system */
</span><span class="cx">                 if ((cepstral->voice = swift_port_find_first_voice(cepstral->port, NULL, NULL)) == NULL) {
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to find any voices!\n");
</span><span class="lines">@@ -215,18 +215,18 @@
</span><span class="cx">
</span><span class="cx">         cepstral->tts_stream = NULL;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(text)) {
</del><ins>+        if (zstr(text)) {
</ins><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">         if (!strncasecmp(text, fp, len)) {
</span><span class="cx">                 text += len;
</span><del>-                if (switch_strlen_zero(text)) {
</del><ins>+                if (zstr(text)) {
</ins><span class="cx">                         return SWITCH_STATUS_FALSE;
</span><span class="cx">                 }
</span><span class="cx">                 swift_port_speak_file(cepstral->port, text, NULL, &cepstral->tts_stream, NULL);
</span><span class="cx">         } else {
</span><span class="cx">                 char *to_say;
</span><del>-                if (switch_strlen_zero(text)) {
</del><ins>+                if (zstr(text)) {
</ins><span class="cx">                         return SWITCH_STATUS_FALSE;
</span><span class="cx">                 }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodasr_ttsmod_pocketsphinxmod_pocketsphinxc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -282,11 +282,11 @@
</span><span class="cx">
</span><span class="cx">                         switch_mutex_lock(ps->flag_mutex);
</span><span class="cx">                         if ((hyp = ps_get_hyp(ps->ps, &ps->score, &ps->uttid))) {
</span><del>-                                if (!switch_strlen_zero(hyp)) {
</del><ins>+                                if (!zstr(hyp)) {
</ins><span class="cx">                                         ps_end_utt(ps->ps);
</span><span class="cx">                                         switch_clear_flag(ps, PSFLAG_READY);
</span><span class="cx">                                         if ((hyp = ps_get_hyp(ps->ps, &ps->score, &ps->uttid))) {
</span><del>-                                                if (switch_strlen_zero(hyp)) {
</del><ins>+                                                if (zstr(hyp)) {
</ins><span class="cx">                                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Lost the text, never mind....\n");
</span><span class="cx">                                                         ps_start_utt(ps->ps, NULL);
</span><span class="cx">                                                         switch_set_flag(ps, PSFLAG_READY);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodasr_ttsmod_tts_commandlinemod_tts_commandlinec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/asr_tts/mod_tts_commandline/mod_tts_commandline.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/asr_tts/mod_tts_commandline/mod_tts_commandline.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/asr_tts/mod_tts_commandline/mod_tts_commandline.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">                 switch_xml_free(xml);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(globals.command)) {
</del><ins>+        if (zstr(globals.command)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No command set, please edit %s\n", cf);
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodasr_ttsmod_unimrcpmod_unimrcpc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -164,12 +164,15 @@
</span><span class="cx"> static int get_next_speech_channel_number(void);
</span><span class="cx">
</span><span class="cx"> #define XML_ID "<?xml"
</span><ins>+#define SRGS_ID "<grammar"
+#define SSML_ID "<speak"
</ins><span class="cx"> #define GSL_ID ";GSL2.0"
</span><span class="cx"> #define ABNF_ID "#ABNF"
</span><span class="cx"> #define JSGF_ID "#JSGF"
</span><span class="cx"> #define BUILTIN_ID "builtin:"
</span><span class="cx"> #define SESSION_ID "session:"
</span><span class="cx"> #define HTTP_ID "http://"
</span><ins>+#define FILE_ID "file://"
</ins><span class="cx"> #define INLINE_ID "inline:"
</span><span class="cx"> static int text_starts_with(const char *text, const char *match);
</span><span class="cx">
</span><span class="lines">@@ -490,7 +493,7 @@
</span><span class="cx"> {
</span><span class="cx">         int result = 0;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(text)) {
</del><ins>+        if (!zstr(text)) {
</ins><span class="cx">                 size_t textlen, matchlen;
</span><span class="cx">
</span><span class="cx">                 /* find first non-space character */
</span><span class="lines">@@ -524,7 +527,7 @@
</span><span class="cx">         char *lname = "";
</span><span class="cx">         *audio_queue = NULL;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(name)) {
</del><ins>+        if (zstr(name)) {
</ins><span class="cx">                 lname = "";
</span><span class="cx">         } else {
</span><span class="cx">                 lname = switch_core_strdup(pool, name);
</span><span class="lines">@@ -704,7 +707,7 @@
</span><span class="cx"> {
</span><span class="cx">         if (queue) {
</span><span class="cx">                 char *name = queue->name;
</span><del>-                if (switch_strlen_zero(name)) {
</del><ins>+                if (zstr(name)) {
</ins><span class="cx">                         name = "";
</span><span class="cx">                 }
</span><span class="cx">                 if (queue->buffer) {
</span><span class="lines">@@ -779,7 +782,7 @@
</span><span class="cx">         }
</span><span class="cx">         switch_core_hash_init(&schan->params, pool);
</span><span class="cx">         schan->data = NULL;
</span><del>-        if (switch_strlen_zero(name)) {
</del><ins>+        if (zstr(name)) {
</ins><span class="cx">                 schan->name = "";
</span><span class="cx">         } else {
</span><span class="cx">                 schan->name = switch_core_strdup(pool, name);
</span><span class="lines">@@ -959,7 +962,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* good enough way of determining SSML or plain text body */
</span><del>-        if (text_starts_with(text, XML_ID)) {
</del><ins>+        if (text_starts_with(text, XML_ID) || text_starts_with(text, SSML_ID)) {
</ins><span class="cx">                 apt_string_assign(&generic_header->content_type, MIME_TYPE_SSML_XML, mrcp_message->pool);
</span><span class="cx">         } else {
</span><span class="cx">                 apt_string_assign(&generic_header->content_type, MIME_TYPE_PLAIN_TEXT, mrcp_message->pool);
</span><span class="lines">@@ -1017,7 +1020,7 @@
</span><span class="cx">                 switch_hash_this(hi, &key, NULL, &val);
</span><span class="cx">                 param_name = (char *)key;
</span><span class="cx">                 param_val = (char *)val;
</span><del>-                if (!switch_strlen_zero(param_name) && !switch_strlen_zero(param_val)) {
</del><ins>+                if (!zstr(param_name) && !zstr(param_val)) {
</ins><span class="cx">                         unimrcp_param_id_t *id = (unimrcp_param_id_t *)switch_core_hash_find(schannel->application->param_id_map, param_name);
</span><span class="cx">                         if (id) {
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) %s: %s\n", schannel->name, param_name, param_val);
</span><span class="lines">@@ -1272,11 +1275,11 @@
</span><span class="cx"> static switch_status_t speech_channel_set_param(speech_channel_t *schannel, const char *param, const char *val)
</span><span class="cx"> {
</span><span class="cx">         switch_mutex_lock(schannel->mutex);
</span><del>-        if (!switch_strlen_zero(param) && val != NULL) {
</del><ins>+        if (!zstr(param) && val != NULL) {
</ins><span class="cx">                 /* check if this is a FreeSWITCH param that needs to be translated to an MRCP param: e.g. voice ==> voice-name */
</span><span class="cx">                 char *mrcp_param = (char *)switch_core_hash_find(schannel->application->fs_param_map, param);
</span><span class="cx">                 char *lcparam = NULL;
</span><del>-                if (switch_strlen_zero(mrcp_param)) {
</del><ins>+                if (zstr(mrcp_param)) {
</ins><span class="cx">                         lcparam = switch_lc_strdup(param);
</span><span class="cx">                         mrcp_param = lcparam;
</span><span class="cx">                 }
</span><span class="lines">@@ -1422,7 +1425,7 @@
</span><span class="cx">         sh->private_info = schannel;
</span><span class="cx">
</span><span class="cx">         /* try to open an MRCP channel */
</span><del>-        if (switch_strlen_zero(profile_name)) {
</del><ins>+        if (zstr(profile_name)) {
</ins><span class="cx">                 profile_name = globals.unimrcp_default_synth_profile;
</span><span class="cx">         }
</span><span class="cx">         profile = (profile_t *)switch_core_hash_find(globals.profiles, profile_name);
</span><span class="lines">@@ -1437,7 +1440,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* Set session TTS params */
</span><del>-        if (!switch_strlen_zero(voice_name)) {
</del><ins>+        if (!zstr(voice_name)) {
</ins><span class="cx">                 speech_channel_set_param(schannel, "Voice-Name", voice_name);
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1476,7 +1479,7 @@
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">         speech_channel_t *schannel = (speech_channel_t *)sh->private_info;
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(text)) {
</del><ins>+        if (zstr(text)) {
</ins><span class="cx">                 status = SWITCH_STATUS_FALSE;
</span><span class="cx">         } else {
</span><span class="cx">                 status = synth_channel_speak(schannel, text);
</span><span class="lines">@@ -1900,10 +1903,10 @@
</span><span class="cx">
</span><span class="cx">         /* input timers are started by default unless the start-input-timers=false param is set */
</span><span class="cx">         start_input_timers = (char *)switch_core_hash_find(schannel->params, "start-input-timers");
</span><del>-        r->timers_started = switch_strlen_zero(start_input_timers) || strcasecmp(start_input_timers, "false");
</del><ins>+        r->timers_started = zstr(start_input_timers) || strcasecmp(start_input_timers, "false");
</ins><span class="cx">         
</span><span class="cx">         /* get the cached grammar */
</span><del>-        if (switch_strlen_zero(name)) {
</del><ins>+        if (zstr(name)) {
</ins><span class="cx">                 grammar = r->last_grammar;
</span><span class="cx">         } else {
</span><span class="cx">                 grammar = (grammar_t *)switch_core_hash_find(r->grammars, name);
</span><span class="lines">@@ -1935,7 +1938,7 @@
</span><span class="cx">
</span><span class="cx">         /* set Content-Type */
</span><span class="cx">         mime_type = grammar_type_to_mime(grammar->type, schannel->profile);
</span><del>-        if (switch_strlen_zero(mime_type)) {
</del><ins>+        if (zstr(mime_type)) {
</ins><span class="cx">                 status = SWITCH_STATUS_FALSE;
</span><span class="cx">                 goto done;
</span><span class="cx">         }
</span><span class="lines">@@ -2029,7 +2032,7 @@
</span><span class="cx">                         goto done;
</span><span class="cx">                 }
</span><span class="cx">                 mime_type = grammar_type_to_mime(type, schannel->profile);
</span><del>-                if (switch_strlen_zero(mime_type)) {
</del><ins>+                if (zstr(mime_type)) {
</ins><span class="cx">                         status = SWITCH_STATUS_FALSE;
</span><span class="cx">                         goto done;
</span><span class="cx">                 }
</span><span class="lines">@@ -2084,7 +2087,7 @@
</span><span class="cx"> {
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(grammar_name)) {
</del><ins>+        if (zstr(grammar_name)) {
</ins><span class="cx">                 status = SWITCH_STATUS_FALSE;
</span><span class="cx">         } else {
</span><span class="cx">                 recognizer_data_t *r = (recognizer_data_t *)schannel->data;
</span><span class="lines">@@ -2106,7 +2109,7 @@
</span><span class="cx">         recognizer_data_t *r;
</span><span class="cx">         switch_mutex_lock(schannel->mutex);
</span><span class="cx">         r = (recognizer_data_t *)schannel->data;
</span><del>-        if (!switch_strlen_zero(r->result)) {
</del><ins>+        if (!zstr(r->result)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) SUCCESS, have result\n", schannel->name);
</span><span class="cx">         } else if (r->start_of_input) {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) SUCCESS, start of input\n", schannel->name);
</span><span class="lines">@@ -2180,12 +2183,12 @@
</span><span class="cx">         recognizer_data_t *r;
</span><span class="cx">         switch_mutex_lock(schannel->mutex);
</span><span class="cx">         r = (recognizer_data_t *)schannel->data;
</span><del>-        if (!switch_strlen_zero(r->result)) {
</del><ins>+        if (!zstr(r->result)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) result is already set\n", schannel->name);
</span><span class="cx">                 status = SWITCH_STATUS_FALSE;
</span><span class="cx">                 goto done;
</span><span class="cx">         }
</span><del>-        if (switch_strlen_zero(result)) {
</del><ins>+        if (zstr(result)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) result is NULL\n", schannel->name);
</span><span class="cx">                 status = SWITCH_STATUS_FALSE;
</span><span class="cx">                 goto done;
</span><span class="lines">@@ -2211,7 +2214,7 @@
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">         recognizer_data_t *r = (recognizer_data_t *)schannel->data;
</span><span class="cx">         switch_mutex_lock(schannel->mutex);
</span><del>-        if (!switch_strlen_zero(r->result)) {
</del><ins>+        if (!zstr(r->result)) {
</ins><span class="cx">                 *result = strdup(r->result);
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) result:\n\n%s\n", schannel->name, *result);
</span><span class="cx">                 r->result = NULL;
</span><span class="lines">@@ -2248,7 +2251,7 @@
</span><span class="cx">                 switch_hash_this(hi, &key, NULL, &val);
</span><span class="cx">                 param_name = (char *)key;
</span><span class="cx">                 param_val = (char *)val;
</span><del>-                if (!switch_strlen_zero(param_name) && !switch_strlen_zero(param_val)) {
</del><ins>+                if (!zstr(param_name) && !zstr(param_val)) {
</ins><span class="cx">                         unimrcp_param_id_t *id = (unimrcp_param_id_t *)switch_core_hash_find(schannel->application->param_id_map, param_name);
</span><span class="cx">                         if (id) {
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) \"%s\": \"%s\"\n", schannel->name, param_name, param_val);
</span><span class="lines">@@ -2572,7 +2575,7 @@
</span><span class="cx">         char *filename = NULL;
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) grammar = %s, name = %s\n", schannel->name, grammar, name);
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(grammar) || switch_strlen_zero(name)) {
</del><ins>+        if (zstr(grammar) || zstr(name)) {
</ins><span class="cx">                 status = SWITCH_STATUS_FALSE;
</span><span class="cx">                 goto done;
</span><span class="cx">         }
</span><span class="lines">@@ -2584,7 +2587,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* figure out what type of grammar this is */
</span><del>-        if (text_starts_with(grammar, HTTP_ID) || text_starts_with(grammar, SESSION_ID) || text_starts_with(grammar, BUILTIN_ID)) {
</del><ins>+        if (text_starts_with(grammar, HTTP_ID) || text_starts_with(grammar, FILE_ID) || text_starts_with(grammar, SESSION_ID) || text_starts_with(grammar, BUILTIN_ID)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "(%s) Grammar is URI\n", schannel->name);
</span><span class="cx">                 type = GRAMMAR_TYPE_URI;
</span><span class="cx">                 grammar_data = grammar;
</span><span class="lines">@@ -2629,7 +2632,7 @@
</span><span class="cx">
</span><span class="cx">         /* determine content type of file grammar or inline grammar */
</span><span class="cx">         if (type == GRAMMAR_TYPE_UNKNOWN) {
</span><del>-                if (text_starts_with(grammar_data, XML_ID)) {
</del><ins>+                if (text_starts_with(grammar_data, XML_ID) || text_starts_with(grammar_data, SRGS_ID)) {
</ins><span class="cx">                         type = GRAMMAR_TYPE_SRGS_XML;
</span><span class="cx">                 } else if (text_starts_with(grammar_data, GSL_ID)) {
</span><span class="cx">                         type = GRAMMAR_TYPE_NUANCE_GSL;
</span><span class="lines">@@ -2673,7 +2676,7 @@
</span><span class="cx"> {
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">         speech_channel_t *schannel = (speech_channel_t *)ah->private_info;
</span><del>-        if (switch_strlen_zero(name) || speech_channel_stop(schannel) != SWITCH_STATUS_SUCCESS ||
</del><ins>+        if (zstr(name) || speech_channel_stop(schannel) != SWITCH_STATUS_SUCCESS ||
</ins><span class="cx">                 recog_channel_unload_grammar(schannel, name) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                 status = SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="lines">@@ -3316,13 +3319,13 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* set up MRCPv2 connection agent that will be shared with all profiles */
</span><del>-        if (!switch_strlen_zero(globals.unimrcp_max_connection_count)) {
</del><ins>+        if (!zstr(globals.unimrcp_max_connection_count)) {
</ins><span class="cx">                 max_connection_count = atoi(globals.unimrcp_max_connection_count);
</span><span class="cx">         }
</span><span class="cx">         if (max_connection_count <= 0) {
</span><span class="cx">                 max_connection_count = 100;
</span><span class="cx">         }
</span><del>-        if (!switch_strlen_zero(globals.unimrcp_offer_new_connection)) {
</del><ins>+        if (!zstr(globals.unimrcp_offer_new_connection)) {
</ins><span class="cx">                 offer_new_connection = strcasecmp("true", globals.unimrcp_offer_new_connection);
</span><span class="cx">         }
</span><span class="cx">         connection_agent = mrcp_client_connection_agent_create(max_connection_count, offer_new_connection, pool);
</span><span class="lines">@@ -3354,7 +3357,7 @@
</span><span class="cx">                         /* get profile attributes */
</span><span class="cx">                         const char *name = apr_pstrdup(pool, switch_xml_attr(profile, "name"));
</span><span class="cx">                         const char *version = switch_xml_attr(profile, "version");
</span><del>-                        if (switch_strlen_zero(name) || switch_strlen_zero(version)) {
</del><ins>+                        if (zstr(name) || zstr(version)) {
</ins><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "<profile> missing name or version attribute\n");
</span><span class="cx">                                 client = NULL;
</span><span class="cx">                                 goto done;
</span><span class="lines">@@ -3381,7 +3384,7 @@
</span><span class="cx">                                 for (param = switch_xml_child(profile, "param"); param; param = switch_xml_next(param)) {
</span><span class="cx">                                         const char *param_name = switch_xml_attr(param, "name");
</span><span class="cx">                                         const char *param_value = switch_xml_attr(param, "value");
</span><del>-                                        if (switch_strlen_zero(param_name)) {
</del><ins>+                                        if (zstr(param_name)) {
</ins><span class="cx">                                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing param name\n");
</span><span class="cx">                                                 client = NULL;
</span><span class="cx">                                                 goto done;
</span><span class="lines">@@ -3409,7 +3412,7 @@
</span><span class="cx">                                 for (param = switch_xml_child(profile, "param"); param; param = switch_xml_next(param)) {
</span><span class="cx">                                         const char *param_name = switch_xml_attr(param, "name");
</span><span class="cx">                                         const char *param_value = switch_xml_attr(param, "value");
</span><del>-                                        if (switch_strlen_zero(param_name)) {
</del><ins>+                                        if (zstr(param_name)) {
</ins><span class="cx">                                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing param name\n");
</span><span class="cx">                                                 client = NULL;
</span><span class="cx">                                                 goto done;
</span><span class="lines">@@ -3468,11 +3471,11 @@
</span><span class="cx">
</span><span class="cx">         /* get MRCP module configuration */
</span><span class="cx">         mod_unimrcp_do_config();
</span><del>-        if (switch_strlen_zero(globals.unimrcp_default_synth_profile)) {
</del><ins>+        if (zstr(globals.unimrcp_default_synth_profile)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing default-tts-profile\n");
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><del>-        if (switch_strlen_zero(globals.unimrcp_default_recog_profile)) {
</del><ins>+        if (zstr(globals.unimrcp_default_recog_profile)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing default-asr-profile\n");
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="lines">@@ -3575,7 +3578,7 @@
</span><span class="cx">         char log_message[4096] = { 0 }; /* same size as MAX_LOG_ENTRY_SIZE in UniMRCP apt_log.c */
</span><span class="cx">         size_t msglen;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(format)) {
</del><ins>+        if (zstr(format)) {
</ins><span class="cx">                 return TRUE;
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodcodecsmod_celtMakefile"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_celt/Makefile (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_celt/Makefile        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_celt/Makefile        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> BASE=../../../..
</span><span class="cx">
</span><del>-CELT=celt-0.6.1
</del><ins>+CELT=celt-0.7.0
</ins><span class="cx">
</span><span class="cx"> CELT_DIR=$(BASE)/libs/$(CELT)
</span><span class="cx"> LOCAL_CFLAGS=-I$(CELT_DIR)/libcelt
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodcodecsmod_celtmod_celtc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_celt/mod_celt.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_celt/mod_celt.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_celt/mod_celt.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        context->mode_object = celt_mode_create(codec->implementation->actual_samples_per_second, 1, codec->implementation->samples_per_packet, NULL);
</del><ins>+        context->mode_object = celt_mode_create(codec->implementation->actual_samples_per_second, codec->implementation->samples_per_packet, NULL);
</ins><span class="cx">         celt_mode_info(context->mode_object, CELT_GET_FRAME_SIZE, &context->frame_size);
</span><span class="cx">         context->bytes_per_packet = (codec->implementation->bits_per_second * context->frame_size/codec->implementation->actual_samples_per_second + 4) / 8;
</span><span class="cx">
</span><span class="lines">@@ -81,11 +81,11 @@
</span><span class="cx">         codec->fmtp_out = switch_core_sprintf(codec->memory_pool, "bitrate=%d", bit_rate);
</span><span class="cx">         */
</span><span class="cx">         if (encoding) {
</span><del>-                context->encoder_object = celt_encoder_create(context->mode_object);
</del><ins>+                context->encoder_object = celt_encoder_create(context->mode_object, 1, NULL);
</ins><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         if (decoding) {
</span><del>-                context->decoder_object = celt_decoder_create(context->mode_object);
</del><ins>+                context->decoder_object = celt_decoder_create(context->mode_object, 1, NULL);
</ins><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         codec->private_info = context;
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        *encoded_data_len = (uint32_t) celt_encode(context->encoder_object, (celt_int16_t *)decoded_data, NULL,
</del><ins>+        *encoded_data_len = (uint32_t) celt_encode(context->encoder_object, (void *)decoded_data, NULL,
</ins><span class="cx">                                                                                          (unsigned char *)encoded_data, context->bytes_per_packet);
</span><span class="cx">
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodcodecsmod_voipcodecsMakefile"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_voipcodecs/Makefile (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_voipcodecs/Makefile        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_voipcodecs/Makefile        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -1,13 +1,28 @@
</span><span class="cx"> BASE=../../../..
</span><span class="cx">
</span><del>-VOIPCODECS_DIR=$(BASE)/libs/voipcodecs
-VOIPCODECS_LA=$(VOIPCODECS_DIR)/src/libvoipcodecs.la
</del><ins>+TIFF_DIR=$(BASE)/libs/tiff-3.8.2
+TIFF_LA=$(TIFF_DIR)/libtiff/libtiff.la
</ins><span class="cx">
</span><del>-LOCAL_CFLAGS=-I$(VOIPCODECS_DIR)/src
-LOCAL_LIBADD=$(VOIPCODECS_LA)
</del><ins>+SPANDSP_DIR=$(BASE)/libs/spandsp
+SPANDSP_LA=$(SPANDSP_DIR)/src/libspandsp.la
</ins><span class="cx">
</span><ins>+LOCAL_CFLAGS=-I$(SPANDSP_DIR)/src -I$(TIFF_DIR)/libtiff
+LOCAL_LIBADD=$(SPANDSP_LA)
+
</ins><span class="cx"> include $(BASE)/build/modmake.rules
</span><span class="cx">
</span><del>-$(VOIPCODECS_LA): $(VOIPCODECS_DIR) $(VOIPCODECS_DIR)/.update
-        cd $(VOIPCODECS_DIR) && $(MAKE)
</del><ins>+$(SPANDSP_LA): $(TIFF_LA) $(SPANDSP_DIR) $(SPANDSP_DIR)/.update
+        cd $(SPANDSP_DIR) && $(MAKE)
</ins><span class="cx">         $(TOUCH_TARGET)
</span><ins>+
+$(TIFF_LA): $(TIFF_DIR) $(TIFF_DIR)/.update
+        cd $(TIFF_DIR) && $(MAKE)
+        $(TOUCH_TARGET)
+
+
+depend_install: $(DESTDIR)$(libdir)/libspandsp.la
+
+$(DESTDIR)$(libdir)/libspandsp.la: $(SPANDSP_LA)
+        cd $(SPANDSP_DIR) && $(MAKE) install
+
+
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodcodecsmod_voipcodecsmod_voipcodecs2008vcproj"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.2008.vcproj (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.2008.vcproj        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.2008.vcproj        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx">                         />
</span><span class="cx">                         <Tool
</span><span class="cx">                                 Name="VCCLCompilerTool"
</span><del>-                                AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\voipcodecs\src&quot;;&quot;$(InputDir)..\..\..\..\libs\voipcodecs\src\msvc&quot;"
</del><ins>+                                AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\spandsp\src\msvc&quot;;&quot;$(InputDir)..\..\..\..\libs\spandsp\src&quot;;&quot;$(InputDir)..\..\..\..\libs\tiff-3.8.2\libtiff&quot;"
</ins><span class="cx">                                 UsePrecompiledHeader="0"
</span><span class="cx">                         />
</span><span class="cx">                         <Tool
</span><span class="lines">@@ -105,7 +105,7 @@
</span><span class="cx">                         />
</span><span class="cx">                         <Tool
</span><span class="cx">                                 Name="VCCLCompilerTool"
</span><del>-                                AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\voipcodecs\src&quot;;&quot;$(InputDir)..\..\..\..\libs\voipcodecs\src\msvc&quot;"
</del><ins>+                                AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\spandsp\src\msvc&quot;;&quot;$(InputDir)..\..\..\..\libs\spandsp\src&quot;;&quot;$(InputDir)..\..\..\..\libs\tiff-3.8.2\libtiff&quot;"
</ins><span class="cx">                                 UsePrecompiledHeader="0"
</span><span class="cx">                         />
</span><span class="cx">                         <Tool
</span><span class="lines">@@ -169,7 +169,7 @@
</span><span class="cx">                         />
</span><span class="cx">                         <Tool
</span><span class="cx">                                 Name="VCCLCompilerTool"
</span><del>-                                AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\voipcodecs\src&quot;;&quot;$(InputDir)..\..\..\..\libs\voipcodecs\src\msvc&quot;"
</del><ins>+                                AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\spandsp\src\msvc&quot;;&quot;$(InputDir)..\..\..\..\libs\spandsp\src&quot;;&quot;$(InputDir)..\..\..\..\libs\tiff-3.8.2\libtiff&quot;"
</ins><span class="cx">                                 UsePrecompiledHeader="0"
</span><span class="cx">                         />
</span><span class="cx">                         <Tool
</span><span class="lines">@@ -232,7 +232,7 @@
</span><span class="cx">                         />
</span><span class="cx">                         <Tool
</span><span class="cx">                                 Name="VCCLCompilerTool"
</span><del>-                                AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\voipcodecs\src&quot;;&quot;$(InputDir)..\..\..\..\libs\voipcodecs\src\msvc&quot;"
</del><ins>+                                AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\spandsp\src\msvc&quot;;&quot;$(InputDir)..\..\..\..\libs\spandsp\src&quot;;&quot;$(InputDir)..\..\..\..\libs\tiff-3.8.2\libtiff&quot;"
</ins><span class="cx">                                 UsePrecompiledHeader="0"
</span><span class="cx">                         />
</span><span class="cx">                         <Tool
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodcodecsmod_voipcodecsmod_voipcodecsc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #include <switch.h>
</span><del>-#include "voipcodecs.h"
</del><ins>+#include "spandsp.h"
</ins><span class="cx">
</span><span class="cx"> SWITCH_MODULE_LOAD_FUNCTION(mod_voipcodecs_load);
</span><span class="cx"> SWITCH_MODULE_DEFINITION(mod_voipcodecs, mod_voipcodecs_load, NULL, NULL);
</span><span class="lines">@@ -41,8 +41,8 @@
</span><span class="cx"> /* LPC10 - START */
</span><span class="cx">
</span><span class="cx"> struct lpc10_context {
</span><del>-        lpc10_encode_state_t encoder_object;
-        lpc10_decode_state_t decoder_object;
</del><ins>+        lpc10_encode_state_t *encoder_object;
+        lpc10_decode_state_t *decoder_object;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> static switch_status_t switch_lpc10_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
</span><span class="lines">@@ -58,11 +58,11 @@
</span><span class="cx">         } else {
</span><span class="cx">
</span><span class="cx">                 if (encoding) {
</span><del>-                        lpc10_encode_init(&context->encoder_object, TRUE);
</del><ins>+                        context->encoder_object = lpc10_encode_init(context->encoder_object, TRUE);
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 if (decoding) {
</span><del>-                        lpc10_decode_init(&context->decoder_object, TRUE);
</del><ins>+                        context->decoder_object = lpc10_decode_init(context->decoder_object, TRUE);
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 codec->private_info = context;
</span><span class="lines">@@ -73,7 +73,18 @@
</span><span class="cx">
</span><span class="cx"> static switch_status_t switch_lpc10_destroy(switch_codec_t *codec)
</span><span class="cx"> {
</span><ins>+        struct lpc10_context *context = codec->private_info;
</ins><span class="cx">         codec->private_info = NULL;
</span><ins>+
+        if (!context) {
+                return SWITCH_STATUS_FALSE;
+        }
+
+        if (context->encoder_object) lpc10_encode_free(context->encoder_object);
+        context->encoder_object = NULL;
+        if (context->decoder_object) lpc10_decode_free(context->decoder_object);
+        context->decoder_object = NULL;
+
</ins><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -90,7 +101,7 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        *encoded_data_len = lpc10_encode(&context->encoder_object, (uint8_t *) encoded_data, (int16_t *) decoded_data, decoded_data_len / 2);
</del><ins>+        *encoded_data_len = lpc10_encode(context->encoder_object, (uint8_t *) encoded_data, (int16_t *) decoded_data, decoded_data_len / 2);
</ins><span class="cx">
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="lines">@@ -108,7 +119,7 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        *decoded_data_len = (2 * lpc10_decode(&context->decoder_object, (int16_t *) decoded_data, (uint8_t *) encoded_data, encoded_data_len));
</del><ins>+        *decoded_data_len = (2 * lpc10_decode(context->decoder_object, (int16_t *) decoded_data, (uint8_t *) encoded_data, encoded_data_len));
</ins><span class="cx">
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="lines">@@ -118,8 +129,8 @@
</span><span class="cx">
</span><span class="cx"> /* GSM - START */
</span><span class="cx"> struct gsm_context {
</span><del>-        gsm0610_state_t decoder_object;
-        gsm0610_state_t encoder_object;
</del><ins>+        gsm0610_state_t *decoder_object;
+        gsm0610_state_t *encoder_object;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> static switch_status_t switch_gsm_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
</span><span class="lines">@@ -134,10 +145,10 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         } else {
</span><span class="cx">                 if (encoding) {
</span><del>-                        gsm0610_init(&context->encoder_object, GSM0610_PACKING_VOIP);
</del><ins>+                        context->encoder_object = gsm0610_init(context->encoder_object, GSM0610_PACKING_VOIP);
</ins><span class="cx">                 }
</span><span class="cx">                 if (decoding) {
</span><del>-                        gsm0610_init(&context->decoder_object, GSM0610_PACKING_VOIP);
</del><ins>+                        context->decoder_object = gsm0610_init(context->decoder_object, GSM0610_PACKING_VOIP);
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 codec->private_info = context;
</span><span class="lines">@@ -157,7 +168,7 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        *encoded_data_len = gsm0610_encode(&context->encoder_object, (uint8_t *) encoded_data, (int16_t *) decoded_data, decoded_data_len / 2);
</del><ins>+        *encoded_data_len = gsm0610_encode(context->encoder_object, (uint8_t *) encoded_data, (int16_t *) decoded_data, decoded_data_len / 2);
</ins><span class="cx">
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="lines">@@ -174,15 +185,26 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        *decoded_data_len = (2 * gsm0610_decode(&context->decoder_object, (int16_t *) decoded_data, (uint8_t *) encoded_data, encoded_data_len));
</del><ins>+        *decoded_data_len = (2 * gsm0610_decode(context->decoder_object, (int16_t *) decoded_data, (uint8_t *) encoded_data, encoded_data_len));
</ins><span class="cx">
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static switch_status_t switch_gsm_destroy(switch_codec_t *codec)
</span><span class="cx"> {
</span><del>-        /* We do not need to use release here as the pool memory is taken care of for us */
</del><ins>+        struct gsm_context *context = codec->private_info;
+
</ins><span class="cx">         codec->private_info = NULL;
</span><ins>+
+        if (!context) {
+                return SWITCH_STATUS_FALSE;
+        }
+
+        if (context->decoder_object) gsm0610_free(context->decoder_object);
+        context->decoder_object = NULL;
+        if (context->encoder_object) gsm0610_free(context->encoder_object);
+        context->encoder_object = NULL;
+
</ins><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -338,8 +360,8 @@
</span><span class="cx"> /* G722 - START */
</span><span class="cx">
</span><span class="cx"> struct g722_context {
</span><del>-        g722_decode_state_t decoder_object;
-        g722_encode_state_t encoder_object;
</del><ins>+        g722_decode_state_t *decoder_object;
+        g722_encode_state_t *encoder_object;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> static switch_status_t switch_g722_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
</span><span class="lines">@@ -354,10 +376,10 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         } else {
</span><span class="cx">                 if (encoding) {
</span><del>-                        g722_encode_init(&context->encoder_object, 64000, G722_PACKED);
</del><ins>+                        context->encoder_object = g722_encode_init(context->encoder_object, 64000, G722_PACKED);
</ins><span class="cx">                 }
</span><span class="cx">                 if (decoding) {
</span><del>-                        g722_decode_init(&context->decoder_object, 64000, G722_PACKED);
</del><ins>+                        context->decoder_object = g722_decode_init(context->decoder_object, 64000, G722_PACKED);
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -378,7 +400,7 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        *encoded_data_len = g722_encode(&context->encoder_object, (uint8_t *) encoded_data, (int16_t *) decoded_data, decoded_data_len / 2);
</del><ins>+        *encoded_data_len = g722_encode(context->encoder_object, (uint8_t *) encoded_data, (int16_t *) decoded_data, decoded_data_len / 2);
</ins><span class="cx">
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="lines">@@ -396,15 +418,26 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        *decoded_data_len = (2 * g722_decode(&context->decoder_object, (int16_t *) decoded_data, (uint8_t *) encoded_data, encoded_data_len));
</del><ins>+        *decoded_data_len = (2 * g722_decode(context->decoder_object, (int16_t *) decoded_data, (uint8_t *) encoded_data, encoded_data_len));
</ins><span class="cx">
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static switch_status_t switch_g722_destroy(switch_codec_t *codec)
</span><span class="cx"> {
</span><del>-        /* We do not need to use release here as the pool memory is taken care of for us */
</del><ins>+        struct g722_context *context = codec->private_info;
+
</ins><span class="cx">         codec->private_info = NULL;
</span><ins>+
+        if (!context) {
+                return SWITCH_STATUS_FALSE;
+        }
+
+        if (context->decoder_object) g722_decode_free(context->decoder_object);
+        context->decoder_object = NULL;
+        if (context->encoder_object) g722_encode_free(context->encoder_object);
+        context->encoder_object = NULL;
+
</ins><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -416,27 +449,36 @@
</span><span class="cx"> {
</span><span class="cx">         uint32_t encoding, decoding;
</span><span class="cx">         int packing = G726_PACKING_RIGHT;
</span><del>-        g726_state_t *context;
</del><ins>+        g726_state_t *context = NULL;
</ins><span class="cx">
</span><span class="cx">         encoding = (flags & SWITCH_CODEC_FLAG_ENCODE);
</span><span class="cx">         decoding = (flags & SWITCH_CODEC_FLAG_DECODE);
</span><span class="cx">
</span><del>-        if (!(encoding || decoding) || (!(context = switch_core_alloc(codec->memory_pool, sizeof(*context))))) {
</del><ins>+        if (!(encoding || decoding)) {
</ins><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><del>-        } else {
-                if ((flags & SWITCH_CODEC_FLAG_AAL2 || strstr(codec->implementation->iananame, "AAL2"))) {
-                        packing = G726_PACKING_LEFT;
-                }
</del><ins>+        }
</ins><span class="cx">
</span><del>-                g726_init(context, codec->implementation->bits_per_second, G726_ENCODING_LINEAR, packing);
</del><ins>+        if ((flags & SWITCH_CODEC_FLAG_AAL2 || strstr(codec->implementation->iananame, "AAL2"))) {
+                packing = G726_PACKING_LEFT;
+        }
+        
+        context = g726_init(context, codec->implementation->bits_per_second, G726_ENCODING_LINEAR, packing);
+        
+        codec->private_info = context;
+        return SWITCH_STATUS_SUCCESS;
</ins><span class="cx">
</span><del>-                codec->private_info = context;
-                return SWITCH_STATUS_SUCCESS;
-        }
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static switch_status_t switch_g726_destroy(switch_codec_t *codec)
</span><span class="cx"> {
</span><ins>+        g726_state_t *context = codec->private_info;
+
+        if (!context) {
+                return SWITCH_STATUS_FALSE;
+        }
+
+        g726_free(context);
+
</ins><span class="cx">         codec->private_info = NULL;
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="lines">@@ -482,8 +524,8 @@
</span><span class="cx"> /* IMA_ADPCM - START */
</span><span class="cx">
</span><span class="cx"> struct ima_adpcm_context {
</span><del>-        ima_adpcm_state_t decoder_object;
-        ima_adpcm_state_t encoder_object;
</del><ins>+        ima_adpcm_state_t *decoder_object;
+        ima_adpcm_state_t *encoder_object;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> static switch_status_t switch_adpcm_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
</span><span class="lines">@@ -498,10 +540,10 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         } else {
</span><span class="cx">                 if (encoding) {
</span><del>-                        ima_adpcm_init(&context->encoder_object, IMA_ADPCM_DVI4, 0);
</del><ins>+                        context->encoder_object = ima_adpcm_init(context->encoder_object, IMA_ADPCM_DVI4, 0);
</ins><span class="cx">                 }
</span><span class="cx">                 if (decoding) {
</span><del>-                        ima_adpcm_init(&context->decoder_object, IMA_ADPCM_DVI4, 0);
</del><ins>+                        context->decoder_object = ima_adpcm_init(context->decoder_object, IMA_ADPCM_DVI4, 0);
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 codec->private_info = context;
</span><span class="lines">@@ -522,7 +564,7 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        *encoded_data_len = ima_adpcm_encode(&context->encoder_object, (uint8_t *) encoded_data, (int16_t *) decoded_data, decoded_data_len / 2);
</del><ins>+        *encoded_data_len = ima_adpcm_encode(context->encoder_object, (uint8_t *) encoded_data, (int16_t *) decoded_data, decoded_data_len / 2);
</ins><span class="cx">
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="lines">@@ -540,15 +582,26 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        *decoded_data_len = (2 * ima_adpcm_decode(&context->decoder_object, (int16_t *) decoded_data, (uint8_t *) encoded_data, encoded_data_len));
</del><ins>+        *decoded_data_len = (2 * ima_adpcm_decode(context->decoder_object, (int16_t *) decoded_data, (uint8_t *) encoded_data, encoded_data_len));
</ins><span class="cx">
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static switch_status_t switch_adpcm_destroy(switch_codec_t *codec)
</span><span class="cx"> {
</span><del>-        /* We do not need to use release here as the pool memory is taken care of for us */
</del><ins>+        struct ima_adpcm_context *context = codec->private_info;
+
</ins><span class="cx">         codec->private_info = NULL;
</span><ins>+
+        if (!context) {
+                return SWITCH_STATUS_FALSE;
+        }
+
+        if (context->decoder_object) ima_adpcm_free(context->decoder_object);
+        context->decoder_object = NULL;
+        if (context->encoder_object) ima_adpcm_free(context->encoder_object);
+        context->encoder_object = NULL;
+
</ins><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodcodecsmod_voipcodecsmod_voipcodecsvcproj"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.vcproj (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.vcproj        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.vcproj        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx">                         />
</span><span class="cx">                         <Tool
</span><span class="cx">                                 Name="VCCLCompilerTool"
</span><del>-                                AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\voipcodecs\src&quot;;&quot;$(InputDir)..\..\..\..\libs\voipcodecs\src\msvc&quot;"
</del><ins>+                                AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\spandsp\src\msvc&quot;;&quot;$(InputDir)..\..\..\..\libs\spandsp\src&quot;;&quot;$(InputDir)..\..\..\..\libs\tiff-3.8.2\libtiff&quot;"
</ins><span class="cx">                                 UsePrecompiledHeader="0"
</span><span class="cx">                         />
</span><span class="cx">                         <Tool
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx">                         />
</span><span class="cx">                         <Tool
</span><span class="cx">                                 Name="VCCLCompilerTool"
</span><del>-                                AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\voipcodecs\src&quot;;&quot;$(InputDir)..\..\..\..\libs\voipcodecs\src\msvc&quot;"
</del><ins>+                                AdditionalIncludeDirectories="&quot;$(InputDir)..\..\..\..\libs\spandsp\src\msvc&quot;;&quot;$(InputDir)..\..\..\..\libs\spandsp\src&quot;;&quot;$(InputDir)..\..\..\..\libs\tiff-3.8.2\libtiff&quot;"
</ins><span class="cx">                                 UsePrecompiledHeader="0"
</span><span class="cx">                         />
</span><span class="cx">                         <Tool
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmoddialplansmod_dialplan_asteriskmod_dialplan_asteriskc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/dialplans/mod_dialplan_asterisk/mod_dialplan_asterisk.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -141,7 +141,7 @@
</span><span class="cx">                 caller_profile = switch_channel_get_caller_profile(channel);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!caller_profile || switch_strlen_zero(caller_profile->destination_number)) {
</del><ins>+        if (!caller_profile || zstr(caller_profile->destination_number)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Obtaining Profile!\n");
</span><span class="cx">                 return NULL;
</span><span class="cx">         }
</span><span class="lines">@@ -271,7 +271,7 @@
</span><span class="cx">                                 switch_regex_safe_free(re);
</span><span class="cx">
</span><span class="cx">                                 if (!extension) {
</span><del>-                                        if (switch_strlen_zero(field_data)) {
</del><ins>+                                        if (zstr(field_data)) {
</ins><span class="cx">                                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "No extension!\n");
</span><span class="cx">                                                 break;
</span><span class="cx">                                         }
</span><span class="lines">@@ -313,7 +313,7 @@
</span><span class="cx">         } else {
</span><span class="cx">                 profile = switch_core_get_variable("sip_profile");
</span><span class="cx">         }
</span><del>-        if (switch_strlen_zero(profile)) {
</del><ins>+        if (zstr(profile)) {
</ins><span class="cx">                 profile = "default";
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmoddialplansmod_dialplan_xmlmod_dialplan_xmlc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -262,10 +262,16 @@
</span><span class="cx">                 if (anti_action) {
</span><span class="cx">                         for (xaction = switch_xml_child(xcond, "anti-action"); xaction; xaction = xaction->next) {
</span><span class="cx">                                 const char *application = switch_xml_attr_soft(xaction, "application");
</span><del>-                                const char *data = switch_xml_attr_soft(xaction, "data");
</del><ins>+                                const char *data;
</ins><span class="cx">                                 const char *inline_ = switch_xml_attr_soft(xaction, "inline");
</span><span class="cx">                                 int xinline = switch_true(inline_);                                
</span><span class="cx">
</span><ins>+                                if (!zstr(xaction->txt)) {
+                                        data = xaction->txt;
+                                } else {
+                                        data = (char *) switch_xml_attr_soft(xaction, "data");
+                                }
+
</ins><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG_CLEAN(session), SWITCH_LOG_DEBUG,
</span><span class="cx">                                                                  "Dialplan: %s ANTI-Action %s(%s) %s\n",
</span><span class="cx">                                                                  switch_channel_get_name(channel), application, data, xinline ? "INLINE" : "");
</span><span class="lines">@@ -295,7 +301,7 @@
</span><span class="cx">                                 const char *inline_ = switch_xml_attr_soft(xaction, "inline");
</span><span class="cx">                                 int xinline = switch_true(inline_);
</span><span class="cx">
</span><del>-                                if (!switch_strlen_zero(xaction->txt)) {
</del><ins>+                                if (!zstr(xaction->txt)) {
</ins><span class="cx">                                         data = xaction->txt;
</span><span class="cx">                                 } else {
</span><span class="cx">                                         data = (char *) switch_xml_attr_soft(xaction, "data");
</span><span class="lines">@@ -393,7 +399,7 @@
</span><span class="cx">
</span><span class="cx">         /* get our handle to the "dialplan" section of the config */
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(alt_path)) {
</del><ins>+        if (!zstr(alt_path)) {
</ins><span class="cx">                 switch_xml_t conf = NULL, tag = NULL;
</span><span class="cx">                 if (!(alt_root = switch_xml_parse_file_simple(alt_path))) {
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Open of [%s] failed\n", alt_path);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_alsamod_alsac"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_alsa/mod_alsa.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_alsa/mod_alsa.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_alsa/mod_alsa.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -243,7 +243,6 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                switch_core_session_queue_indication(session, SWITCH_MESSAGE_INDICATE_RINGING);
</del><span class="cx">                 switch_channel_mark_ring_ready(channel);
</span><span class="cx">
</span><span class="cx">                 while (switch_channel_get_state(channel) == CS_INIT && !switch_test_flag(tech_pvt, TFLAG_ANSWER)) {
</span><span class="lines">@@ -367,7 +366,7 @@
</span><span class="cx">
</span><span class="cx">         switch_mutex_lock(globals.pvt_lock);
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(tech_pvt->call_id)) {
</del><ins>+        if (zstr(tech_pvt->call_id)) {
</ins><span class="cx">                 snprintf(tech_pvt->call_id, sizeof(tech_pvt->call_id), "%d", ++globals.call_id);
</span><span class="cx">                 switch_core_hash_insert(globals.call_hash, tech_pvt->call_id, tech_pvt);
</span><span class="cx">                 switch_core_session_set_read_codec(tech_pvt->session, &globals.read_codec);
</span><span class="lines">@@ -786,7 +785,7 @@
</span><span class="cx">
</span><span class="cx">                 if (outbound_profile) {
</span><span class="cx">                         char name[128];
</span><del>-                        const char *id = !switch_strlen_zero(outbound_profile->caller_id_number) ? outbound_profile->caller_id_number : "na";
</del><ins>+                        const char *id = !zstr(outbound_profile->caller_id_number) ? outbound_profile->caller_id_number : "na";
</ins><span class="cx">                         snprintf(name, sizeof(name), "alsa/%s", id);
</span><span class="cx">
</span><span class="cx">                         switch_channel_set_name(channel, name);
</span><span class="lines">@@ -1187,7 +1186,7 @@
</span><span class="cx">         char *dtmf_str = argv[0];
</span><span class="cx">         switch_dtmf_t dtmf = { 0, switch_core_default_dtmf_duration(0) };
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(dtmf_str)) {
</del><ins>+        if (zstr(dtmf_str)) {
</ins><span class="cx">                 stream->write_function(stream, "No DTMF Supplied!\n");
</span><span class="cx">         } else {
</span><span class="cx">                 switch_mutex_lock(globals.pvt_lock);
</span><span class="lines">@@ -1213,7 +1212,7 @@
</span><span class="cx">         uint8_t one_call = 0;
</span><span class="cx">
</span><span class="cx">         switch_mutex_lock(globals.pvt_lock);
</span><del>-        if (switch_strlen_zero(callid)) {
</del><ins>+        if (zstr(callid)) {
</ins><span class="cx">                 if (globals.call_list) {
</span><span class="cx">                         if (globals.call_list->next) {
</span><span class="cx">                                 tech_pvt = globals.call_list->next;
</span><span class="lines">@@ -1259,7 +1258,7 @@
</span><span class="cx">         char *callid = argv[0];
</span><span class="cx">
</span><span class="cx">         switch_mutex_lock(globals.pvt_lock);
</span><del>-        if (switch_strlen_zero(callid)) {
</del><ins>+        if (zstr(callid)) {
</ins><span class="cx">                 tech_pvt = globals.call_list;
</span><span class="cx">         } else {
</span><span class="cx">                 tech_pvt = switch_core_hash_find(globals.call_hash, callid);
</span><span class="lines">@@ -1286,7 +1285,7 @@
</span><span class="cx">
</span><span class="cx">         switch_mutex_lock(globals.pvt_lock);
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(callid)) {
</del><ins>+        if (!zstr(callid)) {
</ins><span class="cx">                 if ((tp = switch_core_hash_find(globals.call_hash, callid))) {
</span><span class="cx">                         if (switch_test_flag(tp, TFLAG_ANSWER)) {
</span><span class="cx">                                 stream->write_function(stream, "CALL ALREADY ANSWERED\n");
</span><span class="lines">@@ -1459,23 +1458,23 @@
</span><span class="cx">                         return SWITCH_STATUS_MEMERR;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(argv[1])) {
</del><ins>+                if (!zstr(argv[1])) {
</ins><span class="cx">                         dialplan = argv[1];
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(argv[2])) {
</del><ins>+                if (!zstr(argv[2])) {
</ins><span class="cx">                         cid_num = argv[2];
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(argv[3])) {
</del><ins>+                if (!zstr(argv[3])) {
</ins><span class="cx">                         cid_name = argv[3];
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(argv[4])) {
</del><ins>+                if (!zstr(argv[4])) {
</ins><span class="cx">                         tech_pvt->sample_rate = atoi(argv[4]);
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(argv[5])) {
</del><ins>+                if (!zstr(argv[5])) {
</ins><span class="cx">                         tech_pvt->codec_ms = atoi(argv[5]);
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -1577,13 +1576,13 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(cmd)) {
</del><ins>+                if (zstr(cmd)) {
</ins><span class="cx">                         goto done;
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">         } else {
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(cmd)) {
</del><ins>+                if (zstr(cmd)) {
</ins><span class="cx">                         stream->write_function(stream, "%s", usage_string);
</span><span class="cx">                         goto done;
</span><span class="cx">                 }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_dingalingmod_dingalingc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_dingaling/mod_dingaling.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_dingaling/mod_dingaling.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_dingaling/mod_dingaling.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -344,7 +344,7 @@
</span><span class="cx">         char *status = argv[4];
</span><span class="cx">         //char *proto = argv[5];
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(type)) {
</del><ins>+        if (zstr(type)) {
</ins><span class="cx">                 type = NULL;
</span><span class="cx">         } else if (!strcasecmp(type, "unavailable")) {
</span><span class="cx">                 status = NULL;
</span><span class="lines">@@ -550,7 +550,7 @@
</span><span class="cx">                 status = NULL;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(event_type)) {
</del><ins>+        if (zstr(event_type)) {
</ins><span class="cx">                 event_type = "presence";
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1090,7 +1090,6 @@
</span><span class="cx">         started = switch_micro_time_now();
</span><span class="cx">
</span><span class="cx">         /* jingle has no ringing indication so we will just pretend that we got one */
</span><del>-        switch_core_session_queue_indication(session, SWITCH_MESSAGE_INDICATE_RINGING);
</del><span class="cx">         switch_channel_mark_ring_ready(channel);
</span><span class="cx">
</span><span class="cx">         if (switch_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
</span><span class="lines">@@ -1994,7 +1993,7 @@
</span><span class="cx">                 profile->password = switch_core_strdup(module_pool, val);
</span><span class="cx">         } else if (!strcasecmp(var, "avatar")) {
</span><span class="cx">                 profile->avatar = switch_core_strdup(module_pool, val);
</span><del>-        } else if (!strcasecmp(var, "odbc-dsn") && !switch_strlen_zero(val)) {
</del><ins>+        } else if (!strcasecmp(var, "odbc-dsn") && !zstr(val)) {
</ins><span class="cx">                 if (switch_odbc_available()) {
</span><span class="cx">                         profile->odbc_dsn = switch_core_strdup(module_pool, val);
</span><span class="cx">                         if ((profile->odbc_user = strchr(profile->odbc_dsn, ':'))) {
</span><span class="lines">@@ -2008,17 +2007,17 @@
</span><span class="cx">                 }
</span><span class="cx">         } else if (!strcasecmp(var, "use-rtp-timer") && switch_true(val)) {
</span><span class="cx">                 switch_set_flag(profile, TFLAG_TIMER);
</span><del>-        } else if (!strcasecmp(var, "dialplan") && !switch_strlen_zero(val)) {
</del><ins>+        } else if (!strcasecmp(var, "dialplan") && !zstr(val)) {
</ins><span class="cx">                 profile->dialplan = switch_core_strdup(module_pool, val);
</span><span class="cx"> #ifdef AUTO_REPLY                                // gotta fix looping on this
</span><span class="cx">         } else if (!strcasecmp(var, "auto-reply")) {
</span><span class="cx">                 profile->auto_reply = switch_core_strdup(module_pool, val);
</span><span class="cx"> #endif
</span><del>-        } else if (!strcasecmp(var, "name") && !switch_strlen_zero(val)) {
</del><ins>+        } else if (!strcasecmp(var, "name") && !zstr(val)) {
</ins><span class="cx">                 profile->name = switch_core_strdup(module_pool, val);
</span><del>-        } else if (!strcasecmp(var, "message") && !switch_strlen_zero(val)) {
</del><ins>+        } else if (!strcasecmp(var, "message") && !zstr(val)) {
</ins><span class="cx">                 profile->message = switch_core_strdup(module_pool, val);
</span><del>-        } else if (!strcasecmp(var, "local-network-acl") && !switch_strlen_zero(val)) {
</del><ins>+        } else if (!strcasecmp(var, "local-network-acl") && !zstr(val)) {
</ins><span class="cx">                 profile->local_network = switch_core_strdup(module_pool, val);
</span><span class="cx">         } else if (!strcasecmp(var, "rtp-ip")) {
</span><span class="cx">                 profile->ip = switch_core_strdup(module_pool, strcasecmp(switch_str_nil(val), "auto") ? switch_str_nil(val) : globals.guess_ip);
</span><span class="lines">@@ -2031,14 +2030,14 @@
</span><span class="cx">                         ip = globals.guess_ip;
</span><span class="cx">                 } else {
</span><span class="cx">                         globals.auto_nat = 0;
</span><del>-                        ip = switch_strlen_zero(val) ? globals.guess_ip : val;
</del><ins>+                        ip = zstr(val) ? globals.guess_ip : val;
</ins><span class="cx">                 }
</span><span class="cx">                 profile->extip = switch_core_strdup(module_pool, ip);
</span><del>-        } else if (!strcasecmp(var, "server") && !switch_strlen_zero(val)) {
</del><ins>+        } else if (!strcasecmp(var, "server") && !zstr(val)) {
</ins><span class="cx">                 profile->server = switch_core_strdup(module_pool, val);
</span><del>-        } else if (!strcasecmp(var, "rtp-timer-name") && !switch_strlen_zero(val)) {
</del><ins>+        } else if (!strcasecmp(var, "rtp-timer-name") && !zstr(val)) {
</ins><span class="cx">                 profile->timer_name = switch_core_strdup(module_pool, val);
</span><del>-        } else if (!strcasecmp(var, "lanaddr") && !switch_strlen_zero(val)) {
</del><ins>+        } else if (!strcasecmp(var, "lanaddr") && !zstr(val)) {
</ins><span class="cx">                 profile->lanaddr = switch_core_strdup(module_pool, val);
</span><span class="cx">         } else if (!strcasecmp(var, "candidate-acl")) {
</span><span class="cx">                 if (profile->acl_count < MAX_ACL) {
</span><span class="lines">@@ -2056,11 +2055,11 @@
</span><span class="cx">                 } else if (val && !strcasecmp(val, "md5")) {
</span><span class="cx">                         profile->user_flags |= LDL_FLAG_SASL_MD5;
</span><span class="cx">                 }
</span><del>-        } else if (!strcasecmp(var, "exten") && !switch_strlen_zero(val)) {
</del><ins>+        } else if (!strcasecmp(var, "exten") && !zstr(val)) {
</ins><span class="cx">                 profile->exten = switch_core_strdup(module_pool, val);
</span><del>-        } else if (!strcasecmp(var, "context") && !switch_strlen_zero(val)) {
</del><ins>+        } else if (!strcasecmp(var, "context") && !zstr(val)) {
</ins><span class="cx">                 profile->context = switch_core_strdup(module_pool, val);
</span><del>-        } else if (!strcasecmp(var, "auto-login") && !switch_strlen_zero(val)) {
</del><ins>+        } else if (!strcasecmp(var, "auto-login") && !zstr(val)) {
</ins><span class="cx">                 if (switch_true(val)) {
</span><span class="cx">                         switch_set_flag(profile, TFLAG_AUTO);
</span><span class="cx">                 }
</span><span class="lines">@@ -2163,7 +2162,7 @@
</span><span class="cx">
</span><span class="cx">         if (session) return status;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd) || !(myarg = strdup(cmd))) {
</del><ins>+        if (zstr(cmd) || !(myarg = strdup(cmd))) {
</ins><span class="cx">                 stream->write_function(stream, "USAGE: %s\n", DINGALING_SYNTAX);
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="lines">@@ -2215,7 +2214,7 @@
</span><span class="cx">                 goto done;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "USAGE: %s\n", LOGIN_SYNTAX);
</span><span class="cx">                 status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">                 goto done;
</span><span class="lines">@@ -2225,7 +2224,7 @@
</span><span class="cx">
</span><span class="cx">         argc = switch_separate_string(myarg, ';', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd) || argc != 1) {
</del><ins>+        if (zstr(cmd) || argc != 1) {
</ins><span class="cx">                 stream->write_function(stream, "USAGE: %s\n", LOGIN_SYNTAX);
</span><span class="cx">                 status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">                 goto done;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323fromrev15313freeswitchtrunksrcmodendpointsmod_h323"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323 (from rev 15313, freeswitch/trunk/src/mod/endpoints/mod_h323)</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323Makefile"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/Makefile</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323Makefilefromrev15313freeswitchtrunksrcmodendpointsmod_h323Makefile"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/Makefile (from rev 15313, freeswitch/trunk/src/mod/endpoints/mod_h323/Makefile) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/Makefile         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/Makefile        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,7 @@
</span><ins>+BASE=../../../..
+LOCAL_CFLAGS+=-g -ggdb -I/usr/include/ptlib -I/usr/include/openh323 -I. -DPTRACING=1 -D_REENTRANT -fno-exceptions
+LOCAL_LDFLAGS= -lopenh323 -lpt -lrt
+
+include $(BASE)/build/modmake.rules
+
+
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323bugs"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/bugs</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323bugsfromrev15313freeswitchtrunksrcmodendpointsmod_h323bugs"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/bugs (from rev 15313, freeswitch/trunk/src/mod/endpoints/mod_h323/bugs) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/bugs         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/bugs        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+faststart and codecs v CallProceeding due to h323plus, grep "Very Frustrating - S.H." in h323plus
+source and uncomment commented lines.
+
+
+exploration form developer of h323plus:
+
+Yes that should be mera.
+
+The problem is that Callproceeding does not always come from the remote it
+may be generated by the gatekeeper. MERA where sending fast start elements
+in the Call proceeding and connect. The call proceeding where not valid and
+causing the media to fail. Normally (although valid) EP's do not set Fast
+Start in Call proceeding so the code was disabled to resolve the MERA issue.
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323changestxt"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/changes.txt</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323changestxtfromrev15313freeswitchtrunksrcmodendpointsmod_h323changestxt"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/changes.txt (from rev 15313, freeswitch/trunk/src/mod/endpoints/mod_h323/changes.txt) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/changes.txt         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/changes.txt        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+
+fixxxxes
+remove trys to implement non standard codecs.
+implement jitter-size value option.
+implement gk register retry timer.
+implement h245insetup enable/disable option.
+implement h245tunneling enable/disable option.
+implement faststart enable/disable option.
+fix release handling from h323 leg.
+fix misstype in codec conversion.
+fix rtp issue causes choppy sound.
+fix progress ind handling on outbound calls.
+fix crash on log line, btw not understand why.
+implement dtmf transfer.
+fix codec name conversion a bit.
+fix crash on inbound fast start connection.
+
+initial release.
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323h323confxml"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/h323.conf.xml</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323h323confxmlfromrev15313freeswitchtrunksrcmodendpointsmod_h323h323confxml"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/h323.conf.xml (from rev 15313, freeswitch/trunk/src/mod/endpoints/mod_h323/h323.conf.xml) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/h323.conf.xml         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/h323.conf.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+<configuration name="h323.conf" description="H323 Endpoints">
+ <settings>
+ <param name="trace-level" value="10"/>
+ <param name="context" value="default"/>
+ <param name="dialplan" value="XML"/>
+ <param name="codec-prefs" value="PCMA,GSM,G729,G726"/>
+ <param name="gk-address" value=""/> <!-- empty to disable, "*" to search LAN -->
+ <param name="gk-identifer" value=""/> <!-- optional name of gk -->
+ <param name="gk-interface" value=""/> <!-- mandatory listener interface name -->
+ <param name="gk-retry" value="30"/> <!-- optional GK register retry timer -->
+ <param name="faststart" value="true"/> <!-- optional -->
+ <param name="h245tunneling" value="true"/> <!-- optional -->
+ <param name="h245insetup" value="true"/> <!-- optional -->
+ <param name="jitter-size" value="60"/> <!-- optional -->
+ </settings>
+ <listeners>
+ <listener name="default">
+ <param name="h323-ip" value="$${local_ip_v4}"/>
+ <param name="h323-port" value="1720"/>
+ </listener>
+ </listeners>
+</configuration>
+
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323mod_h323cpp"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/mod_h323.cpp</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323mod_h323cppfromrev15313freeswitchtrunksrcmodendpointsmod_h323mod_h323cpp"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/mod_h323.cpp (from rev 15313, freeswitch/trunk/src/mod/endpoints/mod_h323/mod_h323.cpp) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/mod_h323.cpp         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/mod_h323.cpp        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,1453 @@
</span><ins>+/*
+        Version 0.0.11
+*/
+
+#include "mod_h323.h"
+
+SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_string, mod_h323_globals.codec_string);
+SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_context, mod_h323_globals.context);
+SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, mod_h323_globals.dialplan);
+
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_h323_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_h323_shutdown);
+SWITCH_MODULE_DEFINITION(mod_h323, mod_h323_load, mod_h323_shutdown, NULL);
+
+#define CF_NEED_FLUSH (1 << 1)
+struct mod_h323_globals mod_h323_globals = { 0 };
+
+static switch_call_cause_t create_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
+ switch_caller_profile_t *outbound_profile, switch_core_session_t **new_session,
+ switch_memory_pool_t **pool, switch_originate_flag_t flags);
+
+static const char modulename[] = "h323";
+static const char* h323_formats[] = {
+ "G.711-ALaw-64k", "PCMA",
+ "G.711-uLaw-64k", "PCMU",
+ "GSM-06.10", "GSM",
+ "G.723", "G723",
+ "G.729B", "G729b",
+ "G.729", "G729",
+ "G.729A", "G729a",
+ "G.729A/B", "G729ab",
+ "G.723.1", "G723.1",
+ "G.723.1(5.3k)", "G723.1-5k3",
+ "G.723.1A(5.3k)", "G723.1a-5k3",
+ "G.723.1A(6.3k)", "G723.1a-6k3",
+ 0
+};
+
+static switch_status_t on_hangup(switch_core_session_t *session);
+static switch_status_t on_destroy(switch_core_session_t *session);
+
+static switch_io_routines_t h323fs_io_routines = {
+ /*.outgoing_channel */ create_outgoing_channel,
+ /*.read_frame */ FSH323Connection::read_audio_frame,
+ /*.write_frame */ FSH323Connection::write_audio_frame,
+ /*.kill_channel */ FSH323Connection::kill_channel,
+ /*.send_dtmf */ FSH323Connection::send_dtmf,
+ /*.receive_message */ FSH323Connection::receive_message,
+ /*.receive_event */ FSH323Connection::receive_event,
+ /*.state_change */ FSH323Connection::state_change,
+ /*.read_video_frame */ FSH323Connection::read_video_frame,
+ /*.write_video_frame */ FSH323Connection::write_video_frame
+};
+
+static switch_state_handler_table_t h323fs_event_handlers = {
+ /*.on_init */ FSH323Connection::on_init,
+ /*.on_routing */ FSH323Connection::on_routing,
+ /*.on_execute */ FSH323Connection::on_execute,
+ /*.on_hangup */ on_hangup,
+ /*.on_exchange_media */ FSH323Connection::on_exchange_media,
+ /*.on_soft_execute */ FSH323Connection::on_soft_execute,
+ /*.on_consume_media*/ NULL,
+ /*.on_hibernate*/ NULL,
+ /*.on_reset*/ NULL,
+ /*.on_park*/ NULL,
+ /*.on_reporting*/ NULL,
+ /*.on_destroy*/ on_destroy
+};
+
+static FSProcess *opal_process = NULL;
+SWITCH_MODULE_LOAD_FUNCTION(mod_h323_load){
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Starting loading mod_h323\n");
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+                        
+ if (!*module_interface) {
+ return SWITCH_STATUS_MEMERR;
+ }
+
+ h323_process = new FSProcess();
+ if (h323_process == NULL) {
+ return SWITCH_STATUS_MEMERR;
+ }
+
+ if (h323_process->Initialise(*module_interface)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Opal manager initialized and running\n");
+ //unloading causes a seg in linux
+ return SWITCH_STATUS_NOUNLOAD;
+ //return SWITCH_STATUS_SUCCESS;
+ }
+
+ delete h323_process;
+ h323_process = NULL;
+ return SWITCH_STATUS_FALSE;
+}
+
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_h323_shutdown){
+
+ switch_safe_free(mod_h323_globals.context);
+ switch_safe_free(mod_h323_globals.dialplan);
+ switch_safe_free(mod_h323_globals.codec_string);
+ delete h323_process;
+ h323_process = NULL;
+ return SWITCH_STATUS_SUCCESS;
+}
+
+
+
+#if PTRACING
+
+class FSTrace : public ostream {
+ public:
+ FSTrace()
+ : ostream(&buffer)
+ {
+ }
+
+ private:
+ class Buffer : public streambuf {
+ char buffer[250];
+
+ public:
+ Buffer()
+ {
+ setg(buffer, buffer, &buffer[sizeof(buffer)-2]);
+ setp(buffer, &buffer[sizeof(buffer)-2]);
+ }
+
+ virtual int sync()
+ {
+ return overflow(EOF);
+ }
+
+ virtual int underflow()
+ {
+ return EOF;
+ }
+
+ virtual int overflow(int c)
+ {
+ const char *fmt = "%s";
+ char *func = NULL;
+
+ int bufSize = pptr() - pbase();
+
+ if (c != EOF) {
+ *pptr() = (char)c;
+ bufSize++;
+ }
+
+ if (bufSize != 0) {
+ char *bufPtr = pbase();
+ char *bufEndPtr = NULL;
+ setp(bufPtr, epptr());
+ bufPtr[bufSize] = '\0';
+ int line = 0;
+ char *p;
+
+ char *file = NULL;
+ switch_log_level_t level;
+
+
+ switch (strtoul(bufPtr, &file, 10)) {
+ case 1 :
+ level = SWITCH_LOG_INFO;
+ break;
+ default :
+ level = SWITCH_LOG_DEBUG;
+ break;
+ }
+
+ if (file) {
+ while (isspace(*file)) file++;
+
+ if (file && (bufPtr = strchr(file, '(')) && (bufEndPtr = strchr(bufPtr, ')'))) {
+ char *e;
+
+ for(p = bufPtr; p && *p; p++) {
+ if (*p == '\t') {
+ *p = ' ';
+ }
+ }
+
+ *bufPtr++ = '\0';
+ line = atoi(bufPtr);
+ while (bufEndPtr && isspace(*(++bufEndPtr)));
+ bufPtr = bufEndPtr;
+ if (bufPtr && (e = strchr(bufPtr, ' ')) || (e = strchr(bufPtr, '\t'))) {
+ func = bufPtr;
+ bufPtr = e;
+ *bufPtr++ = '\0';
+ }
+ }
+ }
+
+ switch_text_channel_t tchannel = SWITCH_CHANNEL_ID_LOG;
+
+ if (!bufPtr) {
+ bufPtr = pbase();
+ level = SWITCH_LOG_DEBUG;
+ }
+
+ if (bufPtr) {
+ if (end_of(bufPtr) != '\n') {
+ fmt = "%s\n";
+ }
+ if (!(file && func && line)) tchannel = SWITCH_CHANNEL_ID_LOG_CLEAN;
+
+ switch_log_printf(tchannel, file, func, line, NULL, level, fmt, bufPtr);
+ }
+
+ }
+
+ return 0;
+ }
+ } buffer;
+};
+
+#endif
+
+PString GetH245CodecName(const H323Capability* cap){
+        
+        switch (cap->GetSubType()) {
+                case H245_AudioCapability::e_g711Alaw64k:
+                case H245_AudioCapability::e_g711Alaw56k:
+                        return "PCMA";
+                case H245_AudioCapability::e_g711Ulaw64k:
+                case H245_AudioCapability::e_g711Ulaw56k:
+                        return "PCMU";
+                case H245_AudioCapability::e_g722_64k:
+                case H245_AudioCapability::e_g722_56k:
+                case H245_AudioCapability::e_g722_48k:
+                        return "G722";
+                case H245_AudioCapability::e_g728:
+                        return "G728";
+                case H245_AudioCapability::e_g729:
+                case H245_AudioCapability::e_g729AnnexA:
+                case H245_AudioCapability::e_g729wAnnexB:
+                case H245_AudioCapability::e_g729AnnexAwAnnexB:
+                        return "G729";
+                case H245_AudioCapability::e_g7231:
+                case H245_AudioCapability::e_g7231AnnexCCapability:
+                        return "G723";
+                case H245_AudioCapability::e_gsmFullRate:
+                case H245_AudioCapability::e_gsmHalfRate:
+                case H245_AudioCapability::e_gsmEnhancedFullRate:
+                        return "GSM";
+        }
+        return "Unknown";
+}
+
+FSProcess::FSProcess()
+ : PLibraryProcess("Test", "mod_h323", 1, 0, AlphaCode, 1)
+ , m_h323endpoint(NULL){
+}
+
+FSProcess::~FSProcess(){
+ delete m_h323endpoint;
+}
+
+bool FSProcess::Initialise(switch_loadable_module_interface_t *iface){
+        PTRACE(4, "mod_h323\t======>FSProcess::Initialise " << *this);
+        
+ m_h323endpoint = new FSH323EndPoint();
+ return m_h323endpoint != NULL && m_h323endpoint->Initialise(iface);
+}
+
+bool FSH323EndPoint::Initialise(switch_loadable_module_interface_t *iface){
+        PTRACE(4, "mod_h323\t======>FSManager::Initialise " << *this);
+ ReadConfig(false);
+
+ PTrace::SetLevel(mod_h323_globals.trace_level); //just for fun and eyecandy ;)
+ PTrace::SetOptions(PTrace::TraceLevel);
+ PTrace::SetStream(new FSTrace);
+
+ m_freeswitch = (switch_endpoint_interface_t *) switch_loadable_module_create_interface(iface, SWITCH_ENDPOINT_INTERFACE);
+ m_freeswitch->interface_name = modulename;
+ m_freeswitch->io_routines = &h323fs_io_routines;
+ m_freeswitch->state_handler = &h323fs_event_handlers;
+                        
+        PString codec = ((const char *)mod_h323_globals.codec_string);
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Config capabilliti %s \n",(const char *)codec);
+
+        if (!codec.IsEmpty()) {                
+                const char** f = h323_formats;
+                for (; *f; f += 2) {                        
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Find capabilliti %s to %s\n",f[1],(const char *)codec);
+                        if (codec.Find(f[1]) != P_MAX_INDEX) {
+                                PString tmp = f[0];
+                                tmp += "*{sw}";
+                                PINDEX init = GetCapabilities().GetSize();
+                                AddAllCapabilities(0, 0, tmp);
+                                PINDEX num = GetCapabilities().GetSize() - init;
+                                if (!num) {
+                                        // failed to add so pretend we support it in hardware
+                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "H323 failed to add capability '%s' \n",(const char *)tmp);
+                                        tmp = f[0];
+                                        tmp += "*{hw}";
+                                        AddAllCapabilities(0, 0, tmp);
+                                        num = GetCapabilities().GetSize() - init;
+                                }
+                                if (num)                                        
+                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "H.323 added %d capabilities '%s' \n",num,(const char *)tmp);
+                                else
+                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "H323 failed to add capability '%s' \n",(const char *)tmp);
+                                        
+                        }                
+                }
+        }
+
+        
+ AddAllUserInputCapabilities(0,1);
+        PTRACE(1, "OpenPhone\tCapability Table:\n" << setprecision(4) << capabilities);
+        
+        DisableFastStart(!m_faststart);
+ DisableH245Tunneling(!m_h245tunneling);
+ DisableH245inSetup(!m_h245insetup);        
+        
+ if (m_listeners.empty()) {
+ StartListener("");
+ } else {
+ for (std::list < FSListener >::iterator it = m_listeners.begin(); it != m_listeners.end(); ++it) {
+ if (!StartListener(it->listenAddress)) {
+ PTRACE(3, "mod_h323\tCannot start listener for " << it->name);
+ }
+ }
+ }
+
+ if (!m_gkAddress.IsEmpty() && !m_gkIdentifer.IsEmpty() && !m_gkInterface.IsEmpty()) {
+                m_thread = new FSGkRegThread(this,&m_gkAddress,&m_gkIdentifer,&m_gkInterface,m_gkretry);
+                m_thread->SetAutoDelete();
+                m_thread->Resume();
+ }
+        
+ return TRUE;
+}
+
+switch_status_t FSH323EndPoint::ReadConfig(int reload){
+        PTRACE(4, "mod_h323\t======>FSH323EndPoint::ReadConfig " << *this);
+ const char *cf = "h323.conf";
+ switch_status_t status = SWITCH_STATUS_SUCCESS;
+
+        switch_memory_pool_t *pool = NULL;
+ if ((status = switch_core_new_memory_pool(&pool)) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
+ return status;
+ }
+
+ set_global_context("default");
+ set_global_dialplan("XML");
+
+ switch_event_t *params = NULL;
+ switch_event_create(&params, SWITCH_EVENT_REQUEST_PARAMS);
+ switch_assert(params);
+ switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "profile", switch_str_nil(""));
+ switch_xml_t cfg;
+ switch_xml_t xml = switch_xml_open_cfg(cf, &cfg, params);
+ if (xml == NULL) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
+ return SWITCH_STATUS_FALSE;
+ }
+
+ switch_xml_t xmlSettings = switch_xml_child(cfg, "settings");
+ if (xmlSettings) {
+ for (switch_xml_t xmlParam = switch_xml_child(xmlSettings, "param"); xmlParam != NULL; xmlParam = xmlParam->next) {
+ const char *var = switch_xml_attr_soft(xmlParam, "name");
+ const char *val = switch_xml_attr_soft(xmlParam, "value");
+
+ if (!strcasecmp(var, "trace-level")) {
+ int level = atoi(val);
+ if (level > 0) {
+ mod_h323_globals.trace_level = level;
+ }
+ } else if (!strcasecmp(var, "context")) {
+ set_global_context(val);
+ } else if (!strcasecmp(var, "dialplan")) {
+ set_global_dialplan(val);
+ } else if (!strcasecmp(var, "codec-prefs")) {
+ set_global_codec_string(val);
+ } else if (!strcasecmp(var, "jitter-size")) {
+ char * next;
+ unsigned minJitter = strtoul(val, &next, 10);
+ if (minJitter >= 10) {
+ unsigned maxJitter = minJitter;
+ if (*next == ',')
+ maxJitter = atoi(next+1);
+ SetAudioJitterDelay(minJitter, maxJitter); // In milliseconds
+ } else{
+                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Set zero Jitter buffer\n");
+                                        SetAudioJitterDelay(0, 0);
+                                }
+                        } else if (!strcasecmp(var, "faststart")) {
+                                m_faststart = switch_true(val);
+                        } else if (!strcasecmp(var, "h245tunneling")) {
+                                m_h245tunneling = switch_true(val);
+                        } else if (!strcasecmp(var, "h245insetup")) {
+                                m_h245insetup = switch_true(val);
+ } else if (!strcasecmp(var, "gk-address")) {
+ m_gkAddress = val;
+ } else if (!strcasecmp(var, "gk-identifer")) {
+ m_gkIdentifer = val;
+ } else if (!strcasecmp(var, "gk-interface")) {
+ m_gkInterface = val;
+ } else if (!strcasecmp(var, "gk-prefix")) {
+                                m_gkPrefixes.AppendString(val);
+                        } else if (!strcasecmp(var, "gk-retry")) {
+                                m_gkretry = atoi(val);
+                        }
+                        
+ }
+ }
+
+ switch_xml_t xmlListeners = switch_xml_child(cfg, "listeners");
+ if (xmlListeners != NULL) {
+ for (switch_xml_t xmlListener = switch_xml_child(xmlListeners, "listener"); xmlListener != NULL; xmlListener = xmlListener->next) {
+
+ m_listeners.push_back(FSListener());
+ FSListener & listener = m_listeners.back();
+
+ listener.name = switch_xml_attr_soft(xmlListener, "name");
+ if (listener.name.IsEmpty())
+ listener.name = "unnamed";
+
+ PIPSocket::Address ip;
+ WORD port = 1720;
+
+ for (switch_xml_t xmlParam = switch_xml_child(xmlListener, "param"); xmlParam != NULL; xmlParam = xmlParam->next) {
+ const char *var = switch_xml_attr_soft(xmlParam, "name");
+ const char *val = switch_xml_attr_soft(xmlParam, "value");
+
+ if (!strcasecmp(var, "h323-ip"))
+ ip = val;
+ else if (!strcasecmp(var, "h323-port"))
+ port = (WORD) atoi(val);
+ }
+
+ listener.listenAddress = new H323ListenerTCP(*this,ip,port);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Created Listener '%s'\n", (const char *) listener.name);
+ }
+ }
+
+ switch_event_destroy(&params);
+
+ if (xml)
+ switch_xml_free(xml);
+
+ return status;
+}
+
+FSH323EndPoint::FSH323EndPoint()
+        :m_faststart(true)
+        ,m_h245tunneling(true)
+        ,m_h245insetup(true)
+{
+        PTRACE(4, "mod_h323\t======>FSH323EndPoint::FSH323EndPoint [" << *this<<"]");
+        terminalType = e_GatewayOnly;
+}        
+
+FSH323EndPoint::~FSH323EndPoint(){
+        PTRACE(4, "mod_h323\t======>FSH323EndPoint::~FSH323EndPoint [" << *this<<"]");
+        StopGkClient();
+}
+
+H323Connection *FSH323EndPoint::CreateConnection(
+        unsigned callReference,
+        void* userData,
+        H323Transport* transport,
+        H323SignalPDU* setupPDU){
+        PTRACE(4, "mod_h323\t======>FSH323EndPoint::CreateConnection callReference = "<< callReference <<" userDate = "<<userData<<" [" << *this<<"]");
+
+        if ((switch_caller_profile_t *)userData){
+                PTRACE(4, "mod_h323\t------> SWITCH_CALL_DIRECTION_OUTBOUND");
+        } else{
+                PTRACE(4, "mod_h323\t------> SWITCH_CALL_DIRECTION_INBOUND");
+        }
+        
+ switch_core_session_t *fsSession = switch_core_session_request(GetSwitchInterface(),
+ (switch_caller_profile_t *)userData ? SWITCH_CALL_DIRECTION_OUTBOUND : SWITCH_CALL_DIRECTION_INBOUND, NULL);
+ if (fsSession == NULL)
+ return NULL;
+        
+        PTRACE(4, "mod_h323\t------> fsSession = "<<fsSession);
+ switch_channel_t *fsChannel = switch_core_session_get_channel(fsSession);
+
+        if (fsChannel == NULL) {
+ switch_core_session_destroy(&fsSession);
+ return NULL;
+        }
+        
+ return new FSH323Connection(*this,transport,callReference,(switch_caller_profile_t *)userData, fsSession, fsChannel);
+}
+
+bool FSH323EndPoint::OnSetGatewayPrefixes(PStringList & prefixes) const{
+        PTRACE(4, "mod_h323\t======>FSH323EndPoint::OnSetGatewayPrefixes " << *this);
+        if(m_gkPrefixes.GetSize() > 0) {
+                PTRACE(4, "mod_h323\tOnSetGatewayPrefixes " << m_gkPrefixes);
+                prefixes = m_gkPrefixes;
+                return true;
+        }
+        return false;
+}
+
+void FSH323EndPoint::StartGkClient(int retry, PString* gkAddress,PString* gkIdentifer,PString* gkInterface){
+        PTRACE(4, "mod_h323\t======>FSH323EndPoint::StartGkClient [" << *this<<"]");
+        while(!UseGatekeeper(m_gkAddress, m_gkIdentifer, m_gkInterface) && retry > 0 ){
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
+ "Could not start gatekeeper: addr=\"%s\", id=\"%s\", if=\"%s\"\n",
+ (const char *)m_gkAddress,
+ (const char *)m_gkIdentifer,
+ (const char *)m_gkInterface);
+                        switch_yield(retry*1000);
+        }
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Started gatekeeper: %s\n",
+                                                        (const char *)GetGatekeeper()->GetName());        
+        m_thread = 0;        
+}
+
+void FSH323EndPoint::StopGkClient(){
+        PTRACE(4, "mod_h323\t======> FSH323EndPoint::StopGkClient [" << *this<<"]");
+        if (m_thread) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Started gatekeeper thread\n");
+                RemoveGatekeeper();
+                m_thread->Terminate();
+                m_thread = 0;
+ }
+}
+
+FSH323Connection::FSH323Connection(FSH323EndPoint& endpoint, H323Transport* transport, unsigned callReference, switch_caller_profile_t *outbound_profile, switch_core_session_t *fsSession, switch_channel_t *fsChannel)
+        : H323Connection(endpoint,callReference)
+        , m_endpoint(&endpoint)
+        , m_fsSession(fsSession)
+ , m_fsChannel(fsChannel)
+        , m_callOnPreAnswer(false)
+        , m_startRTP(false)
+        , m_rxChennel(false)
+        , m_txChennel(false)
+        , m_ChennelAnswer(false)
+        , m_ChennelProgress(false){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::FSH323Connection [" << *this<<"]");
+
+ h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_alloc(m_fsSession, sizeof(*tech_pvt));
+ tech_pvt->me = this;
+ switch_core_session_set_private(m_fsSession, tech_pvt);
+        
+        switch_mutex_init(&tech_pvt->flag_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(m_fsSession));
+        switch_mutex_init(&tech_pvt->h323_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(m_fsSession));
+        
+ if (outbound_profile != NULL) {
+ SetLocalPartyName(outbound_profile->caller_id_number);
+ SetDisplayName(outbound_profile->caller_id_name);
+
+ switch_caller_profile_t *caller_profile = switch_caller_profile_clone(m_fsSession, outbound_profile);
+ switch_channel_set_caller_profile(m_fsChannel, caller_profile);
+
+ PString name = "h323/";
+ name += outbound_profile->destination_number;
+ switch_channel_set_name(m_fsChannel, name);
+
+ switch_channel_set_flag(m_fsChannel, CF_OUTBOUND);
+ switch_channel_set_state(m_fsChannel, CS_INIT);
+ }
+        
+        m_RTPlocalPort = switch_rtp_request_port((const char *)m_RTPlocalIP.AsString());
+}        
+
+FSH323Connection::~FSH323Connection(){
+ PTRACE(4, "mod_h323\t======>FSH323Connection::~FSH323Connection ["<<*this<<"]");
+        h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_get_private(m_fsSession);
+ tech_pvt->me = NULL;
+}        
+
+void FSH323Connection::OnSetLocalCapabilities(){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::OnSetLocalCapabilities() [" << *this<<"]");
+        H323Connection::OnSetLocalCapabilities();
+        SetLocalCapabilities();
+}
+
+bool FSH323Connection::SetLocalCapabilities(){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::SetLocalCapabilities() Size local capability = "<<localCapabilities.GetSize()<<" [" << *this<<"]");
+ if (!mod_h323_globals.codec_string)
+                return false;
+
+ bool nocodecs = true;
+ bool changed = false;
+ for (int i = 0; i < localCapabilities.GetSize(); i++) {
+                const char* format = 0;
+                PString fname;
+                decodeCapability(localCapabilities[i],&format,0,&fname);
+                if (format) {
+                        PString m_globalcodec = ((const char *)mod_h323_globals.codec_string);
+                        if (m_globalcodec.Find(format) < 0) {
+                                PTRACE(1, "mod_h323\tRemoving capability '"<<fname<<"' ("<<format<<") not in remote '"<<m_globalcodec<<"'");
+                                changed = true;
+                                for (PINDEX idx = 0; idx < fastStartChannels.GetSize(); idx++) {
+                                        if (fastStartChannels[idx].GetCapability() == localCapabilities[i]) {
+                                                PTRACE(1, "mod_h323\tRemoving fast start channel "<<fastStartChannels[idx].GetDirection()<<" '"<<fname<<"' ("<<format<<")");
+                                                fastStartChannels.RemoveAt(idx--);
+                                        }                
+                                }
+                                localCapabilities.Remove(fname);
+                                i--;
+                        } else        nocodecs = false;
+                }
+ }
+ if (nocodecs) {
+                PTRACE(3, "mod_h323\tNo codecs remaining for H323 connection ["<<*this<<"]");
+                changed = false;
+                ClearCall(EndedByCapabilityExchange);                
+ }
+ return changed;
+}
+
+bool FSH323Connection::decodeCapability(const H323Capability& capability, const char** dataFormat, int* payload, PString* capabName){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::decodeCapability");
+ PString fname((const char *)capability.GetFormatName());
+
+ if (fname.Find("{sw}") == (fname.GetLength() - 4))
+                fname = fname.Mid(0,fname.GetLength()-4);
+ if (fname.Find("{hw}") == (fname.GetLength() - 4))
+                fname = fname.Mid(0,fname.GetLength()-4);
+                
+ OpalMediaFormat oformat(fname, false);
+ int pload = oformat.GetPayloadType();
+ const char *format = 0;
+ const char** f = h323_formats;
+ for (; *f; f += 2) {
+                if (fname.Find(*f) == 0) {
+                        format = f[1];
+                        break;
+                }
+ }
+
+        PTRACE(1, "mod_h323\tcapability '"<< fname << "' format '"<<format<<"' payload "<<pload);
+ if (format) {
+                if (capabName)
+                        *capabName = fname;
+                if (dataFormat)
+                        *dataFormat = format;
+                if (payload)
+                        *payload = pload;
+                return true;
+ }
+ return false;
+}
+
+H323Connection::AnswerCallResponse FSH323Connection::OnAnswerCall(const PString &caller,
+ const H323SignalPDU &setupPDU, H323SignalPDU &connectPDU){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::OnAnswerCall caller = "<< caller<<" [" << *this<<"]");
+        
+        if (m_fsSession == NULL) {
+ PTRACE(1, "mod_h323\tSession request failed.");
+ return H323Connection::AnswerCallDenied;
+ }
+
+ switch_core_session_add_stream(m_fsSession, NULL);
+
+ switch_channel_t *channel = switch_core_session_get_channel(m_fsSession);
+ if (channel == NULL) {
+ PTRACE(1, "mod_h323\tSession does not have a channel");
+ return H323Connection::AnswerCallDenied;
+ }
+
+        const Q931& q931 = setupPDU.GetQ931();
+        const H225_Setup_UUIE& setup = setupPDU.m_h323_uu_pdu.m_h323_message_body;
+ const H225_ArrayOf_AliasAddress& address = setup.m_destinationAddress;
+ for (int i = 0; i<address.GetSize(); i++)
+                PTRACE(2, "mod_h323\t address index = "<<i<<" value = "<<(const char *)H323GetAliasAddressString(address[i]));
+        PString called;
+ if (address.GetSize() > 0)
+                called = (const char *)H323GetAliasAddressString(address[0]);
+ if (!called.IsEmpty())
+                PTRACE(2, "mod_h323\t Called number or alias = "<<called);
+ else {
+                PString callnam;
+                if (q931.GetCalledPartyNumber(callnam)) {
+                        called=(const char *)callnam;                        
+                        PTRACE(2, "mod_h323\t Called-Party-Number = "<<called);
+                }
+ }
+
+ switch_caller_profile_t *caller_profile = switch_caller_profile_new(switch_core_session_get_pool(m_fsSession),
+ NULL,
+ /** username */
+ mod_h323_globals.dialplan,
+ /** dial plan */
+ GetRemotePartyName(),
+ /** caller_id_name */
+ GetRemotePartyNumber(),
+ /** caller_id_number */
+ NULL,
+ /** network addr */
+ NULL,
+ /** ANI */
+ NULL,
+ /** ANI II */
+ NULL,
+ /** RDNIS */
+ modulename,
+ /** source */
+ mod_h323_globals.context,
+ /** set context */
+ called
+ /** destination_number */
+ );
+ if (caller_profile == NULL) {
+ PTRACE(1, "mod_h323\tCould not create caller profile");
+ return H323Connection::AnswerCallDenied;
+ }
+
+ PTRACE(4, "mod_h323\tCreated switch caller profile:\n"
+ " username = " << caller_profile->username << "\n"
+ " dialplan = " << caller_profile->dialplan << "\n"
+ " caller_id_name = " << caller_profile->caller_id_name << "\n"
+ " caller_id_number = " << caller_profile->caller_id_number << "\n"
+ " network_addr = " << caller_profile->network_addr << "\n"
+ " source = " << caller_profile->source << "\n"
+ " context = " << caller_profile->context << "\n"
+                 " destination_number= " << caller_profile->destination_number);
+ switch_channel_set_caller_profile(channel, caller_profile);
+
+ char name[256] = "h323/";
+ switch_copy_string(name + 5, caller_profile->destination_number, sizeof(name)-5);
+ switch_channel_set_name(channel, name);
+ switch_channel_set_state(channel, CS_INIT);
+
+ if (switch_core_session_thread_launch(m_fsSession) != SWITCH_STATUS_SUCCESS) {
+ PTRACE(1, "mod_h323\tCould not launch session thread");
+ return H323Connection::AnswerCallDenied;
+ }
+
+        return H323Connection::AnswerCallDeferred;
+}
+
+H323Channel* FSH323Connection::CreateRealTimeLogicalChannel(const H323Capability& capability,H323Channel::Directions dir,unsigned sessionID,const H245_H2250LogicalChannelParameters* param, RTP_QOS * rtpqos){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::CreateRealTimeLogicalChannel [" << *this<<"]");
+        
+        H323TransportAddress m_h323transportadd = GetSignallingChannel()->GetLocalAddress();
+        m_h323transportadd.GetIpAddress(m_RTPlocalIP);
+
+        return new FSH323_ExternalRTPChannel(*this, capability, dir, sessionID,m_RTPlocalIP,m_RTPlocalPort);
+}
+
+PBoolean FSH323Connection::OnStartLogicalChannel(H323Channel & channel){
+ PTRACE(4, "mod_h323\t======>FSH323Connection::OnStartLogicalChannel chennel = "<<&channel<<" ["<<*this<<"]");
+
+        return true;
+}
+
+PBoolean FSH323Connection::OnCreateLogicalChannel(const H323Capability& capability, H323Channel::Directions dir, unsigned& errorCode){
+ PTRACE(4, "mod_h323\t======>FSH323Connection::OnCreateLogicalChannel ('"<< (const char *)capability.GetFormatName()<<"',"<<dir<<") ["<<*this<<"]");
+
+        return H323Connection::OnCreateLogicalChannel(capability,dir,errorCode);
+}
+
+void FSH323Connection::OnReceivedReleaseComplete(const H323SignalPDU & pdu){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::OnReceivedReleaseComplete cause = "<<pdu.GetQ931().GetCause()<<" value = "<<(switch_call_cause_t)pdu.GetQ931().GetCause());
+        h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_get_private(m_fsSession);
+        
+        switch_channel_hangup(switch_core_session_get_channel(m_fsSession),(switch_call_cause_t)pdu.GetQ931().GetCause());
+        return H323Connection::OnReceivedReleaseComplete(pdu);
+}
+
+bool FSH323Connection::OnReceivedProgress(const H323SignalPDU &pdu)
+{
+        PTRACE(4, "mod_h323\t======>FSH323Connection::OnReceivedProgress ["<<*this<<"]");
+        if ((m_rxChennel && m_txChennel) || (m_ChennelProgress && m_rxChennel))
+                switch_channel_mark_pre_answered(m_fsChannel);
+        else{
+                m_ChennelProgress = true;
+        }
+        return true;
+}
+
+
+bool FSH323Connection::OnSendReleaseComplete(H323SignalPDU & pdu)
+{
+        PTRACE(4, "mod_h323\t======>FSH323Connection::OnSendReleaseComplete cause = "<<pdu.GetQ931().GetCause()<<" value = "<<(switch_call_cause_t)pdu.GetQ931().GetCause());
+        
+        switch_channel_hangup(m_fsChannel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);                        
+        return H323Connection::OnSendReleaseComplete(pdu);
+}
+
+PBoolean FSH323Connection::OpenLogicalChannel(const H323Capability& capability, unsigned sessionID, H323Channel::Directions dir){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::OpenLogicalChannel ('"<< (const char *)capability.GetFormatName()<<"', "<< sessionID<<", "<<dir <<") "<<*this);
+
+ return H323Connection::OpenLogicalChannel(capability,sessionID,dir);
+}
+
+
+bool FSH323Connection::OnReceivedCapabilitySet(const H323Capabilities & remoteCaps,
+                                                        const H245_MultiplexCapability * muxCap,
+                                                        H245_TerminalCapabilitySetReject & reject){
+        
+        PTRACE(4, "mod_h323\t======>FSH323Connection::OnReceivedCapabilitySet ["<<*this<<"]");
+        if (!H323Connection::OnReceivedCapabilitySet(remoteCaps, muxCap, reject)) {
+                return false;
+        }
+        PTRACE(4, "mod_h323\t======>END H323Connection::OnReceivedCapabilitySet ["<<*this<<"]");
+        
+        for (int i = 0; i < remoteCapabilities.GetSize(); ++i) {
+                PTRACE(4, "mod_h323\t----> Capabilities = "<<remoteCapabilities[i]);
+        }
+        
+        H323Capability * cap = remoteCapabilities.FindCapability(H323Capability::e_Audio);
+        if (cap == NULL) {
+                PTRACE(4, "mod_h323\t----> Capabilities is NULL ");
+                return false;
+        }
+        PTRACE(4, "mod_h323\t----> Capabilities not NULL ");
+        
+        return true;                                                
+}
+
+
+bool FSH323Connection::OnAlerting(const H323SignalPDU &alertingPDU, const PString &user){
+
+        PTRACE(4, "mod_h323\t======>PFSH323Connection::OnAlerting user = "<<(const char *)user<<" ["<<*this<<"]");
+        switch_status_t status = switch_channel_mark_ring_ready(m_fsChannel);
+        PTRACE(4, "mod_h323\t----------->OnAlerting return = "<<status);
+        return ( status == SWITCH_STATUS_SUCCESS);
+}
+
+void FSH323Connection::OnEstablished(){
+
+        PTRACE(4, "mod_h323\t======>PFSH323Connection::OnEstablished ["<<*this<<"]");
+        if(m_startRTP)                
+                switch_channel_mark_answered(m_fsChannel);
+        else m_ChennelAnswer = true;
+}
+
+
+
+void FSH323Connection::setRemoteAddress(const char* remoteIP, WORD remotePort){
+        PTRACE(4, "mod_h323\t======>PFSH323Connection::setRemoteAddress remoteIP ="<<remoteIP<<", remotePort = "<<remotePort<<" "<<*this);
+        
+ if (!m_remotePort) {
+        PTRACE(4, "mod_h323\tGot remote RTP address "<<remoteIP<<":"<<remotePort<<" ["<<*this<<"]");
+        m_remotePort = remotePort;
+        m_remoteAddr = remoteIP;
+ }
+}
+
+switch_status_t FSH323Connection::on_execute(){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::on_execute [" << *this<<"]");
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+switch_status_t FSH323Connection::on_routing(){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::on_routing ["<< *this<<"]");
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+switch_status_t FSH323Connection::kill_channel(int sig){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::kill_channel ["<< *this<<"]");
+ PTRACE(3, "mod_h323\tKill " << sig << " on connection " << *this);
+        h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_get_private(m_fsSession);
+        
+        if (!tech_pvt) {
+                return SWITCH_STATUS_FALSE;
+        }
+        
+ switch (sig) {
+ case SWITCH_SIG_BREAK:
+                if (switch_rtp_ready(tech_pvt->rtp_session)) {
+                        switch_rtp_break(tech_pvt->rtp_session);
+                }
+ break;
+ case SWITCH_SIG_KILL:
+ default:
+                if (switch_rtp_ready(tech_pvt->rtp_session)) {
+                        switch_rtp_kill_socket(tech_pvt->rtp_session);
+                }
+ break;
+ }
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+switch_status_t FSH323Connection::send_dtmf(const switch_dtmf_t *dtmf){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::send_dtmf " << *this);
+ SendUserInputTone(dtmf->digit, dtmf->duration);
+ return SWITCH_STATUS_SUCCESS;
+}
+
+void FSH323Connection::SendUserInputTone(char tone, unsigned duration, unsigned logicalChannel, unsigned rtpTimestamp)
+{
+        PTRACE(4, "mod_h323\t======>FSH323Connection::SendUserInputTone [" << *this<<"]");
+        H323Connection::SendUserInputTone(tone, duration);
+}
+
+void FSH323Connection::OnUserInputTone(char tone, unsigned duration, unsigned logicalChannel, unsigned rtpTimestamp)
+{
+        PTRACE(4, "mod_h323\t======>FSH323Connection::OnUserInputTone [" << *this<<"]");
+        
+        switch_dtmf_t dtmf = { tone, duration };
+ switch_channel_queue_dtmf(m_fsChannel, &dtmf);
+        H323Connection::OnUserInputTone( tone, duration, logicalChannel, rtpTimestamp);
+}
+
+void FSH323Connection::OnUserInputString(const PString &value)
+{
+        PTRACE(4, "mod_h323\t======>FSH323Connection::OnUserInputString [" << *this<<"]");
+        switch_dtmf_t dtmf = { value[0], 0 };
+ switch_channel_queue_dtmf(m_fsChannel, &dtmf);
+        H323Connection::OnUserInputString(value);
+}
+
+
+switch_status_t FSH323Connection::receive_message(switch_core_session_message_t *msg){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::receive_message MSG=" << msg->message_id);
+ switch_channel_t *channel = switch_core_session_get_channel(m_fsSession);
+
+ switch (msg->message_id) {
+ case SWITCH_MESSAGE_INDICATE_BRIDGE:
+ case SWITCH_MESSAGE_INDICATE_UNBRIDGE:
+ case SWITCH_MESSAGE_INDICATE_AUDIO_SYNC:
+ switch_channel_set_private_flag(channel, CF_NEED_FLUSH);
+ break;
+ default:
+ break;
+ }
+
+ switch (msg->message_id) {
+                case SWITCH_MESSAGE_INDICATE_RINGING:{
+                         AnsweringCall(AnswerCallPending);
+                        break;
+                }
+                case SWITCH_MESSAGE_INDICATE_DEFLECT:{
+                        break;
+                }
+                case SWITCH_MESSAGE_INDICATE_PROGRESS:{                
+                        AnsweringCall(AnswerCallPending);
+                        AnsweringCall(AnswerCallDeferredWithMedia);
+                        
+                        if (m_txChennel && m_rxChennel)
+                                if (!switch_channel_test_flag(m_fsChannel, CF_EARLY_MEDIA)) {
+                                        switch_channel_mark_pre_answered(m_fsChannel);
+                                }
+                        else m_callOnPreAnswer = true;
+                        break;
+                }
+                case SWITCH_MESSAGE_INDICATE_ANSWER:{
+                        if (switch_channel_test_flag(channel, CF_OUTBOUND)) {
+                                return SWITCH_STATUS_FALSE;
+                        }
+                        AnsweringCall(H323Connection::AnswerCallNow);
+                        PTRACE(4, "mod_h323\tMedia started on connection " << *this);
+                
+                        if (m_txChennel && m_rxChennel)
+                                if (!switch_channel_test_flag(m_fsChannel, CF_EARLY_MEDIA)) {
+                                        PTRACE(4, "mod_h323\t-------------------->switch_channel_mark_answered(m_fsChannel) " << *this);
+                                        switch_channel_mark_answered(m_fsChannel);
+                                }
+                        else m_ChennelAnswer = true;
+                        break;
+                }
+                default:{
+                        PTRACE(3, "mod_h323\tReceived message " << msg->message_id << " on connection " << *this);
+                }        
+ }
+ return SWITCH_STATUS_SUCCESS;
+}
+
+switch_status_t FSH323Connection::receive_event(switch_event_t *event){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::receive_event " << *this);
+ PTRACE(3, "mod_h323\tReceived event " << event->event_id << " on connection " << *this);
+ return SWITCH_STATUS_SUCCESS;
+}
+
+switch_status_t FSH323Connection::state_change(){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::state_change " << *this);
+ PTRACE(3, "mod_h323\tState changed on connection " << *this);
+ return SWITCH_STATUS_SUCCESS;
+}
+
+switch_status_t FSH323Connection::on_init(){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::on_init " << *this);
+ switch_channel_t *channel = switch_core_session_get_channel(m_fsSession);
+ if (channel == NULL) {
+ return SWITCH_STATUS_FALSE;
+ }
+
+ PTRACE(3, "mod_h323\tStarted routing for connection " << *this);
+ switch_channel_set_state(channel, CS_ROUTING);
+ return SWITCH_STATUS_SUCCESS;
+}
+
+switch_status_t FSH323Connection::on_exchange_media(){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::on_exchange_media " << *this);
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+switch_status_t FSH323Connection::on_soft_execute(){
+ PTRACE(4, "mod_h323\t======>FSH323Connection::on_soft_execute " << *this);
+        
+ return SWITCH_STATUS_SUCCESS;
+}
+
+switch_status_t FSH323Connection::read_audio_frame(switch_frame_t **frame, switch_io_flag_t flags, int stream_id){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::read_audio_frame " << *this);
+        h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_get_private(m_fsSession);
+        tech_pvt->read_frame.flags = 0;
+
+        switch_set_flag_locked(tech_pvt, TFLAG_READING);
+ if (!switch_channel_ready(m_fsChannel)) {
+                PTRACE(4, "mod_h323\t---------> RETURN");
+                switch_clear_flag_locked(tech_pvt, TFLAG_READING);                
+         return SWITCH_STATUS_FALSE;
+ }
+
+ if (!switch_core_codec_ready(&tech_pvt->read_codec )) {
+                PTRACE(4, "mod_h323\t---------> RETURN");
+                switch_clear_flag_locked(tech_pvt, TFLAG_READING);
+ return SWITCH_STATUS_FALSE;
+ }
+
+        switch_status_t status = switch_rtp_zerocopy_read_frame(tech_pvt->rtp_session, &tech_pvt->read_frame, flags);
+        if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) {
+                        PTRACE(4, "mod_h323\t---------> RETURN");
+                        switch_clear_flag_locked(tech_pvt, TFLAG_READING);
+                        return SWITCH_STATUS_FALSE;
+        }
+        PTRACE(4, "mod_h323\t--------->\n source = "<<tech_pvt->read_frame.source<< "\n packetlen = "<<tech_pvt->read_frame.packetlen<<"\n datalen = "<<tech_pvt->read_frame.datalen<<"\n samples = "<<tech_pvt->read_frame.samples<<"\n rate = "<<tech_pvt->read_frame.rate<<"\n payload = "<<(int)tech_pvt->read_frame.payload<<"\n timestamp = "<<tech_pvt->read_frame.timestamp<<"\n seq = "<<tech_pvt->read_frame.seq<<"\n ssrc = "<<tech_pvt->read_frame.ssrc);
+ if (tech_pvt->read_frame.flags & SFF_CNG) {
+ tech_pvt->read_frame.buflen = sizeof(m_buf);
+ tech_pvt->read_frame.data = m_buf;
+ tech_pvt->read_frame.packet = NULL;
+ tech_pvt->read_frame.packetlen = 0;
+ tech_pvt->read_frame.timestamp = 0;
+ tech_pvt->read_frame.m = SWITCH_FALSE;
+ tech_pvt->read_frame.seq = 0;
+ tech_pvt->read_frame.ssrc = 0;
+ tech_pvt->read_frame.codec = &tech_pvt->read_codec ;
+ } else {
+ tech_pvt->read_frame.codec = &tech_pvt->read_codec ;
+ }
+        switch_clear_flag_locked(tech_pvt, TFLAG_READING);
+        
+ *frame = &tech_pvt->read_frame;
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+switch_status_t FSH323Connection::write_audio_frame(switch_frame_t *frame, switch_io_flag_t flags, int stream_id){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::write_audio_frame " << *this);
+        
+        switch_status_t status = SWITCH_STATUS_SUCCESS;
+        h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_get_private(m_fsSession);
+        switch_assert(tech_pvt != NULL);
+        
+        if (!switch_channel_ready(m_fsChannel)) {
+                PTRACE(4, "mod_h323\t---------> RETURN");
+ return SWITCH_STATUS_FALSE;
+ }        
+        
+        while (!(tech_pvt->read_codec.implementation && switch_rtp_ready(tech_pvt->rtp_session))) {
+                if (switch_channel_ready(m_fsChannel)) {
+                        switch_yield(10000);
+                } else {
+                        PTRACE(4, "mod_h323\t---------> RETURN");
+                        return SWITCH_STATUS_GENERR;
+                }
+        }
+        
+        if (!switch_core_codec_ready(&tech_pvt->read_codec) || !tech_pvt->read_codec.implementation) {
+                PTRACE(4, "mod_h323\t---------> RETURN");
+                return SWITCH_STATUS_GENERR;
+        }
+
+        if ((frame->flags & SFF_CNG)) {
+                PTRACE(4, "mod_h323\t---------> RETURN");
+ return SWITCH_STATUS_SUCCESS;
+ }
+        switch_set_flag_locked(tech_pvt, TFLAG_WRITING);
+        
+        if (switch_rtp_write_frame(tech_pvt->rtp_session, frame)< 0) {
+                status = SWITCH_STATUS_GENERR;
+        }
+        
+        switch_clear_flag_locked(tech_pvt, TFLAG_WRITING);
+        PTRACE(4, "mod_h323\t---------> RETURN");        
+        return status;
+}
+
+switch_status_t FSH323Connection::read_video_frame(switch_frame_t **frame, switch_io_flag_t flag, int stream_id){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::read_video_frame " << *this);
+
+}
+
+switch_status_t FSH323Connection::write_video_frame(switch_frame_t *frame, switch_io_flag_t flag, int stream_id){
+        PTRACE(4, "mod_h323\t======>FSH323Connection::write_video_frame " << *this);
+}
+
+///////////////////////////////////////////////////////////////////////
+
+FSH323_ExternalRTPChannel::FSH323_ExternalRTPChannel(
+ FSH323Connection& connection,
+ const H323Capability& capability,
+ Directions direction,
+ unsigned sessionID,
+        const PIPSocket::Address& ip,
+        WORD dataPort)
+ : H323_ExternalRTPChannel(connection, capability, direction, sessionID,ip,dataPort)
+        , m_conn(&connection)
+        , m_fsSession(connection.GetSession())
+        , m_capability(&capability)
+        , m_RTPlocalPort(dataPort){
+        
+        h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_get_private(m_fsSession);
+        m_RTPlocalIP = (const char *)ip.AsString();
+        SetExternalAddress(H323TransportAddress(ip, dataPort), H323TransportAddress(ip, dataPort+1));
+ PTRACE(4, "mod_h323\t======>FSH323_ExternalRTPChannel::FSH323_ExternalRTPChannel "<< GetDirection()<< " addr="<< m_RTPlocalIP <<":"<< m_RTPlocalPort<<" ["<<*this<<"]");        
+        
+        memset(&m_readFrame, 0, sizeof(m_readFrame));
+ m_readFrame.codec = m_switchCodec;
+ m_readFrame.flags = SFF_RAW_RTP;
+        
+        m_fsChannel = switch_core_session_get_channel(m_fsSession);
+ //SetExternalAddress(H323TransportAddress(localIpAddress, m_RTPlocalPort), H323TransportAddress(localIpAddress, m_RTPlocalPort+1));
+        PTRACE(4, "mod_h323\t------->capability.GetPayloadType() return = "<<capability.GetPayloadType());
+        PTRACE(4, "mod_h323\t------->capability.GetFormatName() return = "<<capability.GetFormatName());
+        
+        PString fname((const char *)capability.GetFormatName());
+
+ if (fname.Find("{sw}") == (fname.GetLength() - 4))
+                fname = fname.Mid(0,fname.GetLength()-4);
+ if (fname.Find("{hw}") == (fname.GetLength() - 4))
+                fname = fname.Mid(0,fname.GetLength()-4);
+        
+        OpalMediaFormat format(fname, FALSE);
+        m_format = &format;
+        payloadCode = format.GetPayloadType();
+        PTRACE(4, "mod_h323\t------->payloadCode = "<<(int)payloadCode);
+}
+
+
+FSH323_ExternalRTPChannel::~FSH323_ExternalRTPChannel(){
+ PTRACE(4, "mod_h323\t======>FSH323_ExternalRTPChannel::~FSH323_ExternalRTPChannel "<< GetDirection()<<" "<<*this);
+        
+        h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_get_private(m_fsSession);
+        if (IsRunning()){
+                PTRACE(4, "mod_h323\t------------->Running");
+                if (switch_rtp_ready(tech_pvt->rtp_session)) {
+                        switch_rtp_kill_socket(tech_pvt->rtp_session);
+                }
+        }
+}
+
+PBoolean FSH323_ExternalRTPChannel::Start(){
+ PTRACE(4, "mod_h323\t======>FSH323_ExternalRTPChannel::Start() "<<*this);
+        
+        const char *err = NULL;
+        switch_rtp_flag_t flags;
+        char * timer_name = NULL;
+        const char *var;
+ h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_get_private(m_fsSession);
+        if (!(m_conn && H323_ExternalRTPChannel::Start()))
+                return FALSE;
+        
+        bool isAudio;
+ if (m_capability->GetMainType() == H323Capability::e_Audio) {
+ isAudio = true;
+                PTRACE(4, "mod_h323\t------------------------->H323Capability::e_Audio");
+ } else if (m_capability->GetMainType() == H323Capability::e_Video) {
+ isAudio = false;
+                PTRACE(4, "mod_h323\t------------------------->H323Capability::e_Video");
+ }
+        
+        H323Codec *codec = GetCodec();
+                
+        PTRACE(4, "mod_h323\t------------------->GetFrameSize() return = "<<m_format->GetFrameSize());
+        PTRACE(4, "mod_h323\t------------------->GetFrameTime() return = "<<m_format->GetFrameTime());
+        PTRACE(4, "mod_h323\t------------------->payloadCode = "<<(int)payloadCode);
+        PTRACE(4, "mod_h323\t------------------->m_capability->GetTxFramesInPacket() return = "<<m_capability->GetTxFramesInPacket());
+        PTRACE(4, "mod_h323\t------------------->m_capability->GetFormatName() return = "<<m_capability->GetFormatName());
+        PTRACE(4, "mod_h323\t------------------->GetH245CodecName() return = "<<GetH245CodecName(m_capability));
+        
+        if (GetDirection() == IsReceiver){
+                m_switchCodec = isAudio ? &tech_pvt->read_codec : &tech_pvt->vid_read_codec;
+ m_switchTimer = isAudio ? &tech_pvt->read_timer : &tech_pvt->vid_read_timer;
+                m_conn->m_rxChennel = true;
+        }else{
+                m_switchCodec = isAudio ? &tech_pvt->write_codec : &tech_pvt->vid_write_codec;
+                m_conn->m_txChennel = true;
+        }
+        
+        if (m_conn->m_callOnPreAnswer && !(GetDirection() == IsReceiver)){
+                m_switchCodec = isAudio ? &tech_pvt->read_codec : &tech_pvt->vid_read_codec;
+ m_switchTimer = isAudio ? &tech_pvt->read_timer : &tech_pvt->vid_read_timer;
+        }
+        
+        if (switch_core_codec_init(m_switchCodec, GetH245CodecName(m_capability), NULL, // FMTP
+ 8000, m_capability->GetTxFramesInPacket(), 1, // Channels
+ SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, // Settings
+ switch_core_session_get_pool(m_fsSession)) != SWITCH_STATUS_SUCCESS) {
+
+ if (switch_core_codec_init(m_switchCodec, GetH245CodecName(m_capability), NULL, // FMTP
+ 8000, 0, 1, // Channels
+ SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, // Settings
+ switch_core_session_get_pool(m_fsSession)) != SWITCH_STATUS_SUCCESS) {
+ PTRACE(1, "mod_h323\t" << switch_channel_get_name(m_fsChannel)<< " Cannot initialise " << ((GetDirection() == IsReceiver)? " read" : " write") << ' '
+ << m_capability->GetMainType() << " codec " << m_capability << " for connection " << *this);
+ switch_channel_hangup(m_fsChannel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION);
+ return false;
+ }
+ PTRACE(2, "mod_h323\t" << switch_channel_get_name(m_fsChannel)<< " Unsupported ptime of " << m_capability->GetTxFramesInPacket() << " on " << ((GetDirection() == IsReceiver)? " read" : " write") << ' '
+ << m_capability->GetMainType() << " codec " << m_capability << " for connection " << *this);
+ }
+
+ PTRACE(1, "mod_h323\t" << switch_channel_get_name(m_fsChannel)<< " initialise " <<
+ switch_channel_get_name(m_fsChannel) << ((GetDirection() == IsReceiver)? " read" : " write") << ' '
+ << m_capability->GetMainType() << " codec " << m_capability << " for connection " << *this);
+        
+         if (GetDirection() == IsReceiver) {
+ m_readFrame.rate = tech_pvt->read_codec.implementation->actual_samples_per_second;
+
+ if (isAudio) {
+ switch_core_session_set_read_codec(m_fsSession, m_switchCodec);
+ if (switch_core_timer_init(m_switchTimer,
+ "soft",
+ m_switchCodec->implementation->microseconds_per_packet / 1000,
+ m_switchCodec->implementation->samples_per_packet,
+ switch_core_session_get_pool(m_fsSession)) != SWITCH_STATUS_SUCCESS) {
+ switch_core_codec_destroy(m_switchCodec);
+ m_switchCodec = NULL;
+ return false;
+ }
+ } else {
+ switch_core_session_set_video_read_codec(m_fsSession, m_switchCodec);
+ switch_channel_set_flag(m_fsChannel, CF_VIDEO);
+ }
+ } else {
+ if (isAudio) {
+ switch_core_session_set_write_codec(m_fsSession, m_switchCodec);
+ } else {
+ switch_core_session_set_video_write_codec(m_fsSession, m_switchCodec);
+ switch_channel_set_flag(m_fsChannel, CF_VIDEO);
+ }
+ }
+
+        if (m_conn->m_callOnPreAnswer && !(GetDirection() == IsReceiver)){
+                m_readFrame.rate = tech_pvt->read_codec.implementation->actual_samples_per_second;
+
+ if (isAudio) {
+ switch_core_session_set_read_codec(m_fsSession, m_switchCodec);
+ if (switch_core_timer_init(m_switchTimer,
+ "soft",
+ m_switchCodec->implementation->microseconds_per_packet / 1000,
+ m_switchCodec->implementation->samples_per_packet,
+ switch_core_session_get_pool(m_fsSession)) != SWITCH_STATUS_SUCCESS) {
+ switch_core_codec_destroy(m_switchCodec);
+ m_switchCodec = NULL;
+ return false;
+ }
+                        switch_channel_set_variable(m_fsChannel,"timer_name","soft");
+                }        
+        }
+        
+        if (m_conn->m_ChennelProgress && (GetDirection() == IsReceiver)){
+                if (isAudio) {
+ switch_core_session_set_write_codec(m_fsSession, m_switchCodec);
+ }
+        }
+        
+ PTRACE(3, "mod_h323\tSet " << ((GetDirection() == IsReceiver)? " read" : " write") << ' '
+ << m_capability->GetMainType() << " codec to << " << m_capability << " for connection " << *this);
+
+        switch_mutex_lock(tech_pvt->h323_mutex);
+        
+        PIPSocket::Address remoteIpAddress;
+ GetRemoteAddress(remoteIpAddress,m_RTPremotePort);        
+        m_RTPremoteIP = (const char *)remoteIpAddress.AsString();
+        PTRACE(4, "mod_h323\t------------------->tech_pvt->rtp_session = "<<tech_pvt->rtp_session);
+        PTRACE(4, "mod_h323\t------------------->samples_per_packet = "<<m_switchCodec->implementation->samples_per_packet);
+        PTRACE(4, "mod_h323\t------------------->actual_samples_per_second = "<<m_switchCodec->implementation->actual_samples_per_second);
+        
+        if (!m_conn->m_startRTP) {                        
+                flags = (switch_rtp_flag_t) (SWITCH_RTP_FLAG_DATAWAIT|SWITCH_RTP_FLAG_AUTO_CNG|SWITCH_RTP_FLAG_RAW_WRITE|SWITCH_RTP_FLAG_AUTOADJ);                
+                if ((var = switch_channel_get_variable(m_fsChannel, "timer_name"))) {
+                        timer_name = (char *) var;
+                }
+                tech_pvt->rtp_session = switch_rtp_new((const char *)m_RTPlocalIP,
+                                                                                         m_RTPlocalPort,
+                                                                                         (const char *)m_RTPremoteIP,
+                                                                                         m_RTPremotePort,
+                                                                                         (switch_payload_t)payloadCode,
+                                                                                         m_switchCodec->implementation->samples_per_packet,        
+                                                                                         m_capability->GetTxFramesInPacket() * 1000,
+                                                                                         (switch_rtp_flag_t) flags, timer_name, &err,
+                                                                                         switch_core_session_get_pool(m_fsSession));
+                PTRACE(4, "mod_h323\t------------------------->tech_pvt->rtp_session = "<<tech_pvt->rtp_session);
+                m_conn->m_startRTP = true;
+                if (switch_rtp_ready(tech_pvt->rtp_session)) {
+                        PTRACE(4, "mod_h323\t+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");                
+                        switch_channel_set_flag(m_fsChannel, CF_FS_RTP);
+                        
+                }else{
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "AUDIO RTP REPORTS ERROR: [%s]\n", switch_str_nil(err));
+                        switch_channel_hangup(m_fsChannel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);                        
+                        switch_mutex_unlock(tech_pvt->h323_mutex);
+                        return SWITCH_STATUS_FALSE;
+                }
+        }
+        
+ PTRACE(4, "mod_h323\t------------->External RTP address "<<m_RTPremoteIP<<":"<<m_RTPremotePort);
+        switch_mutex_unlock(tech_pvt->h323_mutex);
+        if ( m_conn->m_ChennelAnswer && m_conn->m_rxChennel && m_conn->m_txChennel)
+                switch_channel_mark_answered(m_fsChannel);
+                
+        if ((m_conn->m_ChennelProgress && m_conn->m_rxChennel)||(m_conn->m_callOnPreAnswer && m_conn->m_txChennel))
+                switch_channel_mark_pre_answered(m_fsChannel);
+                
+        return true;
+}
+
+
+PBoolean FSH323_ExternalRTPChannel::OnReceivedPDU(
+                                const H245_H2250LogicalChannelParameters& param,
+                                unsigned& errorCode){
+ PTRACE(4, "mod_h323\t======>FSH323_ExternalRTPChannel::OnReceivedPDU ["<<*this<<"]");
+        
+ if (!H323_ExternalRTPChannel::OnReceivedPDU(param,errorCode))
+                return true;
+ PIPSocket::Address remoteIpAddress;
+ WORD remotePort;
+ GetRemoteAddress(remoteIpAddress,remotePort);
+ PTRACE(4, "mod_h323\tRemote RTP address "<<(const char *)remoteIpAddress.AsString()<<":"<<remotePort);
+ m_conn->setRemoteAddress((const char *)remoteIpAddress.AsString(), remotePort);
+ return true;
+}
+
+PBoolean FSH323_ExternalRTPChannel::OnSendingPDU(H245_H2250LogicalChannelParameters& param){
+ PTRACE(4, "mod_h323\t======>FSH323_ExternalRTPChannel::OnSendingPDU ["<<*this<<"]");
+ return H323_ExternalRTPChannel::OnSendingPDU(param);
+}
+
+PBoolean FSH323_ExternalRTPChannel::OnReceivedAckPDU(const H245_H2250LogicalChannelAckParameters& param){
+ PTRACE(4, "mod_h323\t======>FSH323_ExternalRTPChannel::OnReceivedAckPDU ["<<*this<<"]");
+ return H323_ExternalRTPChannel::OnReceivedAckPDU(param);
+}
+
+void FSH323_ExternalRTPChannel::OnSendOpenAck(H245_H2250LogicalChannelAckParameters& param){
+ PTRACE(4, "mod_h323\t======>FSH323_ExternalRTPChannel::OnSendOpenAck ["<<*this<<"]");
+ H323_ExternalRTPChannel::OnSendOpenAck(param);
+}
+
+
+FSH323Connection * FSH323EndPoint::FSMakeCall(const PString & dest, void *userData){
+        PTRACE(4, "mod_h323\t======>FSH323EndPoint::FSMakeCall DST NUMBER = "<<dest<<" ["<<*this<<"]");
+        
+        FSH323Connection * connection;
+        PString token;
+        H323Transport *transport = NULL;
+        
+ if (listeners.GetSize() > 0) {
+                        H323TransportAddress taddr = listeners[0].GetTransportAddress();
+                        PIPSocket::Address addr;
+                        WORD port;
+                        if (taddr.GetIpAndPort(addr, port)) {                                
+                                if (addr) {
+                                        PTRACE(4, "mod_h323\t----> Using "<<addr<<" for outbound call");
+                                        transport = new H323TransportTCP(*this, addr,false);
+                                        if (!transport)                                                
+                                                PTRACE(4, "mod_h323\t----> Unable to create transport for outgoing call");
+                                }
+                        } else
+                                PTRACE(4, "mod_h323\t----> Unable to get address and port");
+        }
+        
+ if (!(connection = (FSH323Connection *)H323EndPoint::MakeCall(dest, token, userData))) {
+ return NULL;
+ }
+        return connection;
+}
+
+
+static switch_call_cause_t create_outgoing_channel(switch_core_session_t *session,
+ switch_event_t *var_event,
+ switch_caller_profile_t *outbound_profile,
+ switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags){
+        PTRACE(4, "mod_h323\t======>create_outgoing_channel DST NUMBER = "<<outbound_profile->destination_number);
+        
+        FSH323Connection * connection;
+ if (h323_process == NULL) {
+ return SWITCH_CAUSE_CRASH;
+ }
+        FSH323EndPoint & ep = h323_process->GetH323EndPoint();
+        if (!(connection = ep.FSMakeCall(outbound_profile->destination_number,outbound_profile))){
+                return SWITCH_CAUSE_PROTOCOL_ERROR;
+        }
+
+ *new_session = connection->GetSession();
+        PTRACE(4, "mod_h323\t--------->GetSession() return = "<<connection->GetSession());
+ return SWITCH_CAUSE_SUCCESS;
+}
+
+
+static switch_status_t on_destroy(switch_core_session_t *session){
+        PTRACE(4, "mod_h323\t======>on_destroy ");
+
+ h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_get_private(session);
+
+ if (tech_pvt) {
+                if (tech_pvt->read_codec.implementation) {
+                        switch_core_codec_destroy(&tech_pvt->read_codec);
+                }
+                if (tech_pvt->write_codec.implementation) {
+                        switch_core_codec_destroy(&tech_pvt->write_codec);
+                }
+                if (tech_pvt->vid_read_codec.implementation) {
+                        switch_core_codec_destroy(&tech_pvt->vid_read_codec);
+                }
+                if (tech_pvt->vid_write_codec.implementation) {
+                        switch_core_codec_destroy(&tech_pvt->vid_write_codec);
+                }
+                if (tech_pvt->read_timer.timer_interface) {
+                        switch_core_timer_destroy(&tech_pvt->read_timer);
+                }
+                if (tech_pvt->vid_read_timer.timer_interface) {
+                        switch_core_timer_destroy(&tech_pvt->vid_read_timer);
+                }
+ }
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+
+static switch_status_t on_hangup(switch_core_session_t *session){
+        PTRACE(4, "mod_h323\t======>switch_status_t on_hangup ");
+
+ switch_channel_t *channel = switch_core_session_get_channel(session);
+ h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_get_private(session);
+ if (tech_pvt->me) {
+                PTRACE(4, "mod_h323\t----->");
+ Q931::CauseValues cause = (Q931::CauseValues)switch_channel_get_cause_q850(channel);
+ tech_pvt->me->SetQ931Cause(cause);
+ tech_pvt->me->ClearCallSynchronous(NULL, H323TranslateToCallEndReason(cause, UINT_MAX));
+ tech_pvt->me = NULL;
+ }
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+
+
+
+
+
+
+
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323mod_h323h"></a>
<div class="delfile"><h4>Deleted: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/mod_h323.h</h4></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_h323mod_h323hfromrev15313freeswitchtrunksrcmodendpointsmod_h323mod_h323h"></a>
<div class="copfile"><h4>Copied: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/mod_h323.h (from rev 15313, freeswitch/trunk/src/mod/endpoints/mod_h323/mod_h323.h) (0 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/mod_h323.h         (rev 0)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_h323/mod_h323.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -0,0 +1,465 @@
</span><ins>+
+
+#if defined(__GNUC__) && defined(HAVE_VISIBILITY)
+#pragma GCC visibility push(default)
+#endif
+
+#include <ptlib.h>
+#include <h323.h>
+#include <h323neg.h>
+#include <h323pdu.h>
+#include <h323caps.h>
+#include <ptclib/delaychan.h>
+
+#include <list>
+
+
+#if defined(__GNUC__) && defined(HAVE_VISIBILITY)
+#pragma GCC visibility pop
+#endif
+
+#undef strcasecmp
+#undef strncasecmp
+
+#define HAVE_APR
+#include <switch.h>
+#include <switch_version.h>
+#define MODNAME "mod_h323"
+
+
+typedef enum {
+        TFLAG_IO = (1 << 0),
+        TFLAG_INBOUND = (1 << 1),
+        TFLAG_OUTBOUND = (1 << 2),
+        TFLAG_READING = (1 << 3),
+        TFLAG_WRITING = (1 << 4),
+        TFLAG_BYE = (1 << 5),
+        TFLAG_VOICE = (1 << 6),
+        TFLAG_RTP_READY = (1 << 7),
+        TFLAG_CODEC_READY = (1 << 8),
+        TFLAG_TRANSPORT = (1 << 9),
+        TFLAG_ANSWER = (1 << 10),
+        TFLAG_VAD_IN = (1 << 11),
+        TFLAG_VAD_OUT = (1 << 12),
+        TFLAG_VAD = (1 << 13),
+        TFLAG_DO_CAND = (1 << 14),
+        TFLAG_DO_DESC = (1 << 15),
+        TFLAG_LANADDR = (1 << 16),
+        TFLAG_AUTO = (1 << 17),
+        TFLAG_DTMF = (1 << 18),
+        TFLAG_TIMER = (1 << 19),
+        TFLAG_TERM = (1 << 20),
+        TFLAG_TRANSPORT_ACCEPT = (1 << 21),
+        TFLAG_READY = (1 << 22),
+} TFLAGS;
+
+struct mod_h323_globals {
+ int trace_level;
+ char *codec_string;
+ char *context;
+ char *dialplan;
+};
+
+extern struct mod_h323_globals mod_h323_globals;
+
+class FSH323Connection;
+class FSH323_ExternalRTPChannel;
+
+typedef struct {
+        unsigned int flags;
+ switch_timer_t read_timer;
+ switch_codec_t read_codec;
+ switch_codec_t write_codec;
+        switch_frame_t read_frame;
+        
+ switch_timer_t vid_read_timer;
+ switch_codec_t vid_read_codec;
+ switch_codec_t vid_write_codec;
+        switch_rtp_t *rtp_session;
+        switch_mutex_t *flag_mutex;
+        switch_mutex_t *h323_mutex;
+        
+ FSH323Connection *me;
+} h323_private_t;
+
+#define DECLARE_CALLBACK0(name) \
+ static switch_status_t name(switch_core_session_t *session) { \
+ h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_get_private(session); \
+ return tech_pvt && tech_pvt->me != NULL ? tech_pvt->me->name() : SWITCH_STATUS_FALSE; } \
+switch_status_t name()
+
+#define DECLARE_CALLBACK1(name, type1, name1) \
+ static switch_status_t name(switch_core_session_t *session, type1 name1) { \
+ h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_get_private(session); \
+ return tech_pvt && tech_pvt->me != NULL ? tech_pvt->me->name(name1) : SWITCH_STATUS_FALSE; } \
+switch_status_t name(type1 name1)
+
+#define DECLARE_CALLBACK3(name, type1, name1, type2, name2, type3, name3) \
+ static switch_status_t name(switch_core_session_t *session, type1 name1, type2 name2, type3 name3) { \
+ h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_get_private(session); \
+ return tech_pvt && tech_pvt->me != NULL ? tech_pvt->me->name(name1, name2, name3) : SWITCH_STATUS_FALSE; } \
+switch_status_t name(type1 name1, type2 name2, type3 name3)
+
+class FSH323EndPoint;
+class FSProcess : public PLibraryProcess {
+ PCLASSINFO(FSProcess, PLibraryProcess);
+
+ public:
+ FSProcess();
+ ~FSProcess();
+
+ bool Initialise(switch_loadable_module_interface_t *iface);
+
+ FSH323EndPoint & GetH323EndPoint() const { return *m_h323endpoint; }
+
+ protected:
+ FSH323EndPoint * m_h323endpoint;
+};
+
+struct FSListener {
+ FSListener() {
+ }
+
+ PString name;
+ H323ListenerTCP *listenAddress;
+ PString localUserName;
+ PString gatekeeper;
+};
+class FSGkRegThread;
+class FSH323EndPoint:public H323EndPoint {
+
+ PCLASSINFO(FSH323EndPoint, H323EndPoint);
+        public:
+                FSH323EndPoint();
+                ~FSH323EndPoint();
+                
+                
+         /**Create a connection that uses the specified call.
+ */
+        virtual H323Connection* CreateConnection(
+                unsigned callReference,
+                void* userData,
+                H323Transport* transport,
+                H323SignalPDU* setupPDU
+        );
+        virtual bool OnSetGatewayPrefixes(PStringList & prefixes) const;
+        
+        bool Initialise(switch_loadable_module_interface_t *iface);
+        
+ switch_status_t ReadConfig(int reload);
+        
+        void StartGkClient(int retry, PString* gkAddress,PString* gkIdentifer,PString* gkInterface);
+        void StopGkClient();
+        
+        switch_endpoint_interface_t *GetSwitchInterface() const {
+ return m_freeswitch;
+ }
+        FSH323Connection * FSMakeCall(const PString & dest,void *userData);
+        list <FSListener> m_listeners;
+        
+        protected:
+                PStringList m_gkPrefixes;
+                switch_endpoint_interface_t *m_freeswitch;
+                PString m_gkAddress;
+                PString m_gkIdentifer;
+                PString m_gkInterface;
+                bool m_faststart;
+                bool m_h245tunneling;
+                bool m_h245insetup;
+                int m_gkretry;
+                FSGkRegThread* m_thread;
+                
+};
+
+
+class FSGkRegThread : public PThread
+{
+ PCLASSINFO(FSGkRegThread, PThread);
+public:
+ FSGkRegThread(FSH323EndPoint* endpoint, PString* gkAddress, PString* gkIdentifer, PString* gkInterface, int retry = 0)
+        : PThread(10000), m_ep(endpoint), m_retry(retry), m_gkAddress(gkAddress),m_gkIdentifer(gkIdentifer),m_gkInterface(gkInterface)
+        { }
+ void Main()
+        { m_ep->StartGkClient(m_retry,m_gkAddress,m_gkIdentifer,m_gkInterface); }
+protected:
+ FSH323EndPoint* m_ep;
+ int m_retry;
+ PString* m_gkAddress;
+        PString* m_gkIdentifer;
+        PString* m_gkInterface;
+};
+
+
+class FSH323Connection:public H323Connection {
+ PCLASSINFO(FSH323Connection, H323Connection)
+
+ public:
+        FSH323Connection(FSH323EndPoint& endpoint,
+                                        H323Transport* transport,
+                                        unsigned callReference,
+                                        switch_caller_profile_t *outbound_profile,
+                                        switch_core_session_t *fsSession,
+                                        switch_channel_t *fsChannel);
+
+        ~FSH323Connection();                                
+
+        virtual H323Channel* CreateRealTimeLogicalChannel(
+                const H323Capability& capability,
+                H323Channel::Directions dir,
+                unsigned sessionID,
+                const H245_H2250LogicalChannelParameters* param,
+                RTP_QOS * rtpqos = NULL
+        );
+        virtual PBoolean OnStartLogicalChannel(H323Channel& channel);
+        virtual PBoolean OnCreateLogicalChannel(const H323Capability& capability, H323Channel::Directions dir, unsigned& errorCode);
+        virtual void OnReceivedReleaseComplete(const H323SignalPDU & pdu);
+        virtual        bool OnReceivedProgress(const H323SignalPDU &);
+        virtual bool OnSendReleaseComplete(H323SignalPDU & pdu);
+        virtual PBoolean OpenLogicalChannel(const H323Capability& capability, unsigned sessionID, H323Channel::Directions dir);
+ void setRemoteAddress(const char* remoteIP, WORD remotePort);
+        virtual void OnSetLocalCapabilities();
+        virtual bool OnAlerting(const H323SignalPDU &alertingPDU, const PString &user);
+        virtual void OnEstablished();
+        bool SetLocalCapabilities();
+        static bool decodeCapability(const H323Capability& capability, const char** dataFormat, int* payload = 0, PString* capabName = 0);
+        virtual H323Connection::AnswerCallResponse OnAnswerCall(const PString& caller,
+                                                const H323SignalPDU& signalPDU, H323SignalPDU& connectPDU);
+        virtual bool OnReceivedCapabilitySet(const H323Capabilities & remoteCaps,
+                                                                const H245_MultiplexCapability * muxCap,
+                                                                H245_TerminalCapabilitySetReject & reject);
+        switch_core_session_t *GetSession() const {
+ return m_fsSession;
+ }
+        virtual void SendUserInputTone(char tone, unsigned duration = 0, unsigned logicalChannel = 0, unsigned rtpTimestamp = 0);
+        virtual void OnUserInputTone(char, unsigned, unsigned, unsigned);
+        virtual void OnUserInputString(const PString &value);
+        DECLARE_CALLBACK0(on_init);
+ DECLARE_CALLBACK0(on_routing);
+ DECLARE_CALLBACK0(on_execute);
+
+ DECLARE_CALLBACK0(on_exchange_media);
+ DECLARE_CALLBACK0(on_soft_execute);
+
+ DECLARE_CALLBACK1(kill_channel, int, sig);
+ DECLARE_CALLBACK1(send_dtmf, const switch_dtmf_t *, dtmf);
+ DECLARE_CALLBACK1(receive_message, switch_core_session_message_t *, msg);
+ DECLARE_CALLBACK1(receive_event, switch_event_t *, event);
+ DECLARE_CALLBACK0(state_change);
+
+        DECLARE_CALLBACK3(read_audio_frame, switch_frame_t **, frame, switch_io_flag_t, flags, int, stream_id);
+ DECLARE_CALLBACK3(write_audio_frame, switch_frame_t *, frame, switch_io_flag_t, flags, int, stream_id);
+ DECLARE_CALLBACK3(read_video_frame, switch_frame_t **, frame, switch_io_flag_t, flag, int, stream_id);
+ DECLARE_CALLBACK3(write_video_frame, switch_frame_t *, frame, switch_io_flag_t, flag, int, stream_id);
+        
+        bool m_callOnPreAnswer;
+        bool m_startRTP;
+        bool m_rxChennel;
+        bool m_txChennel;
+        bool m_ChennelAnswer;
+        bool m_ChennelProgress;
+ protected:
+        FSH323EndPoint * m_endpoint;
+        PString m_remoteAddr;
+ int m_remotePort;
+        switch_core_session_t *m_fsSession;
+ switch_channel_t *m_fsChannel;
+        PIPSocket::Address m_RTPlocalIP;
+        WORD m_RTPlocalPort;
+        unsigned char m_buf[SWITCH_RECOMMENDED_BUFFER_SIZE];
+};
+
+
+class FSH323_ExternalRTPChannel : public H323_ExternalRTPChannel{
+ PCLASSINFO(FSH323_ExternalRTPChannel, H323_ExternalRTPChannel);
+public:
+ /* Create a new channel. */
+ FSH323_ExternalRTPChannel(
+                FSH323Connection& connection,
+                const H323Capability& capability,
+                Directions direction,
+                unsigned sessionID,
+                const PIPSocket::Address& ip,
+                WORD dataPort
+        );
+ /* Destructor */
+ ~FSH323_ExternalRTPChannel();
+
+ virtual PBoolean Start();
+ virtual PBoolean OnReceivedAckPDU(const H245_H2250LogicalChannelAckParameters& param);
+ virtual PBoolean OnSendingPDU(H245_H2250LogicalChannelParameters& param);
+ virtual PBoolean OnReceivedPDU(const H245_H2250LogicalChannelParameters& param,unsigned& errorCode);
+ virtual void OnSendOpenAck(H245_H2250LogicalChannelAckParameters& param);
+        
+
+private:
+ FSH323Connection* m_conn;
+        const H323Capability* m_capability;
+        switch_core_session_t *m_fsSession;
+        switch_channel_t *m_fsChannel;
+        switch_codec_t *m_switchCodec;
+        OpalMediaFormat *m_format;
+        switch_frame_t m_readFrame;
+        switch_timer_t *m_switchTimer;
+        PString m_RTPremoteIP;
+        WORD m_RTPremotePort;
+        PString m_RTPlocalIP;
+        WORD m_RTPlocalPort;
+        BYTE payloadCode;
+        
+};
+
+class BaseG7231Capab : public H323AudioCapability
+{
+ PCLASSINFO(BaseG7231Capab, H323AudioCapability);
+public:
+ BaseG7231Capab(const char* fname, bool annexA = true)
+        : H323AudioCapability(7,4), m_name(fname), m_aa(annexA)
+        { }
+        
+ virtual PObject* Clone() const{
+                return new BaseG7231Capab(*this);
+        }
+        
+ virtual unsigned GetSubType() const{
+                return H245_AudioCapability::e_g7231;
+        }
+        
+ virtual PString GetFormatName() const{
+                return m_name;
+        }
+        
+ virtual H323Codec* CreateCodec(H323Codec::Direction direction) const{
+                return 0;
+        }
+        
+ virtual Comparison Compare(const PObject& obj) const{
+         Comparison res = H323AudioCapability::Compare(obj);
+         if (res != EqualTo)
+                        return res;
+         bool aa = static_cast<const BaseG7231Capab&>(obj).m_aa;
+         if (aa && !m_aa)
+                        return LessThan;
+         if (m_aa && !aa)
+                        return GreaterThan;
+         return EqualTo;
+        }
+        
+ virtual bool OnSendingPDU(H245_AudioCapability& pdu, unsigned packetSize) const        {
+         pdu.SetTag(GetSubType());
+         H245_AudioCapability_g7231& g7231 = pdu;
+         g7231.m_maxAl_sduAudioFrames = packetSize;
+         g7231.m_silenceSuppression = m_aa;
+         return true;
+        }
+        
+ virtual bool OnReceivedPDU(const H245_AudioCapability& pdu, unsigned& packetSize){
+         if (pdu.GetTag() != H245_AudioCapability::e_g7231)
+                        return false;
+         const H245_AudioCapability_g7231& g7231 = pdu;
+         packetSize = g7231.m_maxAl_sduAudioFrames;
+         m_aa = (g7231.m_silenceSuppression != 0);
+         return true;
+        }
+
+protected:
+ const char* m_name;
+ bool m_aa;
+};
+
+class BaseG729Capab : public H323AudioCapability
+{
+ PCLASSINFO(BaseG729Capab, H323AudioCapability);
+public:
+ BaseG729Capab(const char* fname, unsigned type = H245_AudioCapability::e_g729)
+        : H323AudioCapability(24,6), m_name(fname), m_type(type)
+        { }
+ virtual PObject* Clone() const
+        // default copy constructor - take care!
+        { return new BaseG729Capab(*this); }
+ virtual unsigned GetSubType() const
+        { return m_type; }
+ virtual PString GetFormatName() const
+        { return m_name; }
+ virtual H323Codec* CreateCodec(H323Codec::Direction direction) const
+        { return 0; }
+protected:
+ const char* m_name;
+ unsigned m_type;
+};
+
+class BaseGSM0610Cap : public H323AudioCapability
+{
+        PCLASSINFO(BaseGSM0610Cap, H323AudioCapability);
+
+public:
+        
+        BaseGSM0610Cap(const char* fname, unsigned type = H245_AudioCapability::e_gsmFullRate)
+        : H323AudioCapability(24,2), m_name(fname), m_type(type),m_comfortNoise(0),m_scrambled(0)
+        { }
+        
+        virtual PObject * Clone() const{
+                return new BaseGSM0610Cap(*this);
+        }
+
+        virtual H323Codec* CreateCodec(H323Codec::Direction direction) const{
+                return 0;
+        }
+
+        virtual unsigned GetSubType() const{
+                return H245_AudioCapability::e_gsmFullRate;
+        }
+
+        virtual PString GetFormatName() const{
+                return m_name;
+        }
+
+        virtual bool OnSendingPDU(H245_AudioCapability & pdu, unsigned packetSize) const{
+                pdu.SetTag(H245_AudioCapability::e_gsmFullRate);
+                H245_GSMAudioCapability & gsm = pdu;
+                gsm.m_audioUnitSize = packetSize * 33;
+                gsm.m_comfortNoise = m_comfortNoise;
+                gsm.m_scrambled = m_scrambled;
+                return true;
+        }
+        
+        virtual bool OnReceivedPDU(const H245_AudioCapability & pdu, unsigned & packetSize){
+                PTRACE(2, "mod_h323\t==============>BaseGSM0610Cap::OnReceivedPDU");
+                if (pdu.GetTag() != H245_AudioCapability::e_gsmFullRate)
+                        return false;
+                const H245_GSMAudioCapability & gsm = pdu;
+                packetSize = (gsm.m_audioUnitSize + 32) / 33;
+                m_comfortNoise = gsm.m_comfortNoise;
+                m_scrambled = gsm.m_scrambled;
+                return true;
+        }
+
+protected:
+        const char* m_name;
+        int m_comfortNoise;
+        int m_scrambled;
+        unsigned m_type;
+};
+
+
+#define DEFINE_H323_CAPAB(cls,base,param,name) \
+class cls : public base { \
+ public: \
+ cls() : base(name,param) { } \
+}; \
+H323_REGISTER_CAPABILITY(cls,name) \
+
+
+
+
+DEFINE_H323_CAPAB(FS_G7231_5,BaseG7231Capab,false,OPAL_G7231_5k3"{sw}")
+DEFINE_H323_CAPAB(FS_G7231_6,BaseG7231Capab,false,OPAL_G7231_6k3"{sw}")
+DEFINE_H323_CAPAB(FS_G7231A_5,BaseG7231Capab,true,OPAL_G7231A_5k3"{sw}")
+DEFINE_H323_CAPAB(FS_G7231A_6,BaseG7231Capab,true,OPAL_G7231A_6k3"{sw}")
+DEFINE_H323_CAPAB(FS_G729,BaseG729Capab,H245_AudioCapability::e_g729,OPAL_G729"{sw}")
+DEFINE_H323_CAPAB(FS_G729A,BaseG729Capab,H245_AudioCapability::e_g729AnnexA,OPAL_G729A"{sw}")
+DEFINE_H323_CAPAB(FS_G729B,BaseG729Capab,H245_AudioCapability::e_g729wAnnexB,OPAL_G729B"{sw}")
+DEFINE_H323_CAPAB(FS_G729AB,BaseG729Capab,H245_AudioCapability::e_g729AnnexAwAnnexB,OPAL_G729AB"{sw}")
+DEFINE_H323_CAPAB(FS_GSM,BaseGSM0610Cap,H245_AudioCapability::e_gsmFullRate,OPAL_GSM0610"{sw}")
+
+
+static FSProcess *h323_process = NULL;
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_iaxmod_iaxc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_iax/mod_iax.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_iax/mod_iax.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_iax/mod_iax.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -1032,7 +1032,6 @@
</span><span class="cx">                                 break;
</span><span class="cx">                         case IAX_EVENT_RINGA:
</span><span class="cx">                                 if (channel) {
</span><del>-                                        switch_core_session_queue_indication(tech_pvt->session, SWITCH_MESSAGE_INDICATE_RINGING);
</del><span class="cx">                                         switch_channel_mark_ring_ready(channel);
</span><span class="cx">                                 }
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_NOTICE, "Ringing heard.\n");
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_loopbackmod_loopbackc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_loopback/mod_loopback.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_loopback/mod_loopback.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_loopback/mod_loopback.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -314,6 +314,7 @@
</span><span class="cx"> {
</span><span class="cx">         switch_channel_t *channel = NULL;
</span><span class="cx">         private_t *tech_pvt = NULL;
</span><ins>+        const char *app, *arg;
</ins><span class="cx">
</span><span class="cx">         channel = switch_core_session_get_channel(session);
</span><span class="cx">         assert(channel != NULL);
</span><span class="lines">@@ -324,6 +325,21 @@
</span><span class="cx">         do_reset(tech_pvt);
</span><span class="cx">
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s CHANNEL ROUTING\n", switch_channel_get_name(channel));
</span><ins>+
+
+        if (!switch_test_flag(tech_pvt, TFLAG_OUTBOUND) && (app = switch_channel_get_variable(channel, "loopback_app"))) {
+                switch_caller_extension_t *extension = NULL;
+                arg = switch_channel_get_variable(channel, "loopback_app_arg");
+                extension = switch_caller_extension_new(session, app, app);
+                switch_caller_extension_add_application(session, extension, "pre_answer", NULL);
+                switch_caller_extension_add_application(session, extension, app, arg);
+                
+                switch_channel_set_caller_extension(channel, extension);
+                switch_channel_set_state(channel, CS_EXECUTE);
+                return SWITCH_STATUS_FALSE;
+        }
+
+
</ins><span class="cx">         
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="lines">@@ -555,6 +571,7 @@
</span><span class="cx">                 if (tech_pvt->write_frame) {
</span><span class="cx">                         switch_frame_free(&tech_pvt->write_frame);
</span><span class="cx">                 }
</span><ins>+
</ins><span class="cx">                 tech_pvt->write_frame = (switch_frame_t *) pop;
</span><span class="cx">                 tech_pvt->write_frame->codec = &tech_pvt->read_codec;
</span><span class="cx">                 *frame = tech_pvt->write_frame;
</span><span class="lines">@@ -571,6 +588,7 @@
</span><span class="cx">                 *frame = &tech_pvt->cng_frame;
</span><span class="cx">                 tech_pvt->cng_frame.codec = &tech_pvt->read_codec;
</span><span class="cx">                 tech_pvt->cng_frame.datalen = tech_pvt->read_codec.implementation->decoded_bytes_per_packet;
</span><ins>+
</ins><span class="cx">                 memset(tech_pvt->cng_frame.data, 0, tech_pvt->cng_frame.datalen);
</span><span class="cx">                 memset(&data, 0, sizeof(data));
</span><span class="cx">
</span><span class="lines">@@ -797,6 +815,23 @@
</span><span class="cx">
</span><span class="cx">                         caller_profile = switch_caller_profile_clone(*new_session, outbound_profile);
</span><span class="cx">                         caller_profile->source = switch_core_strdup(caller_profile->pool, modname);
</span><ins>+                        if (!strncasecmp(caller_profile->destination_number, "app=", 4)) {
+                                char *dest = switch_core_session_strdup(*new_session, caller_profile->destination_number);
+                                char *app = dest + 4;
+                                char *arg = NULL;
+
+                                if ((arg = strchr(app, ':'))) {
+                                        *arg++ = '\0';
+                                }
+
+                                switch_channel_set_variable(channel, "loopback_app", app);
+                                if (arg) {
+                                        switch_channel_set_variable(channel, "loopback_app_arg", arg);
+                                }
+
+                                caller_profile->destination_number = switch_core_strdup(caller_profile->pool, app);
+                        }
+
</ins><span class="cx">                         if ((context = strchr(caller_profile->destination_number, '/'))) {
</span><span class="cx">                                 *context++ = '\0';
</span><span class="cx">                                 
</span><span class="lines">@@ -804,20 +839,20 @@
</span><span class="cx">                                         *dialplan++ = '\0';
</span><span class="cx">                                 }
</span><span class="cx">
</span><del>-                                if (!switch_strlen_zero(context)) {
</del><ins>+                                if (!zstr(context)) {
</ins><span class="cx">                                         caller_profile->context = switch_core_strdup(caller_profile->pool, context);
</span><span class="cx">                                 }
</span><span class="cx">
</span><del>-                                if (!switch_strlen_zero(dialplan)) {
</del><ins>+                                if (!zstr(dialplan)) {
</ins><span class="cx">                                         caller_profile->dialplan = switch_core_strdup(caller_profile->pool, dialplan);
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                         
</span><del>-                        if (switch_strlen_zero(caller_profile->context)) {
</del><ins>+                        if (zstr(caller_profile->context)) {
</ins><span class="cx">                                 caller_profile->context = switch_core_strdup(caller_profile->pool, "default");
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if (switch_strlen_zero(caller_profile->dialplan)) {
</del><ins>+                        if (zstr(caller_profile->dialplan)) {
</ins><span class="cx">                                 caller_profile->dialplan = switch_core_strdup(caller_profile->pool, "xml");
</span><span class="cx">                         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_portaudiomod_portaudioc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_portaudio/mod_portaudio.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_portaudio/mod_portaudio.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_portaudio/mod_portaudio.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -248,7 +248,6 @@
</span><span class="cx">                         switch_mutex_unlock(globals.pvt_lock);
</span><span class="cx">                         switch_yield(1000000);
</span><span class="cx">                 } else {
</span><del>-                        switch_core_session_queue_indication(session, SWITCH_MESSAGE_INDICATE_RINGING);
</del><span class="cx">                         switch_channel_mark_ring_ready(channel);
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -750,7 +749,7 @@
</span><span class="cx">
</span><span class="cx">                 if (outbound_profile) {
</span><span class="cx">                         char name[128];
</span><del>-                        const char *id = !switch_strlen_zero(outbound_profile->caller_id_number) ? outbound_profile->caller_id_number : "na";
</del><ins>+                        const char *id = !zstr(outbound_profile->caller_id_number) ? outbound_profile->caller_id_number : "na";
</ins><span class="cx">                         switch_snprintf(name, sizeof(name), "portaudio/%s", id);
</span><span class="cx">
</span><span class="cx">                         switch_channel_set_name(channel, name);
</span><span class="lines">@@ -1052,7 +1051,7 @@
</span><span class="cx">                 int match = 0;
</span><span class="cx">                 pdi = Pa_GetDeviceInfo(i);
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(name)) {
</del><ins>+                if (zstr(name)) {
</ins><span class="cx">                         match = 1;
</span><span class="cx">                 } else if (pdi && pdi->name && strstr(pdi->name, name)) {
</span><span class="cx">                         match = 1;
</span><span class="lines">@@ -1477,7 +1476,7 @@
</span><span class="cx">         char *dtmf_str = argv[0];
</span><span class="cx">         switch_dtmf_t dtmf = { 0, switch_core_default_dtmf_duration(0) };
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(dtmf_str)) {
</del><ins>+        if (zstr(dtmf_str)) {
</ins><span class="cx">                 stream->write_function(stream, "No DTMF Supplied!\n");
</span><span class="cx">         } else {
</span><span class="cx">                 switch_mutex_lock(globals.pvt_lock);
</span><span class="lines">@@ -1504,7 +1503,7 @@
</span><span class="cx">         
</span><span class="cx">
</span><span class="cx">         switch_mutex_lock(globals.pvt_lock);
</span><del>-        if (switch_strlen_zero(callid)) {
</del><ins>+        if (zstr(callid)) {
</ins><span class="cx">                 if (globals.call_list) {
</span><span class="cx">                         if (globals.call_list->next) {
</span><span class="cx">                                 tech_pvt = globals.call_list->next;
</span><span class="lines">@@ -1549,7 +1548,7 @@
</span><span class="cx">         char *callid = argv[0];
</span><span class="cx">
</span><span class="cx">         switch_mutex_lock(globals.pvt_lock);
</span><del>-        if (switch_strlen_zero(callid)) {
</del><ins>+        if (zstr(callid)) {
</ins><span class="cx">                 tech_pvt = globals.call_list;
</span><span class="cx">         } else {
</span><span class="cx">                 tech_pvt = switch_core_hash_find(globals.call_hash, callid);
</span><span class="lines">@@ -1574,7 +1573,7 @@
</span><span class="cx">
</span><span class="cx">         switch_mutex_lock(globals.pvt_lock);
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(callid)) {
</del><ins>+        if (!zstr(callid)) {
</ins><span class="cx">                 if ((tp = switch_core_hash_find(globals.call_hash, callid))) {
</span><span class="cx">                         if (switch_test_flag(tp, TFLAG_ANSWER)) {
</span><span class="cx">                                 stream->write_function(stream, "CALL ALREADY ANSWERED\n");
</span><span class="lines">@@ -1717,7 +1716,7 @@
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">         char *dest = NULL;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(argv[0])) {
</del><ins>+        if (zstr(argv[0])) {
</ins><span class="cx">                 stream->write_function(stream, "FAIL:Usage: call <dest>\n");
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -1746,23 +1745,23 @@
</span><span class="cx">                         return SWITCH_STATUS_MEMERR;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(argv[1])) {
</del><ins>+                if (!zstr(argv[1])) {
</ins><span class="cx">                         dialplan = argv[1];
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(argv[2])) {
</del><ins>+                if (!zstr(argv[2])) {
</ins><span class="cx">                         cid_num = argv[2];
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(argv[3])) {
</del><ins>+                if (!zstr(argv[3])) {
</ins><span class="cx">                         cid_name = argv[3];
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(argv[4])) {
</del><ins>+                if (!zstr(argv[4])) {
</ins><span class="cx">                         tech_pvt->sample_rate = atoi(argv[4]);
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(argv[5])) {
</del><ins>+                if (!zstr(argv[5])) {
</ins><span class="cx">                         tech_pvt->codec_ms = atoi(argv[5]);
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -1863,13 +1862,13 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(cmd)) {
</del><ins>+                if (zstr(cmd)) {
</ins><span class="cx">                         goto done;
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">         } else {
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(cmd)) {
</del><ins>+                if (zstr(cmd)) {
</ins><span class="cx">                         stream->write_function(stream, "%s", usage_string);
</span><span class="cx">                         goto done;
</span><span class="cx">                 }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_skypiaxconfigsdefaultxml"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_skypiax/configs/default.xml (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_skypiax/configs/default.xml        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_skypiax/configs/default.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -261,7 +261,7 @@
</span><span class="cx"> <!-- dial via skypiax -->
</span><span class="cx"> <extension name="skypiax">
</span><span class="cx"> <condition field="destination_number" expression="^2909$">
</span><del>-        <action application="bridge" data="skypiax/skypiax1/echo123"/>
</del><ins>+        <action application="bridge" data="skypiax/interface1/echo123"/>
</ins><span class="cx"> </condition>
</span><span class="cx"> </extension>
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_skypiaxmod_skypiaxc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_skypiax/mod_skypiax.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_skypiax/mod_skypiax.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_skypiax/mod_skypiax.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -866,7 +866,7 @@
</span><span class="cx">                 switch_core_session_add_stream(*new_session, NULL);
</span><span class="cx">
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(outbound_profile->destination_number)) {
</del><ins>+                if (!zstr(outbound_profile->destination_number)) {
</ins><span class="cx">                         int i;
</span><span class="cx">                         char *slash;
</span><span class="cx">
</span><span class="lines">@@ -1767,7 +1767,7 @@
</span><span class="cx">         switch_core_session_t *session = NULL;
</span><span class="cx">         switch_channel_t *channel = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(tech_pvt->session_uuid_str)) {
</del><ins>+        if (!zstr(tech_pvt->session_uuid_str)) {
</ins><span class="cx">                 session = switch_core_session_locate(tech_pvt->session_uuid_str);
</span><span class="cx">         } else {
</span><span class="cx">                 ERRORA("No session???\n", SKYPIAX_P_LOG);
</span><span class="lines">@@ -1797,7 +1797,7 @@
</span><span class="cx">         switch_core_session_t *session = NULL;
</span><span class="cx">         switch_channel_t *channel = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(tech_pvt->session_uuid_str)) {
</del><ins>+        if (!zstr(tech_pvt->session_uuid_str)) {
</ins><span class="cx">                 session = switch_core_session_locate(tech_pvt->session_uuid_str);
</span><span class="cx">         } else {
</span><span class="cx">                 ERRORA("No session???\n\n\n", SKYPIAX_P_LOG);
</span><span class="lines">@@ -1831,7 +1831,7 @@
</span><span class="cx">         switch_core_session_t *session = NULL;
</span><span class="cx">         switch_channel_t *channel = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(tech_pvt->session_uuid_str)) {
</del><ins>+        if (!zstr(tech_pvt->session_uuid_str)) {
</ins><span class="cx">                 session = switch_core_session_locate(tech_pvt->session_uuid_str);
</span><span class="cx">         } else {
</span><span class="cx">                 ERRORA("No session???\n", SKYPIAX_P_LOG);
</span><span class="lines">@@ -1917,7 +1917,7 @@
</span><span class="cx">         else
</span><span class="cx">                 stream->write_function(stream, "sk console is NOT yet assigned\n");
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -2031,7 +2031,7 @@
</span><span class="cx">         int argc = 0;
</span><span class="cx">         private_t *tech_pvt = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -2280,7 +2280,7 @@
</span><span class="cx">
</span><span class="cx">         DEBUGA_SKYPE("received CHATMESSAGE on interface %s\n", SKYPIAX_P_LOG, tech_pvt->name);
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(tech_pvt->session_uuid_str)) {
</del><ins>+        if (!zstr(tech_pvt->session_uuid_str)) {
</ins><span class="cx">                 session = switch_core_session_locate(tech_pvt->session_uuid_str);
</span><span class="cx">         }
</span><span class="cx">         if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
</span><span class="lines">@@ -2348,7 +2348,7 @@
</span><span class="cx">         int found = 0;
</span><span class="cx">         //char skype_msg[1024];
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
</del><ins>+        if (!zstr(cmd) && (mycmd = strdup(cmd))) {
</ins><span class="cx">                 argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_sofiamod_sofiac"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/mod_sofia.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/mod_sofia.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/mod_sofia.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx">         if (sofia_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
</span><span class="cx">                 const char *var;
</span><span class="cx">
</span><del>-                if ((var = switch_channel_get_variable(channel, SOFIA_SECURE_MEDIA_VARIABLE)) && !switch_strlen_zero(var)) {
</del><ins>+                if ((var = switch_channel_get_variable(channel, SOFIA_SECURE_MEDIA_VARIABLE)) && !zstr(var)) {
</ins><span class="cx">                         if (switch_true(var) || !strcasecmp(var, SWITCH_RTP_CRYPTO_KEY_32)) {
</span><span class="cx">                                 sofia_set_flag_locked(tech_pvt, TFLAG_SECURE);
</span><span class="cx">                                 sofia_glue_build_crypto(tech_pvt, 1, AES_CM_128_HMAC_SHA1_32, SWITCH_RTP_CRYPTO_SEND);
</span><span class="lines">@@ -175,18 +175,41 @@
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-char * generate_pai_str(switch_core_session_t *session)
</del><ins>+char *generate_pai_str(switch_core_session_t *session)
</ins><span class="cx"> {
</span><span class="cx">         private_object_t *tech_pvt = (private_object_t *) switch_core_session_get_private(session);
</span><span class="cx">         const char *callee_name = NULL, *callee_number = NULL;
</span><ins>+        const char *ua = switch_channel_get_variable(tech_pvt->channel, "sip_user_agent");
</ins><span class="cx">         char *pai = NULL;
</span><span class="cx">
</span><del>-        if ((callee_name = switch_channel_get_variable(tech_pvt->channel, "sip_callee_id_name"))) {
-                if (!(callee_number = switch_channel_get_variable(tech_pvt->channel, "sip_callee_id_number"))) {
</del><ins>+        if (!(callee_name = switch_channel_get_variable(tech_pvt->channel, "sip_callee_id_name"))) {
+                callee_name = switch_channel_get_variable(tech_pvt->channel, "callee_id_name");
+        }
+
+        if (zstr((callee_number = switch_channel_get_variable(tech_pvt->channel, "sip_callee_id_number")))) {
+                if (zstr((callee_number = switch_channel_get_variable(tech_pvt->channel, "callee_id_number")))) {
</ins><span class="cx">                         callee_number = tech_pvt->caller_profile->destination_number;
</span><span class="cx">                 }
</span><del>-                pai = switch_core_session_sprintf(tech_pvt->session, "P-Asserted-Identity: \"%s\" <%s>", callee_name, callee_number);
</del><span class="cx">         }
</span><ins>+
+        if (zstr(callee_name) && !zstr(callee_number)) {
+                callee_name = callee_number;
+        }
+
+        if (!zstr(callee_number) && (zstr(ua) || !switch_stristr("polycom", ua))) {
+                callee_number = switch_core_session_sprintf(session, "sip:%s@%s", callee_number, tech_pvt->profile->sipip);
+        }
+        
+
+        if (!zstr(callee_name) && !zstr(callee_number)) {
+                if (switch_stristr("update_display", tech_pvt->x_freeswitch_support_remote)) {
+                        pai = switch_core_session_sprintf(tech_pvt->session, "P-Asserted-Identity: \"%s\" <%s>\nX-FS-Display-Name: %s\nX-FS-Display-Number: %s\n",
+                                                                                         callee_name, callee_number, callee_name, callee_number);
+                } else {
+                        pai = switch_core_session_sprintf(tech_pvt->session, "P-Asserted-Identity: \"%s\" <%s>\n",
+                                                                                         callee_name, callee_number, callee_name, callee_number);
+                }
+        }
</ins><span class="cx">         return pai;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -300,7 +323,7 @@
</span><span class="cx">                 ps_cause = switch_channel_get_variable(channel, SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(ps_cause) && (!strncasecmp(ps_cause, "sip:", 4) || !strncasecmp(ps_cause, "sips:", 5))) {
</del><ins>+        if (!zstr(ps_cause) && (!strncasecmp(ps_cause, "sip:", 4) || !strncasecmp(ps_cause, "sips:", 5))) {
</ins><span class="cx">                 int new_cause = atoi(sofia_glue_strip_proto(ps_cause));
</span><span class="cx">                 if (new_cause) {
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Overriding SIP cause %d with %d from the other leg\n",
</span><span class="lines">@@ -377,8 +400,8 @@
</span><span class="cx">                         if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
</span><span class="cx">                                 nua_bye(tech_pvt->nh,
</span><span class="cx">                                                 SIPTAG_REASON_STR(reason),
</span><del>-                                                TAG_IF(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
-                                                TAG_IF(!switch_strlen_zero(bye_headers), SIPTAG_HEADER_STR(bye_headers)),
</del><ins>+                                                TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+                                                TAG_IF(!zstr(bye_headers), SIPTAG_HEADER_STR(bye_headers)),
</ins><span class="cx">                                                 TAG_END());
</span><span class="cx">                         }
</span><span class="cx">                 } else {
</span><span class="lines">@@ -390,7 +413,7 @@
</span><span class="cx">                                 if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
</span><span class="cx">                                         nua_cancel(tech_pvt->nh,
</span><span class="cx">                                                          SIPTAG_REASON_STR(reason),
</span><del>-                                                         TAG_IF(!switch_strlen_zero(bye_headers), SIPTAG_HEADER_STR(bye_headers)),
</del><ins>+                                                         TAG_IF(!zstr(bye_headers), SIPTAG_HEADER_STR(bye_headers)),
</ins><span class="cx">                                                          TAG_END());
</span><span class="cx">                                 }
</span><span class="cx">                         } else {
</span><span class="lines">@@ -401,7 +424,7 @@
</span><span class="cx">                                 if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
</span><span class="cx">                                         nua_respond(tech_pvt->nh, sip_cause, sip_status_phrase(sip_cause),
</span><span class="cx">                                                                 SIPTAG_REASON_STR(reason),
</span><del>-                                                                TAG_IF(!switch_strlen_zero(bye_headers), SIPTAG_HEADER_STR(bye_headers)),
</del><ins>+                                                                TAG_IF(!zstr(bye_headers), SIPTAG_HEADER_STR(bye_headers)),
</ins><span class="cx">                                                                 TAG_END());
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="lines">@@ -468,6 +491,13 @@
</span><span class="cx">         } else {
</span><span class="cx">                 /* This if statement check and handles the 3pcc proxy mode */
</span><span class="cx">                 if (sofia_test_pflag(tech_pvt->profile, PFLAG_3PCC_PROXY) && sofia_test_flag(tech_pvt, TFLAG_3PCC)) {
</span><ins>+
+                        tech_pvt->num_codecs = 0;
+                        sofia_glue_tech_prepare_codecs(tech_pvt);
+                        tech_pvt->local_sdp_str = NULL;
+                        sofia_glue_tech_choose_port(tech_pvt, 0);
+                        sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
+                        
</ins><span class="cx">                         /* Send the 200 OK */
</span><span class="cx">                         if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
</span><span class="cx">                                 char *extra_headers = sofia_glue_get_extra_headers(channel, SOFIA_SIP_PROGRESS_HEADER_PREFIX);
</span><span class="lines">@@ -476,7 +506,9 @@
</span><span class="cx">                                                         SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
</span><span class="cx">                                                         SOATAG_REUSE_REJECTED(1),
</span><span class="cx">                                                         SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1),
</span><del>-                                                        TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
</del><ins>+                                                        TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
+                                                        TAG_IF(switch_stristr("update_display", tech_pvt->x_freeswitch_support_remote),
+                                                                 SIPTAG_HEADER_STR("X-FS-Support: "FREESWITCH_SUPPORT)),
</ins><span class="cx">                                                         TAG_END());
</span><span class="cx">
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "3PCC-PROXY, Sent a 200 OK, waiting for ACK\n");
</span><span class="lines">@@ -495,6 +527,7 @@
</span><span class="cx">                         switch_mutex_lock(tech_pvt->sofia_mutex);
</span><span class="cx">                         
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "3PCC-PROXY, Done waiting for ACK\n");
</span><ins>+                        return SWITCH_STATUS_SUCCESS;
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 if ((is_proxy && !b_sdp) || sofia_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION) || !tech_pvt->iananame) {
</span><span class="lines">@@ -564,7 +597,9 @@
</span><span class="cx">                                         SIPTAG_CALL_INFO_STR(switch_channel_get_variable(tech_pvt->channel, SOFIA_SIP_HEADER_PREFIX "call_info")),
</span><span class="cx">                                         SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
</span><span class="cx">                                         SOATAG_REUSE_REJECTED(1), SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1),
</span><del>-                                        TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
</del><ins>+                                        TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
+                                        TAG_IF(switch_stristr("update_display", tech_pvt->x_freeswitch_support_remote),
+                                                 SIPTAG_HEADER_STR("X-FS-Support: "FREESWITCH_SUPPORT)),
</ins><span class="cx">                                         TAG_END());
</span><span class="cx">                 switch_safe_free(extra_headers);
</span><span class="cx">                 sofia_set_flag_locked(tech_pvt, TFLAG_ANS);
</span><span class="lines">@@ -1045,6 +1080,31 @@
</span><span class="cx">
</span><span class="cx">         /* ones that do not need to lock sofia mutex */
</span><span class="cx">         switch (msg->message_id) {
</span><ins>+        case SWITCH_MESSAGE_INDICATE_DEBUG_AUDIO:
+                {
+                        if (switch_rtp_ready(tech_pvt->rtp_session) && !zstr(msg->string_array_arg[0]) && !zstr(msg->string_array_arg[1])) {
+                                int32_t flags = 0;
+                                if (!strcasecmp(msg->string_array_arg[0], "read")) {
+                                        flags |= SWITCH_RTP_FLAG_DEBUG_RTP_READ;
+                                } else if (!strcasecmp(msg->string_array_arg[0], "write")) {
+                                        flags |= SWITCH_RTP_FLAG_DEBUG_RTP_WRITE;
+                                } else if (!strcasecmp(msg->string_array_arg[0], "both")) {
+                                        flags |= SWITCH_RTP_FLAG_DEBUG_RTP_READ | SWITCH_RTP_FLAG_DEBUG_RTP_WRITE;
+                                }
+
+                                if (flags) {
+                                        if (switch_true(msg->string_array_arg[1])) {
+                                                switch_rtp_set_flag(tech_pvt->rtp_session, flags);
+                                        } else {
+                                                switch_rtp_clear_flag(tech_pvt->rtp_session, flags);
+                                        }
+                                } else {
+                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Options\n");
+                                }
+                        }
+                }
+                status = SWITCH_STATUS_FALSE;
+                goto end;
</ins><span class="cx">         case SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY:
</span><span class="cx">                 if (tech_pvt->rtp_session && switch_rtp_test_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_PASS_RFC2833)) {
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Pass 2833 mode may not work on a transcoded call.\n");
</span><span class="lines">@@ -1224,7 +1284,7 @@
</span><span class="cx">                         switch_channel_clear_flag(channel, CF_PROXY_MODE);
</span><span class="cx">                         sofia_glue_tech_set_local_sdp(tech_pvt, NULL, SWITCH_FALSE);
</span><span class="cx">
</span><del>-                        if (!switch_channel_media_ready(channel)) {
</del><ins>+                        if (!(switch_channel_test_flag(channel, CF_ANSWERED) || switch_channel_test_flag(channel, CF_EARLY_MEDIA))) {
</ins><span class="cx">                                 if (!switch_channel_test_flag(tech_pvt->channel, CF_OUTBOUND)) {
</span><span class="cx">                                         const char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE);
</span><span class="cx">
</span><span class="lines">@@ -1255,22 +1315,100 @@
</span><span class="cx">                 }
</span><span class="cx">                 break;
</span><span class="cx">
</span><ins>+        case SWITCH_MESSAGE_INDICATE_WARNING:
+                {
+                        char *message;
+                        if (!zstr(msg->string_arg)) {
+                                const char *ua = switch_channel_get_variable(tech_pvt->channel, "sip_user_agent");
+                                
+                                if (!sofia_test_flag(tech_pvt, TFLAG_UPDATING_DISPLAY)) {
+                                                
+                                        if ((ua && (switch_stristr("polycom", ua)))) {
+                                                message = switch_mprintf("Warning: 399 devnull \"%s\"", msg->string_arg);
+                                                sofia_set_flag_locked(tech_pvt, TFLAG_UPDATING_DISPLAY);
+                                                nua_update(tech_pvt->nh,
+                                                                 TAG_IF(!zstr(message), SIPTAG_HEADER_STR(message)),
+                                                                 TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+                                                                 TAG_END());
+                                                free(message);
+                                        }
+
+                                }
+                        }
+                }
+                break;
</ins><span class="cx">         case SWITCH_MESSAGE_INDICATE_DISPLAY:
</span><span class="cx">                 {
</span><del>-                        if (!switch_strlen_zero(msg->string_arg)) {
</del><ins>+                        const char *name = msg->string_array_arg[0], *number = msg->string_array_arg[1];
+                        char *arg = NULL;
+                        char *argv[2] = { 0 };
+                        int argc;
+                        
+                        if (zstr(name) && !zstr(msg->string_arg)) {
+                                arg = strdup(msg->string_arg);
+                                switch_assert(arg);
+
+                                argc = switch_separate_string(arg, '|', argv, (sizeof(argv) / sizeof(argv[0])));
+                                name = argv[0];
+                                number = argv[1];
+
+                        }
+                        
+                        if (!zstr(name)) {
</ins><span class="cx">                                 char message[256] = "";
</span><span class="cx">                                 const char *ua = switch_channel_get_variable(tech_pvt->channel, "sip_user_agent");
</span><ins>+                                switch_event_t *event;
</ins><span class="cx">
</span><del>-                                if (ua && switch_stristr("snom", ua)) {
-                                        snprintf(message, sizeof(message), "From:\r\nTo: \"%s\" %s\r\n", msg->string_arg, tech_pvt->caller_profile->destination_number);
-                                        nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"), SIPTAG_PAYLOAD_STR(message), TAG_END());
-                                } else if (ua && switch_stristr("polycom", ua)) {
-                                        snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <%s>", msg->string_arg, tech_pvt->caller_profile->destination_number);
-                                        nua_update(tech_pvt->nh,
-                                                         TAG_IF(!switch_strlen_zero_buf(message), SIPTAG_HEADER_STR(message)),
-                                                         TAG_END());
</del><ins>+                                if (zstr(number)) {
+                                        number = tech_pvt->caller_profile->destination_number;
</ins><span class="cx">                                 }
</span><ins>+
+                                if (!sofia_test_flag(tech_pvt, TFLAG_UPDATING_DISPLAY)) {
+                                        if (zstr(tech_pvt->last_sent_callee_id_name) || strcmp(tech_pvt->last_sent_callee_id_name, name) ||
+                                                zstr(tech_pvt->last_sent_callee_id_number) || strcmp(tech_pvt->last_sent_callee_id_number, number)) {
+                                                
+                                                if (switch_stristr("update_display", tech_pvt->x_freeswitch_support_remote)) {
+                                                        snprintf(message, sizeof(message), "X-FS-Display-Name: %s\nX-FS-Display-Number: %s\n", name, number);
+
+                                                        nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/update_display"),
+                                                                         TAG_IF(!zstr_buf(message), SIPTAG_HEADER_STR(message)),
+                                                                         TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+                                                                         TAG_END());
+                                                } else if (ua && switch_stristr("snom", ua)) {
+                                                        snprintf(message, sizeof(message), "From:\r\nTo: \"%s\" %s\r\n", name, number);
+                                                        nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
+                                                                         TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+                                                                         SIPTAG_PAYLOAD_STR(message), TAG_END());
+                                                } else if ((ua && (switch_stristr("polycom", ua)))) {
+                                                        snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <%s>", name, number);
+                                                        sofia_set_flag_locked(tech_pvt, TFLAG_UPDATING_DISPLAY);
+                                                        nua_update(tech_pvt->nh,
+                                                                         TAG_IF(!zstr_buf(message), SIPTAG_HEADER_STR(message)),
+                                                                         TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+                                                                         TAG_END());
+                                                }
+
+                                                tech_pvt->last_sent_callee_id_name = switch_core_session_strdup(tech_pvt->session, name);
+                                                tech_pvt->last_sent_callee_id_number = switch_core_session_strdup(tech_pvt->session, number);
+                                        
+                                                if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) {
+                                                        const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+                                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Direction", "SEND");
+                                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Callee-Name", name);
+                                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Callee-Number", number);
+                                                        if (uuid) {
+                                                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridged-To", uuid);
+                                                        }
+                                                        switch_channel_event_set_data(channel, event);
+                                                        switch_event_fire(&event);
+                                                }
+                                        } else {
+                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Not sending same id again \"%s\" <%s>\n", name, number);
+                                        }
+                                }
</ins><span class="cx">                         }
</span><ins>+
+                        switch_safe_free(arg);
</ins><span class="cx">                 }
</span><span class="cx">                 break;
</span><span class="cx">
</span><span class="lines">@@ -1278,17 +1416,20 @@
</span><span class="cx">                 {
</span><span class="cx">                         sofia_set_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
</span><span class="cx">                         sofia_glue_do_invite(session);
</span><del>-                        if (!switch_strlen_zero(msg->string_arg)) {
</del><ins>+                        if (!zstr(msg->string_arg)) {
</ins><span class="cx">                                 char message[256] = "";
</span><span class="cx">                                 const char *ua = switch_channel_get_variable(tech_pvt->channel, "sip_user_agent");
</span><span class="cx">
</span><span class="cx">                                 if (ua && switch_stristr("snom", ua)) {
</span><span class="cx">                                         snprintf(message, sizeof(message), "From:\r\nTo: \"%s\" %s\r\n", msg->string_arg, tech_pvt->caller_profile->destination_number);
</span><del>-                                        nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"), SIPTAG_PAYLOAD_STR(message), TAG_END());
</del><ins>+                                        nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
+                                                         TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+                                                         SIPTAG_PAYLOAD_STR(message), TAG_END());
</ins><span class="cx">                                 } else if (ua && switch_stristr("polycom", ua)) {
</span><span class="cx">                                         snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <%s>", msg->string_arg, tech_pvt->caller_profile->destination_number);
</span><span class="cx">                                         nua_update(tech_pvt->nh,
</span><del>-                                                         TAG_IF(!switch_strlen_zero_buf(message), SIPTAG_HEADER_STR(message)),
</del><ins>+                                                         TAG_IF(!zstr_buf(message), SIPTAG_HEADER_STR(message)),
+                                                         TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
</ins><span class="cx">                                                          TAG_END());
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="lines">@@ -1302,10 +1443,17 @@
</span><span class="cx">                 }
</span><span class="cx">                 break;
</span><span class="cx">         case SWITCH_MESSAGE_INDICATE_REDIRECT:
</span><del>-                if (!switch_strlen_zero(msg->string_arg)) {
</del><ins>+                if (!zstr(msg->string_arg)) {
</ins><span class="cx">                         if (!switch_channel_test_flag(channel, CF_ANSWERED) && !sofia_test_flag(tech_pvt, TFLAG_BYE)) {
</span><del>-                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Redirecting to %s\n", msg->string_arg);
-                                nua_respond(tech_pvt->nh, SIP_302_MOVED_TEMPORARILY, SIPTAG_CONTACT_STR(msg->string_arg), TAG_END());
</del><ins>+                                char *dest = (char *) msg->string_arg;
+
+                                if (!strchr(msg->string_arg, '<') && !strchr(msg->string_arg, '>')) {
+                                        dest = switch_core_session_sprintf(session, "\"unknown\" <%s>", msg->string_arg);
+                                }
+                                
+                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Redirecting to %s\n", dest);
+
+                                nua_respond(tech_pvt->nh, SIP_302_MOVED_TEMPORARILY, SIPTAG_CONTACT_STR(dest), TAG_END());
</ins><span class="cx">                                 sofia_set_flag_locked(tech_pvt, TFLAG_BYE);
</span><span class="cx">                         } else {
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Too late for redirecting to %s, already answered\n", msg->string_arg);
</span><span class="lines">@@ -1343,7 +1491,7 @@
</span><span class="cx">                         if (code) {
</span><span class="cx">                                 reason = msg->string_arg;
</span><span class="cx">                         } else {
</span><del>-                                if (!switch_strlen_zero(msg->string_arg)) {
</del><ins>+                                if (!zstr(msg->string_arg)) {
</ins><span class="cx">                                         if ((code = atoi(msg->string_arg))) {
</span><span class="cx">                                                 if ((reason = strchr(msg->string_arg, ' '))) {
</span><span class="cx">                                                         reason++;
</span><span class="lines">@@ -1362,9 +1510,9 @@
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                         
</span><del>-                        if (switch_strlen_zero(reason) && code != 407 && code != 302) {
</del><ins>+                        if (zstr(reason) && code != 407 && code != 302) {
</ins><span class="cx">                                 reason = sip_status_phrase(code);
</span><del>-                                if (switch_strlen_zero(reason)) {
</del><ins>+                                if (zstr(reason)) {
</ins><span class="cx">                                         reason = "Because";
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="lines">@@ -1375,7 +1523,7 @@
</span><span class="cx">                                 const char *to_uri = switch_channel_get_variable(channel, "sip_to_uri");
</span><span class="cx">                                 const char *to_host = reason;
</span><span class="cx">
</span><del>-                                if (switch_strlen_zero(to_host)) {
</del><ins>+                                if (zstr(to_host)) {
</ins><span class="cx">                                         to_host = switch_channel_get_variable(channel, "sip_to_host");
</span><span class="cx">                                 }
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Challenging call %s\n", to_uri);
</span><span class="lines">@@ -1399,12 +1547,12 @@
</span><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Overlap Dial with %d %s\n", code, reason);
</span><span class="cx">                                         nua_respond(tech_pvt->nh, code, su_strdup(nua_handle_home(tech_pvt->nh), reason), TAG_IF(to_uri, SIPTAG_CONTACT_STR(to_uri)),
</span><span class="cx">                                                                 SIPTAG_SUPPORTED_STR(NULL), SIPTAG_ACCEPT_STR(NULL),
</span><del>-                                                                TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
-                                                                TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)), TAG_END());
</del><ins>+                                                                TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
+                                                                TAG_IF(!zstr(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)), TAG_END());
</ins><span class="cx">                                         
</span><span class="cx">                                         sofia_set_flag_locked(tech_pvt, TFLAG_BYE);
</span><span class="cx">                                 }
</span><del>-                        } else if (code == 302 && !switch_strlen_zero(msg->string_arg)) {
</del><ins>+                        } else if (code == 302 && !zstr(msg->string_arg)) {
</ins><span class="cx">                                 char *p;
</span><span class="cx">
</span><span class="cx">                                 if ((p = strchr(msg->string_arg, ' '))) {
</span><span class="lines">@@ -1418,7 +1566,7 @@
</span><span class="cx">                         } else {
</span><span class="cx">                                 if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
</span><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Responding with %d [%s]\n", code, reason);
</span><del>-                                        if (!switch_strlen_zero(((char *) msg->pointer_arg))) {
</del><ins>+                                        if (!zstr(((char *) msg->pointer_arg))) {
</ins><span class="cx">                                                 sofia_glue_tech_set_local_sdp(tech_pvt, (char *) msg->pointer_arg, SWITCH_TRUE);
</span><span class="cx">                                                 
</span><span class="cx">                                                 if (switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
</span><span class="lines">@@ -1429,11 +1577,11 @@
</span><span class="cx">                                                                         SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
</span><span class="cx">                                                                         SOATAG_REUSE_REJECTED(1),
</span><span class="cx">                                                                         SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"), NUTAG_INCLUDE_EXTRA_SDP(1),
</span><del>-                                                                        TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
</del><ins>+                                                                        TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
</ins><span class="cx">                                                                         TAG_END());
</span><span class="cx">                                         } else {
</span><span class="cx">                                                 nua_respond(tech_pvt->nh, code, su_strdup(nua_handle_home(tech_pvt->nh), reason), SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
</span><del>-                                                                        TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
</del><ins>+                                                                        TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
</ins><span class="cx">                                                                         TAG_END());
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><span class="lines">@@ -1442,15 +1590,26 @@
</span><span class="cx">                 }
</span><span class="cx">                 break;
</span><span class="cx">         case SWITCH_MESSAGE_INDICATE_RINGING:
</span><ins>+
+                if (sofia_test_pflag(tech_pvt->profile, PFLAG_3PCC_PROXY) && sofia_test_flag(tech_pvt, TFLAG_3PCC)) {
+                        switch_channel_mark_ring_ready(channel);
+                        status = SWITCH_STATUS_SUCCESS;
+                        switch_log_printf(SWITCH_CHANNEL_ID_LOG, msg->_file, msg->_func, msg->_line, NULL, SWITCH_LOG_INFO,
+                                                         "Pretending to send ringing. Not available for 3pcc calls\n");
+                        goto end_lock;
+                }
+
</ins><span class="cx">                 if (!switch_channel_test_flag(channel, CF_RING_READY) && !sofia_test_flag(tech_pvt, TFLAG_BYE) &&
</span><span class="cx">                         !switch_channel_test_flag(channel, CF_EARLY_MEDIA) && !switch_channel_test_flag(channel, CF_ANSWERED)) {
</span><del>-                        char *extra_headers = sofia_glue_get_extra_headers(channel, SOFIA_SIP_PROGRESS_HEADER_PREFIX);
</del><ins>+                        char *extra_header = sofia_glue_get_extra_headers(channel, SOFIA_SIP_PROGRESS_HEADER_PREFIX);
</ins><span class="cx">                         nua_respond(tech_pvt->nh, SIP_180_RINGING,
</span><span class="cx">                                                 SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
</span><span class="cx">                                                 SIPTAG_HEADER_STR(generate_pai_str(session)),
</span><del>-                                                TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
</del><ins>+                                                TAG_IF(!zstr(extra_header), SIPTAG_HEADER_STR(extra_header)),
+                                                TAG_IF(switch_stristr("update_display", tech_pvt->x_freeswitch_support_remote),
+                                                         SIPTAG_HEADER_STR("X-FS-Support: "FREESWITCH_SUPPORT)),
</ins><span class="cx">                                                 TAG_END());
</span><del>-                        switch_safe_free(extra_headers);
</del><ins>+                        switch_safe_free(extra_header);
</ins><span class="cx">                         switch_channel_mark_ring_ready(channel);
</span><span class="cx">                 }
</span><span class="cx">                 break;
</span><span class="lines">@@ -1462,6 +1621,15 @@
</span><span class="cx">                         char *sticky = NULL;
</span><span class="cx">                         const char *val = NULL;
</span><span class="cx">
</span><ins>+                        if (sofia_test_pflag(tech_pvt->profile, PFLAG_3PCC_PROXY) && sofia_test_flag(tech_pvt, TFLAG_3PCC)) {
+                                sofia_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA);
+                                switch_channel_mark_pre_answered(channel);
+                                status = SWITCH_STATUS_SUCCESS;
+                                switch_log_printf(SWITCH_CHANNEL_ID_LOG, msg->_file, msg->_func, msg->_line, NULL, SWITCH_LOG_INFO,
+                                                                 "Pretending to send early media. Not available for 3pcc calls\n");
+                                goto end_lock;
+                        }
+
</ins><span class="cx">                         if (!sofia_test_flag(tech_pvt, TFLAG_ANS) && !sofia_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) {
</span><span class="cx">
</span><span class="cx">                                 sofia_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA);
</span><span class="lines">@@ -1490,7 +1658,9 @@
</span><span class="cx">
</span><span class="cx">                                                         tech_pvt->num_codecs = 0;
</span><span class="cx">                                                         sofia_glue_tech_prepare_codecs(tech_pvt);
</span><del>-                                                        if (sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) {
</del><ins>+                                                        if (zstr(r_sdp) || sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) {
+                                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR,
+                                                                                                 "CODEC NEGOTIATION ERROR. SDP:\n%s\n", r_sdp ? r_sdp : "NO SDP!");
</ins><span class="cx">                                                                 switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "CODEC NEGOTIATION ERROR");
</span><span class="cx">                                                                 //nua_respond(tech_pvt->nh, SIP_488_NOT_ACCEPTABLE, TAG_END());
</span><span class="cx">                                                                 status = SWITCH_STATUS_FALSE;
</span><span class="lines">@@ -1522,7 +1692,7 @@
</span><span class="cx">                                 }
</span><span class="cx">
</span><span class="cx">                                 if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
</span><del>-                                        char *extra_headers = sofia_glue_get_extra_headers(channel, SOFIA_SIP_PROGRESS_HEADER_PREFIX);
</del><ins>+                                        char *extra_header = sofia_glue_get_extra_headers(channel, SOFIA_SIP_PROGRESS_HEADER_PREFIX);
</ins><span class="cx">                                         nua_respond(tech_pvt->nh,
</span><span class="cx">                                                                 SIP_183_SESSION_PROGRESS,
</span><span class="cx">                                                                 NUTAG_AUTOANSWER(0),
</span><span class="lines">@@ -1533,9 +1703,11 @@
</span><span class="cx">                                                                 SOATAG_ORDERED_USER(1),
</span><span class="cx">                                                                 SOATAG_ADDRESS(tech_pvt->adv_sdp_audio_ip),
</span><span class="cx">                                                                 SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str), SOATAG_AUDIO_AUX("cn telephone-event"),
</span><del>-                                                                TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
</del><ins>+                                                                TAG_IF(!zstr(extra_header), SIPTAG_HEADER_STR(extra_header)),
+                                                                TAG_IF(switch_stristr("update_display", tech_pvt->x_freeswitch_support_remote),
+                                                                         SIPTAG_HEADER_STR("X-FS-Support: "FREESWITCH_SUPPORT)),
</ins><span class="cx">                                                                 TAG_END());
</span><del>-                                        switch_safe_free(extra_headers);
</del><ins>+                                        switch_safe_free(extra_header);
</ins><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="lines">@@ -1546,6 +1718,10 @@
</span><span class="cx">
</span><span class="cx"> end_lock:
</span><span class="cx">
</span><ins>+        if (msg->message_id == SWITCH_MESSAGE_INDICATE_ANSWER || msg->message_id == SWITCH_MESSAGE_INDICATE_PROGRESS) {
+                sofia_send_callee_id(session, NULL, NULL);
+        }
+
</ins><span class="cx">         switch_mutex_unlock(tech_pvt->sofia_mutex);
</span><span class="cx">
</span><span class="cx"> end:
</span><span class="lines">@@ -1634,10 +1810,12 @@
</span><span class="cx">                                                          "IP: \t%s\n"
</span><span class="cx">                                                          "Port: \t%s\n"
</span><span class="cx">                                                          "Auth-User: \t%s\n"
</span><del>-                                                         "Auth-Realm: \t%s\n\n",
</del><ins>+                                                         "Auth-Realm: \t%s\n"
+                                                         "MWI-Account:\t%s@%s\n\n",
</ins><span class="cx">                                                          switch_str_nil(argv[0]), switch_str_nil(argv[1]), switch_str_nil(argv[2]), switch_str_nil(argv[3]),
</span><span class="cx">                                                          switch_str_nil(argv[7]), switch_str_nil(argv[4]), switch_str_nil(argv[5]), exp_buf, switch_str_nil(argv[11]),
</span><del>-                                                         switch_str_nil(argv[12]), switch_str_nil(argv[13]), switch_str_nil(argv[14]), switch_str_nil(argv[15]));
</del><ins>+                                                         switch_str_nil(argv[12]), switch_str_nil(argv[13]), switch_str_nil(argv[14]), switch_str_nil(argv[15]),
+                                                         switch_str_nil(argv[16]), switch_str_nil(argv[17]));
</ins><span class="cx">         return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1669,11 +1847,13 @@
</span><span class="cx">                                                          " <network-port>%s</network-port>\n"
</span><span class="cx">                                                          " <sip-auth-user>%s</sip-auth-user>\n"
</span><span class="cx">                                                          " <sip-auth-realm>%s</sip-auth-realm>\n"
</span><ins>+                                                         " <mwi-account>%s@%s</mwi-account>\n"
</ins><span class="cx">                                                          " </registration>\n",
</span><span class="cx">                                                          switch_str_nil(argv[0]), switch_str_nil(argv[1]), switch_str_nil(argv[2]),
</span><span class="cx">                                                          switch_amp_encode(switch_str_nil(argv[3]),xmlbuf,buflen),
</span><span class="cx">                                                          switch_str_nil(argv[7]), switch_str_nil(argv[4]), switch_str_nil(argv[5]), exp_buf, switch_str_nil(argv[11]),
</span><del>-                                                         switch_str_nil(argv[12]), switch_str_nil(argv[13]), switch_str_nil(argv[14]), switch_str_nil(argv[15]));
</del><ins>+                                                         switch_str_nil(argv[12]), switch_str_nil(argv[13]), switch_str_nil(argv[14]), switch_str_nil(argv[15]),
+                                                         switch_str_nil(argv[16]), switch_str_nil(argv[17]));
</ins><span class="cx">         return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1705,7 +1885,7 @@
</span><span class="cx">                                 stream->write_function(stream, "Scheme \t%s\n", switch_str_nil(gp->register_scheme));
</span><span class="cx">                                 stream->write_function(stream, "Realm \t%s\n", switch_str_nil(gp->register_realm));
</span><span class="cx">                                 stream->write_function(stream, "Username\t%s\n", switch_str_nil(gp->register_username));
</span><del>-                                stream->write_function(stream, "Password\t%s\n", switch_strlen_zero(gp->register_password) ? "no" : "yes");
</del><ins>+                                stream->write_function(stream, "Password\t%s\n", zstr(gp->register_password) ? "no" : "yes");
</ins><span class="cx">                                 stream->write_function(stream, "From \t%s\n", switch_str_nil(gp->register_from));
</span><span class="cx">                                 stream->write_function(stream, "Contact \t%s\n", switch_str_nil(gp->register_contact));
</span><span class="cx">                                 stream->write_function(stream, "Exten \t%s\n", switch_str_nil(gp->extension));
</span><span class="lines">@@ -1742,7 +1922,7 @@
</span><span class="cx">                                         stream->write_function(stream, "Dialplan \t%s\n", switch_str_nil(profile->dialplan));
</span><span class="cx">                                         stream->write_function(stream, "Context \t%s\n", switch_str_nil(profile->context));
</span><span class="cx">                                         stream->write_function(stream, "Challenge Realm \t%s\n",
</span><del>-                                                                                 switch_strlen_zero(profile->challenge_realm) ? "auto_to" : profile->challenge_realm);
</del><ins>+                                                                                 zstr(profile->challenge_realm) ? "auto_to" : profile->challenge_realm);
</ins><span class="cx">                                         stream->write_function(stream, "RTP-IP \t%s\n", switch_str_nil(profile->rtpip));
</span><span class="cx">                                         if (profile->extrtpip) {
</span><span class="cx">                                         stream->write_function(stream, "Ext-RTP-IP \t%s\n", profile->extrtpip);
</span><span class="lines">@@ -1758,8 +1938,8 @@
</span><span class="cx">                                         stream->write_function(stream, "TLS-URL \t%s\n", switch_str_nil(profile->tls_url));
</span><span class="cx">                                         stream->write_function(stream, "TLS-BIND-URL \t%s\n", switch_str_nil(profile->tls_bindurl));
</span><span class="cx">                                         }
</span><del>-                                        stream->write_function(stream, "HOLD-MUSIC \t%s\n", switch_strlen_zero(profile->hold_music) ? "N/A" : profile->hold_music);
-                                        stream->write_function(stream, "OUTBOUND-PROXY \t%s\n", switch_strlen_zero(profile->outbound_proxy) ? "N/A" : profile->outbound_proxy);
</del><ins>+                                        stream->write_function(stream, "HOLD-MUSIC \t%s\n", zstr(profile->hold_music) ? "N/A" : profile->hold_music);
+                                        stream->write_function(stream, "OUTBOUND-PROXY \t%s\n", zstr(profile->outbound_proxy) ? "N/A" : profile->outbound_proxy);
</ins><span class="cx">                                         stream->write_function(stream, "CODECS \t%s\n", switch_str_nil(profile->codec_string));
</span><span class="cx">                                         stream->write_function(stream, "TEL-EVENT \t%d\n", profile->te);
</span><span class="cx">                                         if (profile->dtmf_type == DTMF_2833) {
</span><span class="lines">@@ -1791,14 +1971,14 @@
</span><span class="cx">                                 if (!sql && argv[2] && !strcasecmp(argv[2], "pres") && argv[3]) {
</span><span class="cx">                                         sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status,"
</span><span class="cx">                                                         "rpid,expires,user_agent,server_user,server_host,profile_name,hostname,"
</span><del>-                                                        "network_ip,network_port,sip_username,sip_realm"
</del><ins>+                                                        "network_ip,network_port,sip_username,sip_realm,mwi_user,mwi_host"
</ins><span class="cx">                                                         " from sip_registrations where profile_name='%q' and presence_hosts like '%%%q%%'",
</span><span class="cx">                                                         profile->name, argv[3]);
</span><span class="cx">                                 }
</span><span class="cx">                                 if (!sql && argv[2] && !strcasecmp(argv[2], "reg") && argv[3]) {
</span><span class="cx">                                         sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status,"
</span><span class="cx">                                                         "rpid,expires,user_agent,server_user,server_host,profile_name,hostname,"
</span><del>-                                                        "network_ip,network_port,sip_username,sip_realm"
</del><ins>+                                                        "network_ip,network_port,sip_username,sip_realm,mwi_user,mwi_host"
</ins><span class="cx">                                                         " from sip_registrations where profile_name='%q' and contact like '%%%q%%'",
</span><span class="cx">                                                         profile->name, argv[3]);
</span><span class="cx">                                 }
</span><span class="lines">@@ -1816,9 +1996,9 @@
</span><span class="cx">                                                 host = dup;
</span><span class="cx">                                         }
</span><span class="cx">
</span><del>-                                        if (switch_strlen_zero(user) ) {
</del><ins>+                                        if (zstr(user) ) {
</ins><span class="cx">                                                 sqlextra = switch_mprintf("(sip_host='%q')", host);
</span><del>-                                        } else if (switch_strlen_zero(host)) {
</del><ins>+                                        } else if (zstr(host)) {
</ins><span class="cx">                                                 sqlextra = switch_mprintf("(sip_user='%q')", user);
</span><span class="cx">                                         } else {
</span><span class="cx">                                                 sqlextra = switch_mprintf("(sip_user='%q' and sip_host='%q')", user, host);
</span><span class="lines">@@ -1826,7 +2006,7 @@
</span><span class="cx">
</span><span class="cx">                                         sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status,"
</span><span class="cx">                                                         "rpid,expires,user_agent,server_user,server_host,profile_name,hostname,"
</span><del>-                                                        "network_ip,network_port,sip_username,sip_realm"
</del><ins>+                                                        "network_ip,network_port,sip_username,sip_realm,mwi_user,mwi_host"
</ins><span class="cx">                                                         " from sip_registrations where profile_name='%q' and %s",
</span><span class="cx">                                                         profile->name, sqlextra);
</span><span class="cx">                                         switch_safe_free(dup);
</span><span class="lines">@@ -1836,7 +2016,7 @@
</span><span class="cx">                                 if (!sql) {
</span><span class="cx">                                         sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status,"
</span><span class="cx">                                                                                  "rpid,expires,user_agent,server_user,server_host,profile_name,hostname,"
</span><del>-                                                                                 "network_ip,network_port,sip_username,sip_realm"
</del><ins>+                                                                                 "network_ip,network_port,sip_username,sip_realm,mwi_user,mwi_host"
</ins><span class="cx">                                                                                  " from sip_registrations where profile_name='%q'",
</span><span class="cx">                                                                                  profile->name);
</span><span class="cx">                                 }
</span><span class="lines">@@ -1929,7 +2109,7 @@
</span><span class="cx">                                 stream->write_function(stream, " <scheme>%s</scheme>\n", switch_str_nil(gp->register_scheme));
</span><span class="cx">                                 stream->write_function(stream, " <realm>%s</realm>\n", switch_str_nil(gp->register_realm));
</span><span class="cx">                                 stream->write_function(stream, " <username>%s</username>\n", switch_str_nil(gp->register_username));
</span><del>-                                stream->write_function(stream, " <password>%s</password>\n", switch_strlen_zero(gp->register_password) ? "no" : "yes");
</del><ins>+                                stream->write_function(stream, " <password>%s</password>\n", zstr(gp->register_password) ? "no" : "yes");
</ins><span class="cx">                                 stream->write_function(stream, " <from>%s</from>\n", switch_amp_encode(switch_str_nil(gp->register_from),xmlbuf,buflen));
</span><span class="cx">                                 stream->write_function(stream, " <contact>%s</contact>\n", switch_amp_encode(switch_str_nil(gp->register_contact),xmlbuf,buflen));
</span><span class="cx">                                 stream->write_function(stream, " <exten>%s</exten>\n", switch_amp_encode(switch_str_nil(gp->extension),xmlbuf,buflen));
</span><span class="lines">@@ -1969,7 +2149,7 @@
</span><span class="cx">                                         stream->write_function(stream, " <dialplan>%s</dialplan>\n", switch_str_nil(profile->dialplan));
</span><span class="cx">                                         stream->write_function(stream, " <context>%s</context>\n", switch_str_nil(profile->context));
</span><span class="cx">                                         stream->write_function(stream, " <challenge-realm>%s</challenge-realm>\n",
</span><del>-                                                                                 switch_strlen_zero(profile->challenge_realm) ? "auto_to" : profile->challenge_realm);
</del><ins>+                                                                                 zstr(profile->challenge_realm) ? "auto_to" : profile->challenge_realm);
</ins><span class="cx">                                         stream->write_function(stream, " <rtp-ip>%s</rtp-ip>\n", switch_str_nil(profile->rtpip));
</span><span class="cx">                                         stream->write_function(stream, " <ext-rtp-ip>%s</ext-rtp-ip>\n", profile->extrtpip);
</span><span class="cx">                                         stream->write_function(stream, " <sip-ip>%s</sip-ip>\n", switch_str_nil(profile->sipip));
</span><span class="lines">@@ -1978,8 +2158,8 @@
</span><span class="cx">                                         stream->write_function(stream, " <bind-url>%s</bind-url>\n", switch_str_nil(profile->bindurl));
</span><span class="cx">                                         stream->write_function(stream, " <tls-url>%s</tls-url>\n", switch_str_nil(profile->tls_url));
</span><span class="cx">                                         stream->write_function(stream, " <tls-bind-url>%s</tls-bind-url>\n", switch_str_nil(profile->tls_bindurl));
</span><del>-                                        stream->write_function(stream, " <hold-music>%s</hold-music>\n", switch_strlen_zero(profile->hold_music) ? "N/A" : profile->hold_music);
-                                        stream->write_function(stream, " <outbound-proxy>%s</outbound-proxy>\n", switch_strlen_zero(profile->outbound_proxy) ? "N/A" : profile->outbound_proxy);
</del><ins>+                                        stream->write_function(stream, " <hold-music>%s</hold-music>\n", zstr(profile->hold_music) ? "N/A" : profile->hold_music);
+                                        stream->write_function(stream, " <outbound-proxy>%s</outbound-proxy>\n", zstr(profile->outbound_proxy) ? "N/A" : profile->outbound_proxy);
</ins><span class="cx">                                         stream->write_function(stream, " <codecs>%s</codecs>\n", switch_str_nil(profile->codec_string));
</span><span class="cx">                                         stream->write_function(stream, " <tel-event>%d</tel-event>\n", profile->te);
</span><span class="cx">                                         stream->write_function(stream, " <dtmf-mode>rfc2833</dtmf-mode>\n");
</span><span class="lines">@@ -2011,7 +2191,7 @@
</span><span class="cx">
</span><span class="cx">                                         sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status,"
</span><span class="cx">                                                         "rpid,expires,user_agent,server_user,server_host,profile_name,hostname,"
</span><del>-                                                        "network_ip,network_port,sip_username,sip_realm"
</del><ins>+                                                        "network_ip,network_port,sip_username,sip_realm,mwi_user,mwi_host"
</ins><span class="cx">                                                         " from sip_registrations where profile_name='%q' and presence_hosts like '%%%q%%'",
</span><span class="cx">                                                         profile->name, argv[3]);
</span><span class="cx">                                 }
</span><span class="lines">@@ -2019,7 +2199,7 @@
</span><span class="cx">
</span><span class="cx">                                         sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status,"
</span><span class="cx">                                                         "rpid,expires,user_agent,server_user,server_host,profile_name,hostname,"
</span><del>-                                                        "network_ip,network_port,sip_username,sip_realm"
</del><ins>+                                                        "network_ip,network_port,sip_username,sip_realm,mwi_user,mwi_host"
</ins><span class="cx">                                                         " from sip_registrations where profile_name='%q' and contact like '%%%q%%'",
</span><span class="cx">                                                         profile->name, argv[3]);
</span><span class="cx">                                 }
</span><span class="lines">@@ -2037,9 +2217,9 @@
</span><span class="cx">                                                 host = dup;
</span><span class="cx">                                         }
</span><span class="cx">
</span><del>-                                        if (switch_strlen_zero(user)) {
</del><ins>+                                        if (zstr(user)) {
</ins><span class="cx">                                                 sqlextra = switch_mprintf("(sip_host='%q')", host);
</span><del>-                                        } else if (switch_strlen_zero(host)) {
</del><ins>+                                        } else if (zstr(host)) {
</ins><span class="cx">                                                 sqlextra = switch_mprintf("(sip_user='%q')", user);
</span><span class="cx">                                         } else {
</span><span class="cx">                                                 sqlextra = switch_mprintf("(sip_user='%q' and sip_host='%q')", user, host);
</span><span class="lines">@@ -2047,7 +2227,7 @@
</span><span class="cx">
</span><span class="cx">                                         sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status,"
</span><span class="cx">                                                         "rpid,expires,user_agent,server_user,server_host,profile_name,hostname,"
</span><del>-                                                        "network_ip,network_port,sip_username,sip_realm"
</del><ins>+                                                        "network_ip,network_port,sip_username,sip_realm,mwi_user,mwi_host"
</ins><span class="cx">                                                         " from sip_registrations where profile_name='%q' and %s",
</span><span class="cx">                                                         profile->name, sqlextra);
</span><span class="cx">                                         switch_safe_free(dup);
</span><span class="lines">@@ -2057,7 +2237,7 @@
</span><span class="cx">                                 if (!sql) {
</span><span class="cx">                                         sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status,"
</span><span class="cx">                                                                                  "rpid,expires,user_agent,server_user,server_host,profile_name,hostname,"
</span><del>-                                                                                 "network_ip,network_port,sip_username,sip_realm"
</del><ins>+                                                                                 "network_ip,network_port,sip_username,sip_realm,mwi_user,mwi_host"
</ins><span class="cx">                                                                                  " from sip_registrations where profile_name='%q'",
</span><span class="cx">                                                                                  profile->name);
</span><span class="cx">                                 }
</span><span class="lines">@@ -2154,7 +2334,7 @@
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(profile_name) || !(profile = sofia_glue_find_profile(profile_name))) {
</del><ins>+        if (zstr(profile_name) || !(profile = sofia_glue_find_profile(profile_name))) {
</ins><span class="cx">                 stream->write_function(stream, "Invalid Profile [%s]", switch_str_nil(profile_name));
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -2254,7 +2434,7 @@
</span><span class="cx">                 char *gname = argv[2];
</span><span class="cx">                 sofia_gateway_t *gateway_ptr;
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(gname)) {
</del><ins>+                if (zstr(gname)) {
</ins><span class="cx">                         stream->write_function(stream, "No gateway name provided!\n");
</span><span class="cx">                         goto done;
</span><span class="cx">                 }
</span><span class="lines">@@ -2281,7 +2461,7 @@
</span><span class="cx">                 char *gname = argv[2];
</span><span class="cx">                 sofia_gateway_t *gateway_ptr;
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(gname)) {
</del><ins>+                if (zstr(gname)) {
</ins><span class="cx">                         stream->write_function(stream, "No gateway name provided!\n");
</span><span class="cx">                         goto done;
</span><span class="cx">                 }
</span><span class="lines">@@ -2357,7 +2537,7 @@
</span><span class="cx">         struct cb_helper *cb = (struct cb_helper *) pArg;
</span><span class="cx">         char *contact;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(argv[0]) && (contact = sofia_glue_get_url_from_contact(argv[0], 1)) ) {
</del><ins>+        if (!zstr(argv[0]) && (contact = sofia_glue_get_url_from_contact(argv[0], 1)) ) {
</ins><span class="cx">                 cb->stream->write_function(cb->stream, "%ssofia/%s/sip:%s,", argv[2], argv[1], sofia_glue_strip_proto(contact));
</span><span class="cx">                 free(contact);
</span><span class="cx">         }
</span><span class="lines">@@ -2455,11 +2635,11 @@
</span><span class="cx">                         sofia_glue_execute_sql_callback(profile, SWITCH_FALSE, profile->ireg_mutex, sql, contact_callback, &cb);
</span><span class="cx">                         switch_safe_free(sql);
</span><span class="cx">                         reply = (char *) mystream.data;
</span><del>-                        if (!switch_strlen_zero(reply) && end_of(reply) == ',') {
</del><ins>+                        if (!zstr(reply) && end_of(reply) == ',') {
</ins><span class="cx">                                 end_of(reply) = '\0';
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if (switch_strlen_zero(reply)) {
</del><ins>+                        if (zstr(reply)) {
</ins><span class="cx">                                 reply = "error/user_not_registered";
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="lines">@@ -2493,7 +2673,7 @@
</span><span class="cx">         char *gwname, *param, *varname;
</span><span class="cx">         const char *val = NULL;
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "-ERR Parameter missing\n");
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -2509,7 +2689,7 @@
</span><span class="cx">         param = argv[1];
</span><span class="cx">         varname = argv[2];
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(gwname) || switch_strlen_zero(param) || switch_strlen_zero(varname)) {
</del><ins>+        if (zstr(gwname) || zstr(param) || zstr(varname)) {
</ins><span class="cx">                 goto end;
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="lines">@@ -2557,7 +2737,7 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "%s", usage_string);
</span><span class="cx">                 goto done;
</span><span class="cx">         }
</span><span class="lines">@@ -2658,16 +2838,21 @@
</span><span class="cx"> {
</span><span class="cx">         switch_call_cause_t cause = SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
</span><span class="cx">         switch_core_session_t *nsession = NULL;
</span><del>-        char *data, *profile_name, *dest;
</del><ins>+        char *data, *profile_name, *dest, *dest_num = NULL;
</ins><span class="cx">         sofia_profile_t *profile = NULL;
</span><span class="cx">         switch_caller_profile_t *caller_profile = NULL;
</span><span class="cx">         private_object_t *tech_pvt = NULL;
</span><span class="cx">         switch_channel_t *nchannel;
</span><del>-        char *host = NULL, *dest_to = NULL;
</del><ins>+        char *host = NULL, *dest_to = NULL, *p;
</ins><span class="cx">         const char *hval = NULL;
</span><span class="cx">
</span><span class="cx">         *new_session = NULL;
</span><span class="cx">
</span><ins>+        if (!outbound_profile || zstr(outbound_profile->destination_number)) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Invalid Destination\n");
+                goto error;
+        }
+
</ins><span class="cx">         if (!(nsession = switch_core_session_request(sofia_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool))) {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Error Creating Session\n");
</span><span class="cx">                 goto error;
</span><span class="lines">@@ -2728,6 +2913,7 @@
</span><span class="cx">
</span><span class="cx">                 tech_pvt->transport = gateway_ptr->register_transport;
</span><span class="cx">
</span><ins>+
</ins><span class="cx">                 /*
</span><span class="cx">                  * Handle params, strip them off the destination and add them to the
</span><span class="cx">                  * invite contact.
</span><span class="lines">@@ -2771,6 +2957,16 @@
</span><span class="cx">                         tech_pvt->dest = switch_core_session_sprintf(nsession, "sip:%s", dest);
</span><span class="cx">                 }
</span><span class="cx">
</span><ins>+                if ((host = switch_core_session_strdup(nsession, tech_pvt->dest))) {
+                        char *p = strchr(host, '@');
+                        if (p) {
+                                host = p+1;
+                        } else {
+                                host = NULL;
+                                dest_to = NULL;
+                        }
+                }
+
</ins><span class="cx">                 if (params) {
</span><span class="cx">                         tech_pvt->invite_contact = switch_core_session_sprintf(nsession, "%s;%s", gateway_ptr->register_contact, params);
</span><span class="cx">                 } else {
</span><span class="lines">@@ -2779,11 +2975,11 @@
</span><span class="cx">                 
</span><span class="cx">                 gateway_ptr->ob_calls++;
</span><span class="cx">                 
</span><del>-                if (!switch_strlen_zero(gateway_ptr->from_domain) && !switch_channel_get_variable(nchannel, "sip_invite_domain")) {
</del><ins>+                if (!zstr(gateway_ptr->from_domain) && !switch_channel_get_variable(nchannel, "sip_invite_domain")) {
</ins><span class="cx">                         switch_channel_set_variable(nchannel, "sip_invite_domain", gateway_ptr->from_domain);
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(gateway_ptr->outbound_sticky_proxy) && !switch_channel_get_variable(nchannel, "sip_route_uri")) {
</del><ins>+                if (!zstr(gateway_ptr->outbound_sticky_proxy) && !switch_channel_get_variable(nchannel, "sip_route_uri")) {
</ins><span class="cx">                         switch_channel_set_variable(nchannel, "sip_route_uri", gateway_ptr->outbound_sticky_proxy);
</span><span class="cx">                 }
</span><span class="cx">                 
</span><span class="lines">@@ -2872,8 +3068,16 @@
</span><span class="cx">         }
</span><span class="cx">         switch_channel_set_variable(nchannel, "sip_destination_url", tech_pvt->dest);
</span><span class="cx">
</span><ins>+        dest_num = switch_core_session_strdup(nsession, dest);
+        if ((p = strchr(dest_num, ':'))) {
+                dest_num = p + 1;
+                if ((p = strchr(dest_num, '@'))) {
+                        *p = '\0';
+                }
+        }
+
</ins><span class="cx">         caller_profile = switch_caller_profile_clone(nsession, outbound_profile);
</span><del>-        caller_profile->destination_number = switch_core_strdup(caller_profile->pool, dest);
</del><ins>+        caller_profile->destination_number = switch_core_strdup(caller_profile->pool, dest_num);
</ins><span class="cx">         switch_channel_set_caller_profile(nchannel, caller_profile);
</span><span class="cx">         switch_channel_set_flag(nchannel, CF_OUTBOUND);
</span><span class="cx">         sofia_set_flag_locked(tech_pvt, TFLAG_OUTBOUND);
</span><span class="lines">@@ -2890,6 +3094,14 @@
</span><span class="cx">                 switch_channel_set_variable(nchannel, "sip_invite_params", "intercom=true");
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        if ((hval = switch_event_get_header(var_event, "sip_callee_id_name"))) {
+                caller_profile->callee_id_name = switch_core_strdup(caller_profile->pool, hval);
+        }
+
+        if ((hval = switch_event_get_header(var_event, "sip_callee_id_number"))) {
+                caller_profile->callee_id_number = switch_core_strdup(caller_profile->pool, hval);
+        }
+
</ins><span class="cx">         if (session) {
</span><span class="cx">                 switch_channel_t *o_channel = switch_core_session_get_channel(session);
</span><span class="cx">                 const char *vval = NULL;
</span><span class="lines">@@ -2906,7 +3118,7 @@
</span><span class="cx">                 switch_ivr_transfer_variable(session, nsession, "sip-force-contact");
</span><span class="cx">                 switch_ivr_transfer_variable(session, nsession, "sip_sticky_contact");
</span><span class="cx">                 switch_ivr_transfer_variable(session, nsession, "sip_cid_type");
</span><del>-
</del><ins>+                
</ins><span class="cx">                 if (switch_core_session_compare(session, nsession)) {
</span><span class="cx">                         /* It's another sofia channel! so lets cache what they use as a pt for telephone event so
</span><span class="cx">                          we can keep it the same
</span><span class="lines">@@ -2998,7 +3210,7 @@
</span><span class="cx">                          NUTAG_NEWSUB(1),
</span><span class="cx">                          SIPTAG_EVENT_STR(es),
</span><span class="cx">                          SIPTAG_CONTENT_TYPE_STR(ct),
</span><del>-                         TAG_IF(!switch_strlen_zero(body), SIPTAG_PAYLOAD_STR(body)),
</del><ins>+                         TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)),
</ins><span class="cx">                          TAG_END());
</span><span class="cx">
</span><span class="cx">                                 
</span><span class="lines">@@ -3076,7 +3288,7 @@
</span><span class="cx">                                                          NUTAG_WITH_THIS(profile->nua),
</span><span class="cx">                                                          SIPTAG_EVENT_STR(es),
</span><span class="cx">                                                          TAG_IF(ct, SIPTAG_CONTENT_TYPE_STR(ct)),
</span><del>-                                                         TAG_IF(!switch_strlen_zero(body), SIPTAG_PAYLOAD_STR(body)),
</del><ins>+                                                         TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)),
</ins><span class="cx">                                                          TAG_END());
</span><span class="cx">                                 
</span><span class="cx">                                         sofia_glue_release_profile(profile);
</span><span class="lines">@@ -3095,7 +3307,7 @@
</span><span class="cx">                                                                  NUTAG_NEWSUB(1),
</span><span class="cx">                                                                  SIPTAG_EVENT_STR(es),
</span><span class="cx">                                                                  SIPTAG_CONTENT_TYPE_STR(ct),
</span><del>-                                                                 TAG_IF(!switch_strlen_zero(body), SIPTAG_PAYLOAD_STR(body)),
</del><ins>+                                                                 TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)),
</ins><span class="cx">                                                                  TAG_END());
</span><span class="cx">                                         }
</span><span class="cx">                                         switch_core_session_rwunlock(session);
</span><span class="lines">@@ -3108,10 +3320,18 @@
</span><span class="cx">                                                                                  "from sip_registrations where call_id='%q'", ct, es, switch_str_nil(body), call_id
</span><span class="cx">                                                                                  );
</span><span class="cx">                                 } else {
</span><del>-                                        sql = switch_mprintf("select sip_user,sip_host,contact,profile_name,'%q','%q','%q' "
-                                                                                 "from sip_registrations where sip_user='%s' and sip_host='%q'",
-                                                                                 ct, es, switch_str_nil(body), switch_str_nil(user), switch_str_nil(host)
-                                                                                 );
</del><ins>+                                        if (!strcasecmp(es, "message-summary")) {
+                                                sql = switch_mprintf("select sip_user,sip_host,contact,profile_name,'%q','%q','%q' "
+                                                                "from sip_registrations where mwi_user='%s' and mwi_host='%q'",
+                                                                ct, es, switch_str_nil(body), switch_str_nil(user), switch_str_nil(host)
+                                                                );
+                                        } else {
+                                                sql = switch_mprintf("select sip_user,sip_host,contact,profile_name,'%q','%q','%q' "
+                                                                "from sip_registrations where sip_user='%s' and sip_host='%q'",
+                                                                ct, es, switch_str_nil(body), switch_str_nil(user), switch_str_nil(host)
+                                                                );
+
+                                        }
</ins><span class="cx">                                 }
</span><span class="cx">                                 
</span><span class="cx">
</span><span class="lines">@@ -3171,7 +3391,7 @@
</span><span class="cx">                                 nua_message(nh,
</span><span class="cx">                                                         NUTAG_NEWSUB(1),
</span><span class="cx">                                                         SIPTAG_CONTENT_TYPE_STR(ct),
</span><del>-                                                        TAG_IF(!switch_strlen_zero(body), SIPTAG_PAYLOAD_STR(body)),
</del><ins>+                                                        TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)),
</ins><span class="cx">                                                         TAG_END());
</span><span class="cx">
</span><span class="cx">                                 
</span><span class="lines">@@ -3267,7 +3487,7 @@
</span><span class="cx">                                          TAG_IF(ct, SIPTAG_CONTENT_TYPE_STR(ct)),
</span><span class="cx">                                          TAG_IF(alert_info, SIPTAG_ALERT_INFO_STR(alert_info)),
</span><span class="cx">                                          TAG_IF(call_info, SIPTAG_CALL_INFO_STR(call_info)),
</span><del>-                                         TAG_IF(!switch_strlen_zero(body), SIPTAG_PAYLOAD_STR(body)),
</del><ins>+                                         TAG_IF(!zstr(body), SIPTAG_PAYLOAD_STR(body)),
</ins><span class="cx">                                          TAG_END());
</span><span class="cx">
</span><span class="cx">                         if (call_id && nh) {
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_sofiamod_sofiah"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/mod_sofia.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/mod_sofia.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/mod_sofia.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> /*Defines etc..*/
</span><span class="cx"> /*************************************************************************************************************************************************************/
</span><span class="cx"> #define MANUAL_BYE
</span><del>-
</del><ins>+#define DEFAULT_NONCE_TTL 60
</ins><span class="cx"> #define IREG_SECONDS 30
</span><span class="cx"> #define GATEWAY_SECONDS 1
</span><span class="cx"> #define SOFIA_QUEUE_SIZE 50000
</span><span class="lines">@@ -79,6 +79,7 @@
</span><span class="cx"> #define MY_EVENT_EXPIRE "sofia::expire"
</span><span class="cx"> #define MY_EVENT_GATEWAY_STATE "sofia::gateway_state"
</span><span class="cx"> #define MY_EVENT_NOTIFY_REFER "sofia::notify_refer"
</span><ins>+#define MY_EVENT_REINVITE "sofia::reinvite"
</ins><span class="cx">
</span><span class="cx"> #define MULTICAST_EVENT "multicast::event"
</span><span class="cx"> #define SOFIA_REPLACES_HEADER "_sofia_replaces_"
</span><span class="lines">@@ -96,6 +97,7 @@
</span><span class="cx"> #define SOFIA_SECURE_MEDIA_CONFIRMED_VARIABLE "sip_secure_media_confirmed"
</span><span class="cx"> #define SOFIA_HAS_CRYPTO_VARIABLE "sip_has_crypto"
</span><span class="cx"> #define SOFIA_CRYPTO_MANDATORY_VARIABLE "sip_crypto_mandatory"
</span><ins>+#define FREESWITCH_SUPPORT "update_display"
</ins><span class="cx">
</span><span class="cx"> #include <sofia-sip/nua.h>
</span><span class="cx"> #include <sofia-sip/sip_status.h>
</span><span class="lines">@@ -195,6 +197,8 @@
</span><span class="cx">         PFLAG_MANUAL_REDIRECT,
</span><span class="cx">         PFLAG_AUTO_NAT,
</span><span class="cx">         PFLAG_SIPCOMPACT,
</span><ins>+        PFLAG_SQL_IN_TRANS,
+        PFLAG_PASS_CALLEE_ID,
</ins><span class="cx">         /* No new flags below this line */
</span><span class="cx">         PFLAG_MAX
</span><span class="cx"> } PFLAGS;
</span><span class="lines">@@ -245,7 +249,7 @@
</span><span class="cx">         TFLAG_HOLD_LOCK,
</span><span class="cx">         TFLAG_3PCC_HAS_ACK,
</span><span class="cx">         TFLAG_PASS_RFC2833,
</span><del>-
</del><ins>+        TFLAG_UPDATING_DISPLAY,
</ins><span class="cx">         /* No new flags below this line */
</span><span class="cx">         TFLAG_MAX
</span><span class="cx"> } TFLAGS;
</span><span class="lines">@@ -438,6 +442,7 @@
</span><span class="cx">         char *reg_db_domain;
</span><span class="cx">         char *user_agent;
</span><span class="cx">         char *record_template;
</span><ins>+        char *record_path;
</ins><span class="cx">         char *presence_hosts;
</span><span class="cx">         char *challenge_realm;
</span><span class="cx">         sofia_cid_type_t cid_type;
</span><span class="lines">@@ -579,6 +584,10 @@
</span><span class="cx">         char *extrtpip;
</span><span class="cx">         char *stun_ip;
</span><span class="cx">         char *route_uri;
</span><ins>+        char *x_freeswitch_support_remote;
+        char *x_freeswitch_support_local;
+        char *last_sent_callee_id_name;
+        char *last_sent_callee_id_number;
</ins><span class="cx">         switch_port_t stun_port;
</span><span class="cx">         uint32_t stun_flags;
</span><span class="cx">         unsigned long rm_rate;
</span><span class="lines">@@ -810,7 +819,7 @@
</span><span class="cx">
</span><span class="cx"> #define check_decode(_var, _session) do {                                                                \
</span><span class="cx">                 assert(_session);                                                                                                \
</span><del>-                if (!switch_strlen_zero(_var)) {                                                                \
</del><ins>+                if (!zstr(_var)) {                                                                \
</ins><span class="cx">                         int d = 0;                                                                                                        \
</span><span class="cx">                         char *p;                                                                                                        \
</span><span class="cx">                         if (strchr(_var, '%')) {                                                                        \
</span><span class="lines">@@ -910,3 +919,6 @@
</span><span class="cx"> switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *user, const char *host, const char *event, const char *contenttype, const char *body, const char *o_contact, const char *network_ip);
</span><span class="cx"> char *sofia_glue_get_extra_headers(switch_channel_t *channel, const char *prefix);
</span><span class="cx"> void sofia_glue_set_extra_headers(switch_channel_t *channel, sip_t const *sip, const char *prefix);
</span><ins>+void sofia_info_send_sipfrag(switch_core_session_t *aleg, switch_core_session_t *bleg);
+void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *profile, sip_t const *sip, switch_bool_t send);
+void sofia_send_callee_id(switch_core_session_t *session, const char *name, const char *number);
</ins></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_sofiasofiac"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/sofia.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/sofia.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/sofia.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -52,8 +52,8 @@
</span><span class="cx">
</span><span class="cx"> static void set_variable_sip_param(switch_channel_t *channel, char *header_type, sip_param_t const *params);
</span><span class="cx">
</span><del>-static void sofia_info_send_sipfrag(switch_core_session_t *aleg, switch_core_session_t *bleg);
</del><span class="cx">
</span><ins>+
</ins><span class="cx"> static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
</span><span class="cx">                                                                          char const *phrase,
</span><span class="cx">                                                                          nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip,
</span><span class="lines">@@ -327,7 +327,7 @@
</span><span class="cx">         
</span><span class="cx">         switch_channel_hangup(channel, cause);
</span><span class="cx">         nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua),
</span><del>-                TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)), TAG_END());
</del><ins>+                TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)), TAG_END());
</ins><span class="cx">                 
</span><span class="cx">         switch_safe_free(extra_headers);
</span><span class="cx">
</span><span class="lines">@@ -338,9 +338,9 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx">
</span><del>-        if (sip->sip_user_agent && !switch_strlen_zero(sip->sip_user_agent->g_string)) {
</del><ins>+        if (sip->sip_user_agent && !zstr(sip->sip_user_agent->g_string)) {
</ins><span class="cx">                 switch_channel_set_variable(channel, "sip_user_agent", sip->sip_user_agent->g_string);
</span><del>-        } else if (sip->sip_server && !switch_strlen_zero(sip->sip_server->g_string)) {
</del><ins>+        } else if (sip->sip_server && !zstr(sip->sip_server->g_string)) {
</ins><span class="cx">                 switch_channel_set_variable(channel, "sip_user_agent", sip->sip_server->g_string);
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -376,6 +376,133 @@
</span><span class="cx">         
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void sofia_send_callee_id(switch_core_session_t *session, const char *name, const char *number)
+{
+        const char *uuid;
+        switch_core_session_t *session_b;
+        switch_channel_t *channel = switch_core_session_get_channel(session);
+        switch_caller_profile_t *caller_profile = switch_channel_get_caller_profile(channel);
+
+
+        if (zstr(name)) {
+                name = caller_profile->callee_id_name;
+        }
+
+        if (zstr(number)) {
+                number = caller_profile->callee_id_number;
+        }
+
+        if (zstr(name)) {
+                name = number;
+        }
+        
+        if (zstr(number)) {
+                number = caller_profile->destination_number;
+        }
+
+        if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (session_b = switch_core_session_locate(uuid))) {
+                switch_core_session_message_t *msg;
+                //switch_channel_t *channel_b = switch_core_session_get_channel(session_b);
+
+                //switch_channel_set_profile_var(channel_b, "callee_id_name", name);
+                //switch_channel_set_profile_var(channel_b, "callee_id_number", number);
+
+                msg = switch_core_session_alloc(session_b, sizeof(*msg));
+                MESSAGE_STAMP_FFL(msg);
+                msg->message_id = SWITCH_MESSAGE_INDICATE_DISPLAY;
+                msg->string_array_arg[0] = switch_core_session_strdup(session_b, name);
+                msg->string_array_arg[1] = switch_core_session_strdup(session_b, number);
+                msg->from = __FILE__;
+                switch_core_session_queue_message(session_b, msg);
+                switch_core_session_rwunlock(session_b);
+        }
+}
+
+void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *profile, sip_t const *sip, switch_bool_t send)
+{
+        switch_channel_t *channel = switch_core_session_get_channel(session);
+        sip_p_asserted_identity_t *passerted = NULL;
+        char *name = NULL;
+        const char *number = "unknown", *tmp;
+        switch_caller_profile_t *caller_profile;
+        char *dup = NULL;
+        switch_event_t *event;
+        const char *val;
+        int fs = 0;
+
+        if (switch_true(switch_channel_get_variable(channel, SWITCH_IGNORE_DISPLAY_UPDATES_VARIABLE))) {
+                return;
+        }
+
+        if (sip->sip_to) {
+                number = sip->sip_to->a_url->url_user;
+        }
+
+        if ((val = sofia_glue_get_unknown_header(sip, "X-FS-Display-Number"))) {
+                number = val;
+                fs++;
+        }
+
+        if ((val = sofia_glue_get_unknown_header(sip, "X-FS-Display-Name"))) {
+                name = (char *)val;
+                fs++;
+        }
+
+        if (!fs) {
+                if ((passerted = sip_p_asserted_identity(sip))) {
+                        if (passerted->paid_url && passerted->paid_url->url_user) {
+                                number = passerted->paid_url->url_user;
+                        }
+                        if (!zstr(passerted->paid_display)) {
+                                dup = strdup(passerted->paid_display);
+                                if (*dup == '"') {
+                                        name = dup + 1;
+                                } else {
+                                        name = dup;
+                                }
+                                if (end_of(name) == '"') {
+                                        end_of(name) = '\0';
+                                }
+                        }
+                }
+        }
+
+        if ((tmp = switch_channel_get_variable(channel, "sip_callee_id_name"))) {
+                name = (char *)tmp;
+        }
+
+        if ((tmp = switch_channel_get_variable(channel, "sip_callee_id_number"))) {
+                number = tmp;
+        }
+
+        if (!name) name = (char *) number;
+
+        if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) {
+                const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
+                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Direction", "RECV");
+                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Callee-Name", name);
+                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Callee-Number", number);
+                if (uuid) {
+                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridged-To", uuid);
+                }
+                switch_channel_event_set_data(channel, event);
+                switch_event_fire(&event);
+        }
+        
+        caller_profile = switch_channel_get_caller_profile(channel);
+        caller_profile->callee_id_name = switch_core_strdup(caller_profile->pool, name);
+        caller_profile->callee_id_number = switch_core_strdup(caller_profile->pool, number);
+
+        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Update Callee ID to \"%s\" <%s>\n", name, number);
+        
+        if (send) {
+                sofia_send_callee_id(session, NULL, NULL);
+        }
+
+        switch_safe_free(dup);
+}
+
+
</ins><span class="cx"> void sofia_event_callback(nua_event_t event,
</span><span class="cx">                                                  int status,
</span><span class="cx">                                                  char const *phrase,
</span><span class="lines">@@ -403,7 +530,7 @@
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile %s is locked\n", gateway->profile->name);
</span><span class="cx">                                 return;
</span><span class="cx">                         }
</span><del>-                } else if (!switch_strlen_zero(sofia_private->uuid)) {
</del><ins>+                } else if (!zstr(sofia_private->uuid)) {
</ins><span class="cx">                         if ((session = switch_core_session_locate(sofia_private->uuid))) {
</span><span class="cx">                                 tech_pvt = switch_core_session_get_private(session);
</span><span class="cx">                                 channel = switch_core_session_get_channel(session);
</span><span class="lines">@@ -417,7 +544,7 @@
</span><span class="cx">
</span><span class="cx">                                 if (status >= 180 && !*sofia_private->auth_gateway_name) {
</span><span class="cx">                                         const char *gwname = switch_channel_get_variable(channel, "sip_use_gateway");
</span><del>-                                        if (!switch_strlen_zero(gwname)) {
</del><ins>+                                        if (!zstr(gwname)) {
</ins><span class="cx">                                                 switch_set_string(sofia_private->auth_gateway_name, gwname);
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><span class="lines">@@ -487,12 +614,15 @@
</span><span class="cx">         case nua_r_cancel:
</span><span class="cx">         case nua_i_error:
</span><span class="cx">         case nua_i_active:
</span><del>-        case nua_i_ack:
</del><span class="cx">         case nua_i_terminated:
</span><span class="cx">         case nua_r_set_params:
</span><span class="cx">         case nua_i_prack:
</span><span class="cx">         case nua_r_prack:
</span><span class="cx">                 break;
</span><ins>+        case nua_i_ack:
+        case nua_r_ack:
+                if (channel) switch_channel_set_flag(channel, CF_MEDIA_ACK);
+                break;
</ins><span class="cx">         case nua_r_shutdown:
</span><span class="cx">                 if (status >= 200) su_root_break(profile->s_root);
</span><span class="cx">                 break;
</span><span class="lines">@@ -540,7 +670,12 @@
</span><span class="cx">         case nua_i_info:
</span><span class="cx">                 sofia_handle_sip_i_info(nua, profile, nh, session, sip, tags);
</span><span class="cx">                 break;
</span><ins>+        case nua_i_update:
+                break;
</ins><span class="cx">         case nua_r_update:
</span><ins>+                if (session && tech_pvt && locked) {
+                        sofia_clear_flag_locked(tech_pvt, TFLAG_UPDATING_DISPLAY);
+                }
</ins><span class="cx">                 break;
</span><span class="cx">         case nua_r_refer:
</span><span class="cx">                 break;
</span><span class="lines">@@ -650,9 +785,26 @@
</span><span class="cx">                 char *fixed_contact_str = NULL;
</span><span class="cx">
</span><span class="cx">                 sofia_profile_t *profile = NULL;
</span><del>-
</del><span class="cx">                 char guess_ip4[256];
</span><span class="cx">
</span><ins>+                char *mwi_account = NULL;
+                char *dup_mwi_account = NULL;
+                char *mwi_user = NULL;
+                char *mwi_host = NULL;
+
+                if ((mwi_account = switch_event_get_header(event, "orig-mwi-account"))) {
+                        dup_mwi_account = strdup(mwi_account);
+                        switch_assert(dup_mwi_account != NULL);
+                        sofia_glue_get_user_host(dup_mwi_account, &mwi_user, &mwi_host);
+                }
+
+                if (!mwi_user) {
+                        mwi_user = (char *) from_user;
+                }
+                if (!mwi_host) {
+                        mwi_host = (char *) from_host;
+                }
+
</ins><span class="cx">                 if (exp_str) {
</span><span class="cx">                         expires += atol(exp_str);
</span><span class="cx">                 }
</span><span class="lines">@@ -663,7 +815,7 @@
</span><span class="cx">
</span><span class="cx">                 if (!profile_name || !(profile = sofia_glue_find_profile(profile_name))) {
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Profile\n");
</span><del>-                        return;
</del><ins>+                        goto end;
</ins><span class="cx">                 }
</span><span class="cx">                 if (sofia_test_pflag(profile, PFLAG_MULTIREG)) {
</span><span class="cx">                         sql = switch_mprintf("delete from sip_registrations where call_id='%q'", call_id);
</span><span class="lines">@@ -699,10 +851,10 @@
</span><span class="cx">                 switch_find_local_ip(guess_ip4, sizeof(guess_ip4), NULL, AF_INET);
</span><span class="cx">                 sql = switch_mprintf("insert into sip_registrations "
</span><span class="cx">                                                          "(call_id, sip_user, sip_host, presence_hosts, contact, status, rpid, expires,"
</span><del>-                                                         "user_agent, server_user, server_host, profile_name, hostname, network_ip, network_port, sip_username, sip_realm) "
-                                                         "values ('%q','%q','%q','%q','%q','Registered','%q',%ld, '%q','%q','%q','%q','%q','%q','%q','%q','%q')",
</del><ins>+                                                         "user_agent, server_user, server_host, profile_name, hostname, network_ip, network_port, sip_username, sip_realm, mwi_user, mwi_host) "
+                                                         "values ('%q','%q','%q','%q','%q','Registered','%q',%ld, '%q','%q','%q','%q','%q','%q','%q','%q','%q','%q','%q')",
</ins><span class="cx">                                                          call_id, from_user, from_host, presence_hosts, contact_str, rpid, expires, user_agent, to_user, guess_ip4,
</span><del>-                                                         profile_name, mod_sofia_globals.hostname, network_ip, network_port, username, realm);
</del><ins>+                                                         profile_name, mod_sofia_globals.hostname, network_ip, network_port, username, realm, mwi_user, mwi_host);
</ins><span class="cx">
</span><span class="cx">                 if (sql) {
</span><span class="cx">                         sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
</span><span class="lines">@@ -713,11 +865,13 @@
</span><span class="cx">                 if (profile) {
</span><span class="cx">                         sofia_glue_release_profile(profile);
</span><span class="cx">                 }
</span><del>-
</del><ins>+end:
</ins><span class="cx">                 switch_safe_free(fixed_contact_str);
</span><ins>+                switch_safe_free(dup_mwi_account);
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#define SQLLEN 1024 * 64
</ins><span class="cx"> void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread, void *obj)
</span><span class="cx"> {
</span><span class="cx">         sofia_profile_t *profile = (sofia_profile_t *) obj;
</span><span class="lines">@@ -726,7 +880,14 @@
</span><span class="cx">         int loops = 0;
</span><span class="cx">         uint32_t qsize;
</span><span class="cx">         void *pop;
</span><del>-        
</del><ins>+        int loop_count = 0;
+        switch_size_t sql_len = SQLLEN;
+        char *tmp, *sqlbuf = NULL;
+
+        if (sofia_test_pflag(profile, PFLAG_SQL_IN_TRANS)) {
+                sqlbuf = (char *) malloc(sql_len);
+        }
+
</ins><span class="cx">         ireg_loops = IREG_SECONDS;
</span><span class="cx">         gateway_loops = GATEWAY_SECONDS;
</span><span class="cx">
</span><span class="lines">@@ -737,15 +898,57 @@
</span><span class="cx">         qsize = switch_queue_size(profile->sql_queue);
</span><span class="cx">
</span><span class="cx">         while ((mod_sofia_globals.running == 1 && sofia_test_pflag(profile, PFLAG_RUNNING)) || qsize) {
</span><del>-                if (qsize) {
-                        switch_mutex_lock(profile->ireg_mutex);
-                        while (switch_queue_trypop(profile->sql_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) {
-                                sofia_glue_actually_execute_sql(profile, SWITCH_TRUE, (char *) pop, NULL);
-                                free(pop);
</del><ins>+                if (sofia_test_pflag(profile, PFLAG_SQL_IN_TRANS)) {
+                        if (qsize > 0 && (qsize >= 500 || ++loop_count >= 500)) {
+                                switch_size_t newlen;
+                                uint32_t itterations = 0;
+                                switch_size_t len = 0;
+
+                                switch_mutex_lock(profile->ireg_mutex);
+                        
+                                sprintf(sqlbuf + len, "begin;\n");
+                                len += 7;
+
+                                while (switch_queue_trypop(profile->sql_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) {
+                                        char *sql = (char *) pop;
+                                
+                                        newlen = strlen(sql) + 2;
+                                
+                                        if (newlen + 10 < SQLLEN) {
+                                                itterations++;
+                                                if (len + newlen + 10 > sql_len) {
+                                                        sql_len = len + 10 + SQLLEN;
+                                                        if (!(tmp = realloc(sqlbuf, sql_len))) {
+                                                                abort();
+                                                                break;
+                                                        }
+                                                        sqlbuf = tmp;
+                                                }
+                                                sprintf(sqlbuf + len, "%s;\n", sql);
+                                                len += newlen;
+                                        }
+
+                                        free(pop);
+                                }
+
+                                sprintf(sqlbuf + len, "commit;\n");
+
+                                //printf("TRANS:\n%s\n", sqlbuf);
+                                sofia_glue_actually_execute_sql(profile, SWITCH_TRUE, sqlbuf, NULL);
+                                switch_mutex_unlock(profile->ireg_mutex);
+                                loop_count = 0;
</ins><span class="cx">                         }
</span><del>-                        switch_mutex_unlock(profile->ireg_mutex);
</del><ins>+                } else {
+                        if (qsize) {
+                                switch_mutex_lock(profile->ireg_mutex);
+                                while (switch_queue_trypop(profile->sql_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) {
+                                        sofia_glue_actually_execute_sql(profile, SWITCH_TRUE, (char *) pop, NULL);
+                                        free(pop);
+                                }
+                                switch_mutex_unlock(profile->ireg_mutex);
+                        }
</ins><span class="cx">                 }
</span><del>-
</del><ins>+                
</ins><span class="cx">                 if (++loops >= 100) {
</span><span class="cx">                         if (++ireg_loops >= IREG_SECONDS) {
</span><span class="cx">                                 sofia_reg_check_expire(profile, switch_epoch_time_now(NULL), 0);
</span><span class="lines">@@ -772,6 +975,7 @@
</span><span class="cx">         switch_mutex_unlock(profile->ireg_mutex);
</span><span class="cx">
</span><span class="cx">         sofia_clear_pflag_locked(profile, PFLAG_WORKER_RUNNING);
</span><ins>+        switch_safe_free(sqlbuf);
</ins><span class="cx">
</span><span class="cx">         return NULL;
</span><span class="cx"> }
</span><span class="lines">@@ -884,10 +1088,12 @@
</span><span class="cx">                                  NUTAG_APPL_METHOD("REGISTER"),
</span><span class="cx">                                  NUTAG_APPL_METHOD("NOTIFY"),
</span><span class="cx">                                  NUTAG_APPL_METHOD("INFO"),
</span><ins>+                                 NUTAG_APPL_METHOD("ACK"),
</ins><span class="cx"> #ifdef MANUAL_BYE
</span><span class="cx">                                  NUTAG_APPL_METHOD("BYE"),
</span><span class="cx"> #endif
</span><span class="cx">                                  NUTAG_AUTOANSWER(0),
</span><ins>+                                 NUTAG_AUTOACK(0),
</ins><span class="cx">                                  NUTAG_AUTOALERT(0),
</span><span class="cx">                                  NUTAG_ENABLEMESSENGER(1),
</span><span class="cx">                                  TAG_IF((profile->mflags & MFLAG_REGISTER), NUTAG_ALLOW("REGISTER")),
</span><span class="lines">@@ -924,6 +1130,7 @@
</span><span class="cx">                                          NUTAG_APPL_METHOD("OPTIONS"),
</span><span class="cx">                                          NUTAG_APPL_METHOD("REFER"),
</span><span class="cx">                                          NUTAG_AUTOANSWER(0),
</span><ins>+                                         NUTAG_AUTOACK(0),
</ins><span class="cx">                                          NUTAG_AUTOALERT(0),
</span><span class="cx">                                          TAG_IF((profile->mflags & MFLAG_REGISTER), NUTAG_ALLOW("REGISTER")),
</span><span class="cx">                                          TAG_IF((profile->mflags & MFLAG_REFER), NUTAG_ALLOW("REFER")),
</span><span class="lines">@@ -1215,7 +1422,7 @@
</span><span class="cx">                 char *name = (char *) switch_xml_attr_soft(gateway_tag, "name");
</span><span class="cx">                 sofia_gateway_t *gateway;
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(name)) {
</del><ins>+                if (zstr(name)) {
</ins><span class="cx">                         name = "anonymous";
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -1379,33 +1586,33 @@
</span><span class="cx">                                 parse_gateway_subscriptions(profile, gateway, gw_subs_tag);
</span><span class="cx">                         }
</span><span class="cx">                         
</span><del>-                        if (switch_strlen_zero(realm)) {
-                                if (switch_strlen_zero(proxy)) {
</del><ins>+                        if (zstr(realm)) {
+                                if (zstr(proxy)) {
</ins><span class="cx">                                         realm = name;
</span><span class="cx">                                 } else {
</span><span class="cx">                                         realm = proxy;
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if (switch_strlen_zero(username)) {
</del><ins>+                        if (zstr(username)) {
</ins><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: username param is REQUIRED!\n");
</span><span class="cx">                                 goto skip;
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if (switch_strlen_zero(password)) {
</del><ins>+                        if (zstr(password)) {
</ins><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: password param is REQUIRED!\n");
</span><span class="cx">                                 goto skip;
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if (switch_strlen_zero(from_user)) {
</del><ins>+                        if (zstr(from_user)) {
</ins><span class="cx">                                 from_user = username;
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if (switch_strlen_zero(extension)) {
</del><ins>+                        if (zstr(extension)) {
</ins><span class="cx">                                 extension = username;
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if (switch_strlen_zero(proxy)) {
</del><ins>+                        if (zstr(proxy)) {
</ins><span class="cx">                                 proxy = realm;
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="lines">@@ -1414,11 +1621,11 @@
</span><span class="cx">                                 gateway->status = SOFIA_GATEWAY_UP;
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if (switch_strlen_zero(auth_username)) {
</del><ins>+                        if (zstr(auth_username)) {
</ins><span class="cx">                                 auth_username = username;
</span><span class="cx">                         }
</span><span class="cx">                         
</span><del>-                        if (!switch_strlen_zero(register_proxy)) {
</del><ins>+                        if (!zstr(register_proxy)) {
</ins><span class="cx">                                 if (strncasecmp(register_proxy, "sip:", 4) && strncasecmp(register_proxy, "sips:", 5)) {
</span><span class="cx">                                         gateway->register_sticky_proxy = switch_core_sprintf(gateway->pool, "sip:%s", register_proxy);
</span><span class="cx">                                 } else {
</span><span class="lines">@@ -1426,7 +1633,7 @@
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if (!switch_strlen_zero(outbound_proxy)) {
</del><ins>+                        if (!zstr(outbound_proxy)) {
</ins><span class="cx">                                 if (strncasecmp(outbound_proxy, "sip:", 4) && strncasecmp(outbound_proxy, "sips:", 5)) {
</span><span class="cx">                                         gateway->outbound_sticky_proxy = switch_core_sprintf(gateway->pool, "sip:%s", outbound_proxy);
</span><span class="cx">                                 } else {
</span><span class="lines">@@ -1457,21 +1664,21 @@
</span><span class="cx">
</span><span class="cx">                         if (contact_params) {
</span><span class="cx">                                 if (*contact_params == ';') {
</span><del>-                                        params = switch_core_sprintf(gateway->pool, "%s;transport=%s", contact_params, register_transport);
</del><ins>+                                        params = switch_core_sprintf(gateway->pool, "%s;transport=%s;gw=%s", contact_params, register_transport, gateway->name);
</ins><span class="cx">                                 } else {
</span><del>-                                        params = switch_core_sprintf(gateway->pool, ";%s;transport=%s", contact_params, register_transport);
</del><ins>+                                        params = switch_core_sprintf(gateway->pool, ";%s;transport=%s;gw=%s", contact_params, register_transport, gateway->name);
</ins><span class="cx">                                 }
</span><span class="cx">                         } else {
</span><del>-                                params = switch_core_sprintf(gateway->pool, ";transport=%s", register_transport);
</del><ins>+                                params = switch_core_sprintf(gateway->pool, ";transport=%s;gw=%s", register_transport, gateway->name);
</ins><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if (!switch_strlen_zero(from_domain)) {
</del><ins>+                        if (!zstr(from_domain)) {
</ins><span class="cx">                                 gateway->from_domain = switch_core_strdup(gateway->pool, from_domain);
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         gateway->register_url = switch_core_sprintf(gateway->pool, "sip:%s", proxy);
</span><span class="cx">                         gateway->register_from = switch_core_sprintf(gateway->pool, "<sip:%s@%s;transport=%s>",
</span><del>-                                                                                                                 from_user, !switch_strlen_zero(from_domain) ? from_domain : proxy, register_transport);
</del><ins>+                                                                                                                 from_user, !zstr(from_domain) ? from_domain : proxy, register_transport);
</ins><span class="cx">
</span><span class="cx">                         sipip = contact_host ? contact_host : profile->extsipip ? profile->extsipip : profile->sipip;
</span><span class="cx">
</span><span class="lines">@@ -1609,6 +1816,7 @@
</span><span class="cx">                         profile->reg_acl_count = 0;
</span><span class="cx">                         profile->proxy_acl_count = 0;
</span><span class="cx">                         sofia_set_pflag(profile, PFLAG_STUN_ENABLED);
</span><ins>+                        sofia_set_pflag(profile, PFLAG_PASS_CALLEE_ID);
</ins><span class="cx">                         profile->ib_calls = 0;
</span><span class="cx">                         profile->ob_calls = 0;
</span><span class="cx">                         profile->ib_failed_calls = 0;
</span><span class="lines">@@ -1626,6 +1834,12 @@
</span><span class="cx">                                                 profile->debug = atoi(val);
</span><span class="cx">                                         } else if (!strcasecmp(var, "tracelevel")) {
</span><span class="cx">                                                 mod_sofia_globals.tracelevel = switch_log_str2level(val);
</span><ins>+                                        } else if (!strcasecmp(var, "pass-callee-id")) {
+                                                if (switch_true(val)) {
+                                                        sofia_set_pflag(profile, PFLAG_PASS_CALLEE_ID);
+                                                } else {
+                                                        sofia_clear_pflag(profile, PFLAG_PASS_CALLEE_ID);
+                                                }
</ins><span class="cx">                                         } else if (!strcasecmp(var, "sip-trace")) {
</span><span class="cx">                                                 if (switch_true(val)) {
</span><span class="cx">                                                         sofia_set_flag(profile, TFLAG_TPORT_LOG);
</span><span class="lines">@@ -1661,6 +1875,8 @@
</span><span class="cx">                                                 profile->cid_type = sofia_cid_name2type(val);
</span><span class="cx">                                         } else if (!strcasecmp(var, "record-template")) {
</span><span class="cx">                                                 profile->record_template = switch_core_strdup(profile->pool, val);
</span><ins>+                                        } else if (!strcasecmp(var, "record-path")) {
+                                                profile->record_path = switch_core_strdup(profile->pool, val);
</ins><span class="cx">                                         } else if ((!strcasecmp(var, "inbound-no-media") || !strcasecmp(var, "inbound-bypass-media"))) {
</span><span class="cx">                                                 if (switch_true(val)) {
</span><span class="cx">                                                         sofia_set_flag(profile, TFLAG_INB_NOMEDIA);
</span><span class="lines">@@ -1989,7 +2205,7 @@
</span><span class="cx">                                         const char *parse = switch_xml_attr_soft(domain_tag, "parse");
</span><span class="cx">                                         const char *alias = switch_xml_attr_soft(domain_tag, "alias");
</span><span class="cx">
</span><del>-                                        if (!switch_strlen_zero(dname)) {
</del><ins>+                                        if (!zstr(dname)) {
</ins><span class="cx">                                                 if (!strcasecmp(dname, "all")) {
</span><span class="cx">                                                         switch_xml_t xml_root, x_domains;
</span><span class="cx">                                                         if (switch_xml_locate("directory", NULL, NULL, NULL, &xml_root, &x_domains, xml_params, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
</span><span class="lines">@@ -2012,7 +2228,7 @@
</span><span class="cx">                         if ((aliases_tag = switch_xml_child(xprofile, "aliases"))) {
</span><span class="cx">                                 for (alias_tag = switch_xml_child(aliases_tag, "alias"); alias_tag; alias_tag = alias_tag->next) {
</span><span class="cx">                                         char *aname = (char *) switch_xml_attr_soft(alias_tag, "name");
</span><del>-                                        if (!switch_strlen_zero(aname)) {
</del><ins>+                                        if (!zstr(aname)) {
</ins><span class="cx">                                                 
</span><span class="cx">                                                 if (sofia_glue_add_profile(switch_core_strdup(profile->pool, aname), profile) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Adding Alias [%s] for profile [%s]\n", aname, profile->name);
</span><span class="lines">@@ -2068,7 +2284,7 @@
</span><span class="cx">                 su_log_redirect(stun_log, logger, NULL);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(profile_name) && (profile = sofia_glue_find_profile(profile_name))) {
</del><ins>+        if (!zstr(profile_name) && (profile = sofia_glue_find_profile(profile_name))) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Profile [%s] Already exists.\n", switch_str_nil(profile_name));
</span><span class="cx">                 status = SWITCH_STATUS_FALSE;
</span><span class="cx">                 sofia_glue_release_profile(profile);
</span><span class="lines">@@ -2163,6 +2379,7 @@
</span><span class="cx">                                 sofia_set_pflag(profile, PFLAG_MESSAGE_QUERY_ON_REGISTER);
</span><span class="cx">                                 sofia_set_pflag(profile, PFLAG_RTP_AUTOFLUSH_DURING_BRIDGE);
</span><span class="cx">                                 profile->contact_user = SOFIA_DEFAULT_CONTACT_USER;
</span><ins>+                                sofia_set_pflag(profile, PFLAG_PASS_CALLEE_ID);
</ins><span class="cx">
</span><span class="cx">                                 for (param = switch_xml_child(settings, "param"); param; param = param->next) {
</span><span class="cx">                                         char *var = (char *) switch_xml_attr_soft(param, "name");
</span><span class="lines">@@ -2174,7 +2391,7 @@
</span><span class="cx">                                                 profile->debug = atoi(val);
</span><span class="cx">                                         } else if (!strcasecmp(var, "sip-trace") && switch_true(val)) {
</span><span class="cx">                                                 sofia_set_flag(profile, TFLAG_TPORT_LOG);
</span><del>-                                        } else if (!strcasecmp(var, "odbc-dsn") && !switch_strlen_zero(val)) {
</del><ins>+                                        } else if (!strcasecmp(var, "odbc-dsn") && !zstr(val)) {
</ins><span class="cx">                                                 if (switch_odbc_available()) {
</span><span class="cx">                                                         profile->odbc_dsn = switch_core_strdup(profile->pool, val);
</span><span class="cx">                                                         if ((profile->odbc_user = strchr(profile->odbc_dsn, ':'))) {
</span><span class="lines">@@ -2212,6 +2429,8 @@
</span><span class="cx">                                                 profile->cid_type = sofia_cid_name2type(val);
</span><span class="cx">                                         } else if (!strcasecmp(var, "record-template")) {
</span><span class="cx">                                                 profile->record_template = switch_core_strdup(profile->pool, val);
</span><ins>+                                        } else if (!strcasecmp(var, "record-path")) {
+                                                profile->record_path = switch_core_strdup(profile->pool, val);
</ins><span class="cx">                                         } else if ((!strcasecmp(var, "inbound-no-media") || !strcasecmp(var, "inbound-bypass-media")) && switch_true(val)) {
</span><span class="cx">                                                 sofia_set_flag(profile, TFLAG_INB_NOMEDIA);
</span><span class="cx">                                         } else if (!strcasecmp(var, "inbound-late-negotiation") && switch_true(val)) {
</span><span class="lines">@@ -2297,7 +2516,7 @@
</span><span class="cx">                                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid option %s for VAD\n", val);
</span><span class="cx">                                                 }
</span><span class="cx">                                         } else if (!strcasecmp(var, "ext-rtp-ip")) {
</span><del>-                                                if (!switch_strlen_zero(val)) {
</del><ins>+                                                if (!zstr(val)) {
</ins><span class="cx">                                                         char *ip = mod_sofia_globals.guess_ip;
</span><span class="cx">                                                         
</span><span class="cx">                                                         if (!strcmp(val, "0.0.0.0")) {
</span><span class="lines">@@ -2331,7 +2550,7 @@
</span><span class="cx">                                                 }
</span><span class="cx">                                                 profile->sipip = switch_core_strdup(profile->pool, ip);
</span><span class="cx">                                         } else if (!strcasecmp(var, "ext-sip-ip")) {
</span><del>-                                                if (!switch_strlen_zero(val)) {
</del><ins>+                                                if (!zstr(val)) {
</ins><span class="cx">                                                         char *ip = mod_sofia_globals.guess_ip;
</span><span class="cx">                                                         char stun_ip[50] = "";
</span><span class="cx">                                                         char *myip = stun_ip;
</span><span class="lines">@@ -2546,6 +2765,18 @@
</span><span class="cx">                                                 if (switch_true(val)) {
</span><span class="cx">                                                         sofia_set_pflag(profile, PFLAG_SIPCOMPACT);
</span><span class="cx">                                                 }
</span><ins>+                                        } else if (!strcasecmp(var, "pass-callee-id")) {
+                                                if (switch_true(val)) {
+                                                        sofia_set_pflag(profile, PFLAG_PASS_CALLEE_ID);
+                                                } else {
+                                                        sofia_clear_pflag(profile, PFLAG_PASS_CALLEE_ID);
+                                                }
+                                        } else if (!strcasecmp(var, "sql-in-transactions")) {
+                                                if (switch_true(val)) {
+                                                        sofia_set_pflag(profile, PFLAG_SQL_IN_TRANS);
+                                                } else {
+                                                        sofia_clear_pflag(profile, PFLAG_SQL_IN_TRANS);
+                                                }
</ins><span class="cx">                                         } else if (!strcasecmp(var, "bitpacking")) {
</span><span class="cx">                                                 if (!strcasecmp(val, "aal2")) {
</span><span class="cx">                                                         profile->codec_flags = SWITCH_CODEC_FLAG_AAL2;
</span><span class="lines">@@ -2835,7 +3066,7 @@
</span><span class="cx">                                                 const char *parse = switch_xml_attr_soft(domain_tag, "parse");
</span><span class="cx">                                                 const char *alias = switch_xml_attr_soft(domain_tag, "alias");
</span><span class="cx">
</span><del>-                                                if (!switch_strlen_zero(dname)) {
</del><ins>+                                                if (!zstr(dname)) {
</ins><span class="cx">                                                         if (!strcasecmp(dname, "all")) {
</span><span class="cx">                                                                 switch_xml_t xml_root, x_domains;
</span><span class="cx">                                                                 if (switch_xml_locate("directory", NULL, NULL, NULL, &xml_root, &x_domains, xml_params, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
</span><span class="lines">@@ -2858,7 +3089,7 @@
</span><span class="cx">                                 if ((aliases_tag = switch_xml_child(xprofile, "aliases"))) {
</span><span class="cx">                                         for (alias_tag = switch_xml_child(aliases_tag, "alias"); alias_tag; alias_tag = alias_tag->next) {
</span><span class="cx">                                                 char *aname = (char *) switch_xml_attr_soft(alias_tag, "name");
</span><del>-                                                if (!switch_strlen_zero(aname)) {
</del><ins>+                                                if (!zstr(aname)) {
</ins><span class="cx">
</span><span class="cx">                                                         if (sofia_glue_add_profile(switch_core_strdup(profile->pool, aname), profile) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Adding Alias [%s] for profile [%s]\n", aname, profile->name);
</span><span class="lines">@@ -2911,7 +3142,7 @@
</span><span class="cx"> {
</span><span class="cx">         sofia_gateway_t *gateway = NULL;
</span><span class="cx">
</span><del>-        if (sofia_private && !switch_strlen_zero(sofia_private->gateway_name)) {
</del><ins>+        if (sofia_private && !zstr(sofia_private->gateway_name)) {
</ins><span class="cx">                 gateway = sofia_reg_find_gateway(sofia_private->gateway_name);
</span><span class="cx">                 sofia_private->destroy_me = 1;
</span><span class="cx">         }
</span><span class="lines">@@ -2969,8 +3200,16 @@
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 switch_channel_clear_flag(channel, CF_REQ_MEDIA);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 if ((status == 180 || status == 183 || status == 200)) {
</span><ins>+                        const char *x_freeswitch_support;
+
+                        switch_channel_set_flag(channel, CF_MEDIA_ACK);
+
+                        if ((x_freeswitch_support = sofia_glue_get_unknown_header(sip, "X-FS-Support"))) {
+                                tech_pvt->x_freeswitch_support_remote = switch_core_session_strdup(session, x_freeswitch_support);
+                        }
+
</ins><span class="cx">                         if (sip->sip_user_agent && sip->sip_user_agent->g_string) {
</span><span class="cx">                                 switch_channel_set_variable(channel, "sip_user_agent", sip->sip_user_agent->g_string);
</span><span class="cx">                         } else if (sip->sip_server && sip->sip_server->g_string) {
</span><span class="lines">@@ -2978,6 +3217,10 @@
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         sofia_glue_set_extra_headers(channel, sip, SOFIA_SIP_PROGRESS_HEADER_PREFIX);
</span><ins>+
+                        if (sip_p_asserted_identity(sip)) {
+                                sofia_update_callee_id(session, profile, sip, SWITCH_FALSE);
+                        }
</ins><span class="cx">                 }
</span><span class="cx">                 
</span><span class="cx">                 if (channel && sip && (status == 300 || status == 302 || status == 305) && switch_channel_test_flag(channel, CF_OUTBOUND)) {
</span><span class="lines">@@ -3107,6 +3350,7 @@
</span><span class="cx">                                 full_contact = sip_header_as_string(home, (void *) sip->sip_contact);
</span><span class="cx">                                 invite_contact = sofia_glue_strip_uri(full_contact);
</span><span class="cx">
</span><ins>+                                switch_channel_set_variable(channel, "sip_redirected_to", invite_contact);
</ins><span class="cx">                                 tech_pvt->redirected = switch_core_session_strdup(session, invite_contact);
</span><span class="cx">
</span><span class="cx">                                 free(invite_contact);
</span><span class="lines">@@ -3128,7 +3372,7 @@
</span><span class="cx">
</span><span class="cx">                         if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
</span><span class="cx">                                 const char *r_sdp = NULL;
</span><del>-                                switch_core_session_message_t msg = { 0 };
</del><ins>+                                switch_core_session_message_t *msg;
</ins><span class="cx">
</span><span class="cx">                                 if (sip->sip_payload && sip->sip_payload->pl_data &&
</span><span class="cx">                                         sip->sip_content_type && sip->sip_content_type->c_subtype && switch_stristr("sdp", sip->sip_content_type->c_subtype)) {
</span><span class="lines">@@ -3139,23 +3383,17 @@
</span><span class="cx">
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Passing %d %s to other leg\n", status, phrase);
</span><span class="cx">
</span><del>-                                msg.message_id = SWITCH_MESSAGE_INDICATE_RESPOND;
-                                msg.from = __FILE__;
-                                msg.numeric_arg = status;
-                                msg.string_arg = switch_core_session_strdup(other_session, phrase);
</del><ins>+                                msg = switch_core_session_alloc(other_session, sizeof(*msg));
+                                msg->message_id = SWITCH_MESSAGE_INDICATE_RESPOND;
+                                msg->from = __FILE__;
+                                msg->numeric_arg = status;
+                                msg->string_arg = switch_core_session_strdup(other_session, phrase);
</ins><span class="cx">                                 if (r_sdp) {
</span><del>-                                        msg.pointer_arg = switch_core_session_strdup(other_session, r_sdp);
-                                        msg.pointer_arg_size = strlen(r_sdp);
</del><ins>+                                        msg->pointer_arg = switch_core_session_strdup(other_session, r_sdp);
+                                        msg->pointer_arg_size = strlen(r_sdp);
</ins><span class="cx">                                 }
</span><span class="cx">
</span><del>-                                switch_mutex_unlock(tech_pvt->sofia_mutex);
-                                status = switch_core_session_receive_message(other_session, &msg);
-                                switch_mutex_lock(tech_pvt->sofia_mutex);
-
-                                if (status != SWITCH_STATUS_SUCCESS) {
-                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Other leg is not available\n");
-                                        nua_respond(tech_pvt->nh, 403, "Hangup in progress", TAG_END());
-                                }
</del><ins>+                                switch_core_session_queue_message(other_session, msg);
</ins><span class="cx">                                 switch_core_session_rwunlock(other_session);
</span><span class="cx">                         }
</span><span class="cx">                         return;
</span><span class="lines">@@ -3231,7 +3469,6 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-
</del><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         if (!session && (status == 180 || status == 183 || status == 200)) {
</span><span class="lines">@@ -3299,6 +3536,8 @@
</span><span class="cx">         switch_core_session_t *other_session = NULL;
</span><span class="cx">         switch_channel_t *other_channel = NULL;
</span><span class="cx">         char st[80] = "";
</span><ins>+        int is_dup_sdp = 0;
+        switch_event_t *s_event = NULL;
</ins><span class="cx">
</span><span class="cx">         tl_gets(tags,
</span><span class="cx">                         NUTAG_CALLSTATE_REF(ss_state),
</span><span class="lines">@@ -3308,6 +3547,8 @@
</span><span class="cx">                         NUTAG_ANSWER_SENT_REF(answer_sent),
</span><span class="cx">                         SIPTAG_REPLACES_STR_REF(replaces_str), SOATAG_LOCAL_SDP_STR_REF(l_sdp), SOATAG_REMOTE_SDP_STR_REF(r_sdp), TAG_END());
</span><span class="cx">         
</span><ins>+        
+
</ins><span class="cx">         if (ss_state == nua_callstate_terminated) {
</span><span class="cx">
</span><span class="cx">                 if ((status == 300 || status == 302 || status == 305) && session) {
</span><span class="lines">@@ -3338,24 +3579,37 @@
</span><span class="cx">                         goto done;
</span><span class="cx">                 }
</span><span class="cx">
</span><ins>+                if ((switch_channel_test_flag(channel, CF_EARLY_MEDIA) || switch_channel_test_flag(channel, CF_ANSWERED)) &&
+                        (status == 180 || status == 183)) {
+                        /* Must you send 180 after 183 w/sdp ? sheesh */
+                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Channel %s skipping state [%s][%d]\n",
+                                                         switch_channel_get_name(channel), nua_callstate_name(ss_state), status);
+                        goto done;
+                }
+
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Channel %s entering state [%s][%d]\n",
</span><span class="cx">                                                  switch_channel_get_name(channel), nua_callstate_name(ss_state), status);
</span><span class="cx">                 
</span><span class="cx">                 if (r_sdp) {
</span><span class="cx">                         sdp_parser_t *parser;
</span><span class="cx">                         sdp_session_t *sdp;
</span><ins>+                        
+                        if (!zstr(tech_pvt->remote_sdp_str) && !strcmp(tech_pvt->remote_sdp_str, r_sdp)) {
+                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Duplicate SDP\n%s\n", r_sdp);
+                                is_dup_sdp = 1;
+                        } else {
+                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Remote SDP:\n%s\n", r_sdp);
+                                tech_pvt->remote_sdp_str = switch_core_session_strdup(session, r_sdp);
+                                switch_channel_set_variable(channel, SWITCH_R_SDP_VARIABLE, r_sdp);
</ins><span class="cx">
</span><del>-                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Remote SDP:\n%s\n", r_sdp);
-                        tech_pvt->remote_sdp_str = switch_core_session_strdup(session, r_sdp);
-                        switch_channel_set_variable(channel, SWITCH_R_SDP_VARIABLE, r_sdp);
-
-                        if ( sofia_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION) && (parser = sdp_parse(NULL, r_sdp, (int) strlen(r_sdp), 0))) {
-                                if ((sdp = sdp_session(parser))) {
-                                        sofia_glue_set_r_sdp_codec_string(channel, (tech_pvt->profile?tech_pvt->profile->codec_string:NULL), sdp);
</del><ins>+                                if (sofia_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION) && (parser = sdp_parse(NULL, r_sdp, (int) strlen(r_sdp), 0))) {
+                                        if ((sdp = sdp_session(parser))) {
+                                                sofia_glue_set_r_sdp_codec_string(channel, (tech_pvt->profile?tech_pvt->profile->codec_string:NULL), sdp);
+                                        }
+                                        sdp_parser_free(parser);
</ins><span class="cx">                                 }
</span><del>-                                sdp_parser_free(parser);
</del><ins>+                                sofia_glue_pass_sdp(tech_pvt, (char *) r_sdp);
</ins><span class="cx">                         }
</span><del>-                        sofia_glue_pass_sdp(tech_pvt, (char *) r_sdp);
</del><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -3403,23 +3657,6 @@
</span><span class="cx">         case nua_callstate_proceeding:
</span><span class="cx">                 if (status == 180) {
</span><span class="cx">                         switch_channel_mark_ring_ready(channel);
</span><del>-                        if (!switch_channel_test_flag(channel, CF_GEN_RINGBACK)) {
-                                if (switch_channel_test_flag(channel, CF_PROXY_MODE)) {
-                                        if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))
-                                                && (other_session = switch_core_session_locate(uuid))) {
-                                                switch_core_session_message_t msg;
-                                                msg.message_id = SWITCH_MESSAGE_INDICATE_RINGING;
-                                                msg.from = __FILE__;
-                                                switch_mutex_unlock(tech_pvt->sofia_mutex);
-                                                switch_core_session_receive_message(other_session, &msg);
-                                                switch_mutex_lock(tech_pvt->sofia_mutex);
-                                                switch_core_session_rwunlock(other_session);
-                                        }
-
-                                } else {
-                                        switch_core_session_queue_indication(session, SWITCH_MESSAGE_INDICATE_RINGING);
-                                }
-                        }
</del><span class="cx">                 }
</span><span class="cx">                         
</span><span class="cx">                 if (r_sdp) {
</span><span class="lines">@@ -3435,7 +3672,7 @@
</span><span class="cx">                                                 goto done;
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><del>-                                if (!switch_channel_test_flag(channel, CF_GEN_RINGBACK) && (uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))
</del><ins>+                                if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))
</ins><span class="cx">                                         && (other_session = switch_core_session_locate(uuid))) {
</span><span class="cx">                                         other_channel = switch_core_session_get_channel(other_session);
</span><span class="cx">                                         if (!switch_channel_get_variable(other_channel, SWITCH_B_SDP_VARIABLE)) {
</span><span class="lines">@@ -3460,7 +3697,9 @@
</span><span class="cx">                 }
</span><span class="cx">                 break;
</span><span class="cx">         case nua_callstate_completing:
</span><del>-                nua_ack(nh, TAG_END());
</del><ins>+                nua_ack(tech_pvt->nh,
+                                TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+                                TAG_END());
</ins><span class="cx">                 break;
</span><span class="cx">         case nua_callstate_received:
</span><span class="cx">                 if (!sofia_test_flag(tech_pvt, TFLAG_SDP)) {
</span><span class="lines">@@ -3571,12 +3810,13 @@
</span><span class="cx">                                                 //3PCC proxy mode delays the 200 OK until the call is answered
</span><span class="cx">                                                 switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "RECEIVED_NOSDP");
</span><span class="cx">                                                 sofia_set_flag_locked(tech_pvt, TFLAG_3PCC);
</span><del>-                                                sofia_glue_tech_choose_port(tech_pvt, 0);
-                                                sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
</del><ins>+                                                //sofia_glue_tech_choose_port(tech_pvt, 0);
+                                                //sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
</ins><span class="cx">                                                 switch_channel_set_flag(channel, TFLAG_LATE_NEGOTIATION);
</span><span class="cx">                                                 //Moves into CS_INIT so call moves forward into the dialplan
</span><span class="cx">                                                 switch_channel_set_state(channel, CS_INIT);
</span><span class="cx">                                         } else {
</span><ins>+                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "No SDP in INVITE and 3pcc not enabled, hanging up.\n");
</ins><span class="cx">                                                 switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "3PCC DISABLED");
</span><span class="cx">                                                 switch_channel_hangup(channel, SWITCH_CAUSE_MANDATORY_IE_MISSING);
</span><span class="cx">                                         }
</span><span class="lines">@@ -3600,7 +3840,7 @@
</span><span class="cx">                 if (r_sdp) {
</span><span class="cx">                         sdp_parser_t *parser;
</span><span class="cx">                         sdp_session_t *sdp;
</span><del>-                        uint8_t match = 0, is_ok = 1;
</del><ins>+                        uint8_t match = 0, is_ok = 1, is_t38 = 0;
</ins><span class="cx">                         tech_pvt->hold_laps = 0;
</span><span class="cx">
</span><span class="cx">                         if (r_sdp) {
</span><span class="lines">@@ -3612,13 +3852,16 @@
</span><span class="cx">                                         goto done;
</span><span class="cx">                                 }
</span><span class="cx">
</span><ins>+                                if (switch_stristr("m=image", r_sdp)) {
+                                        is_t38 = 1;
+                                }
+
</ins><span class="cx">                                 if (switch_channel_test_flag(channel, CF_PROXY_MODE) || switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
</span><del>-                                        
</del><span class="cx">                                         if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))
</span><span class="cx">                                                 && (other_session = switch_core_session_locate(uuid))) {
</span><del>-                                                switch_core_session_message_t msg = { 0 };
</del><ins>+                                                switch_core_session_message_t *msg;
</ins><span class="cx">                                                 
</span><del>-                                                if (profile->media_options & MEDIA_OPT_MEDIA_ON_HOLD) {
</del><ins>+                                                if (switch_channel_test_flag(channel, CF_PROXY_MODE) && !is_t38 && profile->media_options & MEDIA_OPT_MEDIA_ON_HOLD) {
</ins><span class="cx">                                                         tech_pvt->hold_laps = 1;
</span><span class="cx">                                                         switch_channel_set_variable(channel, SWITCH_R_SDP_VARIABLE, r_sdp);
</span><span class="cx">                                                         switch_channel_clear_flag(channel, CF_PROXY_MODE);
</span><span class="lines">@@ -3659,9 +3902,10 @@
</span><span class="cx">                                                         goto done;
</span><span class="cx">                                                 }
</span><span class="cx">                                                 
</span><del>-                                                msg.message_id = SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT;
-                                                msg.from = __FILE__;
-                                                msg.string_arg = (char *) r_sdp;
</del><ins>+                                                msg = switch_core_session_alloc(other_session, sizeof(*msg));
+                                                msg->message_id = SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT;
+                                                msg->from = __FILE__;
+                                                msg->string_arg = switch_core_session_strdup(other_session, r_sdp);
</ins><span class="cx">                                                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Passing SDP to other leg.\n%s\n", r_sdp);
</span><span class="cx">                                                 
</span><span class="cx">                                                 if (sofia_test_flag(tech_pvt, TFLAG_SIP_HOLD)) {
</span><span class="lines">@@ -3674,22 +3918,19 @@
</span><span class="cx">                                                         switch_channel_presence(tech_pvt->channel, "unknown", "hold", NULL);
</span><span class="cx">                                                 }
</span><span class="cx">                                         
</span><del>-                                                switch_mutex_unlock(tech_pvt->sofia_mutex);
-                                                status = switch_core_session_receive_message(other_session, &msg);
-                                                switch_mutex_lock(tech_pvt->sofia_mutex);
</del><ins>+                                                switch_core_session_queue_message(other_session, msg);
</ins><span class="cx">
</span><del>-                                                if (status != SWITCH_STATUS_SUCCESS) {
-                                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Other leg is not available\n");
-                                                        nua_respond(tech_pvt->nh, 403, "Hangup in progress", TAG_END());
-                                                }
</del><span class="cx">                                                 switch_core_session_rwunlock(other_session);
</span><span class="cx">                                         } else {
</span><del>-                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Re-INVITE to a no-media channel that is not in a bridge.\n");
</del><ins>+                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
+                                                                                 "Re-INVITE to a no-media channel that is not in a bridge.\n");
</ins><span class="cx">                                                 is_ok = 0;
</span><span class="cx">                                                 switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
</span><span class="cx">                                         }
</span><span class="cx">                                         goto done;
</span><span class="cx">                                 } else {
</span><ins>+                                        sofia_set_flag_locked(tech_pvt, TFLAG_REINVITE);
+                                        
</ins><span class="cx">                                         if (tech_pvt->num_codecs) {
</span><span class="cx">                                                 if ((parser = sdp_parse(NULL, r_sdp, (int) strlen(r_sdp), 0))) {
</span><span class="cx">                                                         if ((sdp = sdp_session(parser))) {
</span><span class="lines">@@ -3703,19 +3944,21 @@
</span><span class="cx">                                                         goto done;
</span><span class="cx">                                                 }
</span><span class="cx">                                                 sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
</span><del>-                                                sofia_set_flag_locked(tech_pvt, TFLAG_REINVITE);
</del><ins>+                                                
</ins><span class="cx">                                                 if (sofia_glue_activate_rtp(tech_pvt, 0) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Reinvite RTP Error!\n");
</span><span class="cx">                                                         is_ok = 0;
</span><span class="cx">                                                         switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
</span><span class="cx">                                                 }
</span><del>-                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Processing Reinvite\n");
</del><ins>+                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Processing updated SDP\n");
</ins><span class="cx">                                         } else {
</span><ins>+                                                sofia_clear_flag_locked(tech_pvt, TFLAG_REINVITE);
</ins><span class="cx">                                                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Reinvite Codec Error!\n");
</span><span class="cx">                                                 is_ok = 0;
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><span class="cx">                                 
</span><ins>+                                
</ins><span class="cx">                                 if (is_ok) {
</span><span class="cx">                                         if (tech_pvt->local_crypto_key) {
</span><span class="cx">                                                 sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
</span><span class="lines">@@ -3726,6 +3969,11 @@
</span><span class="cx">                                                                 SOATAG_REUSE_REJECTED(1),
</span><span class="cx">                                                                 SOATAG_ORDERED_USER(1), SOATAG_AUDIO_AUX("cn telephone-event"),
</span><span class="cx">                                                                 TAG_IF(sofia_test_pflag(profile, PFLAG_DISABLE_100REL), NUTAG_INCLUDE_EXTRA_SDP(1)), TAG_END());
</span><ins>+
+                                        if (switch_event_create_subclass(&s_event, SWITCH_EVENT_CUSTOM, MY_EVENT_REINVITE) == SWITCH_STATUS_SUCCESS) {
+                                                switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "Unique-ID", switch_core_session_get_uuid(session));
+                                                switch_event_fire(&s_event);
+                                        }
</ins><span class="cx">                                 } else {
</span><span class="cx">                                         nua_respond(tech_pvt->nh, SIP_488_NOT_ACCEPTABLE, TAG_END());
</span><span class="cx">                                 }
</span><span class="lines">@@ -3733,7 +3981,43 @@
</span><span class="cx">                 }
</span><span class="cx">                 break;
</span><span class="cx">         case nua_callstate_ready:
</span><ins>+                if (r_sdp && !is_dup_sdp && switch_rtp_ready(tech_pvt->rtp_session)) {
+                        /* sdp changed since 18X w sdp, we're supposed to ignore it but we, of course, were pressured into supporting it */
+                        sdp_parser_t *parser;
+                        sdp_session_t *sdp;
+                        uint8_t match = 0;
</ins><span class="cx">
</span><ins>+                        sofia_set_flag_locked(tech_pvt, TFLAG_REINVITE);
+                        
+                        if (tech_pvt->num_codecs) {
+                                if ((parser = sdp_parse(NULL, r_sdp, (int) strlen(r_sdp), 0))) {
+                                        if ((sdp = sdp_session(parser))) {
+                                                match = sofia_glue_negotiate_sdp(session, sdp);
+                                        }
+                                        sdp_parser_free(parser);
+                                }
+                        }
+                        if (match) {
+                                if (sofia_glue_tech_choose_port(tech_pvt, 0) != SWITCH_STATUS_SUCCESS) {
+                                        goto done;
+                                }
+                                sofia_glue_set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
+                                
+                                if (sofia_glue_activate_rtp(tech_pvt, 0) != SWITCH_STATUS_SUCCESS) {
+                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "RTP Error!\n");
+                                        goto done;
+                                        switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+                                } else {
+                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Processing updated SDP\n");
+                                }
+                        } else {
+                                sofia_clear_flag_locked(tech_pvt, TFLAG_REINVITE);
+                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Codec Error!\n");
+                                goto done;
+
+                        }
+                }
+
</ins><span class="cx">                 if (r_sdp && sofia_test_flag(tech_pvt, TFLAG_NOSDP_REINVITE)) {
</span><span class="cx">                         sdp_parser_t *parser;
</span><span class="cx">                         sdp_session_t *sdp;
</span><span class="lines">@@ -3999,6 +4283,34 @@
</span><span class="cx">
</span><span class="cx"> /*---------------------------------------*/
</span><span class="cx">
</span><ins>+static switch_status_t xfer_hanguphook(switch_core_session_t *session)
+{
+        switch_channel_t *channel = switch_core_session_get_channel(session);
+        switch_channel_state_t state = switch_channel_get_state(channel);
+
+        if (state == CS_HANGUP) {
+                switch_core_session_t *ksession;
+                const char *uuid = switch_channel_get_variable(channel, "att_xfer_kill_uuid");
+                
+                if (uuid && (ksession = switch_core_session_force_locate(uuid))) {
+                        switch_channel_t *kchannel = switch_core_session_get_channel(ksession);
+                        
+                        switch_channel_clear_flag(kchannel, CF_XFER_ZOMBIE);
+                        switch_channel_clear_flag(kchannel, CF_TRANSFER);
+                        if (switch_channel_up(kchannel)) {
+                                switch_channel_hangup(kchannel, SWITCH_CAUSE_NORMAL_CLEARING);
+                        }
+
+                        switch_core_session_rwunlock(ksession);
+                }
+
+                switch_core_event_hook_remove_state_change(session, xfer_hanguphook);
+
+        }
+
+        return SWITCH_STATUS_SUCCESS;
+}
+
</ins><span class="cx"> void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, switch_core_session_t *session, sip_t const *sip, tagi_t tags[])
</span><span class="cx"> {
</span><span class="cx">         /* Incoming refer */
</span><span class="lines">@@ -4031,6 +4343,10 @@
</span><span class="cx">         home = su_home_new(sizeof(*home));
</span><span class="cx">         switch_assert(home != NULL);
</span><span class="cx">
</span><ins>+        nua_respond(nh, SIP_202_ACCEPTED,
+                                NUTAG_WITH_THIS(nua),
+                                SIPTAG_EXPIRES_STR("60"), TAG_END());
+
</ins><span class="cx">         if (sip->sip_referred_by) {
</span><span class="cx">                 full_ref_by = sip_header_as_string(home, (void *) sip->sip_referred_by);
</span><span class="cx">         }
</span><span class="lines">@@ -4095,10 +4411,79 @@
</span><span class="cx">
</span><span class="cx">                                                 br_a = switch_channel_get_variable(channel_a, SWITCH_SIGNAL_BOND_VARIABLE);
</span><span class="cx">                                                 br_b = switch_channel_get_variable(channel_b, SWITCH_SIGNAL_BOND_VARIABLE);
</span><ins>+                                                
+                                                if (!switch_ivr_uuid_exists(br_a)) {
+                                                        br_a = NULL;
+                                                }
</ins><span class="cx">
</span><del>-                                                if (br_a && br_b) {
-                                                        switch_core_session_t *new_b_session = NULL, *a_session = NULL, *tmp = NULL;
</del><ins>+                                                if (!switch_ivr_uuid_exists(br_b)) {
+                                                        br_b = NULL;
+                                                }
</ins><span class="cx">                                                 
</span><ins>+                                                if (switch_channel_test_flag(channel_b, CF_ORIGINATOR)) {
+                                                        switch_core_session_t *a_session;
+
+                                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE,
+                                                                                         "Attended Transfer on originating session %s\n", switch_core_session_get_uuid(b_session));
+                                                        
+
+                                                        
+                                                        switch_channel_set_variable(channel_b, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "ATTENDED_TRANSFER");
+                                                        
+                                                        
+                                                        sofia_clear_flag_locked(b_tech_pvt, TFLAG_SIP_HOLD);
+                                                        sofia_clear_flag_locked(tech_pvt, TFLAG_HOLD_LOCK);
+
+                                                        switch_channel_set_variable(channel_b, SWITCH_HOLDING_UUID_VARIABLE, br_a);
+                                                        switch_channel_set_flag(channel_b, CF_XFER_ZOMBIE);
+                                                        switch_channel_set_flag(channel_b, CF_TRANSFER);
+                                                        
+                                                        
+                                                        if ((a_session = switch_core_session_locate(br_a))) {
+                                                                const char *moh = profile->hold_music;
+                                                                switch_channel_t *a_channel = switch_core_session_get_channel(a_session);
+                                                                const char *tmp;
+
+                                                                switch_core_event_hook_add_state_change(a_session, xfer_hanguphook);
+                                                                switch_channel_set_variable(a_channel, "att_xfer_kill_uuid", switch_core_session_get_uuid(b_session));
+
+                                                                if ((tmp = switch_channel_get_variable(a_channel, SWITCH_HOLD_MUSIC_VARIABLE))) {
+                                                                        moh = tmp;
+                                                                }
+                                                                
+                                                                if (!strcasecmp(moh, "silence")) {
+                                                                        moh = NULL;
+                                                                }
+                                                                
+                                                                if (moh) {
+                                                                        char *xdest;
+                                                                        xdest = switch_core_session_sprintf(a_session, "endless_playback:%s,park", moh);
+                                                                        switch_ivr_session_transfer(a_session, xdest, "inline", NULL);
+                                                                } else {
+                                                                        switch_ivr_session_transfer(a_session, "park", "inline", NULL);
+                                                                }
+                                                                
+                                                                switch_core_session_rwunlock(a_session);
+
+                                                                nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
+                                                                                 NUTAG_SUBSTATE(nua_substate_terminated), SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK"), SIPTAG_EVENT_STR(etmp), TAG_END());
+
+                                                                if (b_tech_pvt) {
+                                                                        sofia_set_flag_locked(b_tech_pvt, TFLAG_BYE);
+                                                                        nua_bye(b_tech_pvt->nh,
+                                                                                        SIPTAG_REASON_STR("Q.850;cause=16;text=\"normal_clearing\""),
+                                                                                        TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+                                                                                        TAG_END());
+                                                                }
+                                                        } else {
+                                                                nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
+                                                                                 NUTAG_SUBSTATE(nua_substate_terminated),
+                                                                                 SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden"), SIPTAG_EVENT_STR(etmp), TAG_END());
+                                                        }
+
+                                                } else if (br_a && br_b) {
+                                                        switch_core_session_t *tmp = NULL;
+                                                        
</ins><span class="cx">                                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Attended Transfer [%s][%s]\n",
</span><span class="cx">                                                                                          switch_str_nil(br_a),
</span><span class="cx">                                                                                          switch_str_nil(br_b));
</span><span class="lines">@@ -4116,20 +4501,9 @@
</span><span class="cx">
</span><span class="cx">                                                         sofia_clear_flag_locked(b_tech_pvt, TFLAG_SIP_HOLD);
</span><span class="cx">                                                         sofia_clear_flag_locked(tech_pvt, TFLAG_HOLD_LOCK);
</span><del>-                                                        switch_channel_set_variable(switch_core_session_get_channel(b_session), "park_timeout", "2");
-                                                        switch_channel_set_state(switch_core_session_get_channel(b_session), CS_PARK);
-
-                                                        new_b_session = switch_core_session_locate(br_b);
-                                                        a_session = switch_core_session_locate(br_a);
-                                                        sofia_info_send_sipfrag(a_session, new_b_session);
-
-                                                        if (new_b_session) {
-                                                                switch_core_session_rwunlock(new_b_session);
-                                                        }
-
-                                                        if (a_session) {
-                                                                switch_core_session_rwunlock(a_session);
-                                                        }
</del><ins>+                                                        switch_channel_set_variable(channel_b, "park_timeout", "2");
+                                                        switch_channel_set_state(channel_b, CS_PARK);
+                                                        
</ins><span class="cx">                                                 } else {
</span><span class="cx">                                                         if (!br_a && !br_b) {
</span><span class="cx">                                                                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Cannot transfer channels that are not in a bridge.\n");
</span><span class="lines">@@ -4155,17 +4529,23 @@
</span><span class="cx">
</span><span class="cx">                                                                 if (t_session) {
</span><span class="cx">                                                                         switch_channel_t *t_channel = switch_core_session_get_channel(t_session);
</span><ins>+                                                                        const char *idest = switch_channel_get_variable(hup_channel, "inline_destination");
</ins><span class="cx">                                                                         ext = switch_channel_get_variable(hup_channel, "destination_number");
</span><span class="cx">
</span><del>-                                                                        if (!switch_strlen_zero(full_ref_by)) {
</del><ins>+                                                                        if (!zstr(full_ref_by)) {
</ins><span class="cx">                                                                                 switch_channel_set_variable(t_channel, SOFIA_SIP_HEADER_PREFIX "Referred-By", full_ref_by);
</span><span class="cx">                                                                         }
</span><span class="cx">
</span><del>-                                                                        if (!switch_strlen_zero(full_ref_to)) {
</del><ins>+                                                                        if (!zstr(full_ref_to)) {
</ins><span class="cx">                                                                                 switch_channel_set_variable(t_channel, SOFIA_REFER_TO_VARIABLE, full_ref_to);
</span><span class="cx">                                                                         }
</span><del>-
-                                                                        switch_ivr_session_transfer(t_session, ext, NULL, NULL);
</del><ins>+                                                                        
+                                                                        if (idest) {
+                                                                                switch_ivr_session_transfer(t_session, idest, "inline", NULL);
+                                                                        } else {
+                                                                                switch_ivr_session_transfer(t_session, ext, NULL, NULL);
+                                                                        }
+                                                                        
</ins><span class="cx">                                                                         nua_notify(tech_pvt->nh,
</span><span class="cx">                                                                                          NUTAG_NEWSUB(1),
</span><span class="cx">                                                                                          SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
</span><span class="lines">@@ -4200,7 +4580,7 @@
</span><span class="cx">                                                                 port = refer_to->r_url->url_port;
</span><span class="cx">                                                         }
</span><span class="cx">
</span><del>-                                                        if (switch_strlen_zero(port)) {
</del><ins>+                                                        if (zstr(port)) {
</ins><span class="cx">                                                                 port = "5060";
</span><span class="cx">                                                         }
</span><span class="cx">                                                         
</span><span class="lines">@@ -4240,11 +4620,11 @@
</span><span class="cx">
</span><span class="cx">                                                         switch_channel_set_variable(channel, SOFIA_REPLACES_HEADER, rep);
</span><span class="cx">
</span><del>-                                                        if (!switch_strlen_zero(full_ref_by)) {
</del><ins>+                                                        if (!zstr(full_ref_by)) {
</ins><span class="cx">                                                                 switch_channel_set_variable(channel, SOFIA_SIP_HEADER_PREFIX "Referred-By", full_ref_by);
</span><span class="cx">                                                         }
</span><span class="cx">
</span><del>-                                                        if (!switch_strlen_zero(full_ref_to)) {
</del><ins>+                                                        if (!zstr(full_ref_to)) {
</ins><span class="cx">                                                                 switch_channel_set_variable(channel, SOFIA_REFER_TO_VARIABLE, full_ref_to);
</span><span class="cx">                                                         }
</span><span class="cx">
</span><span class="lines">@@ -4287,10 +4667,10 @@
</span><span class="cx">                         if ((b_session = switch_core_session_locate(br))) {
</span><span class="cx">                                 switch_channel_t *b_channel = switch_core_session_get_channel(b_session);
</span><span class="cx">                                 switch_channel_set_variable(channel, "transfer_fallback_extension", from->a_user);
</span><del>-                                if (!switch_strlen_zero(full_ref_by)) {
</del><ins>+                                if (!zstr(full_ref_by)) {
</ins><span class="cx">                                         switch_channel_set_variable(b_channel, SOFIA_SIP_HEADER_PREFIX "Referred-By", full_ref_by);
</span><span class="cx">                                 }
</span><del>-                                if (!switch_strlen_zero(full_ref_to)) {
</del><ins>+                                if (!zstr(full_ref_to)) {
</ins><span class="cx">                                         switch_channel_set_variable(b_channel, SOFIA_REFER_TO_VARIABLE, full_ref_to);
</span><span class="cx">                                 }
</span><span class="cx">
</span><span class="lines">@@ -4375,6 +4755,8 @@
</span><span class="cx">                         } else if (!strncasecmp(sip->sip_content_type->c_type, "application", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "dtmf")) {
</span><span class="cx">                                 int tmp = atoi(sip->sip_payload->pl_data);
</span><span class="cx">                                 dtmf.digit = switch_rfc2833_to_char(tmp);
</span><ins>+                        } else if (!strncasecmp(sip->sip_content_type->c_type, "message", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "update_display")) {
+                                sofia_update_callee_id(session, profile, sip, SWITCH_TRUE);
</ins><span class="cx">                         } else {
</span><span class="cx">                                 goto end;
</span><span class="cx">                         }
</span><span class="lines">@@ -4409,7 +4791,7 @@
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 if ((clientcode_header = sofia_glue_get_unknown_header(sip, "x-clientcode"))) {
</span><del>-                        if (!switch_strlen_zero(clientcode_header)) {
</del><ins>+                        if (!zstr(clientcode_header)) {
</ins><span class="cx">                                 switch_channel_set_variable(channel, "call_clientcode", clientcode_header);
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Setting CMC to %s\n", clientcode_header);
</span><span class="cx">                                 nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), TAG_END());
</span><span class="lines">@@ -4418,17 +4800,20 @@
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 if ((rec_header = sofia_glue_get_unknown_header(sip, "record"))) {
</span><del>-                        if (switch_strlen_zero(profile->record_template)) {
</del><ins>+                        if (zstr(profile->record_template)) {
</ins><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Record attempted but no template defined.\n");
</span><span class="cx">                                 nua_respond(nh, 488, "Recording not enabled", NUTAG_WITH_THIS(nua), TAG_END());
</span><span class="cx">                         } else {
</span><span class="cx">                                 if (!strcasecmp(rec_header, "on")) {
</span><del>-                                        char *file;
</del><ins>+                                        char *file = NULL, *tmp = NULL;
</ins><span class="cx">
</span><del>-                                        file = switch_channel_expand_variables(channel, profile->record_template);
</del><ins>+                                        tmp = switch_mprintf("%s%s%s", profile->record_path ? profile->record_path : "${base_dir}/recordings",
+                                                                                 SWITCH_PATH_SEPARATOR, profile->record_template);
+                                        file = switch_channel_expand_variables(channel, tmp);
</ins><span class="cx">                                         switch_ivr_record_session(session, file, 0, NULL);
</span><span class="cx">                                         switch_channel_set_variable(channel, "sofia_record_file", file);
</span><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Recording %s to %s\n", switch_channel_get_name(channel), file);
</span><ins>+                                        switch_safe_free(tmp);
</ins><span class="cx">                                         nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), TAG_END());
</span><span class="cx">                                         if (file != profile->record_template) {
</span><span class="cx">                                                 free(file);
</span><span class="lines">@@ -4528,16 +4913,16 @@
</span><span class="cx">                 user = url->url_user;
</span><span class="cx">                 host = url->url_host;
</span><span class="cx">                 port = url->url_port;
</span><del>-                if (!switch_strlen_zero(url->url_params)) {
</del><ins>+                if (!zstr(url->url_params)) {
</ins><span class="cx">                         switch_channel_set_variable(channel, params_var, url->url_params);
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(user)) {
</del><ins>+        if (zstr(user)) {
</ins><span class="cx">                 user = "nobody";
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(host)) {
</del><ins>+        if (zstr(host)) {
</ins><span class="cx">                 host = "nowhere";
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -4596,6 +4981,7 @@
</span><span class="cx">         char *is_nat = NULL;
</span><span class="cx">         char acl_token[512] = "";
</span><span class="cx">         sofia_transport_t transport;
</span><ins>+        const char *gw_name = NULL;
</ins><span class="cx">
</span><span class="cx">         profile->ib_calls++;
</span><span class="cx">
</span><span class="lines">@@ -4643,7 +5029,7 @@
</span><span class="cx">                         contact_host = sip->sip_contact->m_url->url_host;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(contact_host)) {
</del><ins>+                if (!zstr(contact_host)) {
</ins><span class="cx">                         for (x = 0; x < profile->nat_acl_count; x++) {
</span><span class="cx">                                 last_acl = profile->nat_acl[x];
</span><span class="cx">                                 if (!(ok = switch_check_network_list_ip(contact_host, last_acl))) {
</span><span class="lines">@@ -4709,7 +5095,7 @@
</span><span class="cx">                                                                                  "found auth ip [%s] header of [%s]\n",
</span><span class="cx">                                                                                  un->un_name, un->un_value
</span><span class="cx">                                                                                  );
</span><del>-                                                if (!switch_strlen_zero(un->un_value)) {
</del><ins>+                                                if (!zstr(un->un_value)) {
</ins><span class="cx">                                                         for (x = 0; x < profile->acl_count; x++) {
</span><span class="cx">                                                                 last_acl = profile->acl[x];
</span><span class="cx">                                                                 if ((ok = switch_check_network_list_ip_token(un->un_value, last_acl, &token))) {
</span><span class="lines">@@ -4856,7 +5242,7 @@
</span><span class="cx">                 from_host = sip->sip_from->a_url->url_host;
</span><span class="cx">                 channel_name = url_set_chanvars(session, sip->sip_from->a_url, sip_from);
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(from_user)) {
</del><ins>+                if (!zstr(from_user)) {
</ins><span class="cx">                         if (*from_user == '+') {
</span><span class="cx">                                 switch_channel_set_variable(channel, "sip_from_user_stripped", (const char *) (from_user + 1));
</span><span class="cx">                         } else {
</span><span class="lines">@@ -4873,10 +5259,10 @@
</span><span class="cx">                 switch_channel_set_variable(channel, "sofia_profile_name", profile->name);
</span><span class="cx">                 switch_channel_set_variable(channel, "sofia_profile_domain_name", profile->domain_name);
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(sip->sip_from->a_display)) {
</del><ins>+                if (!zstr(sip->sip_from->a_display)) {
</ins><span class="cx">                         displayname = sip->sip_from->a_display;
</span><span class="cx">                 } else {
</span><del>-                        displayname = switch_strlen_zero(from_user) ? "unknown" : from_user;
</del><ins>+                        displayname = zstr(from_user) ? "unknown" : from_user;
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -4884,12 +5270,12 @@
</span><span class="cx">                 if (rpid->rpid_url && rpid->rpid_url->url_user) {
</span><span class="cx">                         char *full_rpid_header = sip_header_as_string(nh->nh_home, (void *) rpid);
</span><span class="cx">                         from_user = rpid->rpid_url->url_user;
</span><del>-                        if (!switch_strlen_zero(full_rpid_header)) {
</del><ins>+                        if (!zstr(full_rpid_header)) {
</ins><span class="cx">                                 switch_channel_set_variable(channel, "sip_Remote-Party-ID", full_rpid_header);
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                 }
</span><del>-                if (!switch_strlen_zero(rpid->rpid_display)) {
</del><ins>+                if (!zstr(rpid->rpid_display)) {
</ins><span class="cx">                         displayname = rpid->rpid_display;
</span><span class="cx">                 }
</span><span class="cx">                 switch_channel_set_variable(channel, "sip_cid_type", "rpid");
</span><span class="lines">@@ -4899,11 +5285,11 @@
</span><span class="cx">                 if (passerted->paid_url && passerted->paid_url->url_user) {
</span><span class="cx">                         char *full_paid_header = sip_header_as_string(nh->nh_home, (void *) passerted);
</span><span class="cx">                         from_user = passerted->paid_url->url_user;
</span><del>-                        if (!switch_strlen_zero(full_paid_header)) {
</del><ins>+                        if (!zstr(full_paid_header)) {
</ins><span class="cx">                                 switch_channel_set_variable(channel, "sip_P-Asserted-Identity", from_user);
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-                if (!switch_strlen_zero(passerted->paid_display)) {
</del><ins>+                if (!zstr(passerted->paid_display)) {
</ins><span class="cx">                         displayname = passerted->paid_display;
</span><span class="cx">                 }
</span><span class="cx">                 switch_channel_set_variable(channel, "sip_cid_type", "pid");
</span><span class="lines">@@ -4913,12 +5299,12 @@
</span><span class="cx">                 if (ppreferred->ppid_url && ppreferred->ppid_url->url_user) {
</span><span class="cx">                         char *full_ppid_header = sip_header_as_string(nh->nh_home, (void *) ppreferred);
</span><span class="cx">                         from_user = ppreferred->ppid_url->url_user;
</span><del>-                        if (!switch_strlen_zero(full_ppid_header)) {
</del><ins>+                        if (!zstr(full_ppid_header)) {
</ins><span class="cx">                                 switch_channel_set_variable(channel, "sip_P-Preferred-Identity", full_ppid_header);
</span><span class="cx">                         }
</span><span class="cx">                         
</span><span class="cx">                 }
</span><del>-                if (!switch_strlen_zero(ppreferred->ppid_display)) {
</del><ins>+                if (!zstr(ppreferred->ppid_display)) {
</ins><span class="cx">                         displayname = ppreferred->ppid_display;
</span><span class="cx">                 }
</span><span class="cx">                 switch_channel_set_variable(channel, "sip_cid_type", "pid");
</span><span class="lines">@@ -5063,7 +5449,7 @@
</span><span class="cx">
</span><span class="cx">                 check_decode(referred_by_user, session);
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(referred_by_user)) {
</del><ins>+                if (!zstr(referred_by_user)) {
</ins><span class="cx">                         if (*referred_by_user == '+') {
</span><span class="cx">                                 switch_channel_set_variable(channel, "sip_referred_by_user_stripped", (const char *) (referred_by_user + 1));
</span><span class="cx">                         } else {
</span><span class="lines">@@ -5100,7 +5486,7 @@
</span><span class="cx">                 switch_channel_set_variable(channel, "sip_subject", sip->sip_subject->g_string);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (sip->sip_user_agent && !switch_strlen_zero(sip->sip_user_agent->g_string)) {
</del><ins>+        if (sip->sip_user_agent && !zstr(sip->sip_user_agent->g_string)) {
</ins><span class="cx">                 switch_channel_set_variable(channel, "sip_user_agent", sip->sip_user_agent->g_string);
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -5163,16 +5549,29 @@
</span><span class="cx">                 free(tmp);
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        
+        if (sip->sip_request->rq_url->url_params) {
+                gw_name = sofia_glue_find_parameter(sip->sip_request->rq_url->url_params, "gw=");
+        }
</ins><span class="cx">
</span><span class="cx">         if (strstr(destination_number, "gw+")) {
</span><del>-                const char *gw_name = destination_number + 3;
</del><ins>+                gw_name = destination_number + 3;
+        }
+
+        if (gw_name) {
</ins><span class="cx">                 sofia_gateway_t *gateway;
</span><span class="cx">                 if (gw_name && (gateway = sofia_reg_find_gateway(gw_name))) {
</span><span class="cx">                         context = switch_core_session_strdup(session, gateway->register_context);
</span><span class="cx">                         switch_channel_set_variable(channel, "sip_gateway", gateway->name);
</span><span class="cx">
</span><span class="cx">                         if (gateway->extension) {
</span><del>-                                destination_number = switch_core_session_strdup(session, gateway->extension);
</del><ins>+                                if (!strcasecmp(gateway->extension, "auto_to_user")) {
+                                        destination_number = sip->sip_to->a_url->url_user;
+                                } else {
+                                        destination_number = switch_core_session_strdup(session, gateway->extension);
+                                }
+                        } else {
+                                destination_number = sip->sip_to->a_url->url_user;
</ins><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         gateway->ib_calls++;
</span><span class="lines">@@ -5294,7 +5693,7 @@
</span><span class="cx">
</span><span class="cx">                 if ((privacy = sip_privacy(sip))) {
</span><span class="cx">                         char *full_priv_header = sip_header_as_string(nh->nh_home, (void *) privacy);
</span><del>-                        if (!switch_strlen_zero(full_priv_header)) {
</del><ins>+                        if (!zstr(full_priv_header)) {
</ins><span class="cx">                                 switch_channel_set_variable(channel, "sip_Privacy", full_priv_header);
</span><span class="cx">                         }
</span><span class="cx">                         if (msg_params_find(privacy->priv_values, "id")) {
</span><span class="lines">@@ -5307,7 +5706,7 @@
</span><span class="cx">                         if (!strncasecmp(un->un_name, "Diversion", 9)) {
</span><span class="cx">                                 /* Basic Diversion Support for Diversion Indication in SIP */
</span><span class="cx">                                 /* draft-levy-sip-diversion-08 */
</span><del>-                                if (!switch_strlen_zero(un->un_value)) {
</del><ins>+                                if (!zstr(un->un_value)) {
</ins><span class="cx">                                         char *tmp_name;
</span><span class="cx">                                         if ((tmp_name = switch_mprintf("%s%s", SOFIA_SIP_HEADER_PREFIX, un->un_name))) {
</span><span class="cx">                                                 switch_channel_set_variable(channel, tmp_name, un->un_value);
</span><span class="lines">@@ -5316,8 +5715,10 @@
</span><span class="cx">                                 }
</span><span class="cx">                         } else if (!strncasecmp(un->un_name, "History-Info", 12)) {
</span><span class="cx">                                 switch_channel_set_variable(channel, "sip_history_info", un->un_value);
</span><ins>+                        } else if (!strcasecmp(un->un_name, "X-FS-Support")) {
+                                tech_pvt->x_freeswitch_support_remote = switch_core_session_strdup(session, un->un_value);
</ins><span class="cx">                         } else if (!strncasecmp(un->un_name, "X-", 2) || !strncasecmp(un->un_name, "P-", 2)) {
</span><del>-                                if (!switch_strlen_zero(un->un_value)) {
</del><ins>+                                if (!zstr(un->un_value)) {
</ins><span class="cx">                                         char new_name[512] = "";
</span><span class="cx">                                         int reps = 0;
</span><span class="cx">                                         for(;;) {
</span><span class="lines">@@ -5454,7 +5855,7 @@
</span><span class="cx">         nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), TAG_END());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void sofia_info_send_sipfrag(switch_core_session_t *aleg, switch_core_session_t *bleg)
</del><ins>+void sofia_info_send_sipfrag(switch_core_session_t *aleg, switch_core_session_t *bleg)
</ins><span class="cx"> {
</span><span class="cx">         private_object_t *b_tech_pvt = NULL, *a_tech_pvt = NULL;
</span><span class="cx">         char message[256] = "";
</span><span class="lines">@@ -5470,22 +5871,27 @@
</span><span class="cx">                         switch_caller_profile_t *acp = a_tech_pvt->caller_profile;
</span><span class="cx">                         
</span><span class="cx">                         if (ua && switch_stristr("snom", ua)) {
</span><del>-                                if (switch_strlen_zero(acp->caller_id_name)) {
</del><ins>+                                if (zstr(acp->caller_id_name)) {
</ins><span class="cx">                                         snprintf(message, sizeof(message), "From:\r\nTo: %s\r\n", acp->caller_id_number);
</span><span class="cx">                                 } else {
</span><span class="cx">                                         snprintf(message, sizeof(message), "From:\r\nTo: \"%s\" %s\r\n", acp->caller_id_name, acp->caller_id_number);
</span><span class="cx">                                 }
</span><del>-                                nua_info(b_tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"), SIPTAG_PAYLOAD_STR(message), TAG_END());
</del><ins>+                                nua_info(b_tech_pvt->nh,
+                                                 SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
+                                                 TAG_IF(!zstr(b_tech_pvt->user_via), SIPTAG_VIA_STR(b_tech_pvt->user_via)),
+                                                 SIPTAG_PAYLOAD_STR(message), TAG_END());
</ins><span class="cx">                         } else if (ua && switch_stristr("polycom", ua)) {
</span><del>-                                if (switch_strlen_zero(acp->caller_id_name)) {
</del><ins>+                                if (zstr(acp->caller_id_name)) {
</ins><span class="cx">                                         snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <%s>", acp->caller_id_number, acp->caller_id_number);
</span><span class="cx">                                 } else {
</span><span class="cx">                                         snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <%s>", acp->caller_id_name, acp->caller_id_number);
</span><span class="cx">                                 }
</span><span class="cx">                                 nua_update(b_tech_pvt->nh,
</span><del>-                                                 TAG_IF(!switch_strlen_zero_buf(message), SIPTAG_HEADER_STR(message)),
</del><ins>+                                                 TAG_IF(!zstr_buf(message), SIPTAG_HEADER_STR(message)),
+                                                 TAG_IF(!zstr(b_tech_pvt->user_via), SIPTAG_VIA_STR(b_tech_pvt->user_via)),
</ins><span class="cx">                                                  TAG_END());
</span><span class="cx">                         }
</span><ins>+
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_sofiasofia_gluec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/sofia_glue.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/sofia_glue.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/sofia_glue.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -178,7 +178,7 @@
</span><span class="cx">                                         tech_pvt->owner_id, tech_pvt->session_id, family, ip, username, family, ip,
</span><span class="cx">                                         srbuf,
</span><span class="cx">                                         port,
</span><del>-                                        (!switch_strlen_zero(tech_pvt->local_crypto_key)
</del><ins>+                                        (!zstr(tech_pvt->local_crypto_key)
</ins><span class="cx">                                         && sofia_test_flag(tech_pvt,TFLAG_SECURE)) ? "S" : "");
</span><span class="cx">
</span><span class="cx">         if (tech_pvt->rm_encoding) {
</span><span class="lines">@@ -276,7 +276,7 @@
</span><span class="cx">                 switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=%s\n", sr);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(tech_pvt->local_crypto_key) && sofia_test_flag(tech_pvt, TFLAG_SECURE)) {
</del><ins>+        if (!zstr(tech_pvt->local_crypto_key) && sofia_test_flag(tech_pvt, TFLAG_SECURE)) {
</ins><span class="cx">                 switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=crypto:%s\n", tech_pvt->local_crypto_key);
</span><span class="cx">                 //switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=encryption:optional\n");
</span><span class="cx"> #if 0
</span><span class="lines">@@ -444,6 +444,7 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+
</ins><span class="cx">         if (codec_string) {
</span><span class="cx">                 char *tmp_codec_string;
</span><span class="cx">                 if ((tmp_codec_string = switch_core_session_strdup(tech_pvt->session, codec_string))) {
</span><span class="lines">@@ -495,6 +496,8 @@
</span><span class="cx">                 tech_pvt->flags[x] = profile->flags[x];
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        tech_pvt->x_freeswitch_support_local = FREESWITCH_SUPPORT;
+
</ins><span class="cx">         tech_pvt->profile = profile;
</span><span class="cx">         profile->inuse++;
</span><span class="cx">         switch_mutex_unlock(profile->flag_mutex);
</span><span class="lines">@@ -518,6 +521,10 @@
</span><span class="cx">
</span><span class="cx">         tech_pvt->session = session;
</span><span class="cx">         tech_pvt->channel = switch_core_session_get_channel(session);
</span><ins>+        switch_channel_set_cap(tech_pvt->channel, CC_MEDIA_ACK);
+        switch_channel_set_cap(tech_pvt->channel, CC_BYPASS_MEDIA);
+        switch_channel_set_cap(tech_pvt->channel, CC_PROXY_MEDIA);
+        
</ins><span class="cx">         switch_core_session_set_private(session, tech_pvt);
</span><span class="cx">
</span><span class="cx">         switch_snprintf(name, sizeof(name), "sofia/%s/%s", profile->name, channame);
</span><span class="lines">@@ -564,7 +571,7 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(stun_ip)) {
</del><ins>+                if (zstr(stun_ip)) {
</ins><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "STUN Failed! NO STUN SERVER\n");
</span><span class="cx">                         goto out;
</span><span class="cx">                 }
</span><span class="lines">@@ -625,7 +632,7 @@
</span><span class="cx">         sip_unknown_t *un;
</span><span class="cx">         for (un = sip->sip_unknown; un; un = un->un_next) {
</span><span class="cx">                 if (!strcasecmp(un->un_name, name)) {
</span><del>-                        if (!switch_strlen_zero(un->un_value)) {
</del><ins>+                        if (!zstr(un->un_value)) {
</ins><span class="cx">                                 return un->un_value;
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="lines">@@ -663,7 +670,7 @@
</span><span class="cx">         sdp_port = tech_pvt->local_sdp_audio_port;
</span><span class="cx">
</span><span class="cx">         if (!(use_ip = switch_channel_get_variable(tech_pvt->channel, "rtp_adv_audio_ip"))
</span><del>-                && !switch_strlen_zero(tech_pvt->profile->extrtpip)) {
</del><ins>+                && !zstr(tech_pvt->profile->extrtpip)) {
</ins><span class="cx">                         use_ip = tech_pvt->profile->extrtpip;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -731,7 +738,7 @@
</span><span class="cx">         sdp_port = tech_pvt->local_sdp_video_port;
</span><span class="cx">
</span><span class="cx">         if (!(use_ip = switch_channel_get_variable(tech_pvt->channel, "rtp_adv_video_ip"))
</span><del>-                && !switch_strlen_zero(tech_pvt->profile->extrtpip)) {
</del><ins>+                && !zstr(tech_pvt->profile->extrtpip)) {
</ins><span class="cx">                         use_ip = tech_pvt->profile->extrtpip;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -998,7 +1005,7 @@
</span><span class="cx">         int x;
</span><span class="cx">         const char *val;
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(tech_pvt->remote_sdp_str)) {
</del><ins>+        if (zstr(tech_pvt->remote_sdp_str)) {
</ins><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1130,7 +1137,7 @@
</span><span class="cx">         char *new_sdp;
</span><span class="cx">         int bad = 0;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(tech_pvt->local_sdp_str)) {
</del><ins>+        if (zstr(tech_pvt->local_sdp_str)) {
</ins><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1141,7 +1148,7 @@
</span><span class="cx">          return;
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(tech_pvt->adv_sdp_audio_ip) || !tech_pvt->adv_sdp_audio_port) {
</del><ins>+        if (zstr(tech_pvt->adv_sdp_audio_ip) || !tech_pvt->adv_sdp_audio_port) {
</ins><span class="cx">          if (sofia_glue_tech_choose_port(tech_pvt, 1) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "%s I/O Error\n", switch_channel_get_name(tech_pvt->channel));
</span><span class="cx">                         return;
</span><span class="lines">@@ -1353,7 +1360,7 @@
</span><span class="cx"> switch_channel_variable_last(channel);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (!switch_strlen_zero((char*)stream.data)) {
</del><ins>+ if (!zstr((char*)stream.data)) {
</ins><span class="cx"> extra_headers = stream.data;
</span><span class="cx"> } else {
</span><span class="cx">                 switch_safe_free(stream.data);
</span><span class="lines">@@ -1373,7 +1380,7 @@
</span><span class="cx">
</span><span class="cx">         for (un = sip->sip_unknown; un; un = un->un_next) {
</span><span class="cx">                 if (!strncasecmp(un->un_name, "X-", 2) || !strncasecmp(un->un_name, "P-", 2)) {
</span><del>-                        if (!switch_strlen_zero(un->un_value)) {
</del><ins>+                        if (!zstr(un->un_value)) {
</ins><span class="cx">                                 switch_snprintf(name, sizeof(name), "%s%s", prefix, un->un_name);
</span><span class="cx">                                 switch_channel_set_variable(channel, name, un->un_value);
</span><span class="cx">                         }
</span><span class="lines">@@ -1441,7 +1448,7 @@
</span><span class="cx">                                                                                 format,
</span><span class="cx">                                                                                 cid_name,
</span><span class="cx">                                                                                 cid_num,
</span><del>-                                                                                !switch_strlen_zero(cid_num) ? "@" : "",
</del><ins>+                                                                                !zstr(cid_num) ? "@" : "",
</ins><span class="cx">                                                                                 sipip);
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1475,7 +1482,7 @@
</span><span class="cx">                 const char *from_var = switch_channel_get_variable(tech_pvt->channel, "sip_from_uri");
</span><span class="cx">                 const char *from_display = switch_channel_get_variable(tech_pvt->channel, "sip_from_display");
</span><span class="cx">                 
</span><del>-                if (switch_strlen_zero(tech_pvt->dest)) {
</del><ins>+                if (zstr(tech_pvt->dest)) {
</ins><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "URL Error!\n");
</span><span class="cx">                         return SWITCH_STATUS_FALSE;
</span><span class="cx">                 }
</span><span class="lines">@@ -1494,15 +1501,15 @@
</span><span class="cx">                         } else {
</span><span class="cx">                                 use_from_str = switch_core_session_sprintf(tech_pvt->session, "sip:%s", from_var);
</span><span class="cx">                         }
</span><del>-                } else if (!switch_strlen_zero(tech_pvt->gateway_from_str)) {
</del><ins>+                } else if (!zstr(tech_pvt->gateway_from_str)) {
</ins><span class="cx">                         use_from_str = tech_pvt->gateway_from_str;
</span><span class="cx">                 } else {
</span><span class="cx">                         use_from_str = tech_pvt->from_str;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(tech_pvt->gateway_from_str)) {
</del><ins>+                if (!zstr(tech_pvt->gateway_from_str)) {
</ins><span class="cx">                         rpid_domain = switch_core_session_strdup(session, tech_pvt->gateway_from_str);
</span><del>-                } else if (!switch_strlen_zero(tech_pvt->from_str)) {
</del><ins>+                } else if (!zstr(tech_pvt->from_str)) {
</ins><span class="cx">                         rpid_domain = switch_core_session_strdup(session, tech_pvt->from_str);
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -1522,7 +1529,7 @@
</span><span class="cx">                  * Ignore transport chanvar and uri parameter for gateway connections
</span><span class="cx">                  * since all of them have been already taken care of in mod_sofia.c:sofia_outgoing_channel()
</span><span class="cx">                  */
</span><del>-                if (tech_pvt->transport == SOFIA_TRANSPORT_UNKNOWN && switch_strlen_zero(tech_pvt->gateway_name)) {
</del><ins>+                if (tech_pvt->transport == SOFIA_TRANSPORT_UNKNOWN && zstr(tech_pvt->gateway_name)) {
</ins><span class="cx">                         if ((p = (char *) switch_stristr("port=", url))) {
</span><span class="cx">                                 p += 5;
</span><span class="cx">                                 tech_pvt->transport = sofia_glue_str2transport(p);
</span><span class="lines">@@ -1546,7 +1553,7 @@
</span><span class="cx">                         return SWITCH_STATUS_FALSE;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(tech_pvt->invite_contact)) {
</del><ins>+                if (zstr(tech_pvt->invite_contact)) {
</ins><span class="cx">                         const char * contact;
</span><span class="cx">                         if ((contact = switch_channel_get_variable(channel, "sip_contact_user"))) {
</span><span class="cx">                                 char *ip_addr;
</span><span class="lines">@@ -1733,7 +1740,7 @@
</span><span class="cx">                 sofia_glue_tech_patch_sdp(tech_pvt);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(tech_pvt->dest)) {
</del><ins>+        if (!zstr(tech_pvt->dest)) {
</ins><span class="cx">                 dst = sofia_glue_get_destination(tech_pvt->dest);
</span><span class="cx">
</span><span class="cx">                 if (dst->route_uri) {
</span><span class="lines">@@ -1759,16 +1766,17 @@
</span><span class="cx">                          NUTAG_AUTOANSWER(0),
</span><span class="cx">                          NUTAG_SESSION_TIMER(session_timeout),
</span><span class="cx">                          TAG_IF(tech_pvt->redirected, NUTAG_URL(tech_pvt->redirected)),
</span><del>-                         TAG_IF(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
-                         TAG_IF(!switch_strlen_zero(tech_pvt->rpid), SIPTAG_REMOTE_PARTY_ID_STR(tech_pvt->rpid)),
-                         TAG_IF(!switch_strlen_zero(tech_pvt->preferred_id), SIPTAG_P_PREFERRED_IDENTITY_STR(tech_pvt->preferred_id)),
-                         TAG_IF(!switch_strlen_zero(tech_pvt->asserted_id), SIPTAG_P_ASSERTED_IDENTITY_STR(tech_pvt->asserted_id)),
-                         TAG_IF(!switch_strlen_zero(tech_pvt->privacy), SIPTAG_PRIVACY_STR(tech_pvt->privacy)),
-                         TAG_IF(!switch_strlen_zero(alert_info), SIPTAG_HEADER_STR(alert_info)),
-                         TAG_IF(!switch_strlen_zero(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
-                         TAG_IF(!switch_strlen_zero(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)),
-                         TAG_IF(!switch_strlen_zero(route_uri), NUTAG_PROXY(route_uri)),
-                         TAG_IF(!switch_strlen_zero(route), SIPTAG_ROUTE_STR(route)),
</del><ins>+                         TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
+                         TAG_IF(!zstr(tech_pvt->rpid), SIPTAG_REMOTE_PARTY_ID_STR(tech_pvt->rpid)),
+                         TAG_IF(!zstr(tech_pvt->preferred_id), SIPTAG_P_PREFERRED_IDENTITY_STR(tech_pvt->preferred_id)),
+                         TAG_IF(!zstr(tech_pvt->asserted_id), SIPTAG_P_ASSERTED_IDENTITY_STR(tech_pvt->asserted_id)),
+                         TAG_IF(!zstr(tech_pvt->privacy), SIPTAG_PRIVACY_STR(tech_pvt->privacy)),
+                         TAG_IF(!zstr(alert_info), SIPTAG_HEADER_STR(alert_info)),
+                         TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
+                         TAG_IF(sofia_test_pflag(tech_pvt->profile, PFLAG_PASS_CALLEE_ID), SIPTAG_HEADER_STR("X-FS-Support: "FREESWITCH_SUPPORT)),
+                         TAG_IF(!zstr(max_forwards), SIPTAG_MAX_FORWARDS_STR(max_forwards)),
+                         TAG_IF(!zstr(route_uri), NUTAG_PROXY(route_uri)),
+                         TAG_IF(!zstr(route), SIPTAG_ROUTE_STR(route)),
</ins><span class="cx">                          SOATAG_ADDRESS(tech_pvt->adv_sdp_audio_ip),
</span><span class="cx">                          SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
</span><span class="cx">                          SOATAG_REUSE_REJECTED(1),
</span><span class="lines">@@ -1820,7 +1828,7 @@
</span><span class="cx">
</span><span class="cx">                 nua_invite(tech_pvt->nh2,
</span><span class="cx">                                  SIPTAG_CONTACT_STR(contact_url),
</span><del>-                                 TAG_IF(!switch_strlen_zero(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
</del><ins>+                                 TAG_IF(!zstr(tech_pvt->user_via), SIPTAG_VIA_STR(tech_pvt->user_via)),
</ins><span class="cx">                                  SOATAG_ADDRESS(tech_pvt->adv_sdp_audio_ip),
</span><span class="cx">                                  SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
</span><span class="cx">                                  SOATAG_REUSE_REJECTED(1),
</span><span class="lines">@@ -2313,7 +2321,7 @@
</span><span class="cx">                 //const char *port = switch_channel_get_variable(tech_pvt->channel, SWITCH_LOCAL_MEDIA_PORT_VARIABLE);
</span><span class="cx">                 char *remote_host = switch_rtp_get_remote_host(tech_pvt->rtp_session);
</span><span class="cx">                 switch_port_t remote_port = switch_rtp_get_remote_port(tech_pvt->rtp_session);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 if (remote_host && remote_port && !strcmp(remote_host, tech_pvt->remote_sdp_audio_ip) && remote_port == tech_pvt->remote_sdp_audio_port) {
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_DEBUG, "Audio params are unchanged for %s.\n", switch_channel_get_name(tech_pvt->channel));
</span><span class="cx">                         goto video;
</span><span class="lines">@@ -2598,7 +2606,7 @@
</span><span class="cx">         char *codec_order[SWITCH_MAX_CODECS];
</span><span class="cx">         const switch_codec_implementation_t *codecs[SWITCH_MAX_CODECS] = { 0 };
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(codec_string)) {
</del><ins>+        if (!zstr(codec_string)) {
</ins><span class="cx">                 char *tmp_codec_string;
</span><span class="cx">                 if ((tmp_codec_string = strdup(codec_string))) {
</span><span class="cx">                         num_codecs = switch_separate_string(tmp_codec_string, ',', codec_order, SWITCH_MAX_CODECS);
</span><span class="lines">@@ -2614,7 +2622,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         for (attr = sdp->sdp_attributes; attr; attr = attr->a_next) {
</span><del>-                if (switch_strlen_zero(attr->a_name)) {
</del><ins>+                if (zstr(attr->a_name)) {
</ins><span class="cx">                         continue;
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -2630,7 +2638,7 @@
</span><span class="cx">                         switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ",t38");
</span><span class="cx">                 } else if (m->m_type == sdp_media_audio && m->m_port) {
</span><span class="cx">                         for (attr = m->m_attributes; attr; attr = attr->a_next) {
</span><del>-                                if (switch_strlen_zero(attr->a_name)) {
</del><ins>+                                if (zstr(attr->a_name)) {
</ins><span class="cx">                                         continue;
</span><span class="cx">                                 }
</span><span class="cx">                                 if (!strcasecmp(attr->a_name, "ptime") && attr->a_value) {
</span><span class="lines">@@ -2736,7 +2744,7 @@
</span><span class="cx">         switch_assert(tech_pvt != NULL);
</span><span class="cx">         switch_assert(r_sdp != NULL);
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(r_sdp)) {
</del><ins>+        if (zstr(r_sdp)) {
</ins><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -2895,7 +2903,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         for (attr = sdp->sdp_attributes; attr; attr = attr->a_next) {
</span><del>-                if (switch_strlen_zero(attr->a_name)) {
</del><ins>+                if (zstr(attr->a_name)) {
</ins><span class="cx">                         continue;
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -2962,13 +2970,12 @@
</span><span class="cx">
</span><span class="cx">                 } else if (m->m_type == sdp_media_audio && m->m_port && !got_audio) {
</span><span class="cx">                         sdp_rtpmap_t *map;
</span><del>-
</del><span class="cx">                         for (attr = m->m_attributes; attr; attr = attr->a_next) {
</span><span class="cx">                                 if (!strcasecmp(attr->a_name, "ptime") && attr->a_value) {
</span><span class="cx">                                         ptime = atoi(attr->a_value);
</span><span class="cx">                                 } else if (!strcasecmp(attr->a_name, "maxptime") && attr->a_value) {
</span><span class="cx">                                         maxptime = atoi(attr->a_value);
</span><del>-                                } else if (!got_crypto && !strcasecmp(attr->a_name, "crypto") && !switch_strlen_zero(attr->a_value)) {
</del><ins>+                                } else if (!got_crypto && !strcasecmp(attr->a_name, "crypto") && !zstr(attr->a_value)) {
</ins><span class="cx">                                         int crypto_tag;
</span><span class="cx">
</span><span class="cx">                                         if (m->m_proto != sdp_proto_srtp) {
</span><span class="lines">@@ -3023,7 +3030,7 @@
</span><span class="cx">                                                 tech_pvt->crypto_tag = crypto_tag;
</span><span class="cx">                                                 got_crypto++;
</span><span class="cx">
</span><del>-                                                if (switch_strlen_zero(tech_pvt->local_crypto_key)) {
</del><ins>+                                                if (zstr(tech_pvt->local_crypto_key)) {
</ins><span class="cx">                                                         if (switch_stristr(SWITCH_RTP_CRYPTO_KEY_32, crypto)) {
</span><span class="cx">                                                                 switch_channel_set_variable(tech_pvt->channel, SOFIA_HAS_CRYPTO_VARIABLE, SWITCH_RTP_CRYPTO_KEY_32);
</span><span class="cx">                                                                 sofia_glue_build_crypto(tech_pvt, atoi(crypto), AES_CM_128_HMAC_SHA1_32, SWITCH_RTP_CRYPTO_SEND);
</span><span class="lines">@@ -3057,26 +3064,43 @@
</span><span class="cx">                  greed:
</span><span class="cx">                         x = 0;
</span><span class="cx">
</span><del>-                        if (tech_pvt->rm_encoding) {
</del><ins>+                        if (tech_pvt->rm_encoding) {// && !sofia_test_flag(tech_pvt, TFLAG_REINVITE)) {
+                                char *remote_host = tech_pvt->remote_sdp_audio_ip;
+                                switch_port_t remote_port = tech_pvt->remote_sdp_audio_port;
+                                int same = 0;
+
+                                if (switch_rtp_ready(tech_pvt->rtp_session)) {
+                                        remote_host = switch_rtp_get_remote_host(tech_pvt->rtp_session);
+                                        remote_port = switch_rtp_get_remote_port(tech_pvt->rtp_session);
+                                }
+                                
</ins><span class="cx">                                 for (map = m->m_rtpmaps; map; map = map->rm_next) {
</span><del>-                                        if (map->rm_pt < 96) {
</del><ins>+                                        if (zstr(map->rm_encoding) && map->rm_pt < 96) {
</ins><span class="cx">                                                 match = (map->rm_pt == tech_pvt->pt) ? 1 : 0;
</span><span class="cx">                                         } else {
</span><span class="cx">                                                 match = strcasecmp(switch_str_nil(map->rm_encoding), tech_pvt->iananame) ? 0 : 1;
</span><span class="cx">                                         }
</span><span class="cx">
</span><del>-                                        if (match && connection->c_address && tech_pvt->remote_sdp_audio_ip &&
-                                                !strcmp(connection->c_address, tech_pvt->remote_sdp_audio_ip) && m->m_port == tech_pvt->remote_sdp_audio_port) {
-                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Our existing sdp is still good [%s %s:%d], let's keep it.\n",
-                                                                                 tech_pvt->rm_encoding, tech_pvt->remote_sdp_audio_ip, tech_pvt->remote_sdp_audio_port);
-                                                got_audio = 1;
</del><ins>+                                        if (match && connection->c_address && remote_host &&
+                                                !strcmp(connection->c_address, remote_host) && m->m_port == remote_port) {
+                                                same = 1;
+                                        } else {
+                                                same = 0;
</ins><span class="cx">                                                 break;
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><ins>+
+                                if (same) {
+                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG,
+                                                                         "Our existing sdp is still good [%s %s:%d], let's keep it.\n",
+                                                                         tech_pvt->rm_encoding, tech_pvt->remote_sdp_audio_ip, tech_pvt->remote_sdp_audio_port);
+                                        got_audio = 1;
+                                } else {
+                                        match = 0;
+                                        got_audio = 0;
+                                }
</ins><span class="cx">                         }
</span><del>-
-
-
</del><ins>+                        
</ins><span class="cx">                         for (map = m->m_rtpmaps; map; map = map->rm_next) {
</span><span class="cx">                                 int32_t i;
</span><span class="cx">                                 uint32_t near_rate = 0;
</span><span class="lines">@@ -3136,7 +3160,7 @@
</span><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Audio Codec Compare [%s:%d:%u:%d]/[%s:%d:%u:%d]\n",
</span><span class="cx">                                                                          rm_encoding, map->rm_pt, (int) map->rm_rate, ptime,
</span><span class="cx">                                                                          imp->iananame, imp->ianacode, codec_rate, imp->microseconds_per_packet / 1000);
</span><del>-                                        if (map->rm_pt < 96) {
</del><ins>+                                        if (zstr(map->rm_encoding) && map->rm_pt < 96) {
</ins><span class="cx">                                                 match = (map->rm_pt == imp->ianacode) ? 1 : 0;
</span><span class="cx">                                         } else {
</span><span class="cx">                                                 match = strcasecmp(rm_encoding, imp->iananame) ? 0 : 1;
</span><span class="lines">@@ -3202,7 +3226,7 @@
</span><span class="cx">                                         tech_pvt->iananame = switch_core_session_strdup(session, (char *) mimp->iananame);
</span><span class="cx">                                         tech_pvt->pt = (switch_payload_t) map->rm_pt;
</span><span class="cx">                                         tech_pvt->rm_rate = map->rm_rate;
</span><del>-                                        if (!strcasecmp((char *) mimp->iananame, "ilbc") && switch_strlen_zero((char*)map->rm_fmtp)) {
</del><ins>+                                        if (!strcasecmp((char *) mimp->iananame, "ilbc") && zstr((char*)map->rm_fmtp)) {
</ins><span class="cx">                                                 /* default to 30 when no mode is defined for ilbc ONLY */
</span><span class="cx">                                                 tech_pvt->codec_ms = 30;
</span><span class="cx">                                         } else {
</span><span class="lines">@@ -3597,7 +3621,9 @@
</span><span class="cx">                 " network_ip VARCHAR(255),\n"
</span><span class="cx">                 " network_port VARCHAR(6),\n"
</span><span class="cx">                 " sip_username VARCHAR(255),\n"
</span><del>-                " sip_realm VARCHAR(255)\n"
</del><ins>+                " sip_realm VARCHAR(255),\n"
+                " mwi_user VARCHAR(255),\n"
+                " mwi_host VARCHAR(255)\n"
</ins><span class="cx">                 ");\n";
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -3659,7 +3685,8 @@
</span><span class="cx">                 " nonce VARCHAR(255),\n"
</span><span class="cx">                 " expires INTEGER,"
</span><span class="cx">                 " profile_name VARCHAR(255),\n"
</span><del>-                " hostname VARCHAR(255)\n"
</del><ins>+                " hostname VARCHAR(255),\n"
+                " last_nc INTEGER\n"
</ins><span class="cx">                 ");\n";
</span><span class="cx">
</span><span class="cx">         /* should we move this glue to sofia_sla or keep it here where all db init happens? XXX MTK */
</span><span class="lines">@@ -3740,7 +3767,7 @@
</span><span class="cx">                 
</span><span class="cx">                 test_sql = switch_mprintf("delete from sip_registrations where (contact like '%%TCP%%' "
</span><span class="cx">                                                                  "or status like '%%TCP%%' or status like '%%TLS%%') and hostname='%q' "
</span><del>-                                                                 "and network_ip!='-1' and network_port!='-1' and sip_username != '-1'",
</del><ins>+                                                                 "and network_ip!='-1' and network_port!='-1' and sip_username != '-1' and mwi_user != '-1' and mwi_host != '-1'",
</ins><span class="cx">                                                                  mod_sofia_globals.hostname);
</span><span class="cx">
</span><span class="cx">                 if (switch_odbc_handle_exec(profile->master_odbc, test_sql, NULL) != SWITCH_ODBC_SUCCESS) {
</span><span class="lines">@@ -3773,7 +3800,7 @@
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 free(test_sql);
</span><del>-                test_sql = switch_mprintf("delete from sip_authentication where hostname='%q'", mod_sofia_globals.hostname);
</del><ins>+                test_sql = switch_mprintf("delete from sip_authentication where hostname='%q' and last_nc >= 0", mod_sofia_globals.hostname);
</ins><span class="cx">
</span><span class="cx">                 if (switch_odbc_handle_exec(profile->master_odbc, test_sql, NULL) != SWITCH_ODBC_SUCCESS) {
</span><span class="cx">                         switch_odbc_handle_exec(profile->master_odbc, "DROP TABLE sip_authentication", NULL);
</span><span class="lines">@@ -3813,7 +3840,7 @@
</span><span class="cx">
</span><span class="cx">                 test_sql = switch_mprintf("delete from sip_registrations where (contact like '%%TCP%%' "
</span><span class="cx">                                                                  "or status like '%%TCP%%' or status like '%%TLS%%') and hostname='%q' "
</span><del>-                                                                 "and network_ip!='-1' and network_port!='-1' and sip_username != '-1'",
</del><ins>+                                                                 "and network_ip!='-1' and network_port!='-1' and sip_username != '-1' and mwi_user != '-1' and mwi_host != '-1'",
</ins><span class="cx">                                                                  mod_sofia_globals.hostname);
</span><span class="cx">                 
</span><span class="cx">                 switch_core_db_test_reactive(profile->master_db, test_sql, "DROP TABLE sip_registrations", reg_sql);
</span><span class="lines">@@ -3831,7 +3858,7 @@
</span><span class="cx">                 switch_core_db_test_reactive(profile->master_db, test_sql, "DROP TABLE sip_presence", pres_sql);
</span><span class="cx">                 free(test_sql);
</span><span class="cx">
</span><del>-                test_sql = switch_mprintf("delete from sip_authentication where hostname='%q'", mod_sofia_globals.hostname);
</del><ins>+                test_sql = switch_mprintf("delete from sip_authentication where hostname='%q' and last_nc >= 0", mod_sofia_globals.hostname);
</ins><span class="cx">                 switch_core_db_test_reactive(profile->master_db, test_sql, "DROP TABLE sip_authentication", auth_sql);
</span><span class="cx">                 free(test_sql);
</span><span class="cx">
</span><span class="lines">@@ -3968,7 +3995,7 @@
</span><span class="cx">                 if (switch_odbc_handle_exec(profile->master_odbc, sql, &stmt) != SWITCH_ODBC_SUCCESS) {
</span><span class="cx">                         char *err_str;
</span><span class="cx">                         err_str = switch_odbc_handle_get_error(profile->master_odbc, stmt);
</span><del>-                        if (!switch_strlen_zero(err_str)) {
</del><ins>+                        if (!zstr(err_str)) {
</ins><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERR: [%s]\n[%s]\n", sql, err_str);
</span><span class="cx">                         }
</span><span class="cx">                         switch_safe_free(err_str);
</span><span class="lines">@@ -4120,46 +4147,44 @@
</span><span class="cx">
</span><span class="cx"> int sofia_glue_get_user_host(char *in, char **user, char **host)
</span><span class="cx"> {
</span><del>-        char *p, *h, *u = in;
</del><ins>+        char *p = NULL, *h = NULL, *u = in;
</ins><span class="cx">
</span><del>-        if (user) {
-                *user = NULL;
</del><ins>+        if (!in) {
+                return 0;
</ins><span class="cx">         }
</span><span class="cx">
</span><del>-        *host = NULL;
-
</del><span class="cx">         /* First isolate the host part from the user part */
</span><span class="cx">         if ((h = strchr(u, '@'))) {
</span><span class="cx">                 *h++ = '\0';
</span><del>-        } else {
-                return 0;
</del><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* Clean out the user part of its protocol prefix (if any) */
</span><del>-        if (user && (p = strchr(u, ':'))) {
</del><ins>+        if ((p = strchr(u, ':'))) {
</ins><span class="cx">                 *p++ = '\0';
</span><span class="cx">                 u = p;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* Clean out the host part of any suffix */
</span><del>-        if ((p = strchr(h, ':'))) {
-                *p = '\0';
</del><ins>+        if (h) {
+                if ((p = strchr(h, ':'))) {
+                        *p = '\0';
+                }
+
+                if ((p = strchr(h, ';'))) {
+                        *p = '\0';
+                }
+
+                if ((p = strchr(h, ' '))) {
+                        *p = '\0';
+                }
</ins><span class="cx">         }
</span><del>-        
-        if ((p = strchr(h, ';'))) {
-                *p = '\0';
</del><ins>+        if (user) {
+                *user = u;
</ins><span class="cx">         }
</span><del>-        
-        if ((p = strchr(h, ' '))) {
-                *p = '\0';
</del><ins>+        if (host) {
+                *host = h;
</ins><span class="cx">         }
</span><span class="cx">
</span><del>-        if (user) {
-        *user = u;
-        }
-
-        *host = h;
-
</del><span class="cx">         return 1;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -4201,7 +4226,7 @@
</span><span class="cx">         char *eoc = NULL;
</span><span class="cx">         char *p = NULL;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 return NULL;
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_sofiasofia_presencec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/sofia_presence.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/sofia_presence.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/sofia_presence.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx">                 goto end;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(type)) {
</del><ins>+        if (!zstr(type)) {
</ins><span class="cx">                 ct = type;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -96,9 +96,9 @@
</span><span class="cx">                 goto end;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(host)) {
</del><ins>+        if (zstr(host)) {
</ins><span class="cx">                 host = profile->domain_name;
</span><del>-                if (switch_strlen_zero(host)) {
</del><ins>+                if (zstr(host)) {
</ins><span class="cx">                         host = prof;
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -123,9 +123,9 @@
</span><span class="cx">                         *p++ = '\0';
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(p)) {
</del><ins>+                if (zstr(p)) {
</ins><span class="cx">                         p = profile->domain_name;
</span><del>-                        if (switch_strlen_zero(p)) {
</del><ins>+                        if (zstr(p)) {
</ins><span class="cx">                                 p = host;
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="lines">@@ -345,11 +345,11 @@
</span><span class="cx">
</span><span class="cx">         if (for_everyone) {
</span><span class="cx">                 sql = switch_mprintf("select sip_user,sip_host,contact,profile_name,network_ip,'%q' "
</span><del>-                                                         "from sip_registrations where sip_user='%q' and sip_host='%q'",
</del><ins>+                                                         "from sip_registrations where mwi_user='%q' and mwi_host='%q'",
</ins><span class="cx">                                                          stream.data, user, host);
</span><span class="cx">         } else if (call_id) {
</span><span class="cx">                 sql = switch_mprintf("select sip_user,sip_host,contact,profile_name,network_ip,'%q' "
</span><del>-                                                         "from sip_registrations where sip_user='%q' and sip_host='%q' and call_id='%q'",
</del><ins>+                                                         "from sip_registrations where mwi_user='%q' and mwi_host='%q' and call_id='%q'",
</ins><span class="cx">                                                          stream.data, user, host, call_id);
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -463,11 +463,11 @@
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(event_type)) {
</del><ins>+        if (zstr(event_type)) {
</ins><span class="cx">                 event_type = "presence";
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(alt_event_type)) {
</del><ins>+        if (zstr(alt_event_type)) {
</ins><span class="cx">                 alt_event_type = "presence";
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -625,7 +625,7 @@
</span><span class="cx">                         
</span><span class="cx">                         switch_safe_free(sql);
</span><span class="cx">
</span><del>-                        if (!switch_strlen_zero((char *) helper.stream.data)) {
</del><ins>+                        if (!zstr((char *) helper.stream.data)) {
</ins><span class="cx">                                 char *this_sql = (char *) helper.stream.data;
</span><span class="cx">                                 char *next = NULL;
</span><span class="cx">                                 char *last = NULL;
</span><span class="lines">@@ -638,7 +638,7 @@
</span><span class="cx">                                                 }
</span><span class="cx">                                         }
</span><span class="cx">
</span><del>-                                        if (!switch_strlen_zero(this_sql) && (!last || strcmp(last, this_sql))) {
</del><ins>+                                        if (!zstr(this_sql) && (!last || strcmp(last, this_sql))) {
</ins><span class="cx">                                                 sofia_glue_execute_sql(profile, &this_sql, SWITCH_FALSE);
</span><span class="cx">                                                 last = this_sql;
</span><span class="cx">                                         }
</span><span class="lines">@@ -839,13 +839,13 @@
</span><span class="cx">                         switch_url_decode(to_buf);
</span><span class="cx">                         to_user = to_buf;
</span><span class="cx">                 }
</span><del>-                if (argc > 10 && !switch_strlen_zero(argv[9]) && !switch_strlen_zero(argv[10])) {
</del><ins>+                if (argc > 10 && !zstr(argv[9]) && !zstr(argv[10])) {
</ins><span class="cx">                         status = argv[9];
</span><span class="cx">                         rpid = argv[10];
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(proto)) {
</del><ins>+        if (zstr(proto)) {
</ins><span class="cx">                 proto = NULL;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -863,11 +863,11 @@
</span><span class="cx">                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
</span><span class="cx">                 switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_count", "%d", 0);
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(to_user)) {
</del><ins>+                if (!zstr(to_user)) {
</ins><span class="cx">                         switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to-user", to_user);
</span><span class="cx">                 }
</span><span class="cx">                 
</span><del>-                if (switch_strlen_zero(state)) {
</del><ins>+                if (zstr(state)) {
</ins><span class="cx">                         switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "unique-id", SOFIA_CHAT_PROTO);
</span><span class="cx">                         switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_HANGUP");
</span><span class="cx">                         switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "resubscribe");
</span><span class="lines">@@ -1004,7 +1004,7 @@
</span><span class="cx">         int kill_handle = 0;
</span><span class="cx">         char expires_str[10] = "";
</span><span class="cx">
</span><del>-        if (argc > 18 && !switch_strlen_zero(argv[17]) && !switch_strlen_zero(argv[18])) {
</del><ins>+        if (argc > 18 && !zstr(argv[17]) && !zstr(argv[18])) {
</ins><span class="cx">                 status = argv[17];
</span><span class="cx">                 rpid = argv[18];
</span><span class="cx">         }
</span><span class="lines">@@ -1012,11 +1012,11 @@
</span><span class="cx">         in = helper->event && helper->event->event_id == SWITCH_EVENT_PRESENCE_IN;
</span><span class="cx">
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(rpid)) {
</del><ins>+        if (zstr(rpid)) {
</ins><span class="cx">                 rpid = "unknown";
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(status)) {
</del><ins>+        if (zstr(status)) {
</ins><span class="cx">                 if (!strcasecmp(rpid, "busy")) {
</span><span class="cx">                         status = "Busy";
</span><span class="cx">                 } else if (!strcasecmp(rpid, "unavailable")) {
</span><span class="lines">@@ -1135,9 +1135,9 @@
</span><span class="cx">
</span><span class="cx">                         if (!strcasecmp(state, "cs_hangup")) {
</span><span class="cx">                                 astate = "terminated";
</span><del>-                        } else if (switch_strlen_zero(astate)) {
</del><ins>+                        } else if (zstr(astate)) {
</ins><span class="cx">                                 astate = switch_str_nil(switch_event_get_header(helper->event, "answer-state"));
</span><del>-                                if (switch_strlen_zero(astate)) {
</del><ins>+                                if (zstr(astate)) {
</ins><span class="cx">                                         if (is_dialog) {
</span><span class="cx">                                                 astate = dft_state;
</span><span class="cx">                                         } else {
</span><span class="lines">@@ -1171,7 +1171,7 @@
</span><span class="cx">                                 clean_from_user = switch_mprintf("%s", from_id ? from_id : from_user);
</span><span class="cx">
</span><span class="cx">                                 if (is_dialog) {
</span><del>-                                        if (!switch_strlen_zero(clean_to_user) && !switch_strlen_zero(clean_from_user)) {
</del><ins>+                                        if (!zstr(clean_to_user) && !zstr(clean_from_user)) {
</ins><span class="cx">                                                 stream.write_function(&stream, "<local>\n<identity display=\"%s\">sip:%s@%s</identity>\n", clean_to_user, clean_to_user, host);
</span><span class="cx">                                                 stream.write_function(&stream, "<target uri=\"sip:%s@%s\">\n", clean_to_user, host);
</span><span class="cx">                                                 stream.write_function(&stream, "<param pname=\"+sip.rendering\" pvalue=\"%s\"/>\n",
</span><span class="lines">@@ -1183,7 +1183,7 @@
</span><span class="cx">                                                 stream.write_function(&stream, "</remote>\n");
</span><span class="cx">                                         } else if (!strcasecmp(proto, "park")) {
</span><span class="cx">                                                 stream.write_function(&stream, "<local>\n<identity display=\"parking\">sip:parking@%s;fifo=%s</identity>\n",
</span><del>-                                                                                         host, !switch_strlen_zero(clean_to_user) ? clean_to_user : "unknown");
</del><ins>+                                                                                         host, !zstr(clean_to_user) ? clean_to_user : "unknown");
</ins><span class="cx">                                                 stream.write_function(&stream, "<target uri=\"sip:parking@%s\">\n", host);
</span><span class="cx">                                                 stream.write_function(&stream, "<param pname=\"+sip.rendering\" pvalue=\"no\"/>\n</target>\n</local>\n");
</span><span class="cx">                                                 stream.write_function(&stream, "<remote>\n<identity display=\"parking\">sip:%s</identity>\n", uuid);
</span><span class="lines">@@ -1191,7 +1191,7 @@
</span><span class="cx">                                                 stream.write_function(&stream, "</remote>\n");
</span><span class="cx">                                         } else if (!strcasecmp(proto, "conf")) {
</span><span class="cx">                                                 stream.write_function(&stream, "<local>\n<identity display=\"conference\">sip:conference@%s;conference=%s</identity>\n",
</span><del>-                                                                                         host, !switch_strlen_zero(clean_to_user) ? clean_to_user : "unknown");
</del><ins>+                                                                                         host, !zstr(clean_to_user) ? clean_to_user : "unknown");
</ins><span class="cx">                                                 stream.write_function(&stream, "<target uri=\"sip:conference@%s\">\n", host);
</span><span class="cx">                                                 stream.write_function(&stream, "<param pname=\"+sip.rendering\" pvalue=\"yes\"/>\n</target>\n</local>\n");
</span><span class="cx">                                                 stream.write_function(&stream, "<remote>\n<identity display=\"conference\">sip:%s@%s</identity>\n", uuid, host);
</span><span class="lines">@@ -1214,7 +1214,7 @@
</span><span class="cx">                         ct = "application/dialog-info+xml";
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(astate) && !switch_strlen_zero(uuid) && helper && helper->stream.data && strcmp(helper->last_uuid, uuid)) {
</del><ins>+                if (!zstr(astate) && !zstr(uuid) && helper && helper->stream.data && strcmp(helper->last_uuid, uuid)) {
</ins><span class="cx">                         helper->stream.write_function(&helper->stream, "update sip_dialogs set state='%s' where uuid='%s';", astate, uuid);
</span><span class="cx">
</span><span class="cx">                         switch_copy_string(helper->last_uuid, uuid, sizeof(helper->last_uuid));
</span><span class="lines">@@ -1231,15 +1231,15 @@
</span><span class="cx">                                         rpid = "on-the-phone";
</span><span class="cx">                                 } else if (!strcmp(astate, "confirmed")) {
</span><span class="cx">                                         char *dest = switch_event_get_header(helper->event, "Caller-Destination-Number");
</span><del>-                                        if (switch_strlen_zero(from_id) && !switch_strlen_zero(dest)) {
</del><ins>+                                        if (zstr(from_id) && !zstr(dest)) {
</ins><span class="cx">                                                 from_id = dest;
</span><span class="cx">                                         }
</span><span class="cx">
</span><del>-                                        if (switch_strlen_zero(from_id)) {
</del><ins>+                                        if (zstr(from_id)) {
</ins><span class="cx">                                                 from_id = p_to_user;
</span><span class="cx">                                         }
</span><span class="cx">                                         
</span><del>-                                        if (switch_strlen_zero(from_id)) {
</del><ins>+                                        if (zstr(from_id)) {
</ins><span class="cx">                                                 switch_snprintf(status_line, sizeof(status_line), "On The Phone %s", status);
</span><span class="cx">                                         } else {
</span><span class="cx">                                                 switch_snprintf(status_line, sizeof(status_line), "Talk %s", switch_str_nil(from_id));
</span><span class="lines">@@ -1450,10 +1450,10 @@
</span><span class="cx">
</span><span class="cx">                 display = contact->m_display;
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(display)) {
</del><ins>+                if (zstr(display)) {
</ins><span class="cx">                         if (from) {
</span><span class="cx">                                 display = from->a_display;
</span><del>-                                if (switch_strlen_zero(display)) {
</del><ins>+                                if (zstr(display)) {
</ins><span class="cx">                                         display = "\"user\"";
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="lines">@@ -1481,7 +1481,7 @@
</span><span class="cx">                         int ok = 1;
</span><span class="cx">                         char *last_acl = NULL;
</span><span class="cx">
</span><del>-                        if (!switch_strlen_zero(contact_host)) {
</del><ins>+                        if (!zstr(contact_host)) {
</ins><span class="cx">                                 for (x = 0; x < profile->nat_acl_count; x++) {
</span><span class="cx">                                         last_acl = profile->nat_acl[x];
</span><span class="cx">                                         if (!(ok = switch_check_network_list_ip(contact_host, last_acl))) {
</span><span class="lines">@@ -1922,12 +1922,12 @@
</span><span class="cx">                                 }
</span><span class="cx">
</span><span class="cx">                                 if (!strcasecmp(status_txt, "open")) {
</span><del>-                                        if (switch_strlen_zero(note_txt)) {
</del><ins>+                                        if (zstr(note_txt)) {
</ins><span class="cx">                                                 note_txt = "Available";
</span><span class="cx">                                         }
</span><span class="cx">                                         in = 1;
</span><span class="cx">                                 } else if (!strcasecmp(status_txt, "closed")) {
</span><del>-                                        if (switch_strlen_zero(note_txt)) {
</del><ins>+                                        if (zstr(note_txt)) {
</ins><span class="cx">                                                 note_txt = "Unavailable";
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodendpointsmod_sofiasofia_regc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/sofia_reg.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/sofia_reg.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/endpoints/mod_sofia/sofia_reg.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -508,7 +508,7 @@
</span><span class="cx">                 host = "none";
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(user)) {
</del><ins>+        if (zstr(user)) {
</ins><span class="cx">                 sqlextra = switch_mprintf(" or (sip_host='%q')", host);
</span><span class="cx">         } else {
</span><span class="cx">                 sqlextra = switch_mprintf(" or (sip_user='%q' and sip_host='%q')", user, host);
</span><span class="lines">@@ -681,8 +681,10 @@
</span><span class="cx">         switch_uuid_get(&uuid);
</span><span class="cx">         switch_uuid_format(uuid_str, &uuid);
</span><span class="cx">
</span><del>-        sql = switch_mprintf("insert into sip_authentication (nonce,expires,profile_name,hostname) "
-                                                 "values('%q', %ld, '%q', '%q')", uuid_str, switch_epoch_time_now(NULL) + profile->nonce_ttl, profile->name, mod_sofia_globals.hostname);
</del><ins>+        sql = switch_mprintf("insert into sip_authentication (nonce,expires,profile_name,hostname, last_nc) "
+                                                 "values('%q', %ld, '%q', '%q', 0)", uuid_str,
+                                                 switch_epoch_time_now(NULL) + (profile->nonce_ttl ? profile->nonce_ttl : DEFAULT_NONCE_TTL),
+                                                 profile->name, mod_sofia_globals.hostname);
</ins><span class="cx">         switch_assert(sql != NULL);
</span><span class="cx">         sofia_glue_actually_execute_sql(profile, SWITCH_FALSE, sql, profile->ireg_mutex);
</span><span class="cx">         switch_safe_free(sql);
</span><span class="lines">@@ -710,6 +712,11 @@
</span><span class="cx">         switch_event_t *s_event;
</span><span class="cx">         const char *to_user = NULL;
</span><span class="cx">         const char *to_host = NULL;
</span><ins>+        char *mwi_account = NULL;
+        char *dup_mwi_account = NULL;
+        char *mwi_user = NULL;
+        char *mwi_host = NULL;
+        char *var = NULL;
</ins><span class="cx">         const char *from_user = NULL;
</span><span class="cx">         const char *from_host = NULL;
</span><span class="cx">         const char *reg_host = profile->reg_db_domain;
</span><span class="lines">@@ -817,10 +824,10 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(display)) {
</del><ins>+                if (zstr(display)) {
</ins><span class="cx">                         if (to) {
</span><span class="cx">                                 display = to->a_display;
</span><del>-                                if (switch_strlen_zero(display)) {
</del><ins>+                                if (zstr(display)) {
</ins><span class="cx">                                         display = "\"user\"";
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="lines">@@ -986,7 +993,7 @@
</span><span class="cx">         if (!authorization || stale) {
</span><span class="cx">                 const char *realm = profile->challenge_realm;
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(realm) || !strcasecmp(realm, "auto_to")) {
</del><ins>+                if (zstr(realm) || !strcasecmp(realm, "auto_to")) {
</ins><span class="cx">                         realm = to_host;
</span><span class="cx">                 } else if (!strcasecmp(realm, "auto_from")) {
</span><span class="cx">                         realm = from_host;
</span><span class="lines">@@ -1004,6 +1011,24 @@
</span><span class="cx">         }
</span><span class="cx"> reg:
</span><span class="cx">
</span><ins>+
+        if (v_event && *v_event && (var = switch_event_get_header(*v_event, "sip-force-extension"))) {
+                to_user = var;
+        }
+
+        if (v_event && *v_event && (mwi_account = switch_event_get_header(*v_event, "mwi-account"))) {
+                dup_mwi_account = strdup(mwi_account);
+                switch_assert(dup_mwi_account != NULL);
+                sofia_glue_get_user_host(dup_mwi_account, &mwi_user, &mwi_host);
+        }
+
+        if (!mwi_user) {
+                mwi_user = (char *) to_user;
+        }
+        if (!mwi_host) {
+                mwi_host = (char *) reg_host;
+        }
+
</ins><span class="cx">         if (regtype != REG_REGISTER) {
</span><span class="cx">                 switch_goto_int(r, 0, end);
</span><span class="cx">         }
</span><span class="lines">@@ -1049,21 +1074,20 @@
</span><span class="cx">                 }
</span><span class="cx">                 switch_mutex_lock(profile->ireg_mutex);
</span><span class="cx">                 sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 switch_find_local_ip(guess_ip4, sizeof(guess_ip4), NULL, AF_INET);
</span><span class="cx">                 sql = switch_mprintf("insert into sip_registrations "
</span><span class="cx">                                                          "(call_id,sip_user,sip_host,presence_hosts,contact,status,rpid,expires,"
</span><del>-                                                         "user_agent,server_user,server_host,profile_name,hostname,network_ip,network_port,sip_username,sip_realm) "
-                                                         "values ('%q','%q', '%q','%q','%q','%q', '%q', %ld, '%q', '%q', '%q', '%q', '%q', '%q', '%q','%q','%q')",
</del><ins>+                                                         "user_agent,server_user,server_host,profile_name,hostname,network_ip,network_port,sip_username,sip_realm,mwi_user,mwi_host) "
+                                                         "values ('%q','%q', '%q','%q','%q','%q', '%q', %ld, '%q', '%q', '%q', '%q', '%q', '%q', '%q','%q','%q','%q','%q')",
</ins><span class="cx">                                                          call_id, to_user, reg_host, profile->presence_hosts ? profile->presence_hosts : reg_host,
</span><span class="cx">                                                          contact_str, reg_desc, rpid, (long) switch_epoch_time_now(NULL) + (long) exptime * 2,
</span><del>-                                                         agent, from_user, guess_ip4, profile->name, mod_sofia_globals.hostname, network_ip, network_port_c, username, realm);
</del><ins>+                                                         agent, from_user, guess_ip4, profile->name, mod_sofia_globals.hostname, network_ip, network_port_c, username, realm, mwi_user, mwi_host);
</ins><span class="cx">                                                         
</span><span class="cx">                 if (sql) {
</span><span class="cx">                         sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-
</del><span class="cx">                 switch_mutex_unlock(profile->ireg_mutex);
</span><span class="cx">
</span><span class="cx">                 if (switch_event_create_subclass(&s_event, SWITCH_EVENT_CUSTOM, MY_EVENT_REGISTER) == SWITCH_STATUS_SUCCESS) {
</span><span class="lines">@@ -1198,7 +1222,7 @@
</span><span class="cx">
</span><span class="cx">                         if (sofia_test_pflag(profile, PFLAG_MESSAGE_QUERY_ON_REGISTER)) {
</span><span class="cx">                                 if (switch_event_create(&s_event, SWITCH_EVENT_MESSAGE_QUERY) == SWITCH_STATUS_SUCCESS) {
</span><del>-                                        switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "Message-Account", "sip:%s@%s", to_user, reg_host);
</del><ins>+                                        switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "Message-Account", "sip:%s@%s", mwi_user, mwi_host);
</ins><span class="cx">                                         switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "VM-Sofia-Profile", profile->name);
</span><span class="cx">                                         switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "VM-Call-ID", call_id);
</span><span class="cx">                                 }
</span><span class="lines">@@ -1239,6 +1263,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> end:
</span><ins>+        switch_safe_free(dup_mwi_account);
</ins><span class="cx">
</span><span class="cx">         if (auth_params) {
</span><span class="cx">                 switch_event_destroy(&auth_params);
</span><span class="lines">@@ -1297,7 +1322,7 @@
</span><span class="cx">                         contact_host = sip->sip_contact->m_url->url_host;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(contact_host)) {
</del><ins>+                if (!zstr(contact_host)) {
</ins><span class="cx">                         for (x = 0; x < profile->nat_acl_count; x++) {
</span><span class="cx">                                 last_acl = profile->nat_acl[x];
</span><span class="cx">                                 if (!(ok = switch_check_network_list_ip(contact_host, last_acl))) {
</span><span class="lines">@@ -1341,7 +1366,7 @@
</span><span class="cx">         sofia_reg_handle_register(nua, profile, nh, sip, type, key, sizeof(key), &v_event, is_nat);
</span><span class="cx">         
</span><span class="cx">         if (v_event) {
</span><del>-                switch_event_fire(&v_event);
</del><ins>+                switch_event_destroy(&v_event);
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx"> end:
</span><span class="lines">@@ -1544,6 +1569,25 @@
</span><span class="cx">
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static unsigned long get_nc(const char *nc, sip_t const *sip)
+{
+        unsigned long x;
+        const char *ua = NULL;
+
+        if (sip->sip_user_agent) {
+                ua = sip->sip_user_agent->g_string;
+        }
+
+        /* sigh, polycom sends nc in base-10 rather than spec which says base-16*/
+        if (ua && switch_stristr("polycom", ua)) {
+                x = strtoul(nc, 0, 10);
+        } else {
+                x = strtoul(nc, 0, 16);
+        }
+
+        return x;
+}
+
</ins><span class="cx"> auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile,
</span><span class="cx">                                                                 sip_authorization_t const *authorization,
</span><span class="cx">                                                                 sip_t const *sip,
</span><span class="lines">@@ -1568,6 +1612,7 @@
</span><span class="cx">         int first = 0;
</span><span class="cx">         const char *passwd = NULL;
</span><span class="cx">         const char *a1_hash = NULL;
</span><ins>+        const char *mwi_account = NULL;
</ins><span class="cx">         char *sql;
</span><span class="cx">         char *number_alias = NULL;
</span><span class="cx">         switch_xml_t domain, xml = NULL, user, param, uparams, dparams, group = NULL, gparams = NULL;
</span><span class="lines">@@ -1625,16 +1670,24 @@
</span><span class="cx">
</span><span class="cx">         /* Optional check that auth name == SIP username */
</span><span class="cx">         if ((regtype == REG_REGISTER) && sofia_test_pflag(profile, PFLAG_CHECKUSER)) {
</span><del>-                if (switch_strlen_zero(username) || switch_strlen_zero(to_user) || strcasecmp(to_user, username)) {
</del><ins>+                if (zstr(username) || zstr(to_user) || strcasecmp(to_user, username)) {
</ins><span class="cx">                         /* Names don't match, so fail */
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SIP username %s does not match auth username\n", switch_str_nil(to_user));
</span><span class="cx">                         goto end;
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(np)) {
</del><ins>+        if (zstr(np)) {
</ins><span class="cx">                 first = 1;
</span><del>-                sql = switch_mprintf("select nonce from sip_authentication where nonce='%q'", nonce);
</del><ins>+                if (nc) {
+                        unsigned long x;
+
+                        x = get_nc(nc, sip);
+                        sql = switch_mprintf("select nonce from sip_authentication where nonce='%q' and last_nc + 1 >= %lu", nonce, x);
+                } else {
+                        sql = switch_mprintf("select nonce from sip_authentication where nonce='%q'", nonce);
+                }
+
</ins><span class="cx">                 switch_assert(sql != NULL);
</span><span class="cx">                 if (!sofia_glue_execute_sql2str(profile, profile->ireg_mutex, sql, np, nplen)) {
</span><span class="cx">                         free(sql);
</span><span class="lines">@@ -1702,13 +1755,13 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(profile->reg_domain)) {
</del><ins>+        if (!zstr(profile->reg_domain)) {
</ins><span class="cx">                 domain_name = profile->reg_domain;
</span><span class="cx">         } else {
</span><span class="cx">                 domain_name = realm;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_xml_locate_user("id", switch_strlen_zero(username) ? "nobody" : username,
</del><ins>+        if (switch_xml_locate_user("id", zstr(username) ? "nobody" : username,
</ins><span class="cx">                                                          domain_name, ip, &xml, &domain, &user, &group, params) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Can't find user [%s@%s]\n"
</span><span class="cx">                                                  "You must define a domain called '%s' in your directory and add a user with the id=\"%s\" attribute\n"
</span><span class="lines">@@ -1727,7 +1780,7 @@
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         if (!(number_alias = (char *) switch_xml_attr(user, "number-alias"))) {
</span><del>-                number_alias = switch_strlen_zero(username) ? "nobody" : username;
</del><ins>+                number_alias = zstr(username) ? "nobody" : username;
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         dparams = switch_xml_child(domain, "params");
</span><span class="lines">@@ -1762,6 +1815,9 @@
</span><span class="cx">                         if (!strcasecmp(var, "a1-hash")) {
</span><span class="cx">                                 a1_hash = val;
</span><span class="cx">                         }
</span><ins>+                        if (!strcasecmp(var, "mwi-account")) {
+                                mwi_account = val;
+                        }
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1786,6 +1842,9 @@
</span><span class="cx">                         if (!strcasecmp(var, "a1-hash")) {
</span><span class="cx">                                 a1_hash = val;
</span><span class="cx">                         }
</span><ins>+                        if (!strcasecmp(var, "mwi-account")) {
+                                mwi_account = val;
+                        }
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1810,6 +1869,9 @@
</span><span class="cx">                         if (!strcasecmp(var, "a1-hash")) {
</span><span class="cx">                                 a1_hash = val;
</span><span class="cx">                         }
</span><ins>+                        if (!strcasecmp(var, "mwi-account")) {
+                                mwi_account = val;
+                        }
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1821,7 +1883,7 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(passwd) && switch_strlen_zero(a1_hash)) {
</del><ins>+        if (zstr(passwd) && zstr(a1_hash)) {
</ins><span class="cx">                 ret = AUTH_OK;
</span><span class="cx">                 goto skip_auth;
</span><span class="cx">         }
</span><span class="lines">@@ -1852,15 +1914,15 @@
</span><span class="cx">                 input2 = switch_mprintf("%s:%s:%s", a1_hash, nonce, uridigest);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        switch_assert(input2);
</del><ins>+        if (input2) {
+                memset(&ctx, 0, sizeof(ctx));
+                su_md5_init(&ctx);
+                su_md5_strupdate(&ctx, input2);
+                su_md5_hexdigest(&ctx, bigdigest);
+                su_md5_deinit(&ctx);
+        }
</ins><span class="cx">
</span><del>-        memset(&ctx, 0, sizeof(ctx));
-        su_md5_init(&ctx);
-        su_md5_strupdate(&ctx, input2);
-        su_md5_hexdigest(&ctx, bigdigest);
-        su_md5_deinit(&ctx);
-
-        if (!strcasecmp(bigdigest, response)) {
</del><ins>+        if (input2 && !strcasecmp(bigdigest, response)) {
</ins><span class="cx">                 ret = AUTH_OK;
</span><span class="cx">         } else {
</span><span class="cx">                 if ((profile->ndlb & PFLAG_NDLB_BROKEN_AUTH_HASH) && strcasecmp(regstr, "REGISTER") && strcasecmp(regstr, "INVITE")) {
</span><span class="lines">@@ -1876,6 +1938,7 @@
</span><span class="cx">                 ret = AUTH_FORBIDDEN;
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        switch_safe_free(input2);
</ins><span class="cx">
</span><span class="cx"> skip_auth:
</span><span class="cx">
</span><span class="lines">@@ -1897,6 +1960,10 @@
</span><span class="cx">                         switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, "user_name", username);
</span><span class="cx">                         switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, "domain_name", domain_name);
</span><span class="cx">
</span><ins>+                        if (mwi_account) {
+                                switch_event_add_header_string(*v_event, SWITCH_STACK_BOTTOM, "mwi-account", mwi_account);
+                        }
+
</ins><span class="cx">                         if ((uparams = switch_xml_child(user, "params"))) {
</span><span class="cx">                                 xparams_type[i] = 0;
</span><span class="cx">                                 xparams[i++] = uparams;
</span><span class="lines">@@ -1936,7 +2003,7 @@
</span><span class="cx">                                                 const char *val = switch_xml_attr_soft(param, "value");
</span><span class="cx">                                                 sofia_gateway_t *gateway_ptr = NULL;
</span><span class="cx">
</span><del>-                                                if (!switch_strlen_zero(var) && !switch_strlen_zero(val) && (xparams_type[j] == 1 || !strncasecmp(var, "sip-",4) || !strcasecmp(var, "register-gateway")) ) {
</del><ins>+                                                if (!zstr(var) && !zstr(val) && (xparams_type[j] == 1 || !strncasecmp(var, "sip-",4) || !strcasecmp(var, "register-gateway")) ) {
</ins><span class="cx">                                                         if (!switch_event_get_header(*v_event, var)) {
</span><span class="cx">                                                                 if (profile->debug) {
</span><span class="cx">                                                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "event_add_header -> '%s' = '%s'\n",var, val);
</span><span class="lines">@@ -1952,7 +2019,7 @@
</span><span class="cx">                                                                         if ((gateways_tag = switch_xml_child(user, "gateways"))) {
</span><span class="cx">                                                                                 for (gateway_tag = switch_xml_child(gateways_tag, "gateway"); gateway_tag; gateway_tag = gateway_tag->next) {
</span><span class="cx">                                                                                         char *name = (char *) switch_xml_attr_soft(gateway_tag, "name");
</span><del>-                                                                                        if (switch_strlen_zero(name)) {
</del><ins>+                                                                                        if (zstr(name)) {
</ins><span class="cx">                                                                                                 name = "anonymous";
</span><span class="cx">                                                                                         }
</span><span class="cx">
</span><span class="lines">@@ -2010,6 +2077,25 @@
</span><span class="cx">         }
</span><span class="cx"> end:
</span><span class="cx">
</span><ins>+
+        if (nc && cnonce && qop) {
+                unsigned long x;
+                char *sql;
+
+                x = get_nc(nc, sip);
+#if defined(_WIN32) && !defined(_WIN64)
+#define        LL_FMT "ll"
+#else
+#define        LL_FMT "l"
+#endif
+                sql = switch_mprintf("update sip_authentication set expires='%"LL_FMT"u',last_nc=%lu where nonce='%s'",
+                                                         switch_epoch_time_now(NULL) + (profile->nonce_ttl ? profile->nonce_ttl : exptime + 10), x, nonce);
+
+                switch_assert(sql != NULL);
+                sofia_glue_actually_execute_sql(profile, SWITCH_FALSE, sql, profile->ireg_mutex);
+                switch_safe_free(sql);
+        }
+
</ins><span class="cx">         switch_event_destroy(&params);
</span><span class="cx">
</span><span class="cx">         if (xml) {
</span><span class="lines">@@ -2017,7 +2103,6 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         switch_safe_free(input);
</span><del>-        switch_safe_free(input2);
</del><span class="cx">         switch_safe_free(username);
</span><span class="cx">         switch_safe_free(realm);
</span><span class="cx">         switch_safe_free(nonce);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodevent_handlersmod_cdr_csvmod_cdr_csvc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_cdr_csv/mod_cdr_csv.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -372,7 +372,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(globals.default_template)) {
</del><ins>+        if (zstr(globals.default_template)) {
</ins><span class="cx">                 globals.default_template = switch_core_strdup(pool, "default");
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodevent_handlersmod_erlang_eventei_helpersc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/ei_helpers.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/ei_helpers.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/ei_helpers.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -347,7 +347,7 @@
</span><span class="cx"> #endif
</span><span class="cx">                 memcpy(thishostname, nodehost->h_name, EI_MAXHOSTNAMELEN);
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero_buf(thishostname)) {
</del><ins>+        if (zstr_buf(thishostname)) {
</ins><span class="cx">                 gethostname(thishostname, EI_MAXHOSTNAMELEN);
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodevent_handlersmod_erlang_eventerlang_eventconfxml"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/erlang_event.conf.xml (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/erlang_event.conf.xml        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/erlang_event.conf.xml        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -3,10 +3,12 @@
</span><span class="cx"> <param name="listen-ip" value="0.0.0.0"/>
</span><span class="cx"> <param name="listen-port" value="8031"/>
</span><span class="cx"> <param name="cookie" value="ClueCon"/>
</span><del>-                <param name="shortname" value="true"/>
-                <!-- in additon to cookie, optionally restrict by ACL -->
-                <!--<param name="apply-inbound-acl" value="lan"/>-->
-                <!-- alternative is "binary" -->
-                <!--<param name="encoding" value="string"/>-->
</del><ins>+ <param name="shortname" value="true"/>
+ <!-- in additon to cookie, optionally restrict by ACL -->
+ <!--<param name="apply-inbound-acl" value="lan"/>-->
+ <!-- alternative is "binary" -->
+ <!--<param name="encoding" value="string"/>-->
+ <!-- provide compatability with previous OTP release (use with care) -->
+ <!--<param name="compat-rel" value="12"/> -->
</ins><span class="cx"> </settings>
</span><span class="cx"> </configuration>
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodevent_handlersmod_erlang_eventhandle_msgc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/handle_msg.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/handle_msg.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/handle_msg.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -465,7 +465,7 @@
</span><span class="cx">         }
</span><span class="cx">         else {
</span><span class="cx">                 switch_core_session_t *session;
</span><del>-                if (!switch_strlen_zero_buf(uuid) && (session = switch_core_session_locate(uuid))) {
</del><ins>+                if (!zstr_buf(uuid) && (session = switch_core_session_locate(uuid))) {
</ins><span class="cx">                         switch_event_t *event;        
</span><span class="cx">                         if (switch_event_create(&event, SWITCH_EVENT_SEND_MESSAGE) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                 
</span><span class="lines">@@ -577,7 +577,7 @@
</span><span class="cx">                 ei_x_encode_atom(rbuf, "badarg");
</span><span class="cx">         } else {
</span><span class="cx">                 switch_core_session_t *session;
</span><del>-                if (!switch_strlen_zero_buf(uuid_str)) {
</del><ins>+                if (!zstr_buf(uuid_str)) {
</ins><span class="cx">                         if ((session = switch_core_session_locate(uuid_str))) {
</span><span class="cx">                                 /* create a new session list element and attach it to this listener */
</span><span class="cx">                                 if ((arity==2 && attach_call_to_pid(listener, &msg->from, session)) ||
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodevent_handlersmod_erlang_eventmod_erlang_eventc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -451,7 +451,7 @@
</span><span class="cx">
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "got data %s after %d milliseconds!\n", xmlstr, i*10);
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(xmlstr)) {
</del><ins>+        if (zstr(xmlstr)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Result\n");
</span><span class="cx">         } else if (!(xml = switch_xml_parse_str_dynamic(xmlstr, SWITCH_FALSE))) {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing XML Result!\n");
</span><span class="lines">@@ -848,7 +848,7 @@
</span><span class="cx"> static switch_bool_t check_inbound_acl(listener_t* listener)
</span><span class="cx"> {
</span><span class="cx">         /* check acl to see if inbound connection is allowed */
</span><del>-        if (prefs.acl_count && !switch_strlen_zero(listener->remote_ip)) {
</del><ins>+        if (prefs.acl_count && !zstr(listener->remote_ip)) {
</ins><span class="cx">                 uint32_t x = 0;
</span><span class="cx">                 for (x = 0; x < prefs.acl_count; x++) {
</span><span class="cx">                         if (!switch_check_network_list_ip(listener->remote_ip, prefs.acl[x])) {
</span><span class="lines">@@ -904,7 +904,7 @@
</span><span class="cx">         switch_assert(listener != NULL);
</span><span class="cx">
</span><span class="cx">         if (check_inbound_acl(listener)) {
</span><del>-                if (switch_strlen_zero(listener->remote_ip)) {
</del><ins>+                if (zstr(listener->remote_ip)) {
</ins><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connection Open\n");
</span><span class="cx">                 } else {
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connection Open from %s\n", listener->remote_ip);/*, listener->remote_port);*/
</span><span class="lines">@@ -982,6 +982,7 @@
</span><span class="cx">
</span><span class="cx">         prefs.shortname = SWITCH_TRUE;
</span><span class="cx">         prefs.encoding = ERLANG_STRING;
</span><ins>+        prefs.compat_rel = 0;
</ins><span class="cx">
</span><span class="cx">         if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", cf);
</span><span class="lines">@@ -999,6 +1000,11 @@
</span><span class="cx">                                         set_pref_cookie(val);
</span><span class="cx">                                 } else if (!strcmp(var, "nodename")) {
</span><span class="cx">                                         set_pref_nodename(val);
</span><ins>+                                } else if (!strcmp(var, "compat-rel")) {
+                                        if (atoi(val) >= 7)
+                                                prefs.compat_rel = atoi(val);
+                                        else
+                                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid compatability release '%s' specified\n", val);
</ins><span class="cx">                                 } else if (!strcmp(var, "shortname")) {
</span><span class="cx">                                                 prefs.shortname = switch_true(val);
</span><span class="cx">                                 } else if (!strcmp(var, "encoding")) {
</span><span class="lines">@@ -1021,11 +1027,11 @@
</span><span class="cx">                 switch_xml_free(xml);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(prefs.ip)) {
</del><ins>+        if (zstr(prefs.ip)) {
</ins><span class="cx">                 set_pref_ip("0.0.0.0");
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(prefs.cookie)) {
</del><ins>+        if (zstr(prefs.cookie)) {
</ins><span class="cx">                 set_pref_cookie("ClueCon");
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1313,7 +1319,7 @@
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Parse Error - need registered name and node!\n");
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><del>-        if (switch_strlen_zero(argv[0])) {
</del><ins>+        if (zstr(argv[0])) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missing registered name or module:function!\n");
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="lines">@@ -1333,7 +1339,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">         node = argv[1];
</span><del>-        if (switch_strlen_zero(node)) {
</del><ins>+        if (zstr(node)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missing node name!\n");
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="lines">@@ -1445,7 +1451,7 @@
</span><span class="cx">                 "erlang sessions <node_name>\n"
</span><span class="cx">                 "--------------------------------------------------------------------------------\n";
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "%s", usage_string);
</span><span class="cx">                 goto done;
</span><span class="cx">         }
</span><span class="lines">@@ -1650,6 +1656,11 @@
</span><span class="cx">                 switch_yield(100000);
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        if (prefs.compat_rel) {
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Compatability with OTP R%d requested\n", prefs.compat_rel);
+                ei_set_compat_rel(prefs.compat_rel);
+        }
+
</ins><span class="cx">         if (SWITCH_STATUS_SUCCESS!=initialise_ei(&ec)) {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to init ei connection\n");
</span><span class="cx">                 goto init_failed;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodevent_handlersmod_erlang_eventmod_erlang_eventh"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.h        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -181,6 +181,7 @@
</span><span class="cx">         uint32_t acl_count;
</span><span class="cx">         uint32_t id;
</span><span class="cx">         erlang_encoding_t encoding;
</span><ins>+        int compat_rel;
</ins><span class="cx"> };
</span><span class="cx"> typedef struct prefs_struct prefs_t;
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodevent_handlersmod_event_socketmod_event_socketc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_event_socket/mod_event_socket.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_event_socket/mod_event_socket.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_event_socket/mod_event_socket.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -356,7 +356,7 @@
</span><span class="cx">
</span><span class="cx">         host = argv[0];
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(host)) {
</del><ins>+        if (zstr(host)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Missing Host!\n");
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="lines">@@ -432,9 +432,7 @@
</span><span class="cx">                 
</span><span class="cx">                 switch_ivr_park(session, NULL);
</span><span class="cx">
</span><del>-                if (switch_core_session_private_event_count(session)) {
-                        switch_ivr_parse_all_events(session);
-                }
</del><ins>+                switch_ivr_parse_all_events(session);
</ins><span class="cx">                 
</span><span class="cx">                 if (switch_test_flag(listener, LFLAG_RESUME) || ((var = switch_channel_get_variable(channel, "socket_resume")) && switch_true(var))) {
</span><span class="cx">                         switch_channel_set_state(channel, CS_EXECUTE);
</span><span class="lines">@@ -585,7 +583,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">         if (!http) {
</span><del>-                stream->write_function(stream, "This is a web application.!\n");
</del><ins>+                stream->write_function(stream, "This is a web application!\n");
</ins><span class="cx"> return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="cx">         stream->write_function(stream, "Content-Type: text/xml\n\n");
</span><span class="lines">@@ -619,7 +617,7 @@
</span><span class="cx"> goto end;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(action)) {
</del><ins>+                if (zstr(action)) {
</ins><span class="cx">                         stream->write_function(stream, "<data><reply type=\"error\">Invalid Syntax</reply></data>\n");
</span><span class="cx"> goto end;
</span><span class="cx">                 }
</span><span class="lines">@@ -630,7 +628,7 @@
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 if (!strcasecmp(action, "delete")) {
</span><del>-                        if (switch_strlen_zero(header_val)) {
</del><ins>+                        if (zstr(header_val)) {
</ins><span class="cx">                                 stream->write_function(stream, "<data><reply type=\"error\">Invalid Syntax</reply></data>\n");
</span><span class="cx">                                 goto filter_end;
</span><span class="cx">                         }
</span><span class="lines">@@ -643,7 +641,7 @@
</span><span class="cx">                         }
</span><span class="cx">                         stream->write_function(stream, "<data>\n <reply type=\"success\">filter deleted.</reply>\n<api-command>\n");
</span><span class="cx">                 } else if (!strcasecmp(action, "add")) {
</span><del>-                        if (switch_strlen_zero(header_name) || switch_strlen_zero(header_val)) {
</del><ins>+                        if (zstr(header_name) || zstr(header_val)) {
</ins><span class="cx">                                 stream->write_function(stream, "<data><reply type=\"error\">Invalid Syntax</reply></data>\n");
</span><span class="cx">                                 goto filter_end;
</span><span class="cx">                         }
</span><span class="lines">@@ -717,7 +715,7 @@
</span><span class="cx">                 uint8_t custom = 0;
</span><span class="cx">                 char *edup;
</span><span class="cx">                 
</span><del>-                if (switch_strlen_zero(events) && switch_strlen_zero(loglevel)) {
</del><ins>+                if (zstr(events) && zstr(loglevel)) {
</ins><span class="cx">                         stream->write_function(stream, "<data><reply type=\"error\">Missing parameter!</reply></data>\n");
</span><span class="cx">                         goto end;
</span><span class="cx">                 }
</span><span class="lines">@@ -1070,7 +1068,7 @@
</span><span class="cx">                                                 char *var, *val;
</span><span class="cx">                                                 var = cur;
</span><span class="cx">                                                 strip_cr(var);
</span><del>-                                                if (!switch_strlen_zero(var)) {
</del><ins>+                                                if (!zstr(var)) {
</ins><span class="cx">                                                         if ((val = strchr(var, ':'))) {
</span><span class="cx">                                                                 *val++ = '\0';
</span><span class="cx">                                                                 while (*val == ' ') {
</span><span class="lines">@@ -1537,6 +1535,7 @@
</span><span class="cx">                         listener->event_list[SWITCH_EVENT_CHANNEL_EXECUTE] = 1;
</span><span class="cx">                         listener->event_list[SWITCH_EVENT_CHANNEL_EXECUTE_COMPLETE] = 1;
</span><span class="cx">                         listener->event_list[SWITCH_EVENT_CHANNEL_HANGUP] = 1;
</span><ins>+                        listener->event_list[SWITCH_EVENT_CHANNEL_HANGUP_COMPLETE] = 1;
</ins><span class="cx">                         listener->event_list[SWITCH_EVENT_CHANNEL_ORIGINATE] = 1;
</span><span class="cx">                         listener->event_list[SWITCH_EVENT_CHANNEL_UUID] = 1;
</span><span class="cx">                         listener->event_list[SWITCH_EVENT_CHANNEL_OUTGOING] = 1;
</span><span class="lines">@@ -1584,7 +1583,7 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(onoff)) {
</del><ins>+                if (zstr(onoff)) {
</ins><span class="cx">                         switch_snprintf(reply, reply_len, "-ERR missing value.");
</span><span class="cx">                         goto done;
</span><span class="cx">                 }
</span><span class="lines">@@ -1624,7 +1623,7 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">                 
</span><del>-                if (switch_strlen_zero(uuid)) {
</del><ins>+                if (zstr(uuid)) {
</ins><span class="cx">                         uuid = switch_event_get_header(*event, "session-id");
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -1632,7 +1631,7 @@
</span><span class="cx">                         uuid = NULL;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(uuid) && listener->session) {
</del><ins>+                if (zstr(uuid) && listener->session) {
</ins><span class="cx">                         if (async) {
</span><span class="cx">                                 if ((status = switch_core_session_queue_private_event(listener->session, event)) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                         switch_snprintf(reply, reply_len, "+OK");
</span><span class="lines">@@ -1644,7 +1643,7 @@
</span><span class="cx">                                 switch_snprintf(reply, reply_len, "+OK");
</span><span class="cx">                         }
</span><span class="cx">                 } else {
</span><del>-                        if (!switch_strlen_zero(uuid) && (session = switch_core_session_locate(uuid))) {
</del><ins>+                        if (!zstr(uuid) && (session = switch_core_session_locate(uuid))) {
</ins><span class="cx">                                 if ((status = switch_core_session_queue_private_event(session, event)) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                         switch_snprintf(reply, reply_len, "+OK");
</span><span class="cx">                                 } else {
</span><span class="lines">@@ -1790,12 +1789,12 @@
</span><span class="cx">                 level_s = cmd + 3;
</span><span class="cx">
</span><span class="cx">                 //see if we got an argument
</span><del>-                if (!switch_strlen_zero(level_s)) {
</del><ins>+                if (!zstr(level_s)) {
</ins><span class="cx">                         //if so move to the argument
</span><span class="cx">                         level_s++;
</span><span class="cx">                 }
</span><span class="cx">                 //see if we lined up on an argument or not
</span><del>-                if (!switch_strlen_zero(level_s)) {
</del><ins>+                if (!zstr(level_s)) {
</ins><span class="cx">                         ltype = switch_log_str2level(level_s);
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -1962,7 +1961,7 @@
</span><span class="cx">
</span><span class="cx"> done:
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(reply)) {
</del><ins>+        if (zstr(reply)) {
</ins><span class="cx">                 switch_snprintf(reply, reply_len, "-ERR command not found");
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -2004,7 +2003,7 @@
</span><span class="cx">         switch_socket_opt_set(listener->sock, SWITCH_SO_TCP_NODELAY, TRUE);
</span><span class="cx">         switch_socket_opt_set(listener->sock, SWITCH_SO_NONBLOCK, TRUE);
</span><span class="cx">
</span><del>-        if (prefs.acl_count && listener->sa && !switch_strlen_zero(listener->remote_ip)) {
</del><ins>+        if (prefs.acl_count && listener->sa && !zstr(listener->remote_ip)) {
</ins><span class="cx">                 uint32_t x = 0;
</span><span class="cx">
</span><span class="cx">                 for (x = 0; x < prefs.acl_count; x++) {
</span><span class="lines">@@ -2025,7 +2024,7 @@
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         if (globals.debug > 0) {
</span><del>-                if (switch_strlen_zero(listener->remote_ip)) {
</del><ins>+                if (zstr(listener->remote_ip)) {
</ins><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Connection Open\n");
</span><span class="cx">                 } else {
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Connection Open from %s:%d\n", listener->remote_ip, listener->remote_port);
</span><span class="lines">@@ -2244,11 +2243,11 @@
</span><span class="cx">                 switch_xml_free(xml);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(prefs.ip)) {
</del><ins>+        if (zstr(prefs.ip)) {
</ins><span class="cx">                 set_pref_ip("127.0.0.1");
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(prefs.password)) {
</del><ins>+        if (zstr(prefs.password)) {
</ins><span class="cx">                 set_pref_pass("ClueCon");
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodevent_handlersmod_radius_cdrmod_radius_cdrc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/event_handlers/mod_radius_cdr/mod_radius_cdr.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -138,6 +138,7 @@
</span><span class="cx">         switch_status_t retval = SWITCH_STATUS_TERM;
</span><span class="cx">         VALUE_PAIR *send = NULL;
</span><span class="cx">         uint32_t client_port = 0;
</span><ins>+        uint32_t framed_addr = 0;
</ins><span class="cx">         uint32_t status_type = PW_STATUS_START;
</span><span class="cx">         switch_time_t callstartdate = 0;
</span><span class="cx">         switch_time_t callanswerdate = 0;
</span><span class="lines">@@ -254,7 +255,9 @@
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                         if (profile->network_addr) {
</span><del>-                                if (rc_avpair_add(rad_config, &send, PW_FRAMED_IP_ADDRESS, (void *) profile->network_addr, -1, 0) == NULL) {
</del><ins>+                                inet_pton(AF_INET, (void *) profile->network_addr, &framed_addr);
+                                framed_addr = htonl(framed_addr);
+                                if (rc_avpair_add(rad_config, &send, PW_FRAMED_IP_ADDRESS, &framed_addr, -1, 0) == NULL) {
</ins><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "failed adding Framed-IP-Address: %s\n", profile->network_addr);
</span><span class="cx">                                         rc_destroy(rad_config);
</span><span class="cx">                                         goto end;
</span><span class="lines">@@ -366,7 +369,9 @@
</span><span class="cx">                 retval = SWITCH_STATUS_TERM;
</span><span class="cx">         }
</span><span class="cx">         rc_avpair_free(send);
</span><ins>+ rc_destroy(rad_config);
</ins><span class="cx"> end:
</span><ins>+        switch_xml_free(cdr);
</ins><span class="cx">         switch_thread_rwlock_unlock(globals.rwlock);
</span><span class="cx">         return (retval);
</span><span class="cx"> }
</span><span class="lines">@@ -379,6 +384,7 @@
</span><span class="cx">         switch_status_t retval = SWITCH_STATUS_TERM;
</span><span class="cx">         VALUE_PAIR *send = NULL;
</span><span class="cx">         uint32_t client_port = 0;
</span><ins>+        uint32_t framed_addr = 0;
</ins><span class="cx">         uint32_t status_type = PW_STATUS_STOP;
</span><span class="cx">         switch_time_t callstartdate = 0;
</span><span class="cx">         switch_time_t callanswerdate = 0;
</span><span class="lines">@@ -513,7 +519,9 @@
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                         if (profile->network_addr) {
</span><del>-                                if (rc_avpair_add(rad_config, &send, PW_FRAMED_IP_ADDRESS, (void *) profile->network_addr, -1, 0) == NULL) {
</del><ins>+                                inet_pton(AF_INET, (void *) profile->network_addr, &framed_addr);
+                                framed_addr = htonl(framed_addr);
+                                if (rc_avpair_add(rad_config, &send, PW_FRAMED_IP_ADDRESS, &framed_addr, -1, 0) == NULL) {
</ins><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "failed adding Framed-IP-Address: %s\n", profile->network_addr);
</span><span class="cx">                                         rc_destroy(rad_config);
</span><span class="cx">                                         goto end;
</span><span class="lines">@@ -635,8 +643,10 @@
</span><span class="cx">                 retval = SWITCH_STATUS_TERM;
</span><span class="cx">         }
</span><span class="cx">         rc_avpair_free(send);
</span><ins>+ rc_destroy(rad_config);
</ins><span class="cx">
</span><span class="cx"> end:
</span><ins>+        switch_xml_free(cdr);
</ins><span class="cx">         switch_thread_rwlock_unlock(globals.rwlock);
</span><span class="cx">         return (retval);
</span><span class="cx"> }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodformatsmod_local_streammod_local_streamc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/formats/mod_local_stream/mod_local_stream.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/formats/mod_local_stream/mod_local_stream.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/formats/mod_local_stream/mod_local_stream.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -608,7 +608,7 @@
</span><span class="cx">         int argc = 0;
</span><span class="cx">
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 goto usage;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -621,7 +621,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         local_stream_name = argv[0];
</span><del>-        if (switch_strlen_zero(local_stream_name)) {
</del><ins>+        if (zstr(local_stream_name)) {
</ins><span class="cx">                 goto usage;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -662,7 +662,7 @@
</span><span class="cx">
</span><span class="cx">         switch_mutex_lock(globals.mutex);
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 for (hi = switch_hash_first(NULL, globals.source_hash); hi; hi = switch_hash_next(hi)) {
</span><span class="cx">                         switch_hash_this(hi, &var, NULL, &val);
</span><span class="cx">                         if ((source = (local_stream_source_t *) val)) {
</span><span class="lines">@@ -751,7 +751,7 @@
</span><span class="cx">         switch_xml_t cfg, xml, directory, param;
</span><span class="cx">         int tmp;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 goto usage;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -855,7 +855,7 @@
</span><span class="cx">                 switch_xml_free(xml);
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(local_stream_name) || switch_strlen_zero(path)) {
</del><ins>+        if (zstr(local_stream_name) || zstr(path)) {
</ins><span class="cx">                 goto usage;
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodformatsmod_native_filemod_native_filec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/formats/mod_native_file/mod_native_file.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/formats/mod_native_file/mod_native_file.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/formats/mod_native_file/mod_native_file.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -152,7 +152,7 @@
</span><span class="cx">         uint32_t x;
</span><span class="cx">
</span><span class="cx">         for (x = 0; x < num_codecs; x++) {
</span><del>-                supported_formats[x] = codecs[x]->iananame;
</del><ins>+                supported_formats[x] = switch_core_strdup(pool, codecs[x]->iananame);
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         *module_interface = switch_loadable_module_create_module_interface(pool, modname);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodformatsmod_portaudio_streammod_portaudio_streamc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/formats/mod_portaudio_stream/mod_portaudio_stream.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/formats/mod_portaudio_stream/mod_portaudio_stream.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/formats/mod_portaudio_stream/mod_portaudio_stream.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -136,7 +136,7 @@
</span><span class="cx">                 int match = 0;
</span><span class="cx">                 pdi = Pa_GetDeviceInfo(i);
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(name)) {
</del><ins>+                if (zstr(name)) {
</ins><span class="cx">                         match = 1;
</span><span class="cx">                 } else if (pdi && pdi->name && strstr(pdi->name, name)) {
</span><span class="cx">                         match = 1;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_javasrcorgfreeswitchswigCoreSessionjava"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -193,10 +193,6 @@
</span><span class="cx"> return freeswitchJNI.CoreSession_recordFile__SWIG_3(swigCPtr, this, file_name);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- public void setCallerData(String var, String val) {
- freeswitchJNI.CoreSession_setCallerData(swigCPtr, this, var, val);
- }
-
</del><span class="cx"> public int originate(CoreSession a_leg_session, String dest, int timeout, SWIGTYPE_p_switch_state_handler_table_t handlers) {
</span><span class="cx"> return freeswitchJNI.CoreSession_originate__SWIG_0(swigCPtr, this, CoreSession.getCPtr(a_leg_session), a_leg_session, dest, timeout, SWIGTYPE_p_switch_state_handler_table_t.getCPtr(handlers));
</span><span class="cx"> }
</span><span class="lines">@@ -225,10 +221,14 @@
</span><span class="cx"> freeswitchJNI.CoreSession_set_tts_parms(swigCPtr, this, tts_name, voice_name);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- public int collectDigits(int timeout) {
- return freeswitchJNI.CoreSession_collectDigits(swigCPtr, this, timeout);
</del><ins>+ public int collectDigits(int abs_timeout) {
+ return freeswitchJNI.CoreSession_collectDigits__SWIG_0(swigCPtr, this, abs_timeout);
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+ public int collectDigits(int digit_timeout, int abs_timeout) {
+ return freeswitchJNI.CoreSession_collectDigits__SWIG_1(swigCPtr, this, digit_timeout, abs_timeout);
+ }
+
</ins><span class="cx"> public String getDigits(int maxdigits, String terminators, int timeout) {
</span><span class="cx"> return freeswitchJNI.CoreSession_getDigits__SWIG_0(swigCPtr, this, maxdigits, terminators, timeout);
</span><span class="cx"> }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_javasrcorgfreeswitchswigfreeswitchJNIjava"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -125,7 +125,6 @@
</span><span class="cx"> public final static native int CoreSession_recordFile__SWIG_1(long jarg1, CoreSession jarg1_, String jarg2, int jarg3, int jarg4);
</span><span class="cx"> public final static native int CoreSession_recordFile__SWIG_2(long jarg1, CoreSession jarg1_, String jarg2, int jarg3);
</span><span class="cx"> public final static native int CoreSession_recordFile__SWIG_3(long jarg1, CoreSession jarg1_, String jarg2);
</span><del>- public final static native void CoreSession_setCallerData(long jarg1, CoreSession jarg1_, String jarg2, String jarg3);
</del><span class="cx"> public final static native int CoreSession_originate__SWIG_0(long jarg1, CoreSession jarg1_, long jarg2, CoreSession jarg2_, String jarg3, int jarg4, long jarg5);
</span><span class="cx"> public final static native int CoreSession_originate__SWIG_1(long jarg1, CoreSession jarg1_, long jarg2, CoreSession jarg2_, String jarg3, int jarg4);
</span><span class="cx"> public final static native int CoreSession_originate__SWIG_2(long jarg1, CoreSession jarg1_, long jarg2, CoreSession jarg2_, String jarg3);
</span><span class="lines">@@ -133,7 +132,8 @@
</span><span class="cx"> public final static native void CoreSession_setDTMFCallback(long jarg1, CoreSession jarg1_, long jarg2, String jarg3);
</span><span class="cx"> public final static native int CoreSession_speak(long jarg1, CoreSession jarg1_, String jarg2);
</span><span class="cx"> public final static native void CoreSession_set_tts_parms(long jarg1, CoreSession jarg1_, String jarg2, String jarg3);
</span><del>- public final static native int CoreSession_collectDigits(long jarg1, CoreSession jarg1_, int jarg2);
</del><ins>+ public final static native int CoreSession_collectDigits__SWIG_0(long jarg1, CoreSession jarg1_, int jarg2);
+ public final static native int CoreSession_collectDigits__SWIG_1(long jarg1, CoreSession jarg1_, int jarg2, int jarg3);
</ins><span class="cx"> public final static native String CoreSession_getDigits__SWIG_0(long jarg1, CoreSession jarg1_, int jarg2, String jarg3, int jarg4);
</span><span class="cx"> public final static native String CoreSession_getDigits__SWIG_1(long jarg1, CoreSession jarg1_, int jarg2, String jarg3, int jarg4, int jarg5);
</span><span class="cx"> public final static native int CoreSession_transfer__SWIG_0(long jarg1, CoreSession jarg1_, String jarg2, String jarg3, String jarg4);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_javaswitch_swig_wrapcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_java/switch_swig_wrap.cpp (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_java/switch_swig_wrap.cpp        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_java/switch_swig_wrap.cpp        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -2345,31 +2345,6 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><del>-SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1setCallerData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3) {
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
-
- (void)jenv;
- (void)jcls;
- (void)jarg1_;
- arg1 = *(CoreSession **)&jarg1;
- arg2 = 0;
- if (jarg2) {
- arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
- if (!arg2) return ;
- }
- arg3 = 0;
- if (jarg3) {
- arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0);
- if (!arg3) return ;
- }
- (arg1)->setCallerData(arg2,arg3);
- if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
- if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
-}
-
-
</del><span class="cx"> SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1originate_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jstring jarg3, jint jarg4, jlong jarg5) {
</span><span class="cx"> jint jresult = 0 ;
</span><span class="cx"> CoreSession *arg1 = (CoreSession *) 0 ;
</span><span class="lines">@@ -2529,7 +2504,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><del>-SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1collectDigits(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
</del><ins>+SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1collectDigits_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2) {
</ins><span class="cx"> jint jresult = 0 ;
</span><span class="cx"> CoreSession *arg1 = (CoreSession *) 0 ;
</span><span class="cx"> int arg2 ;
</span><span class="lines">@@ -2546,6 +2521,25 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1collectDigits_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jint jarg3) {
+ jint jresult = 0 ;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ int arg2 ;
+ int arg3 ;
+ int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(CoreSession **)&jarg1;
+ arg2 = (int)jarg2;
+ arg3 = (int)jarg3;
+ result = (int)(arg1)->collectDigits(arg2,arg3);
+ jresult = (jint)result;
+ return jresult;
+}
+
+
</ins><span class="cx"> SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1getDigits_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jint jarg2, jstring jarg3, jint jarg4) {
</span><span class="cx"> jstring jresult = 0 ;
</span><span class="cx"> CoreSession *arg1 = (CoreSession *) 0 ;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_luafreeswitch_luacpp"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_lua/freeswitch_lua.cpp (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_lua/freeswitch_lua.cpp        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_lua/freeswitch_lua.cpp        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx">                 lua_call(L, arg_count, 1);
</span><span class="cx">                 err = lua_tostring(L, -1);
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(err)) {
</del><ins>+                if (!zstr(err)) {
</ins><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s\n", err);
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -198,7 +198,7 @@
</span><span class="cx">
</span><span class="cx">         if (func) {
</span><span class="cx">                 hangup_func_str = strdup(func);
</span><del>-                if (!switch_strlen_zero(arg)) {
</del><ins>+                if (!zstr(arg)) {
</ins><span class="cx">                         hangup_func_arg = strdup(arg);
</span><span class="cx">                 }
</span><span class="cx">                 switch_channel_set_private(channel, "CoreSession", this);
</span><span class="lines">@@ -269,7 +269,7 @@
</span><span class="cx">                         lua_pushnumber(L, dtmf->duration);
</span><span class="cx">                         lua_rawset(L, -3);
</span><span class="cx">
</span><del>-                        if (!switch_strlen_zero(cb_arg)) {
</del><ins>+                        if (!zstr(cb_arg)) {
</ins><span class="cx">                                 lua_getfield(L, LUA_GLOBALSINDEX, (char *) cb_arg);
</span><span class="cx">                                 arg_count++;
</span><span class="cx">                         }
</span><span class="lines">@@ -293,7 +293,7 @@
</span><span class="cx">                         mod_lua_conjure_event(L, event, "__Input_Event__", 1);
</span><span class="cx">                         lua_getfield(L, LUA_GLOBALSINDEX, "__Input_Event__");
</span><span class="cx">
</span><del>-                        if (!switch_strlen_zero(cb_arg)) {
</del><ins>+                        if (!zstr(cb_arg)) {
</ins><span class="cx">                                 lua_getfield(L, LUA_GLOBALSINDEX, (char *) cb_arg);
</span><span class="cx">                                 arg_count++;
</span><span class="cx">                         }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_luamod_luacpp"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_lua/mod_lua.cpp (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_lua/mod_lua.cpp        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_lua/mod_lua.cpp        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx"> {
</span><span class="cx">         int error = 0;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(input_code)) {
</del><ins>+        if (zstr(input_code)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No code to execute!\n");
</span><span class="cx">                 return 1;
</span><span class="cx">         }
</span><span class="lines">@@ -178,7 +178,7 @@
</span><span class="cx">
</span><span class="cx">         if (error) {
</span><span class="cx">                 const char *err = lua_tostring(L, -1);
</span><del>-                if (!switch_strlen_zero(err)) {
</del><ins>+                if (!zstr(err)) {
</ins><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s\n", err);
</span><span class="cx">                 }
</span><span class="cx">                 lua_pop(L, 1);                        /* pop error message from the stack */
</span><span class="lines">@@ -216,7 +216,7 @@
</span><span class="cx">
</span><span class="cx">         switch_xml_t xml = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(globals.xml_handler)) {
</del><ins>+        if (!zstr(globals.xml_handler)) {
</ins><span class="cx">                 lua_State *L = lua_init();
</span><span class="cx">                 char *mycmd = strdup(globals.xml_handler);
</span><span class="cx">                 const char *str;
</span><span class="lines">@@ -253,7 +253,7 @@
</span><span class="cx">                 str = lua_tostring(L, 1);
</span><span class="cx">                 
</span><span class="cx">                 if (str) {
</span><del>-                        if (switch_strlen_zero(str)) {
</del><ins>+                        if (zstr(str)) {
</ins><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Result\n");
</span><span class="cx">                         } else if (!(xml = switch_xml_parse_str_dynamic((char *)str, SWITCH_TRUE))) {
</span><span class="cx">                                 /* const char -> char conversion was OK because switch_xml_parse_str_dynamic makes a duplicate of str
</span><span class="lines">@@ -293,17 +293,17 @@
</span><span class="cx">                         if (!strcmp(var, "xml-handler-script")) {
</span><span class="cx">                                 globals.xml_handler = switch_core_strdup(globals.pool, val);
</span><span class="cx">                         } else if (!strcmp(var, "xml-handler-bindings")) {
</span><del>-                                if (!switch_strlen_zero(globals.xml_handler)) {
</del><ins>+                                if (!zstr(globals.xml_handler)) {
</ins><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "binding '%s' to '%s'\n", globals.xml_handler, val);
</span><span class="cx">                                         switch_xml_bind_search_function(lua_fetch, switch_xml_parse_section_string(val), NULL);
</span><span class="cx">                                 }
</span><del>-                        } else if (!strcmp(var, "module-directory") && !switch_strlen_zero(val)) {
</del><ins>+                        } else if (!strcmp(var, "module-directory") && !zstr(val)) {
</ins><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "lua: appending module directory: '%s'\n", val);
</span><span class="cx">                                 if (cpath_stream.data_len) {
</span><span class="cx">                                         cpath_stream.write_function(&cpath_stream, ";");
</span><span class="cx">                                 }
</span><span class="cx">                                 cpath_stream.write_function(&cpath_stream, "%s", val);
</span><del>-                        } else if (!strcmp(var, "script-directory") && !switch_strlen_zero(val)) {
</del><ins>+                        } else if (!strcmp(var, "script-directory") && !zstr(val)) {
</ins><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "lua: appending script directory: '%s'\n", val);
</span><span class="cx">                                 if (path_stream.data_len) {
</span><span class="cx">                                         path_stream.write_function(&path_stream, ";");
</span><span class="lines">@@ -394,7 +394,7 @@
</span><span class="cx">         char *mycmd;
</span><span class="cx">         int error;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "no args specified!\n");
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="lines">@@ -413,7 +413,7 @@
</span><span class="cx"> SWITCH_STANDARD_API(luarun_api_function)
</span><span class="cx"> {
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "-ERR no args specified!\n");
</span><span class="cx">         } else {
</span><span class="cx">                 lua_thread(cmd);
</span><span class="lines">@@ -431,7 +431,7 @@
</span><span class="cx">         char *mycmd;
</span><span class="cx">         int error;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "");
</span><span class="cx">         } else {
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_luamod_lua_wrapcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_lua/mod_lua_wrap.cpp (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_lua/mod_lua_wrap.cpp        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_lua/mod_lua_wrap.cpp        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -5459,36 +5459,6 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><del>-static int _wrap_CoreSession_setCallerData(lua_State* L) {
- int SWIG_arg = -1;
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
-
- SWIG_check_num_args("setCallerData",3,3)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setCallerData",1,"CoreSession *");
- if(!lua_isstring(L,2)) SWIG_fail_arg("setCallerData",2,"char *");
- if(!lua_isstring(L,3)) SWIG_fail_arg("setCallerData",3,"char *");
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
- SWIG_fail_ptr("CoreSession_setCallerData",1,SWIGTYPE_p_CoreSession);
- }
-
- arg2 = (char *)lua_tostring(L, 2);
- arg3 = (char *)lua_tostring(L, 3);
- (arg1)->setCallerData(arg2,arg3);
- SWIG_arg=0;
-
- return SWIG_arg;
-
- if(0) SWIG_fail;
-
-fail:
- lua_error(L);
- return SWIG_arg;
-}
-
-
</del><span class="cx"> static int _wrap_CoreSession_originate__SWIG_0(lua_State* L) {
</span><span class="cx"> int SWIG_arg = -1;
</span><span class="cx"> CoreSession *arg1 = (CoreSession *) 0 ;
</span><span class="lines">@@ -5839,7 +5809,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><del>-static int _wrap_CoreSession_collectDigits(lua_State* L) {
</del><ins>+static int _wrap_CoreSession_collectDigits__SWIG_0(lua_State* L) {
</ins><span class="cx"> int SWIG_arg = -1;
</span><span class="cx"> CoreSession *arg1 = (CoreSession *) 0 ;
</span><span class="cx"> int arg2 ;
</span><span class="lines">@@ -5867,6 +5837,93 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+static int _wrap_CoreSession_collectDigits__SWIG_1(lua_State* L) {
+ int SWIG_arg = -1;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ int arg2 ;
+ int arg3 ;
+ int result;
+
+ SWIG_check_num_args("collectDigits",3,3)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("collectDigits",1,"CoreSession *");
+ if(!lua_isnumber(L,2)) SWIG_fail_arg("collectDigits",2,"int");
+ if(!lua_isnumber(L,3)) SWIG_fail_arg("collectDigits",3,"int");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
+ SWIG_fail_ptr("CoreSession_collectDigits",1,SWIGTYPE_p_CoreSession);
+ }
+
+ arg2 = (int)lua_tonumber(L, 2);
+ arg3 = (int)lua_tonumber(L, 3);
+ result = (int)(arg1)->collectDigits(arg2,arg3);
+ SWIG_arg=0;
+ lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_CoreSession_collectDigits(lua_State* L) {
+ int argc;
+ int argv[4]={
+ 1,2,3,4
+ };
+
+ argc = lua_gettop(L);
+ if (argc == 2) {
+ int _v;
+ {
+ void *ptr;
+ if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) {
+ _v = 0;
+ } else {
+ _v = 1;
+ }
+ }
+ if (_v) {
+ {
+ _v = lua_isnumber(L,argv[1]);
+ }
+ if (_v) {
+ return _wrap_CoreSession_collectDigits__SWIG_0(L);
+ }
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ {
+ void *ptr;
+ if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) {
+ _v = 0;
+ } else {
+ _v = 1;
+ }
+ }
+ if (_v) {
+ {
+ _v = lua_isnumber(L,argv[1]);
+ }
+ if (_v) {
+ {
+ _v = lua_isnumber(L,argv[2]);
+ }
+ if (_v) {
+ return _wrap_CoreSession_collectDigits__SWIG_1(L);
+ }
+ }
+ }
+ }
+
+ lua_pushstring(L,"No matching function for overloaded 'CoreSession_collectDigits'");
+ lua_error(L);return 0;
+}
+
+
</ins><span class="cx"> static int _wrap_CoreSession_getDigits__SWIG_0(lua_State* L) {
</span><span class="cx"> int SWIG_arg = -1;
</span><span class="cx"> CoreSession *arg1 = (CoreSession *) 0 ;
</span><span class="lines">@@ -7285,7 +7342,6 @@
</span><span class="cx"> {"hangupCause", _wrap_CoreSession_hangupCause},
</span><span class="cx"> {"getState", _wrap_CoreSession_getState},
</span><span class="cx"> {"recordFile", _wrap_CoreSession_recordFile},
</span><del>- {"setCallerData", _wrap_CoreSession_setCallerData},
</del><span class="cx"> {"originate", _wrap_CoreSession_originate},
</span><span class="cx"> {"destroy", _wrap_CoreSession_destroy},
</span><span class="cx"> {"setDTMFCallback", _wrap_CoreSession_setDTMFCallback},
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_managedfreeswitch_wrapcxx"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_managed/freeswitch_wrap.cxx (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_managed/freeswitch_wrap.cxx        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_managed/freeswitch_wrap.cxx        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -1114,6 +1114,17 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_SOFT_HOLDING_UUID_VARIABLE_get() {
+ char * jresult ;
+ char *result = 0 ;
+
+ result = (char *) "soft_holding_uuid";
+
+ jresult = SWIG_csharp_string_callback((const char *)result);
+ return jresult;
+}
+
+
</ins><span class="cx"> SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_API_BRIDGE_END_VARIABLE_get() {
</span><span class="cx"> char * jresult ;
</span><span class="cx"> char *result = 0 ;
</span><span class="lines">@@ -4706,6 +4717,17 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+SWIGEXPORT int SWIGSTDCALL CSharp_MESSAGE_STRING_ARG_MAX_get() {
+ int jresult ;
+ int result;
+
+ result = (int) 10;
+
+ jresult = result;
+ return jresult;
+}
+
+
</ins><span class="cx"> SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_session_message_from_set(void * jarg1, char * jarg2) {
</span><span class="cx"> switch_core_session_message *arg1 = (switch_core_session_message *) 0 ;
</span><span class="cx"> char *arg2 = (char *) 0 ;
</span><span class="lines">@@ -5130,6 +5152,32 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_session_message_string_array_arg_set(void * jarg1, void * jarg2) {
+ switch_core_session_message *arg1 = (switch_core_session_message *) 0 ;
+ char **arg2 ;
+
+ arg1 = (switch_core_session_message *)jarg1;
+ arg2 = (char **)jarg2;
+ {
+ size_t ii;
+ char const * *b = (char const * *) arg1->string_array_arg;
+ for (ii = 0; ii < (size_t)10; ii++) b[ii] = *((char const * *) arg2 + ii);
+ }
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_core_session_message_string_array_arg_get(void * jarg1) {
+ void * jresult ;
+ switch_core_session_message *arg1 = (switch_core_session_message *) 0 ;
+ char **result = 0 ;
+
+ arg1 = (switch_core_session_message *)jarg1;
+ result = (char **)(char **) ((arg1)->string_array_arg);
+ jresult = result;
+ return jresult;
+}
+
+
</ins><span class="cx"> SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_core_session_message() {
</span><span class="cx"> void * jresult ;
</span><span class="cx"> switch_core_session_message *result = 0 ;
</span><span class="lines">@@ -6150,6 +6198,14 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_session_wake_session_thread(void * jarg1) {
+ switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+
+ arg1 = (switch_core_session_t *)jarg1;
+ switch_core_session_wake_session_thread(arg1);
+}
+
+
</ins><span class="cx"> SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_session_signal_state_change(void * jarg1) {
</span><span class="cx"> switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
</span><span class="cx">
</span><span class="lines">@@ -6306,6 +6362,14 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_session_free_message(void * jarg1) {
+ switch_core_session_message_t **arg1 = (switch_core_session_message_t **) 0 ;
+
+ arg1 = (switch_core_session_message_t **)jarg1;
+ switch_core_session_free_message(arg1);
+}
+
+
</ins><span class="cx"> SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_pass_indication(void * jarg1, int jarg2) {
</span><span class="cx"> int jresult ;
</span><span class="cx"> switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
</span><span class="lines">@@ -9451,13 +9515,15 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><del>-SWIGEXPORT int SWIGSTDCALL CSharp_switch_simple_email(char * jarg1, char * jarg2, char * jarg3, char * jarg4, char * jarg5) {
</del><ins>+SWIGEXPORT int SWIGSTDCALL CSharp_switch_simple_email(char * jarg1, char * jarg2, char * jarg3, char * jarg4, char * jarg5, char * jarg6, char * jarg7) {
</ins><span class="cx"> int jresult ;
</span><span class="cx"> char *arg1 = (char *) 0 ;
</span><span class="cx"> char *arg2 = (char *) 0 ;
</span><span class="cx"> char *arg3 = (char *) 0 ;
</span><span class="cx"> char *arg4 = (char *) 0 ;
</span><span class="cx"> char *arg5 = (char *) 0 ;
</span><ins>+ char *arg6 = (char *) 0 ;
+ char *arg7 = (char *) 0 ;
</ins><span class="cx"> switch_bool_t result;
</span><span class="cx">
</span><span class="cx"> arg1 = (char *)jarg1;
</span><span class="lines">@@ -9465,7 +9531,9 @@
</span><span class="cx"> arg3 = (char *)jarg3;
</span><span class="cx"> arg4 = (char *)jarg4;
</span><span class="cx"> arg5 = (char *)jarg5;
</span><del>- result = (switch_bool_t)switch_simple_email((char const *)arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5);
</del><ins>+ arg6 = (char *)jarg6;
+ arg7 = (char *)jarg7;
+ result = (switch_bool_t)switch_simple_email((char const *)arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,(char const *)arg6,(char const *)arg7);
</ins><span class="cx"> jresult = result;
</span><span class="cx"> return jresult;
</span><span class="cx"> }
</span><span class="lines">@@ -9717,6 +9785,64 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+SWIGEXPORT void SWIGSTDCALL CSharp_switch_caller_profile_callee_id_name_set(void * jarg1, char * jarg2) {
+ switch_caller_profile *arg1 = (switch_caller_profile *) 0 ;
+ char *arg2 = (char *) 0 ;
+
+ arg1 = (switch_caller_profile *)jarg1;
+ arg2 = (char *)jarg2;
+ {
+ if (arg2) {
+ arg1->callee_id_name = (char const *) (new char[strlen((const char *)arg2)+1]);
+ strcpy((char *)arg1->callee_id_name, (const char *)arg2);
+ } else {
+ arg1->callee_id_name = 0;
+ }
+ }
+}
+
+
+SWIGEXPORT char * SWIGSTDCALL CSharp_switch_caller_profile_callee_id_name_get(void * jarg1) {
+ char * jresult ;
+ switch_caller_profile *arg1 = (switch_caller_profile *) 0 ;
+ char *result = 0 ;
+
+ arg1 = (switch_caller_profile *)jarg1;
+ result = (char *) ((arg1)->callee_id_name);
+ jresult = SWIG_csharp_string_callback((const char *)result);
+ return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_caller_profile_callee_id_number_set(void * jarg1, char * jarg2) {
+ switch_caller_profile *arg1 = (switch_caller_profile *) 0 ;
+ char *arg2 = (char *) 0 ;
+
+ arg1 = (switch_caller_profile *)jarg1;
+ arg2 = (char *)jarg2;
+ {
+ if (arg2) {
+ arg1->callee_id_number = (char const *) (new char[strlen((const char *)arg2)+1]);
+ strcpy((char *)arg1->callee_id_number, (const char *)arg2);
+ } else {
+ arg1->callee_id_number = 0;
+ }
+ }
+}
+
+
+SWIGEXPORT char * SWIGSTDCALL CSharp_switch_caller_profile_callee_id_number_get(void * jarg1) {
+ char * jresult ;
+ switch_caller_profile *arg1 = (switch_caller_profile *) 0 ;
+ char *result = 0 ;
+
+ arg1 = (switch_caller_profile *)jarg1;
+ result = (char *) ((arg1)->callee_id_number);
+ jresult = SWIG_csharp_string_callback((const char *)result);
+ return jresult;
+}
+
+
</ins><span class="cx"> SWIGEXPORT void SWIGSTDCALL CSharp_switch_caller_profile_caller_ton_set(void * jarg1, unsigned char jarg2) {
</span><span class="cx"> switch_caller_profile *arg1 = (switch_caller_profile *) 0 ;
</span><span class="cx"> uint8_t arg2 ;
</span><span class="lines">@@ -19417,6 +19543,30 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_restart(void * jarg1) {
+ switch_channel_t *arg1 = (switch_channel_t *) 0 ;
+
+ arg1 = (switch_channel_t *)jarg1;
+ switch_channel_restart(arg1);
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_caller_extension_masquerade(void * jarg1, void * jarg2, unsigned long jarg3) {
+ int jresult ;
+ switch_channel_t *arg1 = (switch_channel_t *) 0 ;
+ switch_channel_t *arg2 = (switch_channel_t *) 0 ;
+ uint32_t arg3 ;
+ switch_status_t result;
+
+ arg1 = (switch_channel_t *)jarg1;
+ arg2 = (switch_channel_t *)jarg2;
+ arg3 = (uint32_t)jarg3;
+ result = (switch_status_t)switch_channel_caller_extension_masquerade(arg1,arg2,arg3);
+ jresult = result;
+ return jresult;
+}
+
+
</ins><span class="cx"> SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_set_caller_extension(void * jarg1, void * jarg2) {
</span><span class="cx"> switch_channel_t *arg1 = (switch_channel_t *) 0 ;
</span><span class="cx"> switch_caller_extension_t *arg2 = (switch_caller_extension_t *) 0 ;
</span><span class="lines">@@ -19473,6 +19623,40 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_set_cap(void * jarg1, int jarg2) {
+ switch_channel_t *arg1 = (switch_channel_t *) 0 ;
+ switch_channel_cap_t arg2 ;
+
+ arg1 = (switch_channel_t *)jarg1;
+ arg2 = (switch_channel_cap_t)jarg2;
+ switch_channel_set_cap(arg1,arg2);
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_clear_cap(void * jarg1, int jarg2) {
+ switch_channel_t *arg1 = (switch_channel_t *) 0 ;
+ switch_channel_cap_t arg2 ;
+
+ arg1 = (switch_channel_t *)jarg1;
+ arg2 = (switch_channel_cap_t)jarg2;
+ switch_channel_clear_cap(arg1,arg2);
+}
+
+
+SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_channel_test_cap(void * jarg1, int jarg2) {
+ unsigned long jresult ;
+ switch_channel_t *arg1 = (switch_channel_t *) 0 ;
+ switch_channel_cap_t arg2 ;
+ uint32_t result;
+
+ arg1 = (switch_channel_t *)jarg1;
+ arg2 = (switch_channel_cap_t)jarg2;
+ result = (uint32_t)switch_channel_test_cap(arg1,arg2);
+ jresult = (unsigned long)result;
+ return jresult;
+}
+
+
</ins><span class="cx"> SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_set_flag_partner(void * jarg1, int jarg2) {
</span><span class="cx"> int jresult ;
</span><span class="cx"> switch_channel_t *arg1 = (switch_channel_t *) 0 ;
</span><span class="lines">@@ -22104,6 +22288,18 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_parse_all_messages(void * jarg1) {
+ int jresult ;
+ switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+ switch_status_t result;
+
+ arg1 = (switch_core_session_t *)jarg1;
+ result = (switch_status_t)switch_ivr_parse_all_messages(arg1);
+ jresult = result;
+ return jresult;
+}
+
+
</ins><span class="cx"> SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_sleep(void * jarg1, unsigned long jarg2, int jarg3, void * jarg4) {
</span><span class="cx"> int jresult ;
</span><span class="cx"> switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
</span><span class="lines">@@ -22664,6 +22860,16 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+SWIGEXPORT void SWIGSTDCALL CSharp_switch_ivr_bridge_display(void * jarg1, void * jarg2) {
+ switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+ switch_core_session_t *arg2 = (switch_core_session_t *) 0 ;
+
+ arg1 = (switch_core_session_t *)jarg1;
+ arg2 = (switch_core_session_t *)jarg2;
+ switch_ivr_bridge_display(arg1,arg2);
+}
+
+
</ins><span class="cx"> SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_multi_threaded_bridge(void * jarg1, void * jarg2, void * jarg3, void * jarg4, void * jarg5) {
</span><span class="cx"> int jresult ;
</span><span class="cx"> switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
</span><span class="lines">@@ -23472,6 +23678,18 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_uuid_exists(char * jarg1) {
+ int jresult ;
+ char *arg1 = (char *) 0 ;
+ switch_bool_t result;
+
+ arg1 = (char *)jarg1;
+ result = (switch_bool_t)switch_ivr_uuid_exists((char const *)arg1);
+ jresult = result;
+ return jresult;
+}
+
+
</ins><span class="cx"> SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_RTP_MAX_BUF_LEN_get() {
</span><span class="cx"> int jresult ;
</span><span class="cx"> int result;
</span><span class="lines">@@ -28848,18 +29066,6 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><del>-SWIGEXPORT void SWIGSTDCALL CSharp_CoreSession_SetCallerData(void * jarg1, char * jarg2, char * jarg3) {
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
-
- arg1 = (CoreSession *)jarg1;
- arg2 = (char *)jarg2;
- arg3 = (char *)jarg3;
- (arg1)->setCallerData(arg2,arg3);
-}
-
-
</del><span class="cx"> SWIGEXPORT int SWIGSTDCALL CSharp_CoreSession_originate(void * jarg1, void * jarg2, char * jarg3, int jarg4, void * jarg5) {
</span><span class="cx"> int jresult ;
</span><span class="cx"> CoreSession *arg1 = (CoreSession *) 0 ;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_managedmanagedFreeSWITCHManageddll"></a>
<div class="binary"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_managed/managed/FreeSWITCH.Managed.dll</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_managedmanagedFreeSWITCHManagedpdb"></a>
<div class="binary"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_managed/managed/FreeSWITCH.Managed.pdb</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_managedmanagedswigcs"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_managed/managed/swig.cs (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_managed/managed/swig.cs        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_managed/managed/swig.cs        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -260,10 +260,6 @@
</span><span class="cx"> return ret;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- public void SetCallerData(string var, string val) {
- freeswitchPINVOKE.CoreSession_SetCallerData(swigCPtr, var, val);
- }
-
</del><span class="cx"> protected int originate(CoreSession a_leg_session, string dest, int timeout, switch_state_handler_table handlers) {
</span><span class="cx"> int ret = freeswitchPINVOKE.CoreSession_originate(swigCPtr, CoreSession.getCPtr(a_leg_session), dest, timeout, switch_state_handler_table.getCPtr(handlers));
</span><span class="cx"> return ret;
</span><span class="lines">@@ -1203,6 +1199,10 @@
</span><span class="cx"> return ret;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ public static void switch_core_session_wake_session_thread(SWIGTYPE_p_switch_core_session session) {
+ freeswitchPINVOKE.switch_core_session_wake_session_thread(SWIGTYPE_p_switch_core_session.getCPtr(session));
+ }
+
</ins><span class="cx"> public static void switch_core_session_signal_state_change(SWIGTYPE_p_switch_core_session session) {
</span><span class="cx"> freeswitchPINVOKE.switch_core_session_signal_state_change(SWIGTYPE_p_switch_core_session.getCPtr(session));
</span><span class="cx"> }
</span><span class="lines">@@ -1269,6 +1269,10 @@
</span><span class="cx"> return ret;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ public static void switch_core_session_free_message(SWIGTYPE_p_p_switch_core_session_message message) {
+ freeswitchPINVOKE.switch_core_session_free_message(SWIGTYPE_p_p_switch_core_session_message.getCPtr(message));
+ }
+
</ins><span class="cx"> public static switch_status_t switch_core_session_pass_indication(SWIGTYPE_p_switch_core_session session, switch_core_session_message_types_t indication) {
</span><span class="cx"> switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_session_pass_indication(SWIGTYPE_p_switch_core_session.getCPtr(session), (int)indication);
</span><span class="cx"> return ret;
</span><span class="lines">@@ -2373,8 +2377,8 @@
</span><span class="cx"> return ret;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- public static switch_bool_t switch_simple_email(string to, string from, string headers, string body, string file) {
- switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_simple_email(to, from, headers, body, file);
</del><ins>+ public static switch_bool_t switch_simple_email(string to, string from, string headers, string body, string file, string convert_cmd, string convert_ext) {
+ switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_simple_email(to, from, headers, body, file, convert_cmd, convert_ext);
</ins><span class="cx"> return ret;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2626,6 +2630,15 @@
</span><span class="cx"> freeswitchPINVOKE.switch_channel_variable_last(SWIGTYPE_p_switch_channel.getCPtr(channel));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ public static void switch_channel_restart(SWIGTYPE_p_switch_channel channel) {
+ freeswitchPINVOKE.switch_channel_restart(SWIGTYPE_p_switch_channel.getCPtr(channel));
+ }
+
+ public static switch_status_t switch_channel_caller_extension_masquerade(SWIGTYPE_p_switch_channel orig_channel, SWIGTYPE_p_switch_channel new_channel, uint offset) {
+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_channel_caller_extension_masquerade(SWIGTYPE_p_switch_channel.getCPtr(orig_channel), SWIGTYPE_p_switch_channel.getCPtr(new_channel), offset);
+ return ret;
+ }
+
</ins><span class="cx"> public static void switch_channel_set_caller_extension(SWIGTYPE_p_switch_channel channel, switch_caller_extension caller_extension) {
</span><span class="cx"> freeswitchPINVOKE.switch_channel_set_caller_extension(SWIGTYPE_p_switch_channel.getCPtr(channel), switch_caller_extension.getCPtr(caller_extension));
</span><span class="cx"> }
</span><span class="lines">@@ -2649,6 +2662,19 @@
</span><span class="cx"> freeswitchPINVOKE.switch_channel_set_flag_recursive(SWIGTYPE_p_switch_channel.getCPtr(channel), (int)flag);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ public static void switch_channel_set_cap(SWIGTYPE_p_switch_channel channel, switch_channel_cap_t cap) {
+ freeswitchPINVOKE.switch_channel_set_cap(SWIGTYPE_p_switch_channel.getCPtr(channel), (int)cap);
+ }
+
+ public static void switch_channel_clear_cap(SWIGTYPE_p_switch_channel channel, switch_channel_cap_t cap) {
+ freeswitchPINVOKE.switch_channel_clear_cap(SWIGTYPE_p_switch_channel.getCPtr(channel), (int)cap);
+ }
+
+ public static uint switch_channel_test_cap(SWIGTYPE_p_switch_channel channel, switch_channel_cap_t cap) {
+ uint ret = freeswitchPINVOKE.switch_channel_test_cap(SWIGTYPE_p_switch_channel.getCPtr(channel), (int)cap);
+ return ret;
+ }
+
</ins><span class="cx"> public static switch_bool_t switch_channel_set_flag_partner(SWIGTYPE_p_switch_channel channel, switch_channel_flag_t flag) {
</span><span class="cx"> switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_channel_set_flag_partner(SWIGTYPE_p_switch_channel.getCPtr(channel), (int)flag);
</span><span class="cx"> return ret;
</span><span class="lines">@@ -3173,6 +3199,11 @@
</span><span class="cx"> return ret;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ public static switch_status_t switch_ivr_parse_all_messages(SWIGTYPE_p_switch_core_session session) {
+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_parse_all_messages(SWIGTYPE_p_switch_core_session.getCPtr(session));
+ return ret;
+ }
+
</ins><span class="cx"> public static switch_status_t switch_ivr_sleep(SWIGTYPE_p_switch_core_session session, uint ms, switch_bool_t sync, switch_input_args_t args) {
</span><span class="cx"> switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_sleep(SWIGTYPE_p_switch_core_session.getCPtr(session), ms, (int)sync, switch_input_args_t.getCPtr(args));
</span><span class="cx"> return ret;
</span><span class="lines">@@ -3328,6 +3359,10 @@
</span><span class="cx"> return ret;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ public static void switch_ivr_bridge_display(SWIGTYPE_p_switch_core_session session, SWIGTYPE_p_switch_core_session peer_session) {
+ freeswitchPINVOKE.switch_ivr_bridge_display(SWIGTYPE_p_switch_core_session.getCPtr(session), SWIGTYPE_p_switch_core_session.getCPtr(peer_session));
+ }
+
</ins><span class="cx"> public static switch_status_t switch_ivr_multi_threaded_bridge(SWIGTYPE_p_switch_core_session session, SWIGTYPE_p_switch_core_session peer_session, SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_p_void_unsigned_int__switch_status_t dtmf_callback, SWIGTYPE_p_void session_data, SWIGTYPE_p_void peer_session_data) {
</span><span class="cx"> switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_multi_threaded_bridge(SWIGTYPE_p_switch_core_session.getCPtr(session), SWIGTYPE_p_switch_core_session.getCPtr(peer_session), SWIGTYPE_p_f_p_switch_core_session_p_void_enum_switch_input_type_t_p_void_unsigned_int__switch_status_t.getCPtr(dtmf_callback), SWIGTYPE_p_void.getCPtr(session_data), SWIGTYPE_p_void.getCPtr(peer_session_data));
</span><span class="cx"> return ret;
</span><span class="lines">@@ -3575,6 +3610,11 @@
</span><span class="cx"> freeswitchPINVOKE.switch_process_import(SWIGTYPE_p_switch_core_session.getCPtr(session), SWIGTYPE_p_switch_channel.getCPtr(peer_channel), varname);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ public static switch_bool_t switch_ivr_uuid_exists(string uuid) {
+ switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_ivr_uuid_exists(uuid);
+ return ret;
+ }
+
</ins><span class="cx"> public static switch_status_t switch_rtp_add_crypto_key(SWIGTYPE_p_switch_rtp rtp_session, switch_rtp_crypto_direction_t direction, uint index, switch_rtp_crypto_key_type_t type, SWIGTYPE_p_unsigned_char key, SWIGTYPE_p_switch_size_t keylen) {
</span><span class="cx"> switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_add_crypto_key(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), (int)direction, index, (int)type, SWIGTYPE_p_unsigned_char.getCPtr(key), SWIGTYPE_p_switch_size_t.getCPtr(keylen));
</span><span class="cx"> if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
</span><span class="lines">@@ -4365,6 +4405,7 @@
</span><span class="cx"> public static readonly string SWITCH_CHANNEL_EXECUTE_ON_RING_VARIABLE = freeswitchPINVOKE.SWITCH_CHANNEL_EXECUTE_ON_RING_VARIABLE_get();
</span><span class="cx"> public static readonly string SWITCH_CALL_TIMEOUT_VARIABLE = freeswitchPINVOKE.SWITCH_CALL_TIMEOUT_VARIABLE_get();
</span><span class="cx"> public static readonly string SWITCH_HOLDING_UUID_VARIABLE = freeswitchPINVOKE.SWITCH_HOLDING_UUID_VARIABLE_get();
</span><ins>+ public static readonly string SWITCH_SOFT_HOLDING_UUID_VARIABLE = freeswitchPINVOKE.SWITCH_SOFT_HOLDING_UUID_VARIABLE_get();
</ins><span class="cx"> public static readonly string SWITCH_API_BRIDGE_END_VARIABLE = freeswitchPINVOKE.SWITCH_API_BRIDGE_END_VARIABLE_get();
</span><span class="cx"> public static readonly string SWITCH_API_HANGUP_HOOK_VARIABLE = freeswitchPINVOKE.SWITCH_API_HANGUP_HOOK_VARIABLE_get();
</span><span class="cx"> public static readonly string SWITCH_SESSION_IN_HANGUP_HOOK_VARIABLE = freeswitchPINVOKE.SWITCH_SESSION_IN_HANGUP_HOOK_VARIABLE_get();
</span><span class="lines">@@ -4456,6 +4497,7 @@
</span><span class="cx"> public static readonly int SWITCH_CORE_DB_DONE = freeswitchPINVOKE.SWITCH_CORE_DB_DONE_get();
</span><span class="cx"> public static readonly int SWITCH_MAX_CORE_THREAD_SESSION_OBJS = freeswitchPINVOKE.SWITCH_MAX_CORE_THREAD_SESSION_OBJS_get();
</span><span class="cx"> public static readonly int SWITCH_MAX_STREAMS = freeswitchPINVOKE.SWITCH_MAX_STREAMS_get();
</span><ins>+ public static readonly int MESSAGE_STRING_ARG_MAX = freeswitchPINVOKE.MESSAGE_STRING_ARG_MAX_get();
</ins><span class="cx"> public static readonly string SWITCH_CORE_DB = freeswitchPINVOKE.SWITCH_CORE_DB_get();
</span><span class="cx"> public static readonly int SWITCH_CMD_CHUNK_LEN = freeswitchPINVOKE.SWITCH_CMD_CHUNK_LEN_get();
</span><span class="cx"> public static readonly int SWITCH_SMAX = freeswitchPINVOKE.SWITCH_SMAX_get();
</span><span class="lines">@@ -4880,6 +4922,9 @@
</span><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_HOLDING_UUID_VARIABLE_get")]
</span><span class="cx"> public static extern string SWITCH_HOLDING_UUID_VARIABLE_get();
</span><span class="cx">
</span><ins>+ [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_SOFT_HOLDING_UUID_VARIABLE_get")]
+ public static extern string SWITCH_SOFT_HOLDING_UUID_VARIABLE_get();
+
</ins><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_API_BRIDGE_END_VARIABLE_get")]
</span><span class="cx"> public static extern string SWITCH_API_BRIDGE_END_VARIABLE_get();
</span><span class="cx">
</span><span class="lines">@@ -5771,6 +5816,9 @@
</span><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_app_log")]
</span><span class="cx"> public static extern void delete_switch_app_log(HandleRef jarg1);
</span><span class="cx">
</span><ins>+ [DllImport("mod_managed", EntryPoint="CSharp_MESSAGE_STRING_ARG_MAX_get")]
+ public static extern int MESSAGE_STRING_ARG_MAX_get();
+
</ins><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_message_from_set")]
</span><span class="cx"> public static extern void switch_core_session_message_from_set(HandleRef jarg1, string jarg2);
</span><span class="cx">
</span><span class="lines">@@ -5867,6 +5915,12 @@
</span><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_message__line_get")]
</span><span class="cx"> public static extern int switch_core_session_message__line_get(HandleRef jarg1);
</span><span class="cx">
</span><ins>+ [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_message_string_array_arg_set")]
+ public static extern void switch_core_session_message_string_array_arg_set(HandleRef jarg1, HandleRef jarg2);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_message_string_array_arg_get")]
+ public static extern IntPtr switch_core_session_message_string_array_arg_get(HandleRef jarg1);
+
</ins><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_new_switch_core_session_message")]
</span><span class="cx"> public static extern IntPtr new_switch_core_session_message();
</span><span class="cx">
</span><span class="lines">@@ -6107,6 +6161,9 @@
</span><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_get_channel")]
</span><span class="cx"> public static extern IntPtr switch_core_session_get_channel(HandleRef jarg1);
</span><span class="cx">
</span><ins>+ [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_wake_session_thread")]
+ public static extern void switch_core_session_wake_session_thread(HandleRef jarg1);
+
</ins><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_signal_state_change")]
</span><span class="cx"> public static extern void switch_core_session_signal_state_change(HandleRef jarg1);
</span><span class="cx">
</span><span class="lines">@@ -6149,6 +6206,9 @@
</span><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_queue_message")]
</span><span class="cx"> public static extern int switch_core_session_queue_message(HandleRef jarg1, HandleRef jarg2);
</span><span class="cx">
</span><ins>+ [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_free_message")]
+ public static extern void switch_core_session_free_message(HandleRef jarg1);
+
</ins><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_pass_indication")]
</span><span class="cx"> public static extern int switch_core_session_pass_indication(HandleRef jarg1, int jarg2);
</span><span class="cx">
</span><span class="lines">@@ -6825,7 +6885,7 @@
</span><span class="cx"> public static extern string switch_url_decode(string jarg1);
</span><span class="cx">
</span><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_switch_simple_email")]
</span><del>- public static extern int switch_simple_email(string jarg1, string jarg2, string jarg3, string jarg4, string jarg5);
</del><ins>+ public static extern int switch_simple_email(string jarg1, string jarg2, string jarg3, string jarg4, string jarg5, string jarg6, string jarg7);
</ins><span class="cx">
</span><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_switch_find_end_paren")]
</span><span class="cx"> public static extern string switch_find_end_paren(string jarg1, char jarg2, char jarg3);
</span><span class="lines">@@ -6875,6 +6935,18 @@
</span><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_switch_caller_profile_caller_id_number_get")]
</span><span class="cx"> public static extern string switch_caller_profile_caller_id_number_get(HandleRef jarg1);
</span><span class="cx">
</span><ins>+ [DllImport("mod_managed", EntryPoint="CSharp_switch_caller_profile_callee_id_name_set")]
+ public static extern void switch_caller_profile_callee_id_name_set(HandleRef jarg1, string jarg2);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_caller_profile_callee_id_name_get")]
+ public static extern string switch_caller_profile_callee_id_name_get(HandleRef jarg1);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_caller_profile_callee_id_number_set")]
+ public static extern void switch_caller_profile_callee_id_number_set(HandleRef jarg1, string jarg2);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_caller_profile_callee_id_number_get")]
+ public static extern string switch_caller_profile_callee_id_number_get(HandleRef jarg1);
+
</ins><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_switch_caller_profile_caller_ton_set")]
</span><span class="cx"> public static extern void switch_caller_profile_caller_ton_set(HandleRef jarg1, byte jarg2);
</span><span class="cx">
</span><span class="lines">@@ -9293,6 +9365,12 @@
</span><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_variable_last")]
</span><span class="cx"> public static extern void switch_channel_variable_last(HandleRef jarg1);
</span><span class="cx">
</span><ins>+ [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_restart")]
+ public static extern void switch_channel_restart(HandleRef jarg1);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_caller_extension_masquerade")]
+ public static extern int switch_channel_caller_extension_masquerade(HandleRef jarg1, HandleRef jarg2, uint jarg3);
+
</ins><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_set_caller_extension")]
</span><span class="cx"> public static extern void switch_channel_set_caller_extension(HandleRef jarg1, HandleRef jarg2);
</span><span class="cx">
</span><span class="lines">@@ -9308,6 +9386,15 @@
</span><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_set_flag_recursive")]
</span><span class="cx"> public static extern void switch_channel_set_flag_recursive(HandleRef jarg1, int jarg2);
</span><span class="cx">
</span><ins>+ [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_set_cap")]
+ public static extern void switch_channel_set_cap(HandleRef jarg1, int jarg2);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_clear_cap")]
+ public static extern void switch_channel_clear_cap(HandleRef jarg1, int jarg2);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_test_cap")]
+ public static extern uint switch_channel_test_cap(HandleRef jarg1, int jarg2);
+
</ins><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_set_flag_partner")]
</span><span class="cx"> public static extern int switch_channel_set_flag_partner(HandleRef jarg1, int jarg2);
</span><span class="cx">
</span><span class="lines">@@ -9899,6 +9986,9 @@
</span><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_parse_next_event")]
</span><span class="cx"> public static extern int switch_ivr_parse_next_event(HandleRef jarg1);
</span><span class="cx">
</span><ins>+ [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_parse_all_messages")]
+ public static extern int switch_ivr_parse_all_messages(HandleRef jarg1);
+
</ins><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_sleep")]
</span><span class="cx"> public static extern int switch_ivr_sleep(HandleRef jarg1, uint jarg2, int jarg3, HandleRef jarg4);
</span><span class="cx">
</span><span class="lines">@@ -9992,6 +10082,9 @@
</span><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_originate")]
</span><span class="cx"> public static extern int switch_ivr_originate(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, string jarg4, uint jarg5, HandleRef jarg6, string jarg7, string jarg8, HandleRef jarg9, HandleRef jarg10, uint jarg11);
</span><span class="cx">
</span><ins>+ [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_bridge_display")]
+ public static extern void switch_ivr_bridge_display(HandleRef jarg1, HandleRef jarg2);
+
</ins><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_multi_threaded_bridge")]
</span><span class="cx"> public static extern int switch_ivr_multi_threaded_bridge(HandleRef jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4, HandleRef jarg5);
</span><span class="cx">
</span><span class="lines">@@ -10139,6 +10232,9 @@
</span><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_switch_process_import")]
</span><span class="cx"> public static extern void switch_process_import(HandleRef jarg1, HandleRef jarg2, string jarg3);
</span><span class="cx">
</span><ins>+ [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_uuid_exists")]
+ public static extern int switch_ivr_uuid_exists(string jarg1);
+
</ins><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_RTP_MAX_BUF_LEN_get")]
</span><span class="cx"> public static extern int SWITCH_RTP_MAX_BUF_LEN_get();
</span><span class="cx">
</span><span class="lines">@@ -11420,9 +11516,6 @@
</span><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_RecordFile")]
</span><span class="cx"> public static extern int CoreSession_RecordFile(HandleRef jarg1, string jarg2, int jarg3, int jarg4, int jarg5);
</span><span class="cx">
</span><del>- [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_SetCallerData")]
- public static extern void CoreSession_SetCallerData(HandleRef jarg1, string jarg2, string jarg3);
-
</del><span class="cx"> [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_originate")]
</span><span class="cx"> public static extern int CoreSession_originate(HandleRef jarg1, HandleRef jarg2, string jarg3, int jarg4, HandleRef jarg5);
</span><span class="cx">
</span><span class="lines">@@ -17680,6 +17773,26 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ public string callee_id_name {
+ set {
+ freeswitchPINVOKE.switch_caller_profile_callee_id_name_set(swigCPtr, value);
+ }
+ get {
+ string ret = freeswitchPINVOKE.switch_caller_profile_callee_id_name_get(swigCPtr);
+ return ret;
+ }
+ }
+
+ public string callee_id_number {
+ set {
+ freeswitchPINVOKE.switch_caller_profile_callee_id_number_set(swigCPtr, value);
+ }
+ get {
+ string ret = freeswitchPINVOKE.switch_caller_profile_callee_id_number_get(swigCPtr);
+ return ret;
+ }
+ }
+
</ins><span class="cx"> public byte caller_ton {
</span><span class="cx"> set {
</span><span class="cx"> freeswitchPINVOKE.switch_caller_profile_caller_ton_set(swigCPtr, value);
</span><span class="lines">@@ -17996,11 +18109,27 @@
</span><span class="cx">
</span><span class="cx"> namespace FreeSWITCH.Native {
</span><span class="cx">
</span><ins>+public enum switch_channel_cap_t {
+ CC_MEDIA_ACK = 1,
+ CC_FLAG_MAX
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.35
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
</ins><span class="cx"> public enum switch_channel_flag_t {
</span><span class="cx"> CF_ANSWERED = 1,
</span><span class="cx"> CF_OUTBOUND,
</span><span class="cx"> CF_EARLY_MEDIA,
</span><del>- CF_ORIGINATOR,
</del><ins>+ CF_BRIDGE_ORIGINATOR,
</ins><span class="cx"> CF_TRANSFER,
</span><span class="cx"> CF_ACCEPT_CNG,
</span><span class="cx"> CF_REDIRECT,
</span><span class="lines">@@ -18034,6 +18163,9 @@
</span><span class="cx"> CF_REPORTING,
</span><span class="cx"> CF_PARK,
</span><span class="cx"> CF_TIMESTAMP_SET,
</span><ins>+ CF_ORIGINATOR,
+ CF_XFER_ZOMBIE,
+ CF_MEDIA_ACK,
</ins><span class="cx"> CF_FLAG_MAX
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -19486,6 +19618,17 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ public SWIGTYPE_p_p_char string_array_arg {
+ set {
+ freeswitchPINVOKE.switch_core_session_message_string_array_arg_set(swigCPtr, SWIGTYPE_p_p_char.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_core_session_message_string_array_arg_get(swigCPtr);
+ SWIGTYPE_p_p_char ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_p_char(cPtr, false);
+ return ret;
+ }
+ }
+
</ins><span class="cx"> public switch_core_session_message() : this(freeswitchPINVOKE.new_switch_core_session_message(), true) {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -20914,6 +21057,7 @@
</span><span class="cx"> SWITCH_EVENT_NAT,
</span><span class="cx"> SWITCH_EVENT_RECORD_START,
</span><span class="cx"> SWITCH_EVENT_RECORD_STOP,
</span><ins>+ SWITCH_EVENT_CALL_UPDATE,
</ins><span class="cx"> SWITCH_EVENT_ALL
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_managedmod_managedcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_managed/mod_managed.cpp (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_managed/mod_managed.cpp        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_managed/mod_managed.cpp        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -371,7 +371,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> SWITCH_STANDARD_API(managedrun_api_function)
</span><span class="cx"> {
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "-ERR no args specified!\n");        
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -391,7 +391,7 @@
</span><span class="cx">
</span><span class="cx"> SWITCH_STANDARD_API(managed_api_function)
</span><span class="cx"> {
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "-ERR no args specified!\n");        
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -409,7 +409,7 @@
</span><span class="cx">
</span><span class="cx"> SWITCH_STANDARD_APP(managed_app_function)
</span><span class="cx"> {
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No args specified!\n");
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="lines">@@ -426,7 +426,7 @@
</span><span class="cx">
</span><span class="cx"> SWITCH_STANDARD_API(managedreload_api_function)
</span><span class="cx"> {
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "-ERR no args specified!\n");        
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_perlfreeswitchpm"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_perl/freeswitch.pm (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_perl/freeswitch.pm        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_perl/freeswitch.pm        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -414,7 +414,6 @@
</span><span class="cx"> *hangupCause = *freeswitchc::CoreSession_hangupCause;
</span><span class="cx"> *getState = *freeswitchc::CoreSession_getState;
</span><span class="cx"> *recordFile = *freeswitchc::CoreSession_recordFile;
</span><del>-*setCallerData = *freeswitchc::CoreSession_setCallerData;
</del><span class="cx"> *originate = *freeswitchc::CoreSession_originate;
</span><span class="cx"> *destroy = *freeswitchc::CoreSession_destroy;
</span><span class="cx"> *setDTMFCallback = *freeswitchc::CoreSession_setDTMFCallback;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_perlmod_perlc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_perl/mod_perl.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_perl/mod_perl.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_perl/mod_perl.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">
</span><span class="cx">         Perl_eval_pv(my_perl, string, FALSE);
</span><span class="cx">
</span><del>-        if ((err = SvPV(get_sv("@", TRUE), n_a)) && !switch_strlen_zero(err)) {
</del><ins>+        if ((err = SvPV(get_sv("@", TRUE), n_a)) && !zstr(err)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "[%s]\n%s\n", string, err);
</span><span class="cx">                 return -1;
</span><span class="cx">         }
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx"> {
</span><span class="cx">         int error = 0;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(input_code)) {
</del><ins>+        if (zstr(input_code)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No code to execute!\n");
</span><span class="cx">                 return -1;
</span><span class="cx">         }
</span><span class="lines">@@ -183,7 +183,7 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if ((err = SvPV(get_sv("@", TRUE), n_a)) && !switch_strlen_zero(err)) {
</del><ins>+                if ((err = SvPV(get_sv("@", TRUE), n_a)) && !zstr(err)) {
</ins><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s\n", err);
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -304,7 +304,7 @@
</span><span class="cx"> SWITCH_STANDARD_API(perlrun_api_function)
</span><span class="cx"> {
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "-ERR Missing args.\n");
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -319,7 +319,7 @@
</span><span class="cx">
</span><span class="cx">         struct perl_o po = { 0 };
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "-ERR Missing args.\n");
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -338,7 +338,7 @@
</span><span class="cx">         int argc = 0;
</span><span class="cx">         switch_xml_t xml = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(globals.xml_handler)) {
</del><ins>+        if (!zstr(globals.xml_handler)) {
</ins><span class="cx">                 PerlInterpreter *my_perl = clone_perl();
</span><span class="cx">                 HV *hash;
</span><span class="cx">                 char *str;
</span><span class="lines">@@ -360,7 +360,7 @@
</span><span class="cx">                         abort();
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(section)) {
</del><ins>+                if (zstr(section)) {
</ins><span class="cx">                         section = "";
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -368,7 +368,7 @@
</span><span class="cx">                 sv_setpv(this, section);
</span><span class="cx">                 hv_store(hash, "section", 7, this, 0);
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(tag_name)) {
</del><ins>+                if (zstr(tag_name)) {
</ins><span class="cx">                         tag_name = "";
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -376,7 +376,7 @@
</span><span class="cx">                 sv_setpv(this, tag_name);
</span><span class="cx">                 hv_store(hash, "tag_name", 8, this, 0);
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(key_name)) {
</del><ins>+                if (zstr(key_name)) {
</ins><span class="cx">                         key_name = "";
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -384,7 +384,7 @@
</span><span class="cx">                 sv_setpv(this, key_name);
</span><span class="cx">                 hv_store(hash, "key_name", 8, this, 0);
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(key_value)) {
</del><ins>+                if (zstr(key_value)) {
</ins><span class="cx">                         key_value = "";
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -414,8 +414,8 @@
</span><span class="cx">                 perl_run(my_perl);
</span><span class="cx">                 str = SvPV(get_sv("XML_STRING", TRUE), n_a);
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(str)) {
-                        if (switch_strlen_zero(str)) {
</del><ins>+                if (!zstr(str)) {
+                        if (zstr(str)) {
</ins><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Result\n");
</span><span class="cx">                         } else if (!(xml = switch_xml_parse_str(str, strlen(str)))) {
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing XML Result!\n");
</span><span class="lines">@@ -446,7 +446,7 @@
</span><span class="cx">                         if (!strcmp(var, "xml-handler-script")) {
</span><span class="cx">                                 globals.xml_handler = switch_core_strdup(globals.pool, val);
</span><span class="cx">                         } else if (!strcmp(var, "xml-handler-bindings")) {
</span><del>-                                if (!switch_strlen_zero(globals.xml_handler)) {
</del><ins>+                                if (!zstr(globals.xml_handler)) {
</ins><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "binding '%s' to '%s'\n", globals.xml_handler, var);
</span><span class="cx">                                         switch_xml_bind_search_function(perl_fetch, switch_xml_parse_section_string(val), NULL);
</span><span class="cx">                                 }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_perlmod_perl_wrapcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_perl/mod_perl_wrap.cpp (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_perl/mod_perl_wrap.cpp        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_perl/mod_perl_wrap.cpp        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -7080,55 +7080,6 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><del>-XS(_wrap_CoreSession_setCallerData) {
- {
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- int res3 ;
- char *buf3 = 0 ;
- int alloc3 = 0 ;
- int argvi = 0;
- dXSARGS;
-
- if ((items < 3) || (items > 3)) {
- SWIG_croak("Usage: CoreSession_setCallerData(self,var,val);");
- }
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_setCallerData" "', argument " "1"" of type '" "CoreSession *""'");
- }
- arg1 = reinterpret_cast< CoreSession * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_setCallerData" "', argument " "2"" of type '" "char *""'");
- }
- arg2 = reinterpret_cast< char * >(buf2);
- res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_setCallerData" "', argument " "3"" of type '" "char *""'");
- }
- arg3 = reinterpret_cast< char * >(buf3);
- (arg1)->setCallerData(arg2,arg3);
-
-
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- XSRETURN(argvi);
- fail:
-
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- SWIG_croak_null();
- }
-}
-
-
</del><span class="cx"> XS(_wrap_CoreSession_originate__SWIG_0) {
</span><span class="cx"> {
</span><span class="cx"> CoreSession *arg1 = (CoreSession *) 0 ;
</span><span class="lines">@@ -7632,7 +7583,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><del>-XS(_wrap_CoreSession_collectDigits) {
</del><ins>+XS(_wrap_CoreSession_collectDigits__SWIG_0) {
</ins><span class="cx"> {
</span><span class="cx"> CoreSession *arg1 = (CoreSession *) 0 ;
</span><span class="cx"> int arg2 ;
</span><span class="lines">@@ -7645,7 +7596,7 @@
</span><span class="cx"> dXSARGS;
</span><span class="cx">
</span><span class="cx"> if ((items < 2) || (items > 2)) {
</span><del>- SWIG_croak("Usage: CoreSession_collectDigits(self,timeout);");
</del><ins>+ SWIG_croak("Usage: CoreSession_collectDigits(self,abs_timeout);");
</ins><span class="cx"> }
</span><span class="cx"> res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
</span><span class="cx"> if (!SWIG_IsOK(res1)) {
</span><span class="lines">@@ -7670,6 +7621,146 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+XS(_wrap_CoreSession_collectDigits__SWIG_1) {
+ {
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ int arg2 ;
+ int arg3 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ int argvi = 0;
+ dXSARGS;
+
+ if ((items < 3) || (items > 3)) {
+ SWIG_croak("Usage: CoreSession_collectDigits(self,digit_timeout,abs_timeout);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_collectDigits" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoreSession_collectDigits" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = static_cast< int >(val2);
+ ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_collectDigits" "', argument " "3"" of type '" "int""'");
+ }
+ arg3 = static_cast< int >(val3);
+ result = (int)(arg1)->collectDigits(arg2,arg3);
+ ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
+
+
+
+ XSRETURN(argvi);
+ fail:
+
+
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_CoreSession_collectDigits) {
+ dXSARGS;
+
+ {
+ unsigned long _index = 0;
+ SWIG_TypeRank _rank = 0;
+ if (items == 2) {
+ SWIG_TypeRank _ranki = 0;
+ SWIG_TypeRank _rankm = 0;
+ SWIG_TypeRank _pi = 1;
+ int _v = 0;
+ {
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_CoreSession, 0);
+ _v = SWIG_CheckState(res);
+ }
+ if (!_v) goto check_1;
+ _ranki += _v*_pi;
+ _rankm += _pi;
+ _pi *= SWIG_MAXCASTRANK;
+ {
+ {
+ int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL);
+ _v = SWIG_CheckState(res);
+ }
+ }
+ if (!_v) goto check_1;
+ _ranki += _v*_pi;
+ _rankm += _pi;
+ _pi *= SWIG_MAXCASTRANK;
+ if (!_index || (_ranki < _rank)) {
+ _rank = _ranki; _index = 1;
+ if (_rank == _rankm) goto dispatch;
+ }
+ }
+ check_1:
+
+ if (items == 3) {
+ SWIG_TypeRank _ranki = 0;
+ SWIG_TypeRank _rankm = 0;
+ SWIG_TypeRank _pi = 1;
+ int _v = 0;
+ {
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_CoreSession, 0);
+ _v = SWIG_CheckState(res);
+ }
+ if (!_v) goto check_2;
+ _ranki += _v*_pi;
+ _rankm += _pi;
+ _pi *= SWIG_MAXCASTRANK;
+ {
+ {
+ int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL);
+ _v = SWIG_CheckState(res);
+ }
+ }
+ if (!_v) goto check_2;
+ _ranki += _v*_pi;
+ _rankm += _pi;
+ _pi *= SWIG_MAXCASTRANK;
+ {
+ {
+ int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), NULL);
+ _v = SWIG_CheckState(res);
+ }
+ }
+ if (!_v) goto check_2;
+ _ranki += _v*_pi;
+ _rankm += _pi;
+ _pi *= SWIG_MAXCASTRANK;
+ if (!_index || (_ranki < _rank)) {
+ _rank = _ranki; _index = 2;
+ if (_rank == _rankm) goto dispatch;
+ }
+ }
+ check_2:
+
+ dispatch:
+ switch(_index) {
+ case 1:
+ ++PL_markstack_ptr; SWIG_CALLXS(_wrap_CoreSession_collectDigits__SWIG_0); return;
+ case 2:
+ ++PL_markstack_ptr; SWIG_CALLXS(_wrap_CoreSession_collectDigits__SWIG_1); return;
+ }
+ }
+
+ croak("No matching function for overloaded 'CoreSession_collectDigits'");
+ XSRETURN(0);
+}
+
+
</ins><span class="cx"> XS(_wrap_CoreSession_getDigits__SWIG_0) {
</span><span class="cx"> {
</span><span class="cx"> CoreSession *arg1 = (CoreSession *) 0 ;
</span><span class="lines">@@ -11598,7 +11689,6 @@
</span><span class="cx"> {"freeswitchc::CoreSession_hangupCause", _wrap_CoreSession_hangupCause},
</span><span class="cx"> {"freeswitchc::CoreSession_getState", _wrap_CoreSession_getState},
</span><span class="cx"> {"freeswitchc::CoreSession_recordFile", _wrap_CoreSession_recordFile},
</span><del>-{"freeswitchc::CoreSession_setCallerData", _wrap_CoreSession_setCallerData},
</del><span class="cx"> {"freeswitchc::CoreSession_originate", _wrap_CoreSession_originate},
</span><span class="cx"> {"freeswitchc::CoreSession_destroy", _wrap_CoreSession_destroy},
</span><span class="cx"> {"freeswitchc::CoreSession_setDTMFCallback", _wrap_CoreSession_setDTMFCallback},
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_pythonfreeswitchpy"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_python/freeswitch.py (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_python/freeswitch.py        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_python/freeswitch.py        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -272,7 +272,6 @@
</span><span class="cx"> def hangupCause(*args): return _freeswitch.CoreSession_hangupCause(*args)
</span><span class="cx"> def getState(*args): return _freeswitch.CoreSession_getState(*args)
</span><span class="cx"> def recordFile(*args): return _freeswitch.CoreSession_recordFile(*args)
</span><del>- def setCallerData(*args): return _freeswitch.CoreSession_setCallerData(*args)
</del><span class="cx"> def originate(*args): return _freeswitch.CoreSession_originate(*args)
</span><span class="cx"> def destroy(*args): return _freeswitch.CoreSession_destroy(*args)
</span><span class="cx"> def setDTMFCallback(*args): return _freeswitch.CoreSession_setDTMFCallback(*args)
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_pythonmod_pythonc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_python/mod_python.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_python/mod_python.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_python/mod_python.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -236,7 +236,7 @@
</span><span class="cx">         switch_xml_t xml = NULL;
</span><span class="cx">         char *str = NULL;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(globals.xml_handler)) {
</del><ins>+        if (!zstr(globals.xml_handler)) {
</ins><span class="cx">                 char *mycmd = strdup(globals.xml_handler);
</span><span class="cx">
</span><span class="cx">                 switch_assert(mycmd);
</span><span class="lines">@@ -244,7 +244,7 @@
</span><span class="cx">                 eval_some_python("xml_fetch", mycmd, NULL, NULL, params, &str, NULL);
</span><span class="cx">
</span><span class="cx">                 if (str) {
</span><del>-                        if (switch_strlen_zero(str)) {
</del><ins>+                        if (zstr(str)) {
</ins><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Result\n");
</span><span class="cx">                         } else if (!(xml = switch_xml_parse_str((char *) str, strlen(str)))) {
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Parsing XML Result!\n");
</span><span class="lines">@@ -276,7 +276,7 @@
</span><span class="cx">                         if (!strcmp(var, "xml-handler-script")) {
</span><span class="cx">                                 globals.xml_handler = switch_core_strdup(globals.pool, val);
</span><span class="cx">                         } else if (!strcmp(var, "xml-handler-bindings")) {
</span><del>-                                if (!switch_strlen_zero(globals.xml_handler)) {
</del><ins>+                                if (!zstr(globals.xml_handler)) {
</ins><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "binding '%s' to '%s'\n", globals.xml_handler, val);
</span><span class="cx">                                         switch_xml_bind_search_function(python_fetch, switch_xml_parse_section_string(val), NULL);
</span><span class="cx">                                 }
</span><span class="lines">@@ -397,7 +397,7 @@
</span><span class="cx"> SWITCH_STANDARD_API(launch_python)
</span><span class="cx"> {
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "USAGE: %s\n", python_run_interface.syntax);
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_pythonmod_python_wrapcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_python/mod_python_wrap.cpp (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_python/mod_python_wrap.cpp        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_python/mod_python_wrap.cpp        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -7175,51 +7175,6 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><del>-SWIGINTERN PyObject *_wrap_CoreSession_setCallerData(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- int res3 ;
- char *buf3 = 0 ;
- int alloc3 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_setCallerData",&obj0,&obj1,&obj2)) SWIG_fail;
- res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_setCallerData" "', argument " "1"" of type '" "CoreSession *""'");
- }
- arg1 = reinterpret_cast< CoreSession * >(argp1);
- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_setCallerData" "', argument " "2"" of type '" "char *""'");
- }
- arg2 = reinterpret_cast< char * >(buf2);
- res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_setCallerData" "', argument " "3"" of type '" "char *""'");
- }
- arg3 = reinterpret_cast< char * >(buf3);
- (arg1)->setCallerData(arg2,arg3);
- resultobj = SWIG_Py_Void();
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return resultobj;
-fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return NULL;
-}
-
-
</del><span class="cx"> SWIGINTERN PyObject *_wrap_CoreSession_originate__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
</span><span class="cx"> PyObject *resultobj = 0;
</span><span class="cx"> CoreSession *arg1 = (CoreSession *) 0 ;
</span><span class="lines">@@ -7608,7 +7563,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><del>-SWIGINTERN PyObject *_wrap_CoreSession_collectDigits(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
</del><ins>+SWIGINTERN PyObject *_wrap_CoreSession_collectDigits__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
</ins><span class="cx"> PyObject *resultobj = 0;
</span><span class="cx"> CoreSession *arg1 = (CoreSession *) 0 ;
</span><span class="cx"> int arg2 ;
</span><span class="lines">@@ -7639,6 +7594,102 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+SWIGINTERN PyObject *_wrap_CoreSession_collectDigits__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ int arg2 ;
+ int arg3 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_collectDigits",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_collectDigits" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoreSession_collectDigits" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = static_cast< int >(val2);
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoreSession_collectDigits" "', argument " "3"" of type '" "int""'");
+ }
+ arg3 = static_cast< int >(val3);
+ result = (int)(arg1)->collectDigits(arg2,arg3);
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoreSession_collectDigits(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[4];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 3); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 2) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CoreSession, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_int(argv[1], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_CoreSession_collectDigits__SWIG_0(self, args);
+ }
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CoreSession, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_int(argv[1], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ {
+ int res = SWIG_AsVal_int(argv[2], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_CoreSession_collectDigits__SWIG_1(self, args);
+ }
+ }
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CoreSession_collectDigits'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " collectDigits(CoreSession *,int)\n"
+ " collectDigits(CoreSession *,int,int)\n");
+ return NULL;
+}
+
+
</ins><span class="cx"> SWIGINTERN PyObject *_wrap_CoreSession_getDigits__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
</span><span class="cx"> PyObject *resultobj = 0;
</span><span class="cx"> CoreSession *arg1 = (CoreSession *) 0 ;
</span><span class="lines">@@ -10378,7 +10429,6 @@
</span><span class="cx">          { (char *)"CoreSession_hangupCause", _wrap_CoreSession_hangupCause, METH_VARARGS, NULL},
</span><span class="cx">          { (char *)"CoreSession_getState", _wrap_CoreSession_getState, METH_VARARGS, NULL},
</span><span class="cx">          { (char *)"CoreSession_recordFile", _wrap_CoreSession_recordFile, METH_VARARGS, NULL},
</span><del>-         { (char *)"CoreSession_setCallerData", _wrap_CoreSession_setCallerData, METH_VARARGS, NULL},
</del><span class="cx">          { (char *)"CoreSession_originate", _wrap_CoreSession_originate, METH_VARARGS, NULL},
</span><span class="cx">          { (char *)"CoreSession_destroy", _wrap_CoreSession_destroy, METH_VARARGS, NULL},
</span><span class="cx">          { (char *)"CoreSession_setDTMFCallback", _wrap_CoreSession_setDTMFCallback, METH_VARARGS, NULL},
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_spidermonkeymod_spidermonkeyc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -1015,7 +1015,7 @@
</span><span class="cx">                 if ((mods = switch_xml_child(cfg, "modules"))) {
</span><span class="cx">                         for (ld = switch_xml_child(mods, "load"); ld; ld = ld->next) {
</span><span class="cx">                                 const char *val = switch_xml_attr_soft(ld, "module");
</span><del>-                                if (!switch_strlen_zero(val) && strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT)) {
</del><ins>+                                if (!zstr(val) && strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT)) {
</ins><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Invalid extension for %s\n", val);
</span><span class="cx">                                         continue;
</span><span class="cx">                                 }
</span><span class="lines">@@ -1405,7 +1405,7 @@
</span><span class="cx">
</span><span class="cx">         if (argc > 0) {
</span><span class="cx">                 file_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
</span><del>-                if (switch_strlen_zero(file_name)) {
</del><ins>+                if (zstr(file_name)) {
</ins><span class="cx">                         return JS_FALSE;
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -1542,7 +1542,7 @@
</span><span class="cx">
</span><span class="cx">         if (argc > 0) {
</span><span class="cx">                 phrase_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
</span><del>-                if (switch_strlen_zero(phrase_name)) {
</del><ins>+                if (zstr(phrase_name)) {
</ins><span class="cx">                         return JS_FALSE;
</span><span class="cx">                 }
</span><span class="cx">         } else {
</span><span class="lines">@@ -1555,7 +1555,7 @@
</span><span class="cx">
</span><span class="cx">         if (argc > 2) {
</span><span class="cx">                 tmp = JS_GetStringBytes(JS_ValueToString(cx, argv[2]));
</span><del>-                if (!switch_strlen_zero(tmp)) {
</del><ins>+                if (!zstr(tmp)) {
</ins><span class="cx">                         phrase_lang = tmp;
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -1609,7 +1609,7 @@
</span><span class="cx">                 }
</span><span class="cx">                 JS_CallFunction(jss->cx, jss->obj, jss->on_hangup, argc, argv, &ret);
</span><span class="cx">                 resp = JS_GetStringBytes(JS_ValueToString(jss->cx, ret));
</span><del>-                if (!switch_strlen_zero(resp)) {
</del><ins>+                if (!zstr(resp)) {
</ins><span class="cx">                         ret = !strcasecmp(resp, "exit") ? JS_FALSE : JS_TRUE;
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -1683,7 +1683,7 @@
</span><span class="cx">
</span><span class="cx">         if (argc > 0) {
</span><span class="cx">                 file_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
</span><del>-                if (switch_strlen_zero(file_name)) {
</del><ins>+                if (zstr(file_name)) {
</ins><span class="cx">                         return JS_FALSE;
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -1927,12 +1927,12 @@
</span><span class="cx">         voice_name = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
</span><span class="cx">         text = JS_GetStringBytes(JS_ValueToString(cx, argv[2]));
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(tts_name)) {
</del><ins>+        if (zstr(tts_name)) {
</ins><span class="cx">                 eval_some_js("~throw new Error(\"Invalid TTS Name\");", cx, obj, rval);
</span><span class="cx">                 return JS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(text)) {
</del><ins>+        if (zstr(text)) {
</ins><span class="cx">                 eval_some_js("~throw new Error(\"Invalid Text\");", cx, obj, rval);
</span><span class="cx">                 return JS_FALSE;
</span><span class="cx">         }
</span><span class="lines">@@ -2972,21 +2972,21 @@
</span><span class="cx">
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(jss->dialplan))
</del><ins>+                if (!zstr(jss->dialplan))
</ins><span class="cx">                         dialplan = jss->dialplan;
</span><del>-                if (!switch_strlen_zero(jss->caller_id_name))
</del><ins>+                if (!zstr(jss->caller_id_name))
</ins><span class="cx">                         cid_name = jss->caller_id_name;
</span><del>-                if (!switch_strlen_zero(jss->caller_id_number))
</del><ins>+                if (!zstr(jss->caller_id_number))
</ins><span class="cx">                         cid_num = jss->caller_id_number;
</span><del>-                if (!switch_strlen_zero(jss->ani))
</del><ins>+                if (!zstr(jss->ani))
</ins><span class="cx">                         ani = jss->ani;
</span><del>-                if (!switch_strlen_zero(jss->aniii))
</del><ins>+                if (!zstr(jss->aniii))
</ins><span class="cx">                         aniii = jss->aniii;
</span><del>-                if (!switch_strlen_zero(jss->rdnis))
</del><ins>+                if (!zstr(jss->rdnis))
</ins><span class="cx">                         rdnis = jss->rdnis;
</span><del>-                if (!switch_strlen_zero(jss->context))
</del><ins>+                if (!zstr(jss->context))
</ins><span class="cx">                         context = jss->context;
</span><del>-                if (!switch_strlen_zero(jss->username))
</del><ins>+                if (!zstr(jss->username))
</ins><span class="cx">                         username = jss->username;
</span><span class="cx">
</span><span class="cx">                 dest = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
</span><span class="lines">@@ -2998,7 +2998,7 @@
</span><span class="cx">
</span><span class="cx">                 if (argc > 2) {
</span><span class="cx">                         tmp = JS_GetStringBytes(JS_ValueToString(cx, argv[2]));
</span><del>-                        if (!switch_strlen_zero(tmp)) {
</del><ins>+                        if (!zstr(tmp)) {
</ins><span class="cx">                                 to = tmp;
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="lines">@@ -3678,7 +3678,7 @@
</span><span class="cx">         struct js_task *task;
</span><span class="cx">         switch_memory_pool_t *pool;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(text)) {
</del><ins>+        if (zstr(text)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "missing required input!\n");
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="lines">@@ -3707,11 +3707,11 @@
</span><span class="cx">                 path_info = switch_event_get_header(stream->param_event, "http-path-info");
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd) && path_info) {
</del><ins>+        if (zstr(cmd) && path_info) {
</ins><span class="cx">                 cmd = path_info;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "USAGE: %s\n", jsapi_interface->syntax);
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="lines">@@ -3727,7 +3727,7 @@
</span><span class="cx">
</span><span class="cx"> SWITCH_STANDARD_API(launch_async)
</span><span class="cx"> {
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 stream->write_function(stream, "USAGE: %s\n", js_run_interface->syntax);
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_spidermonkey_curlmod_spidermonkey_curlc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_spidermonkey_curl/mod_spidermonkey_curl.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_spidermonkey_curl/mod_spidermonkey_curl.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_spidermonkey_curl/mod_spidermonkey_curl.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -144,7 +144,7 @@
</span><span class="cx">
</span><span class="cx">         if (argc > 5) {
</span><span class="cx">                 cred = JS_GetStringBytes(JS_ValueToString(cx, argv[5]));
</span><del>-                if (!switch_strlen_zero(cred)) {
</del><ins>+                if (!zstr(cred)) {
</ins><span class="cx">                         curl_easy_setopt(co->curl_handle, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
</span><span class="cx">                         curl_easy_setopt(co->curl_handle, CURLOPT_USERPWD, cred);
</span><span class="cx">                 }
</span><span class="lines">@@ -174,7 +174,7 @@
</span><span class="cx">                         data = "";
</span><span class="cx">                 }
</span><span class="cx">                 curl_easy_setopt(co->curl_handle, CURLOPT_POSTFIELDS, data);
</span><del>-        } else if (!switch_strlen_zero(data)) {
</del><ins>+        } else if (!zstr(data)) {
</ins><span class="cx">                 durl = switch_mprintf("%s?%s", url, data);
</span><span class="cx">                 url_p = durl;
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_spidermonkey_odbcmod_spidermonkey_odbcc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_spidermonkey_odbc/mod_spidermonkey_odbc.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -128,11 +128,11 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(username)) {
</del><ins>+        if (zstr(username)) {
</ins><span class="cx">                 username = NULL;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(password)) {
</del><ins>+        if (zstr(password)) {
</ins><span class="cx">                 password = NULL;
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodlanguagesmod_yamlmod_yamlc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_yaml/mod_yaml.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_yaml/mod_yaml.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/languages/mod_yaml/mod_yaml.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -404,7 +404,7 @@
</span><span class="cx">         char *path = NULL;
</span><span class="cx">         FILE *input;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(alt_path)) {
</del><ins>+        if (!zstr(alt_path)) {
</ins><span class="cx">                 path = strdup(alt_path);
</span><span class="cx">         } else {
</span><span class="cx">                 path = switch_mprintf("%s/yaml/extensions.yaml", SWITCH_GLOBAL_dirs.conf_dir);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodloggersmod_consolemod_consolec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/loggers/mod_console/mod_console.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/loggers/mod_console/mod_console.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/loggers/mod_console/mod_console.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -130,7 +130,7 @@
</span><span class="cx"> #else
</span><span class="cx">                                 COLORIZE = 1;
</span><span class="cx"> #endif
</span><del>-                        } else if (!strcasecmp(var, "loglevel") && !switch_strlen_zero(val)) {
</del><ins>+                        } else if (!strcasecmp(var, "loglevel") && !zstr(val)) {
</ins><span class="cx">                                 hard_log_level = switch_log_str2level(val);
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="lines">@@ -255,68 +255,95 @@
</span><span class="cx"> SWITCH_STANDARD_API(console_api_function)
</span><span class="cx"> {
</span><span class="cx">         int argc;
</span><del>-        char *mydata = NULL, *argv[3];
-        const char *err = NULL;
</del><ins>+        char *mycmd = NULL, *argv[3] = { 0 };
+        switch_status_t status = SWITCH_STATUS_SUCCESS;
+        const char *usage_string = "USAGE:\n"
+                "--------------------------------------------------------------------------------\n"
+                "console help\n"
+                "console loglevel [[0-7] | <loglevel_string>]\n"
+                "console colorize [on|off|toggle]\n"
+                "--------------------------------------------------------------------------------\n";
+        const char *loglevel_usage_string = "USAGE:\n"
+                "--------------------------------------------------------------------------------\n"
+                "console loglevel [[0-7] | <loglevel_string>]\n"
+                "\n"
+                "Set the logging verbosity of the console from 0 (least verbose) to\n"
+                "7 (debugging), or specify the loglevel as a string:\n"
+                "\n"
+                " 0 console\n"
+                " 1 alert\n"
+                " 2 crit\n"
+                " 3 err\n"
+                " 4 warning\n"
+                " 5 notice\n"
+                " 6 info\n"
+                " 7 debug\n"
+                "--------------------------------------------------------------------------------\n";
+        const char *colorize_usage_string = "USAGE:\n"
+                "--------------------------------------------------------------------------------\n"
+                "console colorize [on|off|toggle]\n"
+                "\n"
+                "Enable, disable, or toggle console coloring.\n"
+                "--------------------------------------------------------------------------------\n";
</ins><span class="cx">
</span><del>-        if (!cmd) {
-                err = "bad args";
-                goto end;
</del><ins>+        if (session)
+                return SWITCH_STATUS_FALSE;
+
+        if (zstr(cmd)) {
+                stream->write_function(stream, "%s", usage_string);
+                goto done;
</ins><span class="cx">         }
</span><span class="cx">
</span><del>-        mydata = strdup(cmd);
-        assert(mydata);
</del><ins>+        if (!(mycmd = strdup(cmd))) {
+                status = SWITCH_STATUS_MEMERR;
+                goto done;
+        }
</ins><span class="cx">
</span><del>-        argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
</del><ins>+        if (!(argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) || !argv[0]) {
+                stream->write_function(stream, "%s", usage_string);
+                goto done;
+        }
</ins><span class="cx">
</span><del>-        if (argc > 0) {
</del><ins>+        if (!strcasecmp(argv[0], "loglevel")) {
+                int level = hard_log_level;
</ins><span class="cx">
</span><del>-                if (argc < 1) {
-                        err = "missing arg";
-                        goto end;
</del><ins>+                if (argc > 1) {
+                        if (!strcasecmp(argv[1], "help")) {
+                                stream->write_function(stream, "%s", loglevel_usage_string);
+                                goto done;
+                        } else if (*argv[1] > 47 && *argv[1] < 58) {
+                                level = atoi(argv[1]);
+                        } else {
+                                level = switch_log_str2level(argv[1]);
+                        }
</ins><span class="cx">                 }
</span><ins>+                if (level == SWITCH_LOG_INVALID) {
+                        stream->write_function(stream, "-ERR Invalid console loglevel (%s)!\n\n", argc>1? argv[1] : "");
+                } else {
+                        hard_log_level = level;
+                        stream->write_function(stream, "+OK console log level set to %s\n", switch_log_level2str(hard_log_level));
+                }
</ins><span class="cx">
</span><del>-                if (!strcasecmp(argv[0], "loglevel")) {
-                        int level = hard_log_level;
-
-                        if (argc > 1) {
-                                if (*argv[1] > 47 && *argv[1] < 58) {
-                                        level = atoi(argv[1]);
-                                } else {
-                                        level = switch_log_str2level(argv[1]);
-                                }
-                        }
-
-                        if (level == SWITCH_LOG_INVALID) {
-                                stream->write_function(stream, "-ERR syntax error, console log level not set!\n");
</del><ins>+        } else if (!strcasecmp(argv[0], "colorize")) {
+                if (argc > 1) {
+                        if (!strcasecmp(argv[1], "help")) {
+                                stream->write_function(stream, "%s", colorize_usage_string);
+                                goto done;
+                        } else if (!strcasecmp(argv[1], "toggle")) {
+                                COLORIZE ^= 1;
</ins><span class="cx">                         } else {
</span><del>-                                hard_log_level = level;
-                                stream->write_function(stream, "+OK console log level set to %s\n", switch_log_level2str(hard_log_level));
-                        }
-                        goto end;
-                } else if (!strcasecmp(argv[0], "colorize")) {
-                        if (argc > 1) {
</del><span class="cx">                                 COLORIZE = switch_true(argv[1]);
</span><span class="cx">                         }
</span><del>-                        stream->write_function(stream, "+OK console color %s\n", COLORIZE ? "enabled" : "disabled");
-                        goto end;
</del><span class="cx">                 }
</span><ins>+                stream->write_function(stream, "+OK console color %s\n", COLORIZE ? "enabled" : "disabled");
</ins><span class="cx">
</span><del>-                err = "invalid command";
-
</del><ins>+        } else { /* if (!strcasecmp(argv[0], "help")) { */
+                stream->write_function(stream, "%s", usage_string);
</ins><span class="cx">         }
</span><span class="cx">
</span><del>-
- end:
-
-        if (err) {
-                stream->write_function(stream, "-Error %s\n", err);
-        }
-
-
-        free(mydata);
-
-        return SWITCH_STATUS_SUCCESS;
-
</del><ins>+done:
+        switch_safe_free(mycmd);
+        return status;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SWITCH_MODULE_LOAD_FUNCTION(mod_console_load)
</span><span class="lines">@@ -329,9 +356,23 @@
</span><span class="cx">         /* connect my internal structure to the blank pointer passed to me */
</span><span class="cx">         *module_interface = switch_loadable_module_create_module_interface(pool, modname);
</span><span class="cx">
</span><del>-        SWITCH_ADD_API(api_interface, "console", "Console", console_api_function, "loglevel [level]|colorize [on|off]");
</del><ins>+        SWITCH_ADD_API(api_interface, "console", "Console", console_api_function, "loglevel [level]|colorize [on|toggle|off]");
+        switch_console_set_complete("add console help");
</ins><span class="cx">         switch_console_set_complete("add console loglevel");
</span><ins>+        switch_console_set_complete("add console loglevel help");
+        switch_console_set_complete("add console loglevel console");
+        switch_console_set_complete("add console loglevel alert");
+        switch_console_set_complete("add console loglevel crit");
+        switch_console_set_complete("add console loglevel err");
+        switch_console_set_complete("add console loglevel warning");
+        switch_console_set_complete("add console loglevel notice");
+        switch_console_set_complete("add console loglevel info");
+        switch_console_set_complete("add console loglevel debug");
</ins><span class="cx">         switch_console_set_complete("add console colorize");
</span><ins>+        switch_console_set_complete("add console colorize help");
+        switch_console_set_complete("add console colorize on");
+        switch_console_set_complete("add console colorize off");
+        switch_console_set_complete("add console colorize toggle");
</ins><span class="cx">
</span><span class="cx">         /* setup my logger function */
</span><span class="cx">         switch_log_bind_logger(switch_console_logger, SWITCH_LOG_DEBUG, SWITCH_TRUE);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodloggersmod_logfilemod_logfilec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/loggers/mod_logfile/mod_logfile.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/loggers/mod_logfile/mod_logfile.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/loggers/mod_logfile/mod_logfile.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -277,7 +277,7 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(new_profile->logfile)) {
</del><ins>+        if (zstr(new_profile->logfile)) {
</ins><span class="cx">                 char logfile[512];
</span><span class="cx">                 switch_snprintf(logfile, sizeof(logfile), "%s%s%s", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, "freeswitch.log");
</span><span class="cx">                 new_profile->logfile = strdup(logfile);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodloggersmod_syslogmod_syslogc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/loggers/mod_syslog/mod_syslog.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/loggers/mod_syslog/mod_syslog.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/loggers/mod_syslog/mod_syslog.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -49,10 +49,12 @@
</span><span class="cx"> static struct {
</span><span class="cx">         char *ident;
</span><span class="cx">         char *format;
</span><ins>+        char *facility;
</ins><span class="cx"> } globals;
</span><span class="cx">
</span><span class="cx"> SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_ident, globals.ident);
</span><span class="cx"> SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_format, globals.format);
</span><ins>+SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_facility, globals.facility);
</ins><span class="cx">
</span><span class="cx"> static switch_loadable_module_interface_t console_module_interface = {
</span><span class="cx">         /*.module_name */ modname,
</span><span class="lines">@@ -99,7 +101,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* don't log blank lines */
</span><del>-        if (!switch_strlen_zero(node->data) && (strspn(node->data, " \t\r\n") < strlen(node->data))) {
</del><ins>+        if (!zstr(node->data) && (strspn(node->data, " \t\r\n") < strlen(node->data))) {
</ins><span class="cx">                 syslog(syslog_level, "%s", node->data);
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -126,7 +128,9 @@
</span><span class="cx">                                         set_global_ident(val);
</span><span class="cx">                                 } else if (!strcmp(var, "format")) {
</span><span class="cx">                                         set_global_format(val);
</span><del>- } else if (!strcasecmp(var, "loglevel") && !switch_strlen_zero(val)) {
</del><ins>+                                } else if (!strcmp(var, "facility")) {
+                                        set_global_facility(val);
+ } else if (!strcasecmp(var, "loglevel") && !zstr(val)) {
</ins><span class="cx"> log_level = switch_log_str2level(val);
</span><span class="cx"> if (log_level == SWITCH_LOG_INVALID) {
</span><span class="cx"> log_level = SWITCH_LOG_WARNING;
</span><span class="lines">@@ -138,13 +142,15 @@
</span><span class="cx">                 switch_xml_free(xml);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(globals.ident)) {
</del><ins>+        if (zstr(globals.ident)) {
</ins><span class="cx">                 set_global_ident(DEFAULT_IDENT);
</span><span class="cx">         }
</span><del>-        if (switch_strlen_zero(globals.format)) {
</del><ins>+        if (zstr(globals.format)) {
</ins><span class="cx">                 set_global_format(DEFAULT_FORMAT);
</span><span class="cx">         }
</span><del>-
</del><ins>+ if (zstr(globals.facility)) {
+                set_global_facility(DEFAULT_FACILITY);
+ }
</ins><span class="cx">         return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -173,6 +179,7 @@
</span><span class="cx">
</span><span class="cx">         switch_safe_free(globals.ident);
</span><span class="cx">         switch_safe_free(globals.format);
</span><ins>+        switch_safe_free(globals.facility);
</ins><span class="cx">
</span><span class="cx">         switch_log_unbind_logger(mod_syslog_logger);
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodxml_intmod_xml_cdrmod_xml_cdrc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_cdr/mod_xml_cdr.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx">
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Rotating log file paths\n");
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(globals.base_log_dir)) {
</del><ins>+        if (!zstr(globals.base_log_dir)) {
</ins><span class="cx">                 if (globals.rotate) {
</span><span class="cx">                         if ((path = switch_mprintf("%s%s%s", globals.base_log_dir, SWITCH_PATH_SEPARATOR, date))) {
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Rotating log file path to %s\n", path);
</span><span class="lines">@@ -131,7 +131,7 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(globals.base_err_log_dir)) {
</del><ins>+        if (!zstr(globals.base_err_log_dir)) {
</ins><span class="cx">                 if (globals.rotate) {
</span><span class="cx">                         if ((path = switch_mprintf("%s%s%s", globals.base_err_log_dir, SWITCH_PATH_SEPARATOR, date))) {
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Rotating err log file path to %s\n", path);
</span><span class="lines">@@ -223,7 +223,7 @@
</span><span class="cx">                 logdir = globals.log_dir;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(logdir)) {
</del><ins>+        if (!zstr(logdir)) {
</ins><span class="cx">                 path = switch_mprintf("%s%s%s%s.cdr.xml", logdir, SWITCH_PATH_SEPARATOR, a_prefix, switch_core_session_get_uuid(session));
</span><span class="cx">                 switch_thread_rwlock_unlock(globals.log_path_lock);
</span><span class="cx">                 if (path) {
</span><span class="lines">@@ -280,7 +280,7 @@
</span><span class="cx">                         goto error;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(globals.cred)) {
</del><ins>+                if (!zstr(globals.cred)) {
</ins><span class="cx">                         curl_easy_setopt(curl_handle, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
</span><span class="cx">                         curl_easy_setopt(curl_handle, CURLOPT_USERPWD, globals.cred);
</span><span class="cx">                 }
</span><span class="lines">@@ -474,15 +474,15 @@
</span><span class="cx">                         char *var = (char *) switch_xml_attr_soft(param, "name");
</span><span class="cx">                         char *val = (char *) switch_xml_attr_soft(param, "value");
</span><span class="cx">
</span><del>-                        if (!strcasecmp(var, "cred") && !switch_strlen_zero(val)) {
</del><ins>+                        if (!strcasecmp(var, "cred") && !zstr(val)) {
</ins><span class="cx">                                 globals.cred = switch_core_strdup(globals.pool, val);
</span><del>-                        } else if (!strcasecmp(var, "url") && !switch_strlen_zero(val)) {
</del><ins>+                        } else if (!strcasecmp(var, "url") && !zstr(val)) {
</ins><span class="cx">                                 if (globals.url_count >= MAX_URLS) {
</span><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "maximum urls configured!\n");
</span><span class="cx">                                 } else {
</span><span class="cx">                                         globals.urls[globals.url_count++] = switch_core_strdup(globals.pool, val);
</span><span class="cx">                                 }
</span><del>-                        } else if (!strcasecmp(var, "delay") && !switch_strlen_zero(val)) {
</del><ins>+                        } else if (!strcasecmp(var, "delay") && !zstr(val)) {
</ins><span class="cx">                                 globals.delay = (uint32_t) atoi(val);
</span><span class="cx">                         } else if (!strcasecmp(var, "log-b-leg")) {
</span><span class="cx">                                 globals.log_b = switch_true(val);
</span><span class="lines">@@ -490,18 +490,18 @@
</span><span class="cx">                                 globals.prefix_a = switch_true(val);
</span><span class="cx">                         } else if (!strcasecmp(var, "disable-100-continue") && switch_true(val)) {
</span><span class="cx">                                 globals.disable100continue = 1;
</span><del>-                        } else if (!strcasecmp(var, "encode") && !switch_strlen_zero(val)) {
</del><ins>+                        } else if (!strcasecmp(var, "encode") && !zstr(val)) {
</ins><span class="cx">                                 if (!strcasecmp(val, "base64")) {
</span><span class="cx">                                         globals.encode = 2;
</span><span class="cx">                                 } else {
</span><span class="cx">                                         globals.encode = switch_true(val) ? 1 : 0;
</span><span class="cx">                                 }
</span><del>-                        } else if (!strcasecmp(var, "retries") && !switch_strlen_zero(val)) {
</del><ins>+                        } else if (!strcasecmp(var, "retries") && !zstr(val)) {
</ins><span class="cx">                                 globals.retries = (uint32_t) atoi(val);
</span><del>-                        } else if (!strcasecmp(var, "rotate") && !switch_strlen_zero(val)) {
</del><ins>+                        } else if (!strcasecmp(var, "rotate") && !zstr(val)) {
</ins><span class="cx">                                 globals.rotate = switch_true(val);
</span><span class="cx">                         } else if (!strcasecmp(var, "log-dir")) {
</span><del>-                                if (switch_strlen_zero(val)) {
</del><ins>+                                if (zstr(val)) {
</ins><span class="cx">                                         globals.base_log_dir = switch_mprintf("%s%sxml_cdr", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR);
</span><span class="cx">                                 } else {
</span><span class="cx">                                         if (switch_is_file_path(val)) {
</span><span class="lines">@@ -511,7 +511,7 @@
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><span class="cx">                         } else if (!strcasecmp(var, "err-log-dir")) {
</span><del>-                                if (switch_strlen_zero(val)) {
</del><ins>+                                if (zstr(val)) {
</ins><span class="cx">                                         globals.base_err_log_dir = switch_mprintf("%s%sxml_cdr", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR);
</span><span class="cx">                                 } else {
</span><span class="cx">                                         if (switch_is_file_path(val)) {
</span><span class="lines">@@ -536,8 +536,8 @@
</span><span class="cx">                                 globals.enable_ssl_verifyhost = 1;
</span><span class="cx">                         }
</span><span class="cx">                 
</span><del>-                        if (switch_strlen_zero(globals.base_err_log_dir)) {
-                                if (!switch_strlen_zero(globals.base_log_dir)) {
</del><ins>+                        if (zstr(globals.base_err_log_dir)) {
+                                if (!zstr(globals.base_log_dir)) {
</ins><span class="cx">                                         globals.base_err_log_dir = switch_core_strdup(globals.pool, globals.base_log_dir);
</span><span class="cx">                                 } else {
</span><span class="cx">                                         globals.base_err_log_dir = switch_core_sprintf(globals.pool, "%s%sxml_cdr", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodxml_intmod_xml_curlmod_xml_curlc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -55,6 +55,7 @@
</span><span class="cx">         char *cookie_file;
</span><span class="cx">         switch_hash_t *vars_map;
</span><span class="cx">         int use_dynamic_url;
</span><ins>+        int auth_scheme;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> static int keep_files_around = 0;
</span><span class="lines">@@ -89,7 +90,7 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 goto usage;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -216,8 +217,8 @@
</span><span class="cx">         config_data.max_bytes = XML_CURL_MAX_BYTES;
</span><span class="cx">
</span><span class="cx">         if ((config_data.fd = open(filename, O_CREAT | O_RDWR | O_TRUNC, S_IRUSR | S_IWUSR)) > -1) {
</span><del>-                if (!switch_strlen_zero(binding->cred)) {
-                        curl_easy_setopt(curl_handle, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
</del><ins>+                if (!zstr(binding->cred)) {
+                        curl_easy_setopt(curl_handle, CURLOPT_HTTPAUTH, binding->auth_scheme);
</ins><span class="cx">                         curl_easy_setopt(curl_handle, CURLOPT_USERPWD, binding->cred);
</span><span class="cx">                 }
</span><span class="cx">                 curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, headers);
</span><span class="lines">@@ -353,9 +354,11 @@
</span><span class="cx">                 uint32_t enable_ssl_verifyhost = 0;
</span><span class="cx">                 char *cookie_file = NULL;
</span><span class="cx">                 hash_node_t* hash_node;
</span><ins>+                int auth_scheme = CURLAUTH_BASIC;
</ins><span class="cx">                 need_vars_map = 0;
</span><span class="cx">                 vars_map = NULL;
</span><span class="cx">
</span><ins>+
</ins><span class="cx">                 for (param = switch_xml_child(binding_tag, "param"); param; param = param->next) {
</span><span class="cx">                         char *var = (char *) switch_xml_attr_soft(param, "name");
</span><span class="cx">                         char *val = (char *) switch_xml_attr_soft(param, "value");
</span><span class="lines">@@ -366,6 +369,23 @@
</span><span class="cx">                                 }
</span><span class="cx">                         } else if (!strcasecmp(var, "gateway-credentials")) {
</span><span class="cx">                                 bind_cred = val;
</span><ins>+                        } else if (!strcasecmp(var, "auth-scheme")) {
+                                if (*val == '=') {
+                                        auth_scheme = 0;
+                                        val++;
+                                }
+                                
+                                if (!strcasecmp(val, "basic")) {
+                                        auth_scheme |= CURLAUTH_BASIC;
+                                } else if (!strcasecmp(val, "digest")) {
+                                        auth_scheme |= CURLAUTH_DIGEST;
+                                } else if (!strcasecmp(val, "NTLM")) {
+                                        auth_scheme |= CURLAUTH_NTLM;
+                                } else if (!strcasecmp(val, "GSS-NEGOTIATE")) {
+                                        auth_scheme |= CURLAUTH_GSSNEGOTIATE;
+                                } else if (!strcasecmp(val, "any")) {
+                                        auth_scheme = CURLAUTH_ANY;
+                                }
</ins><span class="cx">                         } else if (!strcasecmp(var, "disable-100-continue") && switch_true(val)) {
</span><span class="cx">                                 disable100continue = 1;
</span><span class="cx">                         } else if (!strcasecmp(var, "method")) {
</span><span class="lines">@@ -419,6 +439,8 @@
</span><span class="cx">                 }
</span><span class="cx">                 memset(binding, 0, sizeof(*binding));
</span><span class="cx">
</span><ins>+                binding->auth_scheme = auth_scheme;
+                
</ins><span class="cx">                 binding->url = strdup(url);
</span><span class="cx">                 switch_assert(binding->url);
</span><span class="cx">
</span><span class="lines">@@ -486,7 +508,7 @@
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Binding [%s] XML Fetch Function [%s] [%s]\n",
</span><del>-                                                 switch_strlen_zero(bname) ? "N/A" : bname, binding->url, binding->bindings ? binding->bindings : "all");
</del><ins>+                                                 zstr(bname) ? "N/A" : bname, binding->url, binding->bindings ? binding->bindings : "all");
</ins><span class="cx">                 switch_xml_bind_search_function(xml_url_fetch, switch_xml_parse_section_string(binding->bindings), binding);
</span><span class="cx">                 x++;
</span><span class="cx">                 binding = NULL;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodxml_intmod_xml_ldapmod_xml_ldapc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 goto usage;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -466,7 +466,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Binding [%s] XML Fetch Function [%s] (%s) [%s]\n",
</span><del>-                                                 switch_strlen_zero(bname) ? "N/A" : bname, binding->basedn, binding->filter, binding->bindings ? binding->bindings : "all");
</del><ins>+                                                 zstr(bname) ? "N/A" : bname, binding->basedn, binding->filter, binding->bindings ? binding->bindings : "all");
</ins><span class="cx">
</span><span class="cx">                 switch_xml_bind_search_function(xml_ldap_search, switch_xml_parse_section_string(bname), binding);
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodxml_intmod_xml_ldapmod_xml_ldapv2c"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_ldap/mod_xml_ldapv2.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_ldap/mod_xml_ldapv2.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_ldap/mod_xml_ldapv2.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -257,7 +257,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Binding [%s] XML Fetch Function [%s] (%s) [%s]\n",
</span><del>-                                                 switch_strlen_zero(bname) ? "N/A" : bname, binding->basedn, binding->filter, binding->bindings ? binding->bindings : "all");
</del><ins>+                                                 zstr(bname) ? "N/A" : bname, binding->basedn, binding->filter, binding->bindings ? binding->bindings : "all");
</ins><span class="cx">
</span><span class="cx">                 switch_xml_bind_search_function(xml_ldap_search, switch_xml_parse_section_string(bname), binding);
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcmodxml_intmod_xml_rpcmod_xml_rpcc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -257,7 +257,7 @@
</span><span class="cx">                 return FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(globals.realm) && switch_strlen_zero(globals.user)) {
</del><ins>+        if (zstr(globals.realm) && zstr(globals.user)) {
</ins><span class="cx">                 return TRUE;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -272,12 +272,12 @@
</span><span class="cx">                 domain_name = dp;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(globals.realm) && !switch_strlen_zero(globals.user) && !strcmp(user, globals.user)) {
</del><ins>+        if (!zstr(globals.realm) && !zstr(globals.user) && !strcmp(user, globals.user)) {
</ins><span class="cx">                 switch_safe_free(user);
</span><span class="cx">                 return TRUE;
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(user) || switch_strlen_zero(domain_name)) {
</del><ins>+        if (zstr(user) || zstr(domain_name)) {
</ins><span class="cx">                 switch_safe_free(user);
</span><span class="cx">                 return FALSE;
</span><span class="cx">         }
</span><span class="lines">@@ -352,11 +352,11 @@
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><span class="cx">
</span><del>-                                if (switch_strlen_zero(user) || switch_strlen_zero(domain_name)) {
</del><ins>+                                if (zstr(user) || zstr(domain_name)) {
</ins><span class="cx">                                         goto fail;
</span><span class="cx">                                 }
</span><span class="cx">
</span><del>-                                if (!switch_strlen_zero(globals.realm) && !switch_strlen_zero(globals.user) && !switch_strlen_zero(globals.pass)) {
</del><ins>+                                if (!zstr(globals.realm) && !zstr(globals.user) && !zstr(globals.pass)) {
</ins><span class="cx">                                         if (at) {
</span><span class="cx">                                                 switch_snprintf(z, sizeof(z), "%s@%s:%s", globals.user, globals.realm, globals.pass);
</span><span class="cx">                                         } else {
</span><span class="lines">@@ -374,7 +374,7 @@
</span><span class="cx">                                 }
</span><span class="cx">
</span><span class="cx">
</span><del>-                                if (!switch_strlen_zero(mypass2) && !strcasecmp(mypass2, "user-choose")) {
</del><ins>+                                if (!zstr(mypass2) && !strcasecmp(mypass2, "user-choose")) {
</ins><span class="cx">                                         mypass2 = NULL;
</span><span class="cx">                                 }
</span><span class="cx">
</span><span class="lines">@@ -872,7 +872,7 @@
</span><span class="cx">                 relative_oid = oid;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data)) {
</del><ins>+        if (!zstr(data)) {
</ins><span class="cx">                 switch_copy_string(buf, data, sizeof(buf));
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitchc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -273,9 +273,10 @@
</span><span class="cx">         char *opts;
</span><span class="cx">         char opts_str[1024] = "";
</span><span class="cx">         char *local_argv[1024] = { 0 };
</span><ins>+        int local_argc = argc;
</ins><span class="cx">         char *arg_argv[128] = { 0 };
</span><span class="cx">         char *usageDesc;
</span><del>-        int alt_dirs = 0;
</del><ins>+        int alt_dirs = 0, log_set = 0, run_set = 0, kill = 0;
</ins><span class="cx">         int known_opt;
</span><span class="cx">         int high_prio = 0;
</span><span class="cx"> #ifdef __sun
</span><span class="lines">@@ -300,7 +301,7 @@
</span><span class="cx">                 strncpy(opts_str, opts, sizeof(opts_str) - 1);
</span><span class="cx">                 i = switch_separate_string(opts_str, ' ', arg_argv, (sizeof(arg_argv) / sizeof(arg_argv[0])));
</span><span class="cx">                 for (x = 0; x < i; x++) {
</span><del>-                        local_argv[argc++] = arg_argv[x];
</del><ins>+                        local_argv[local_argc++] = arg_argv[x];
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -339,7 +340,7 @@
</span><span class="cx">                 "\t-htdocs [htdocsdir] -- specify an alternate htdocs dir\n"
</span><span class="cx">                 "\t-scripts [scriptsdir] -- specify an alternate scripts dir\n";
</span><span class="cx">
</span><del>-        for (x = 1; x < argc; x++) {
</del><ins>+        for (x = 1; x < local_argc; x++) {
</ins><span class="cx">                 known_opt = 0;
</span><span class="cx"> #ifdef WIN32
</span><span class="cx">                 if (x == 1) {
</span><span class="lines">@@ -497,7 +498,8 @@
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 if (local_argv[x] && !strcmp(local_argv[x], "-stop")) {
</span><del>-                                return freeswitch_kill_background();
</del><ins>+                        kill++;
+                        known_opt++;
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 if (local_argv[x] && !strcmp(local_argv[x], "-nc")) {
</span><span class="lines">@@ -553,6 +555,7 @@
</span><span class="cx">                                 }
</span><span class="cx">                                 strcpy(SWITCH_GLOBAL_dirs.log_dir, local_argv[x]);
</span><span class="cx">                                 alt_dirs++;
</span><ins>+                                log_set++;
</ins><span class="cx">                         } else {
</span><span class="cx">                                 fprintf(stderr, "When using -log you must specify a log directory\n");
</span><span class="cx">                                 return 255;
</span><span class="lines">@@ -569,6 +572,7 @@
</span><span class="cx">                                         return 255;
</span><span class="cx">                                 }
</span><span class="cx">                                 strcpy(SWITCH_GLOBAL_dirs.run_dir, local_argv[x]);
</span><ins>+                                run_set++;
</ins><span class="cx">                         } else {
</span><span class="cx">                                 fprintf(stderr, "When using -run you must specify a pid directory\n");
</span><span class="cx">                                 return 255;
</span><span class="lines">@@ -630,7 +634,20 @@
</span><span class="cx">                         exit(0);
</span><span class="cx">                 }
</span><span class="cx">         }
</span><ins>+        
+        if (log_set && !run_set) {
+                SWITCH_GLOBAL_dirs.run_dir = (char *) malloc(strlen(SWITCH_GLOBAL_dirs.log_dir) + 1);
+                if (!SWITCH_GLOBAL_dirs.run_dir) {
+                        fprintf(stderr, "Allocation error\n");
+                        return 255;
+                }
+                strcpy(SWITCH_GLOBAL_dirs.run_dir, SWITCH_GLOBAL_dirs.log_dir);
+        }
</ins><span class="cx">
</span><ins>+        if (kill) {
+                return freeswitch_kill_background();
+        }
+
</ins><span class="cx">         if (apr_initialize() != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                 fprintf(stderr, "FATAL ERROR! Could not initialize APR\n");
</span><span class="cx">                 return 255;
</span><span class="lines">@@ -671,10 +688,10 @@
</span><span class="cx">                         setrlimit(RLIMIT_STACK, &rlp);
</span><span class="cx">
</span><span class="cx">                         apr_terminate();
</span><del>-                        ret = (int)execv(local_argv[0], local_argv);
</del><ins>+                        ret = (int)execv(argv[0], argv);
</ins><span class="cx">                         
</span><span class="cx">                         for(i = 0; i < argc; i++) {
</span><del>-                                switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%s ", local_argv[i]);
</del><ins>+                                switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%s ", argv[i]);
</ins><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         return system(buf);
</span><span class="lines">@@ -764,13 +781,12 @@
</span><span class="cx">                 char buf[1024] = "";
</span><span class="cx">                 int j = 0;
</span><span class="cx">                 
</span><del>-                switch_assert(local_argv[0]);
</del><span class="cx">                 switch_sleep(1000000);
</span><del>-                ret = (int)execv(local_argv[0], local_argv);
</del><ins>+                ret = (int)execv(argv[0], argv);
</ins><span class="cx">                 fprintf(stderr, "Restart Failed [%s] resorting to plan b\n", strerror(errno));
</span><span class="cx">
</span><span class="cx">                 for(j = 0; j < argc; j++) {
</span><del>-                        switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%s ", local_argv[j]);
</del><ins>+                        switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%s ", argv[j]);
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 ret = system(buf);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_bufferc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_buffer.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_buffer.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_buffer.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -280,6 +280,18 @@
</span><span class="cx">         return w;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+SWITCH_DECLARE(switch_size_t) switch_buffer_slide_write(switch_buffer_t *buffer, const void *data, switch_size_t datalen)
+{
+        switch_size_t w;
+
+        if (!(w = switch_buffer_write(buffer, data, datalen))) {
+                switch_buffer_toss(buffer, datalen);
+                return switch_buffer_write(buffer, data, datalen);
+        }
+
+        return w;
+}
+
</ins><span class="cx"> SWITCH_DECLARE(void) switch_buffer_destroy(switch_buffer_t **buffer)
</span><span class="cx"> {
</span><span class="cx">         if (buffer && *buffer) {
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_callerc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_caller.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_caller.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_caller.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -33,8 +33,8 @@
</span><span class="cx"> #include <switch.h>
</span><span class="cx"> #include <switch_caller.h>
</span><span class="cx">
</span><del>-#define profile_dup(a,b,p) if (!switch_strlen_zero(a)) { b = switch_core_strdup(p, a); } else { b = SWITCH_BLANK_STRING; }
-#define profile_dup_clean(a,b,p) if (!switch_strlen_zero(a)) { b = switch_var_clean_string(switch_clean_string(switch_core_strdup(p, a)));} else { b = SWITCH_BLANK_STRING; }
</del><ins>+#define profile_dup(a,b,p) if (!zstr(a)) { b = switch_core_strdup(p, a); } else { b = SWITCH_BLANK_STRING; }
+#define profile_dup_clean(a,b,p) if (!zstr(a)) { b = switch_var_clean_string(switch_clean_string(switch_core_strdup(p, a)));} else { b = SWITCH_BLANK_STRING; }
</ins><span class="cx">
</span><span class="cx"> SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_new(switch_memory_pool_t *pool,
</span><span class="cx">                                                                                                                                         const char *username,
</span><span class="lines">@@ -57,11 +57,11 @@
</span><span class="cx">                 context = "default";
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(caller_id_name)) {
</del><ins>+        if (zstr(caller_id_name)) {
</ins><span class="cx">                 caller_id_name = "FreeSWITCH";
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(caller_id_number)) {
</del><ins>+        if (zstr(caller_id_number)) {
</ins><span class="cx">                 caller_id_number = "0000000000";
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -78,7 +78,8 @@
</span><span class="cx">         profile_dup_clean(destination_number, profile->destination_number, pool);
</span><span class="cx">         profile->uuid = SWITCH_BLANK_STRING;
</span><span class="cx">         profile->chan_name = SWITCH_BLANK_STRING;
</span><del>-
</del><ins>+        profile->callee_id_name = SWITCH_BLANK_STRING;
+        profile->callee_id_number = SWITCH_BLANK_STRING;
</ins><span class="cx">         switch_set_flag(profile, SWITCH_CPF_SCREEN);
</span><span class="cx">         profile->pool = pool;
</span><span class="cx">         return profile;
</span><span class="lines">@@ -95,6 +96,8 @@
</span><span class="cx">         profile_dup(tocopy->dialplan, profile->dialplan, pool);
</span><span class="cx">         profile_dup(tocopy->caller_id_name, profile->caller_id_name, pool);
</span><span class="cx">         profile_dup(tocopy->caller_id_number, profile->caller_id_number, pool);
</span><ins>+        profile_dup(tocopy->callee_id_name, profile->callee_id_name, pool);
+        profile_dup(tocopy->callee_id_number, profile->callee_id_number, pool);
</ins><span class="cx">         profile_dup(tocopy->network_addr, profile->network_addr, pool);
</span><span class="cx">         profile_dup(tocopy->ani, profile->ani, pool);
</span><span class="cx">         profile_dup(tocopy->aniii, profile->aniii, pool);
</span><span class="lines">@@ -139,15 +142,21 @@
</span><span class="cx">         if (!strcasecmp(name, "caller_id_name")) {
</span><span class="cx">                 return caller_profile->caller_id_name;
</span><span class="cx">         }
</span><ins>+        if (!strcasecmp(name, "caller_id_number")) {
+                return caller_profile->caller_id_number;
+        }
+        if (!strcasecmp(name, "callee_id_name")) {
+                return caller_profile->callee_id_name;
+        }
+        if (!strcasecmp(name, "callee_id_number")) {
+                return caller_profile->callee_id_number;
+        }
</ins><span class="cx">         if (!strcasecmp(name, "ani")) {
</span><span class="cx">                 return caller_profile->ani;
</span><span class="cx">         }
</span><span class="cx">         if (!strcasecmp(name, "aniii")) {
</span><span class="cx">                 return caller_profile->aniii;
</span><span class="cx">         }
</span><del>-        if (!strcasecmp(name, "caller_id_number")) {
-                return caller_profile->caller_id_number;
-        }
</del><span class="cx">         if (!strcasecmp(name, "network_addr")) {
</span><span class="cx">                 return caller_profile->network_addr;
</span><span class="cx">         }
</span><span class="lines">@@ -238,59 +247,59 @@
</span><span class="cx"> {
</span><span class="cx">         char header_name[1024];
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(caller_profile->username)) {
</del><ins>+        if (!zstr(caller_profile->username)) {
</ins><span class="cx">                 switch_snprintf(header_name, sizeof(header_name), "%s-Username", prefix);
</span><span class="cx">                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->username);
</span><span class="cx">         }
</span><del>-        if (!switch_strlen_zero(caller_profile->dialplan)) {
</del><ins>+        if (!zstr(caller_profile->dialplan)) {
</ins><span class="cx">                 switch_snprintf(header_name, sizeof(header_name), "%s-Dialplan", prefix);
</span><span class="cx">                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->dialplan);
</span><span class="cx">         }
</span><del>-        if (!switch_strlen_zero(caller_profile->caller_id_name)) {
</del><ins>+        if (!zstr(caller_profile->caller_id_name)) {
</ins><span class="cx">                 switch_snprintf(header_name, sizeof(header_name), "%s-Caller-ID-Name", prefix);
</span><span class="cx">                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->caller_id_name);
</span><span class="cx">         }
</span><del>-        if (!switch_strlen_zero(caller_profile->caller_id_number)) {
</del><ins>+        if (!zstr(caller_profile->caller_id_number)) {
</ins><span class="cx">                 switch_snprintf(header_name, sizeof(header_name), "%s-Caller-ID-Number", prefix);
</span><span class="cx">                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->caller_id_number);
</span><span class="cx">         }
</span><del>-        if (!switch_strlen_zero(caller_profile->network_addr)) {
</del><ins>+        if (!zstr(caller_profile->network_addr)) {
</ins><span class="cx">                 switch_snprintf(header_name, sizeof(header_name), "%s-Network-Addr", prefix);
</span><span class="cx">                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->network_addr);
</span><span class="cx">         }
</span><del>-        if (!switch_strlen_zero(caller_profile->ani)) {
</del><ins>+        if (!zstr(caller_profile->ani)) {
</ins><span class="cx">                 switch_snprintf(header_name, sizeof(header_name), "%s-ANI", prefix);
</span><span class="cx">                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->ani);
</span><span class="cx">         }
</span><del>-        if (!switch_strlen_zero(caller_profile->aniii)) {
</del><ins>+        if (!zstr(caller_profile->aniii)) {
</ins><span class="cx">                 switch_snprintf(header_name, sizeof(header_name), "%s-ANI-II", prefix);
</span><span class="cx">                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->aniii);
</span><span class="cx">         }
</span><del>-        if (!switch_strlen_zero(caller_profile->destination_number)) {
</del><ins>+        if (!zstr(caller_profile->destination_number)) {
</ins><span class="cx">                 switch_snprintf(header_name, sizeof(header_name), "%s-Destination-Number", prefix);
</span><span class="cx">                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->destination_number);
</span><span class="cx">         }
</span><del>-        if (!switch_strlen_zero(caller_profile->uuid)) {
</del><ins>+        if (!zstr(caller_profile->uuid)) {
</ins><span class="cx">                 switch_snprintf(header_name, sizeof(header_name), "%s-Unique-ID", prefix);
</span><span class="cx">                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->uuid);
</span><span class="cx">         }
</span><del>-        if (!switch_strlen_zero(caller_profile->source)) {
</del><ins>+        if (!zstr(caller_profile->source)) {
</ins><span class="cx">                 switch_snprintf(header_name, sizeof(header_name), "%s-Source", prefix);
</span><span class="cx">                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->source);
</span><span class="cx">         }
</span><del>-        if (!switch_strlen_zero(caller_profile->context)) {
</del><ins>+        if (!zstr(caller_profile->context)) {
</ins><span class="cx">                 switch_snprintf(header_name, sizeof(header_name), "%s-Context", prefix);
</span><span class="cx">                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->context);
</span><span class="cx">         }
</span><del>-        if (!switch_strlen_zero(caller_profile->rdnis)) {
</del><ins>+        if (!zstr(caller_profile->rdnis)) {
</ins><span class="cx">                 switch_snprintf(header_name, sizeof(header_name), "%s-RDNIS", prefix);
</span><span class="cx">                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->rdnis);
</span><span class="cx">         }
</span><del>-        if (!switch_strlen_zero(caller_profile->chan_name)) {
</del><ins>+        if (!zstr(caller_profile->chan_name)) {
</ins><span class="cx">                 switch_snprintf(header_name, sizeof(header_name), "%s-Channel-Name", prefix);
</span><span class="cx">                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->chan_name);
</span><span class="cx">         }
</span><del>-        if (!switch_strlen_zero(caller_profile->profile_index)) {
</del><ins>+        if (!zstr(caller_profile->profile_index)) {
</ins><span class="cx">                 switch_snprintf(header_name, sizeof(header_name), "%s-Profile-Index", prefix);
</span><span class="cx">                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->profile_index);
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_channelc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_channel.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_channel.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_channel.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -1,4 +1,3 @@
</span><del>-
</del><span class="cx"> /*
</span><span class="cx"> * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
</span><span class="cx"> * Copyright (C) 2005-2009, Anthony Minessale II <anthm@freeswitch.org>
</span><span class="lines">@@ -120,6 +119,7 @@
</span><span class="cx">         switch_channel_state_t state;
</span><span class="cx">         switch_channel_state_t running_state;
</span><span class="cx">         uint32_t flags[CF_FLAG_MAX];
</span><ins>+        uint32_t caps[CC_FLAG_MAX];
</ins><span class="cx">         uint8_t state_flags[CF_FLAG_MAX];
</span><span class="cx">         uint32_t private_flags;
</span><span class="cx">         uint32_t app_flags;
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx"> SWITCH_DECLARE(void) switch_channel_audio_sync(switch_channel_t *channel)
</span><span class="cx"> {
</span><span class="cx">         if (switch_channel_media_ready(channel)) {
</span><del>-                switch_core_session_message_t msg;
</del><ins>+                switch_core_session_message_t msg = { 0 };
</ins><span class="cx">                 msg.message_id = SWITCH_MESSAGE_INDICATE_AUDIO_SYNC;
</span><span class="cx">                 msg.from = channel->name;
</span><span class="cx">                 switch_core_session_receive_message(channel->session, &msg);
</span><span class="lines">@@ -317,7 +317,7 @@
</span><span class="cx">         int i, argc;
</span><span class="cx">         char *argv[256];
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(dtmf_string)) {
</del><ins>+        if (zstr(dtmf_string)) {
</ins><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -536,7 +536,7 @@
</span><span class="cx">         const char *val = NULL, *r = NULL;
</span><span class="cx">         switch_assert(channel != NULL);
</span><span class="cx">         
</span><del>-        if (!switch_strlen_zero(varname)) {
</del><ins>+        if (!zstr(varname)) {
</ins><span class="cx">                 if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
</span><span class="cx">                         switch_core_session_t *session;
</span><span class="cx">                         if ((session = switch_core_session_locate(uuid))) {
</span><span class="lines">@@ -599,7 +599,7 @@
</span><span class="cx">         const char *old = NULL;
</span><span class="cx">
</span><span class="cx">         switch_assert(channel != NULL);
</span><del>-        if (!switch_strlen_zero(channel->name)) {
</del><ins>+        if (!zstr(channel->name)) {
</ins><span class="cx">                 old = channel->name;
</span><span class="cx">         }
</span><span class="cx">         channel->name = NULL;
</span><span class="lines">@@ -619,9 +619,68 @@
</span><span class="cx"> SWITCH_DECLARE(char *) switch_channel_get_name(switch_channel_t *channel)
</span><span class="cx"> {
</span><span class="cx">         switch_assert(channel != NULL);
</span><del>-        return (!switch_strlen_zero(channel->name)) ? channel->name : "N/A";
</del><ins>+        return (!zstr(channel->name)) ? channel->name : "N/A";
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+SWITCH_DECLARE(switch_status_t) switch_channel_set_profile_var(switch_channel_t *channel, const char *name, const char *val)
+{
+        char *v;
+        switch_status_t status = SWITCH_STATUS_SUCCESS;
+
+        switch_mutex_lock(channel->profile_mutex);
+
+        if (!zstr(val)) {
+                v = switch_core_strdup(channel->caller_profile->pool, val);
+        } else {
+                v = SWITCH_BLANK_STRING;
+        }
+        
+        if (!strcasecmp(name, "dialplan")) {
+                channel->caller_profile->dialplan = v;
+        } else if (!strcasecmp(name, "username")) {
+                channel->caller_profile->username = v;
+        } else if (!strcasecmp(name, "caller_id_name")) {
+                channel->caller_profile->caller_id_name = v;
+        } else if (!strcasecmp(name, "caller_id_number")) {
+                channel->caller_profile->caller_id_number = v;
+        } else if (!strcasecmp(name, "callee_id_name")) {
+                channel->caller_profile->callee_id_name = v;
+        } else if (!strcasecmp(name, "callee_id_number")) {
+                channel->caller_profile->callee_id_number = v;
+        } else if (val && !strcasecmp(name, "caller_ton")) {
+                channel->caller_profile->caller_ton = (uint8_t) atoi(v);
+        } else if (val && !strcasecmp(name, "caller_numplan")) {
+                channel->caller_profile->caller_numplan = (uint8_t) atoi(v);
+        } else if (val && !strcasecmp(name, "destination_number_ton")) {
+                channel->caller_profile->destination_number_ton = (uint8_t) atoi(v);
+        } else if (val && !strcasecmp(name, "destination_number_numplan")) {
+                channel->caller_profile->destination_number_numplan = (uint8_t) atoi(v);
+        } else if (!strcasecmp(name, "ani")) {
+                channel->caller_profile->ani = v;
+        } else if (!strcasecmp(name, "aniii")) {
+                channel->caller_profile->aniii = v;
+        } else if (!strcasecmp(name, "network_addr")) {
+                channel->caller_profile->network_addr = v;
+        } else if (!strcasecmp(name, "rdnis")) {
+                channel->caller_profile->rdnis = v;
+        } else if (!strcasecmp(name, "destination_number")) {
+                channel->caller_profile->destination_number = v;
+        } else if (!strcasecmp(name, "uuid")) {
+                channel->caller_profile->uuid = v;
+        } else if (!strcasecmp(name, "source")) {
+                channel->caller_profile->source = v;
+        } else if (!strcasecmp(name, "context")) {
+                channel->caller_profile->context = v;
+        } else if (!strcasecmp(name, "chan_name")) {
+                channel->caller_profile->chan_name = v;
+        } else {
+                status = SWITCH_STATUS_FALSE;
+        }
+        switch_mutex_unlock(channel->profile_mutex);
+
+        return status;
+}
+
</ins><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_var_check(switch_channel_t *channel,
</span><span class="cx">                                                                                                                                          const char *varname, const char *value, switch_bool_t var_check)
</span><span class="cx"> {
</span><span class="lines">@@ -630,9 +689,9 @@
</span><span class="cx">         switch_assert(channel != NULL);
</span><span class="cx">
</span><span class="cx">         switch_mutex_lock(channel->profile_mutex);
</span><del>-        if (channel->variables && !switch_strlen_zero(varname)) {
</del><ins>+        if (channel->variables && !zstr(varname)) {
</ins><span class="cx">                 switch_event_del_header(channel->variables, varname);
</span><del>-                if (!switch_strlen_zero(value)) {
</del><ins>+                if (!zstr(value)) {
</ins><span class="cx">                         int ok = 1;
</span><span class="cx">                         
</span><span class="cx">                         if (var_check) {
</span><span class="lines">@@ -663,7 +722,7 @@
</span><span class="cx">         switch_assert(channel != NULL);
</span><span class="cx">
</span><span class="cx">         switch_mutex_lock(channel->profile_mutex);
</span><del>-        if (channel->variables && !switch_strlen_zero(varname)) {
</del><ins>+        if (channel->variables && !zstr(varname)) {
</ins><span class="cx">                 switch_event_del_header(channel->variables, varname);
</span><span class="cx">
</span><span class="cx">                 va_start(ap, fmt);
</span><span class="lines">@@ -691,7 +750,7 @@
</span><span class="cx">         const char *uuid;
</span><span class="cx">         switch_assert(channel != NULL);
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(varname)) {
</del><ins>+        if (!zstr(varname)) {
</ins><span class="cx">                 if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))) {
</span><span class="cx">                         switch_core_session_t *session;
</span><span class="cx">                         if ((session = switch_core_session_locate(uuid))) {
</span><span class="lines">@@ -841,6 +900,33 @@
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+
+SWITCH_DECLARE(void) switch_channel_set_cap(switch_channel_t *channel, switch_channel_cap_t cap)
+{
+        switch_assert(channel);
+        switch_assert(channel->flag_mutex);
+
+        switch_mutex_lock(channel->flag_mutex);
+        channel->caps[cap] = 1;
+        switch_mutex_unlock(channel->flag_mutex);
+}
+
+SWITCH_DECLARE(void) switch_channel_clear_cap(switch_channel_t *channel, switch_channel_cap_t cap)
+{
+        switch_assert(channel != NULL);
+        switch_assert(channel->flag_mutex);
+
+        switch_mutex_lock(channel->flag_mutex);
+        channel->caps[cap] = 0;
+        switch_mutex_unlock(channel->flag_mutex);
+}
+
+SWITCH_DECLARE(uint32_t) switch_channel_test_cap(switch_channel_t *channel, switch_channel_cap_t cap)
+{
+        switch_assert(channel != NULL);
+        return channel->caps[cap] ? 1 : 0;
+}
+
</ins><span class="cx"> SWITCH_DECLARE(void) switch_channel_set_flag(switch_channel_t *channel, switch_channel_flag_t flag)
</span><span class="cx"> {
</span><span class="cx">         switch_assert(channel);
</span><span class="lines">@@ -994,7 +1080,7 @@
</span><span class="cx">         ret = 0;
</span><span class="cx">
</span><span class="cx">         if (!channel->hangup_cause && channel->state > CS_ROUTING && channel->state < CS_HANGUP && channel->state != CS_RESET &&
</span><del>-                !switch_channel_test_flag(channel, CF_TRANSFER)) {
</del><ins>+                !switch_channel_test_flag(channel, CF_TRANSFER) && !switch_channel_test_flag(channel, CF_NOT_READY)) {
</ins><span class="cx">                 ret++;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1408,6 +1494,7 @@
</span><span class="cx">                 event->event_id == SWITCH_EVENT_API ||
</span><span class="cx">                 event->event_id == SWITCH_EVENT_RECORD_START ||
</span><span class="cx">                 event->event_id == SWITCH_EVENT_RECORD_STOP ||
</span><ins>+                event->event_id == SWITCH_EVENT_CALL_UPDATE ||
</ins><span class="cx">                 event->event_id == SWITCH_EVENT_CUSTOM
</span><span class="cx">                 ) {
</span><span class="cx">
</span><span class="lines">@@ -1663,6 +1750,88 @@
</span><span class="cx">         switch_mutex_unlock(channel->state_mutex);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+SWITCH_DECLARE(void) switch_channel_restart(switch_channel_t *channel)
+{
+        switch_channel_set_state(channel, CS_RESET);
+        switch_channel_wait_for_state_timeout(channel, CS_RESET, 5000);
+        switch_channel_set_state(channel, CS_EXECUTE);
+}
+
+/* XXX This is a somewhat simple operation. Were essentially taking the extension that one channel
+ was executing and generating a new extension for another channel that starts out where the
+ original one left off with an optional forward offset. Since all we are really doing is
+ copying a few basic pool-allocated structures from one channel to another there really is
+ not much to worry about here in terms of threading since we use read-write locks.
+ While the features are nice, they only really are needed in one specific crazy attended
+ transfer scenario where one channel was in the middle of calling a particular extension
+ when it was rudely cut off by a transfer key press. XXX */
+
+SWITCH_DECLARE(switch_status_t) switch_channel_caller_extension_masquerade(switch_channel_t *orig_channel, switch_channel_t *new_channel, uint32_t offset)
+{
+        switch_caller_profile_t *caller_profile;
+        switch_caller_extension_t *extension = NULL, *orig_extension = NULL;
+        switch_caller_application_t *ap;
+        switch_status_t status = SWITCH_STATUS_FALSE;
+        switch_event_header_t *hi = NULL;
+        const char *no_copy = switch_channel_get_variable(orig_channel, "attended_transfer_no_copy");
+        char *dup;
+        int i, argc = 0;
+        char *argv[128];
+
+        if (no_copy) {
+                dup = switch_core_session_strdup(new_channel->session, no_copy);
+                argc = switch_separate_string(dup, ',', argv, (sizeof(argv) / sizeof(argv[0])));
+        }
+
+
+        switch_mutex_lock(orig_channel->profile_mutex);
+        switch_mutex_lock(new_channel->profile_mutex);
+        
+        
+        caller_profile = switch_caller_profile_clone(new_channel->session, new_channel->caller_profile);
+        switch_assert(caller_profile);
+        extension = switch_caller_extension_new(new_channel->session, caller_profile->destination_number, caller_profile->destination_number);
+        orig_extension = switch_channel_get_caller_extension(orig_channel);
+        
+        
+        if (extension && orig_extension) {
+                for(ap = orig_extension->current_application; ap && offset > 0; offset--) {
+                        ap = ap->next;
+                }
+                
+                for (; ap; ap = ap->next) {
+                        switch_caller_extension_add_application(new_channel->session, extension, ap->application_name, ap->application_data);
+                }
+                
+                caller_profile->destination_number = switch_core_strdup(caller_profile->pool, orig_channel->caller_profile->destination_number);
+                switch_channel_set_caller_profile(new_channel, caller_profile);
+                switch_channel_set_caller_extension(new_channel, extension);
+
+                for (hi = orig_channel->variables->headers; hi; hi = hi->next) {
+                        int ok = 1;
+                        for (i = 0; i < argc; i++) {
+                                if (!strcasecmp(argv[i], hi->name)) {
+                                        ok = 0;
+                                        break;
+                                }
+                        }
+                        
+                        if (!ok) continue;
+
+                        switch_channel_set_variable(new_channel, hi->name, hi->value);
+                }
+
+                status = SWITCH_STATUS_SUCCESS;
+        }
+
+
+        switch_mutex_unlock(new_channel->profile_mutex);
+        switch_mutex_unlock(orig_channel->profile_mutex);
+
+
+        return status;
+}
+
</ins><span class="cx"> SWITCH_DECLARE(void) switch_channel_set_caller_extension(switch_channel_t *channel, switch_caller_extension_t *caller_extension)
</span><span class="cx"> {
</span><span class="cx">         switch_assert(channel != NULL);
</span><span class="lines">@@ -1706,10 +1875,11 @@
</span><span class="cx">         switch_channel_clear_flag(channel, CF_BLOCK_STATE);
</span><span class="cx">         
</span><span class="cx">         if (channel->state < CS_HANGUP) {
</span><del>-                switch_channel_state_t last_state = channel->state;
</del><ins>+                switch_channel_state_t last_state;
</ins><span class="cx">                 switch_event_t *event;
</span><span class="cx">
</span><span class="cx">                 switch_mutex_lock(channel->state_mutex);
</span><ins>+                last_state = channel->state;
</ins><span class="cx">                 channel->state = CS_HANGUP;
</span><span class="cx">                 switch_mutex_unlock(channel->state_mutex);
</span><span class="cx">
</span><span class="lines">@@ -1783,6 +1953,8 @@
</span><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_pre_answered(switch_channel_t *channel, const char *file, const char *func, int line)
</span><span class="cx"> {
</span><span class="cx">         switch_event_t *event;
</span><ins>+        const char *var = NULL;
+        char *app;
</ins><span class="cx">
</span><span class="cx">         if (!switch_channel_test_flag(channel, CF_EARLY_MEDIA)) {
</span><span class="cx">                 const char *uuid;
</span><span class="lines">@@ -1814,6 +1986,16 @@
</span><span class="cx">                         switch_mutex_unlock(channel->profile_mutex);
</span><span class="cx">                 }
</span><span class="cx">
</span><ins>+                if (((var = switch_channel_get_variable(channel, SWITCH_CHANNEL_EXECUTE_ON_PRE_ANSWER_VARIABLE)) ||
+                         (var = switch_channel_get_variable(channel, SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE))) && !zstr(var)) {
+                        char *arg = NULL;
+                        app = switch_core_session_strdup(channel->session, var);
+                        if ((arg = strchr(app, ' '))) {
+                                *arg++ = '\0';
+                        }
+                        switch_core_session_execute_application(channel->session, app, arg);
+                }
+
</ins><span class="cx">                 /* if we're the child of another channel and the other channel is in a blocking read they will never realize we have answered so send
</span><span class="cx">                  a SWITCH_SIG_BREAK to interrupt any blocking reads on that channel
</span><span class="cx">                  */
</span><span class="lines">@@ -1830,7 +2012,7 @@
</span><span class="cx">
</span><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_channel_perform_pre_answer(switch_channel_t *channel, const char *file, const char *func, int line)
</span><span class="cx"> {
</span><del>-        switch_core_session_message_t msg;
</del><ins>+        switch_core_session_message_t msg = { 0 };
</ins><span class="cx">         switch_status_t status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">
</span><span class="cx">         switch_assert(channel != NULL);
</span><span class="lines">@@ -1864,7 +2046,7 @@
</span><span class="cx">
</span><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_channel_perform_ring_ready(switch_channel_t *channel, const char *file, const char *func, int line)
</span><span class="cx"> {
</span><del>-        switch_core_session_message_t msg;
</del><ins>+        switch_core_session_message_t msg = { 0 };
</ins><span class="cx">         switch_status_t status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">
</span><span class="cx">         switch_assert(channel != NULL);
</span><span class="lines">@@ -1956,7 +2138,10 @@
</span><span class="cx">
</span><span class="cx">         switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "ANSWER");
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, switch_channel_get_uuid(channel), SWITCH_LOG_NOTICE, "Channel [%s] has been answered\n", channel->name);
</span><del>-        if ((var = switch_channel_get_variable(channel, SWITCH_CHANNEL_EXECUTE_ON_ANSWER_VARIABLE)) && !switch_strlen_zero(var)) {
</del><ins>+
+        if (((var = switch_channel_get_variable(channel, SWITCH_CHANNEL_EXECUTE_ON_ANSWER_VARIABLE)) ||
+                 (!switch_channel_test_flag(channel, CF_EARLY_MEDIA) && (var = switch_channel_get_variable(channel, SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE))))
+                && !zstr(var)) {
</ins><span class="cx">                 char *arg = NULL;
</span><span class="cx">
</span><span class="cx">                 app = switch_core_session_strdup(channel->session, var);
</span><span class="lines">@@ -1973,6 +2158,23 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        if ((var = switch_channel_get_variable(channel, SWITCH_CHANNEL_API_ON_ANSWER_VARIABLE)) && !zstr(var)) {
+                switch_stream_handle_t stream = { 0 };
+                char *arg = NULL;
+
+                app = switch_core_session_strdup(channel->session, var);
+                if ((arg = strchr(app, ' '))) {
+                        *arg++ = '\0';
+                }
+
+                SWITCH_STANDARD_STREAM(stream);
+                switch_api_execute(app, arg, NULL, &stream);
+
+                switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_DEBUG, "%s api on answer: %s(%s)\n%s\n",
+                                                 channel->name, app, switch_str_nil(arg), (char *)stream.data);
+                free(stream.data);
+        }
+
</ins><span class="cx">         switch_channel_audio_sync(channel);
</span><span class="cx">
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="lines">@@ -1980,7 +2182,7 @@
</span><span class="cx">
</span><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *channel, const char *file, const char *func, int line)
</span><span class="cx"> {
</span><del>-        switch_core_session_message_t msg;
</del><ins>+        switch_core_session_message_t msg = { 0 };
</ins><span class="cx">         switch_status_t status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">
</span><span class="cx">         switch_assert(channel != NULL);
</span><span class="lines">@@ -2027,7 +2229,7 @@
</span><span class="cx">         char *func_val = NULL;
</span><span class="cx">         int nv = 0;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(in)) {
</del><ins>+        if (zstr(in)) {
</ins><span class="cx">                 return (char *) in;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -2308,7 +2510,7 @@
</span><span class="cx">         prof_names[10] = "uuid";
</span><span class="cx">
</span><span class="cx">         for (x = 0; prof[x]; x++) {
</span><del>-                if (switch_strlen_zero(prof[x])) {
</del><ins>+                if (zstr(prof[x])) {
</ins><span class="cx">                         continue;
</span><span class="cx">                 }
</span><span class="cx">                 new_len = (strlen(prof[x]) * 3) + 1;
</span><span class="lines">@@ -2361,6 +2563,32 @@
</span><span class="cx">         return stream.data;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+SWITCH_DECLARE(switch_status_t) switch_channel_pass_callee_id(switch_channel_t *channel, switch_channel_t *other_channel)
+{
+        int x = 0;
+
+        switch_assert(channel);
+        switch_assert(other_channel);
+
+        switch_mutex_lock(channel->profile_mutex);
+        switch_mutex_lock(other_channel->profile_mutex);
+
+        if (!zstr(channel->caller_profile->callee_id_name)) {
+                other_channel->caller_profile->callee_id_name = switch_core_strdup(channel->caller_profile->pool, channel->caller_profile->callee_id_name);
+                x++;
+        }
+
+        if (!zstr(channel->caller_profile->callee_id_number)) {
+                other_channel->caller_profile->callee_id_number = switch_core_strdup(channel->caller_profile->pool, channel->caller_profile->callee_id_number);
+                x++;
+        }
+
+        switch_mutex_unlock(other_channel->profile_mutex);
+        switch_mutex_unlock(channel->profile_mutex);
+
+        return x ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
+}
+
</ins><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_channel_get_variables(switch_channel_t *channel, switch_event_t **event)
</span><span class="cx"> {
</span><span class="cx">         switch_status_t status;
</span><span class="lines">@@ -2408,7 +2636,7 @@
</span><span class="cx">                 ocp = switch_channel_get_originator_caller_profile(channel);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(caller_profile->caller_id_name)) {
</del><ins>+        if (!zstr(caller_profile->caller_id_name)) {
</ins><span class="cx">                 cid_buf = switch_core_session_sprintf(channel->session, "\"%s\" <%s>", caller_profile->caller_id_name,
</span><span class="cx">                                                                                          switch_str_nil(caller_profile->caller_id_number));
</span><span class="cx">         } else {
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_consolec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_console.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_console.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_console.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -464,7 +464,7 @@
</span><span class="cx">                 line = el_gets(el, &count);
</span><span class="cx">
</span><span class="cx">                 if (count > 1) {
</span><del>-                        if (!switch_strlen_zero(line)) {
</del><ins>+                        if (!zstr(line)) {
</ins><span class="cx">                                 char *cmd = strdup(line);
</span><span class="cx">                                 char *p;
</span><span class="cx">                                 const LineInfo *lf = el_line(el);
</span><span class="lines">@@ -513,7 +513,7 @@
</span><span class="cx">
</span><span class="cx">         switch_copy_string(h->last, target, sizeof(h->last));
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(target)) {
</del><ins>+        if (!zstr(target)) {
</ins><span class="cx">                 if ((++h->hits % 4) == 0) {
</span><span class="cx">                         fprintf(h->out, "\n");
</span><span class="cx">                 }
</span><span class="lines">@@ -841,15 +841,17 @@
</span><span class="cx"> SWITCH_DECLARE(void) switch_console_loop(void)
</span><span class="cx"> {
</span><span class="cx">
</span><del>-        char cmd[2048];
-        int32_t activity = 1;
-        switch_size_t x = 0;
-
</del><ins>+        char cmd[2048] = "";
+        int32_t activity = 1;        
</ins><span class="cx">         gethostname(hostname, sizeof(hostname));
</span><span class="cx">
</span><span class="cx">         while (running) {
</span><span class="cx">                 int32_t arg;
</span><del>-#ifndef _MSC_VER
</del><ins>+#ifdef _MSC_VER
+                DWORD read, i;
+                HANDLE stdinHandle = GetStdHandle(STD_INPUT_HANDLE);
+                INPUT_RECORD in[128];
+#else
</ins><span class="cx">                 fd_set rfds, efds;
</span><span class="cx">                 struct timeval tv = { 0, 20000 };
</span><span class="cx"> #endif
</span><span class="lines">@@ -863,12 +865,31 @@
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_CONSOLE, "\nfreeswitch@%s> ", hostname);
</span><span class="cx">                 }
</span><span class="cx"> #ifdef _MSC_VER
</span><del>-                activity = WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 20);
</del><ins>+                activity = 0;
+                PeekConsoleInput(stdinHandle, in, 128, &read);
+                for (i = 0; i < read; i++) {
+                        if (in[i].EventType == KEY_EVENT && !in[i].Event.KeyEvent.bKeyDown) {
+                                activity = 1;
+                                break;
+                        }
+                }
</ins><span class="cx">
</span><del>-                if (activity == 102) {
-                        fflush(stdout);
-                        continue;
</del><ins>+                if (activity) {
+                        DWORD bytes = 0;
+                        char *end;
+                        ReadConsole(stdinHandle, cmd, sizeof(cmd), &bytes, NULL);
+                        FlushConsoleInputBuffer(stdinHandle);
+                        end = end_of_p(cmd);
+                        while(*end == '\r' || *end == '\n') {
+                                *end-- = '\0';        
+                        }
</ins><span class="cx">                 }
</span><ins>+
+                if (cmd[0]) {
+                        running = switch_console_process(cmd, 0);
+                        memset(cmd, 0, sizeof(cmd));
+                }
+                Sleep(20);
</ins><span class="cx"> #else
</span><span class="cx">                 FD_ZERO(&rfds);
</span><span class="cx">                 FD_ZERO(&efds);
</span><span class="lines">@@ -890,7 +911,7 @@
</span><span class="cx">                         fflush(stdout);
</span><span class="cx">                         continue;
</span><span class="cx">                 }
</span><del>-#endif
</del><ins>+
</ins><span class="cx">                 memset(&cmd, 0, sizeof(cmd));
</span><span class="cx">                 for (x = 0; x < (sizeof(cmd) - 1); x++) {
</span><span class="cx">                         int c = getchar();
</span><span class="lines">@@ -911,6 +932,7 @@
</span><span class="cx">                 if (cmd[0]) {
</span><span class="cx">                         running = switch_console_process(cmd, 0);
</span><span class="cx">                 }
</span><ins>+#endif
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_corec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -957,7 +957,7 @@
</span><span class="cx">                                 const char *dft = switch_xml_attr(x_list, "default");
</span><span class="cx">                                 switch_bool_t default_type = SWITCH_TRUE;
</span><span class="cx">
</span><del>-                                if (switch_strlen_zero(name)) {
</del><ins>+                                if (zstr(name)) {
</ins><span class="cx">                                         continue;
</span><span class="cx">                                 }
</span><span class="cx">
</span><span class="lines">@@ -1346,13 +1346,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-/* no ctl-c mofo */
-static void handle_SIGINT(int sig)
-{
-        if (sig);
-        return;
-}
-
</del><span class="cx"> static void handle_SIGHUP(int sig)
</span><span class="cx"> {
</span><span class="cx">         if (sig) {
</span><span class="lines">@@ -1400,34 +1393,34 @@
</span><span class="cx"> #endif
</span><span class="cx">                                 } else if (!strcasecmp(var, "colorize-console") && switch_true(val)) {
</span><span class="cx">                                         runtime.colorize_console = SWITCH_TRUE;
</span><del>-                                } else if (!strcasecmp(var, "mailer-app") && !switch_strlen_zero(val)) {
</del><ins>+                                } else if (!strcasecmp(var, "mailer-app") && !zstr(val)) {
</ins><span class="cx">                                         runtime.mailer_app = switch_core_strdup(runtime.memory_pool, val);
</span><span class="cx">                                 } else if (!strcasecmp(var, "mailer-app-args") && val) {
</span><span class="cx">                                         runtime.mailer_app_args = switch_core_strdup(runtime.memory_pool, val);
</span><del>-                                } else if (!strcasecmp(var, "sessions-per-second") && !switch_strlen_zero(val)) {
</del><ins>+                                } else if (!strcasecmp(var, "sessions-per-second") && !zstr(val)) {
</ins><span class="cx">                                         switch_core_sessions_per_second(atoi(val));
</span><del>-                                } else if (!strcasecmp(var, "max_dtmf_duration") && !switch_strlen_zero(val)) {
</del><ins>+                                } else if (!strcasecmp(var, "max_dtmf_duration") && !zstr(val)) {
</ins><span class="cx">                                         int tmp = atoi(val);
</span><span class="cx">                                         if (tmp > 0) {
</span><span class="cx">                                                 switch_core_max_dtmf_duration((uint32_t) tmp);
</span><span class="cx">                                         }
</span><del>-                                } else if (!strcasecmp(var, "min_dtmf_duration") && !switch_strlen_zero(val)) {
</del><ins>+                                } else if (!strcasecmp(var, "min_dtmf_duration") && !zstr(val)) {
</ins><span class="cx">                                         int tmp = atoi(val);
</span><span class="cx">                                         if (tmp > 0) {
</span><span class="cx">                                                 switch_core_min_dtmf_duration((uint32_t) tmp);
</span><span class="cx">                                         }
</span><del>-                                } else if (!strcasecmp(var, "default_dtmf_duration") && !switch_strlen_zero(val)) {
</del><ins>+                                } else if (!strcasecmp(var, "default_dtmf_duration") && !zstr(val)) {
</ins><span class="cx">                                         int tmp = atoi(val);
</span><span class="cx">                                         if (tmp > 0) {
</span><span class="cx">                                                 switch_core_default_dtmf_duration((uint32_t) tmp);
</span><span class="cx">                                         }
</span><span class="cx">                                 } else if (!strcasecmp(var, "disable-monotonic-timing")) {
</span><span class="cx">                                         switch_time_set_monotonic(SWITCH_FALSE);
</span><del>-                                } else if (!strcasecmp(var, "max-sessions") && !switch_strlen_zero(val)) {
</del><ins>+                                } else if (!strcasecmp(var, "max-sessions") && !zstr(val)) {
</ins><span class="cx">                                         switch_core_session_limit(atoi(val));
</span><del>-                                } else if (!strcasecmp(var, "rtp-start-port") && !switch_strlen_zero(val)) {
</del><ins>+                                } else if (!strcasecmp(var, "rtp-start-port") && !zstr(val)) {
</ins><span class="cx">                                         switch_rtp_set_start_port((switch_port_t) atoi(val));
</span><del>-                                } else if (!strcasecmp(var, "rtp-end-port") && !switch_strlen_zero(val)) {
</del><ins>+                                } else if (!strcasecmp(var, "rtp-end-port") && !zstr(val)) {
</ins><span class="cx">                                         switch_rtp_set_end_port((switch_port_t) atoi(val));
</span><span class="cx"> #ifdef ENABLE_ZRTP
</span><span class="cx">                                 } else if (!strcasecmp(var, "rtp-enable-zrtp")) {
</span><span class="lines">@@ -1463,7 +1456,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* set signal handlers */
</span><del>-        signal(SIGINT, handle_SIGINT);
</del><ins>+        signal(SIGINT, SIG_IGN);
</ins><span class="cx"> #ifdef SIGPIPE
</span><span class="cx">         signal(SIGPIPE, handle_SIGPIPE);
</span><span class="cx"> #endif
</span><span class="lines">@@ -1535,6 +1528,28 @@
</span><span class="cx">         return switch_micro_time_now() - runtime.initiated;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+
+#ifdef _MSC_VER
+static void win_shutdown(void)
+{
+        
+        HANDLE shutdown_event;        
+        char path[512];
+        /* for windows we need the event to signal for shutting down a background FreeSWITCH */
+        snprintf(path, sizeof(path), "Global\\Freeswitch.%d", getpid());
+        
+        /* open the event so we can signal it */
+        shutdown_event = OpenEvent(EVENT_MODIFY_STATE, FALSE, path);
+        
+        if (shutdown_event) {
+                /* signal the event to shutdown */
+                SetEvent(shutdown_event);
+                /* cleanup */
+                CloseHandle(shutdown_event);
+        }
+}
+#endif
+
</ins><span class="cx"> SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, int32_t *val)
</span><span class="cx"> {
</span><span class="cx">         if (switch_test_flag((&runtime), SCF_SHUTTING_DOWN)) {
</span><span class="lines">@@ -1579,18 +1594,25 @@
</span><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
</span><span class="cx">                                                                          "Shutdown in progress, %u session(s) remain.\nShutting down %s\n",
</span><span class="cx">                                                                          count,
</span><del>-                                                                         cmd == SCSC_SHUTDOWN_ASAP ? "ASAP" : "Once there are no active calls.");
</del><ins>+                                                                         cmd == SCSC_SHUTDOWN_ASAP ? "ASAP" : "once there are no active calls.");
</ins><span class="cx">                                         x = 0;
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                         
</span><span class="cx">                         if (switch_test_flag((&runtime), SCF_SHUTDOWN_REQUESTED)) {
</span><span class="cx">                                 switch_set_flag((&runtime), SCF_NO_NEW_SESSIONS);
</span><ins>+#ifdef _MSC_VER
+                                win_shutdown();
+#endif
+
</ins><span class="cx">                                 if (*val) {
</span><span class="cx">                                         switch_set_flag((&runtime), SCF_RESTART);
</span><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Restarting\n");
</span><span class="cx">                                 } else {
</span><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Shutting down\n");
</span><ins>+#ifdef _MSC_VER
+                                        fclose(stdin);
+#endif
</ins><span class="cx">                                 }
</span><span class="cx">                                 runtime.running = 0;
</span><span class="cx">                         } else {
</span><span class="lines">@@ -1600,11 +1622,19 @@
</span><span class="cx">                 }
</span><span class="cx">                 break;
</span><span class="cx">         case SCSC_SHUTDOWN:
</span><ins>+
+#ifdef _MSC_VER
+                win_shutdown();
+#endif
+
</ins><span class="cx">                 if (*val) {
</span><span class="cx">                         switch_set_flag((&runtime), SCF_RESTART);
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Restarting\n");
</span><span class="cx">                 } else {
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Shutting down\n");
</span><ins>+#ifdef _MSC_VER
+                        fclose(stdin);
+#endif
</ins><span class="cx">                 }
</span><span class="cx">                 runtime.running = 0;
</span><span class="cx">                 break;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_asrc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_asr.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_asr.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_asr.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -96,7 +96,7 @@
</span><span class="cx">
</span><span class="cx">         switch_assert(ah != NULL);
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(grammar)) {
</del><ins>+        if (zstr(grammar)) {
</ins><span class="cx">                 status = SWITCH_STATUS_FALSE;
</span><span class="cx">                 goto done;
</span><span class="cx">         }
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx">         while (data && *data == ' ') {
</span><span class="cx">                 data++;
</span><span class="cx">         }
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 status = SWITCH_STATUS_FALSE;
</span><span class="cx">                 goto done;
</span><span class="cx">         }
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx">         if (*data == '{') {
</span><span class="cx">                 param_string = data + 1;
</span><span class="cx">                 data = switch_find_end_paren(data, '{', '}');
</span><del>-                if (switch_strlen_zero(data)) {
</del><ins>+                if (zstr(data)) {
</ins><span class="cx">                         status = SWITCH_STATUS_FALSE;
</span><span class="cx">                         goto done;
</span><span class="cx">                 } else {        
</span><span class="lines">@@ -130,7 +130,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* set ASR params */
</span><del>-        if (!switch_strlen_zero(param_string)) {
</del><ins>+        if (!zstr(param_string)) {
</ins><span class="cx">                 char *param[256] = { 0 };
</span><span class="cx">                 int i;
</span><span class="cx">                 int argc = switch_separate_string(param_string, ',', param, (sizeof(param) / sizeof(param[0])));
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_codecc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_codec.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_codec.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_codec.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -280,10 +280,10 @@
</span><span class="cx">         if (session->write_codec && codec && session->write_impl.decoded_bytes_per_packet) {
</span><span class="cx">                 if (switch_event_create(&event, SWITCH_EVENT_CODEC) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                         switch_channel_event_set_data(session->channel, event);
</span><del>-                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-write-codec-name", session->write_impl.iananame);
-                        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-write-codec-rate", "%d", session->write_impl.actual_samples_per_second);
</del><ins>+                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Channel-Write-Codec-Name", session->write_impl.iananame);
+                        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Write-Codec-Rate", "%d", session->write_impl.actual_samples_per_second);
</ins><span class="cx">                         if (session->write_impl.actual_samples_per_second != session->write_impl.samples_per_second) {
</span><del>-                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-reported-write-codec-rate", "%d",
</del><ins>+                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Reported-Write-Codec-Rate", "%d",
</ins><span class="cx">                                                                                 session->write_impl.actual_samples_per_second);
</span><span class="cx">                         }
</span><span class="cx">                         switch_event_fire(&event);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_filec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_file.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_file.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_file.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -46,17 +46,20 @@
</span><span class="cx">         char stream_name[128] = "";
</span><span class="cx">         char *rhs = NULL;
</span><span class="cx">         const char *spool_path = NULL;
</span><ins>+        int is_stream = 0;
</ins><span class="cx">
</span><span class="cx">         if (switch_test_flag(fh, SWITCH_FILE_OPEN)) {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Handle already open\n");
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(file_path)) {
</del><ins>+        if (zstr(file_path)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Filename\n");
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        fh->flags = flags;
+
</ins><span class="cx">         if (pool) {
</span><span class="cx">                 fh->memory_pool = pool;
</span><span class="cx">         } else {
</span><span class="lines">@@ -73,6 +76,7 @@
</span><span class="cx">                 ext = stream_name;
</span><span class="cx">                 file_path = rhs + 3;
</span><span class="cx">                 fh->file_path = switch_core_strdup(fh->memory_pool, file_path);
</span><ins>+                is_stream = 1;
</ins><span class="cx">         } else {
</span><span class="cx">                 if ((flags & SWITCH_FILE_FLAG_WRITE)) {
</span><span class="cx">
</span><span class="lines">@@ -100,7 +104,7 @@
</span><span class="cx">
</span><span class="cx">                 if ((ext = strrchr(file_path, '.')) == 0) {
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unknown file Format [%s]\n", file_path);
</span><del>-                        switch_goto_status(SWITCH_STATUS_FALSE, end);
</del><ins>+                        switch_goto_status(SWITCH_STATUS_FALSE, fail);
</ins><span class="cx">                 }
</span><span class="cx">                 ext++;
</span><span class="cx">                 fh->file_path = switch_core_strdup(fh->memory_pool, file_path);
</span><span class="lines">@@ -110,13 +114,13 @@
</span><span class="cx">
</span><span class="cx">         if ((fh->file_interface = switch_loadable_module_get_file_interface(ext)) == 0) {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid file format [%s] for [%s]!\n", ext, file_path);
</span><del>-                switch_goto_status(SWITCH_STATUS_GENERR, end);
</del><ins>+                switch_goto_status(SWITCH_STATUS_GENERR, fail);
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         fh->file = file;
</span><span class="cx">         fh->func = func;
</span><span class="cx">         fh->line = line;
</span><del>-        fh->flags = flags;
</del><ins>+
</ins><span class="cx">         
</span><span class="cx">         if (spool_path) {
</span><span class="cx">                 char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
</span><span class="lines">@@ -151,16 +155,16 @@
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Spool dir is set. Make sure [%s] is also a valid path\n", fh->spool_path);
</span><span class="cx">                 }
</span><span class="cx">                 UNPROTECT_INTERFACE(fh->file_interface);
</span><del>-                switch_goto_status(status, end);
</del><ins>+                switch_goto_status(status, fail);
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">         if ((flags & SWITCH_FILE_FLAG_WRITE) &&
</span><del>-                !strstr(file_path, SWITCH_URL_SEPARATOR) && (status = switch_file_exists(file_path, fh->memory_pool)) != SWITCH_STATUS_SUCCESS) {
</del><ins>+                !is_stream && (status = switch_file_exists(file_path, fh->memory_pool)) != SWITCH_STATUS_SUCCESS) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "File [%s] not created!\n", file_path);
</span><span class="cx">                 fh->file_interface->file_close(fh);
</span><span class="cx">                 UNPROTECT_INTERFACE(fh->file_interface);
</span><del>-                switch_goto_status(status, end);
</del><ins>+                switch_goto_status(status, fail);
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         if ((flags & SWITCH_FILE_FLAG_READ)) {
</span><span class="lines">@@ -187,8 +191,9 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         switch_set_flag(fh, SWITCH_FILE_OPEN);
</span><ins>+        return status;
</ins><span class="cx">
</span><del>- end:
</del><ins>+ fail:
</ins><span class="cx">         
</span><span class="cx">         if (switch_test_flag(fh, SWITCH_FILE_FLAG_FREE_POOL)) {
</span><span class="cx">                 switch_core_destroy_memory_pool(&fh->memory_pool);
</span><span class="lines">@@ -493,9 +498,11 @@
</span><span class="cx">                                 if ((blen = switch_buffer_read(fh->pre_buffer, fh->pre_buffer_data, fh->pre_buffer_datalen))) {
</span><span class="cx">                                         if (!asis) blen /= 2;
</span><span class="cx">                                         if (fh->channels > 1) blen /= fh->channels;
</span><ins>+                                        
</ins><span class="cx">                                         if (fh->file_interface->file_write(fh, fh->pre_buffer_data, &blen) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                                 break;
</span><span class="cx">                                         }
</span><ins>+                                        fh->samples_out += blen;
</ins><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                 }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_hashc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_hash.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_hash.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_hash.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -39,18 +39,25 @@
</span><span class="cx">
</span><span class="cx"> struct switch_hash {
</span><span class="cx">         Hash table;
</span><ins>+        switch_memory_pool_t *pool;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_core_hash_init_case(switch_hash_t **hash, switch_memory_pool_t *pool, switch_bool_t case_sensitive)
</span><span class="cx"> {
</span><span class="cx">         switch_hash_t *newhash;
</span><span class="cx">
</span><del>-        newhash = switch_core_alloc(pool, sizeof(*newhash));
</del><ins>+        if (pool) {
+                newhash = switch_core_alloc(pool, sizeof(*newhash));
+                newhash->pool = pool;
+        } else {
+                switch_zmalloc(newhash, sizeof(*newhash));
+        }
+
</ins><span class="cx">         switch_assert(newhash);
</span><span class="cx">
</span><span class="cx">         sqlite3HashInit(&newhash->table, case_sensitive ? SQLITE_HASH_BINARY : SQLITE_HASH_STRING, 1);
</span><span class="cx">         *hash = newhash;
</span><del>-
</del><ins>+        
</ins><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -58,7 +65,13 @@
</span><span class="cx"> {
</span><span class="cx">         switch_assert(hash != NULL && *hash != NULL);
</span><span class="cx">         sqlite3HashClear(&(*hash)->table);
</span><ins>+
+        if (!(*hash)->pool) {
+                free(*hash);
+        }
+
</ins><span class="cx">         *hash = NULL;
</span><ins>+
</ins><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_ioc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_io.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_io.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_io.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -112,6 +112,8 @@
</span><span class="cx">
</span><span class="cx">         if (!(session->read_codec && session->read_codec->implementation && switch_core_codec_ready(session->read_codec))) {
</span><span class="cx">                 if (switch_channel_test_flag(session->channel, CF_PROXY_MODE) || switch_channel_get_state(session->channel) == CS_HIBERNATE) {
</span><ins>+                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "%s reading on a session with no media!\n", switch_channel_get_name(session->channel));
+                        switch_cond_next();
</ins><span class="cx">                         *frame = &runtime.dummy_cng_frame;
</span><span class="cx">                         return SWITCH_STATUS_SUCCESS;
</span><span class="cx">                 }
</span><span class="lines">@@ -332,6 +334,10 @@
</span><span class="cx">                         switch_bool_t ok = SWITCH_TRUE;
</span><span class="cx">                         switch_thread_rwlock_rdlock(session->bug_rwlock);
</span><span class="cx">                         for (bp = session->bugs; bp; bp = bp->next) {
</span><ins>+                                if (!switch_channel_test_flag(session->channel, CF_ANSWERED) && switch_core_media_bug_test_flag(bp, SMBF_ANSWER_REQ)) {
+                                        continue;
+                                }
+
</ins><span class="cx">                                 if (bp->ready && switch_test_flag(bp, SMBF_READ_STREAM)) {
</span><span class="cx">                                         switch_mutex_lock(bp->read_mutex);
</span><span class="cx">                                         switch_buffer_write(bp->raw_read_buffer, read_frame->data, read_frame->datalen);
</span><span class="lines">@@ -494,6 +500,10 @@
</span><span class="cx">                         switch_bool_t ok = SWITCH_TRUE;
</span><span class="cx">                         switch_thread_rwlock_rdlock(session->bug_rwlock);
</span><span class="cx">                         for (bp = session->bugs; bp; bp = bp->next) {
</span><ins>+                                if (!switch_channel_test_flag(session->channel, CF_ANSWERED) && switch_core_media_bug_test_flag(bp, SMBF_ANSWER_REQ)) {
+                                        continue;
+                                }
+
</ins><span class="cx">                                 if (bp->ready && switch_test_flag(bp, SMBF_READ_PING)) {
</span><span class="cx">                                         switch_mutex_lock(bp->read_mutex);
</span><span class="cx">                                         if (bp->callback) {
</span><span class="lines">@@ -758,6 +768,11 @@
</span><span class="cx">                         if (!bp->ready) {
</span><span class="cx">                                 continue;
</span><span class="cx">                         }
</span><ins>+
+                        if (!switch_channel_test_flag(session->channel, CF_ANSWERED) && switch_core_media_bug_test_flag(bp, SMBF_ANSWER_REQ)) {
+                                continue;
+                        }
+
</ins><span class="cx">                         if (switch_test_flag(bp, SMBF_WRITE_STREAM)) {
</span><span class="cx">
</span><span class="cx">                                 switch_mutex_lock(bp->write_mutex);
</span><span class="lines">@@ -1180,7 +1195,7 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(dtmf_string)) {
</del><ins>+        if (zstr(dtmf_string)) {
</ins><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_media_bugc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_media_bug.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_media_bug.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_media_bug.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -235,7 +235,7 @@
</span><span class="cx">         switch_size_t bytes;
</span><span class="cx">         switch_codec_implementation_t read_impl = {0};
</span><span class="cx">         switch_codec_implementation_t write_impl = {0};
</span><del>-        
</del><ins>+        const char *p;
</ins><span class="cx">
</span><span class="cx">         if (!switch_channel_media_ready(session->channel)) {
</span><span class="cx">                 if (switch_channel_pre_answer(session->channel) != SWITCH_STATUS_SUCCESS) {
</span><span class="lines">@@ -248,6 +248,11 @@
</span><span class="cx">
</span><span class="cx">         *new_bug = NULL;
</span><span class="cx">
</span><ins>+
+        if ((p = switch_channel_get_variable(session->channel, "media_bug_answer_req")) && switch_true(p)) {
+                flags |= SMBF_ANSWER_REQ;
+        }
+
</ins><span class="cx"> #if 0
</span><span class="cx">         if (flags & SMBF_WRITE_REPLACE) {
</span><span class="cx">                 switch_thread_rwlock_wrlock(session->bug_rwlock);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_memoryc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_memory.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_memory.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_memory.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -139,7 +139,7 @@
</span><span class="cx">                 return NULL;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(todup)) {
</del><ins>+        if (zstr(todup)) {
</ins><span class="cx">                 return SWITCH_BLANK_STRING;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -235,7 +235,7 @@
</span><span class="cx">                 return NULL;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(todup)) {
</del><ins>+        if (zstr(todup)) {
</ins><span class="cx">                 return SWITCH_BLANK_STRING;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -275,7 +275,7 @@
</span><span class="cx">                 return NULL;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(todup)) {
</del><ins>+        if (zstr(todup)) {
</ins><span class="cx">                 return SWITCH_BLANK_STRING;
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_sessionc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_session.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_session.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_session.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -373,7 +373,7 @@
</span><span class="cx">                 switch_assert(channel != NULL);
</span><span class="cx">
</span><span class="cx">                 forwardvar = switch_channel_get_variable(channel, SWITCH_MAX_FORWARDS_VARIABLE);
</span><del>-                if (!switch_strlen_zero(forwardvar)) {
</del><ins>+                if (!zstr(forwardvar)) {
</ins><span class="cx">                         forwardval = atoi(forwardvar) - 1;
</span><span class="cx">                 }
</span><span class="cx">                 if (forwardval <= 0) {
</span><span class="lines">@@ -506,13 +506,27 @@
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         if (switch_channel_test_flag(channel, CF_PROXY_MODE)) {
</span><del>-                                switch_channel_set_flag(peer_channel, CF_PROXY_MODE);
</del><ins>+                                if (switch_channel_test_cap(peer_channel, CC_BYPASS_MEDIA)) {
+                                        switch_channel_set_flag(peer_channel, CF_PROXY_MODE);                
+                                } else {
+                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
+                                                                         "%s does not support the proxy feature, disabling.\n",
+                                                                         switch_channel_get_name(peer_channel));
+                                        switch_channel_clear_flag(channel, CF_PROXY_MODE);
+                                }
</ins><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         if (switch_channel_test_flag(channel, CF_PROXY_MEDIA)) {
</span><del>-                                switch_channel_set_flag(peer_channel, CF_PROXY_MEDIA);
-                                if (switch_channel_test_flag(channel, CF_VIDEO)) {
-                                        switch_channel_set_flag(peer_channel, CF_VIDEO);
</del><ins>+                                if (switch_channel_test_cap(peer_channel, CC_PROXY_MEDIA)) {
+                                        switch_channel_set_flag(peer_channel, CF_PROXY_MEDIA);
+                                        if (switch_channel_test_flag(channel, CF_VIDEO)) {
+                                                switch_channel_set_flag(peer_channel, CF_VIDEO);
+                                        }
+                                } else {
+                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
+                                                                         "%s does not support the proxy feature, disabling.\n",
+                                                                         switch_channel_get_name(peer_channel));
+                                        switch_channel_clear_flag(channel, CF_PROXY_MEDIA);
</ins><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="lines">@@ -562,6 +576,9 @@
</span><span class="cx">         "TRANSCODING_NECESSARY",
</span><span class="cx">         "AUDIO_SYNC",
</span><span class="cx">         "REQUEST_IMAGE_MEDIA",
</span><ins>+        "UUID_CHANGE",
+        "WARNING",
+        "DEBUG_AUDIO",
</ins><span class="cx">         "INVALID"
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -582,17 +599,35 @@
</span><span class="cx">                 return status;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        message->_file = file;
-        message->_func = func;
-        message->_line = line;
</del><ins>+        if (!message->_file) {
+                message->_file = file;
+        }
</ins><span class="cx">
</span><ins>+        if (!message->_func) {
+                message->_func = func;
+        }
+
+        if (!message->_line) {
+                message->_line = line;
+        }
+
</ins><span class="cx">         if (message->message_id > SWITCH_MESSAGE_INVALID) {
</span><span class="cx">                 message->message_id = SWITCH_MESSAGE_INVALID;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, switch_core_session_get_uuid(session), SWITCH_LOG_DEBUG, "%s receive message [%s]\n",
</del><ins>+        switch_log_printf(SWITCH_CHANNEL_ID_LOG, message->_file, message->_func, message->_line,
+                                         switch_core_session_get_uuid(session), SWITCH_LOG_DEBUG, "%s receive message [%s]\n",
</ins><span class="cx">                                          switch_channel_get_name(session->channel), message_names[message->message_id]);
</span><ins>+
</ins><span class="cx">         
</span><ins>+        if (message->message_id == SWITCH_MESSAGE_INDICATE_DISPLAY &&
+                switch_true(switch_channel_get_variable(session->channel, SWITCH_IGNORE_DISPLAY_UPDATES_VARIABLE))) {
+                switch_log_printf(SWITCH_CHANNEL_ID_LOG, message->_file, message->_func, message->_line,
+                                                 switch_core_session_get_uuid(session), SWITCH_LOG_DEBUG, "Ignoring display update.\n");
+                status = SWITCH_STATUS_SUCCESS;
+                goto end;
+        }
+        
</ins><span class="cx">         if (session->endpoint_interface->io_routines->receive_message) {
</span><span class="cx">                 status = session->endpoint_interface->io_routines->receive_message(session, message);
</span><span class="cx">         }
</span><span class="lines">@@ -633,6 +668,9 @@
</span><span class="cx">                 break;
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+ end:
+
+        switch_core_session_free_message(&message);
</ins><span class="cx">         switch_core_session_rwunlock(session);
</span><span class="cx">
</span><span class="cx">         return status;
</span><span class="lines">@@ -684,11 +722,39 @@
</span><span class="cx">                 if (switch_queue_trypush(session->message_queue, message) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                         status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">                 }
</span><ins>+
+                switch_core_session_kill_channel(session, SWITCH_SIG_BREAK);
+
+                if (switch_channel_test_flag(session->channel, CF_PROXY_MODE) || switch_channel_test_flag(session->channel, CF_THREAD_SLEEPING)) {
+                        switch_core_session_wake_session_thread(session);
+                }
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         return status;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+SWITCH_DECLARE(void) switch_core_session_free_message(switch_core_session_message_t **message)
+{
+        switch_core_session_message_t *to_free = *message;
+        int i;
+        char *s;
+
+        *message = NULL;
+
+        if (switch_test_flag(to_free, SCSMF_DYNAMIC)) {
+                s = (char *)to_free->string_arg;
+                switch_safe_free(s);
+                switch_safe_free(to_free->pointer_arg);
+                
+                for (i = 0; i < MESSAGE_STRING_ARG_MAX; i++) {
+                        s = (char *)to_free->string_array_arg[i];
+                        switch_safe_free(s);
+                }
+
+                switch_safe_free(to_free);
+        }
+}
+
</ins><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_core_session_dequeue_message(switch_core_session_t *session, switch_core_session_message_t **message)
</span><span class="cx"> {
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_FALSE;
</span><span class="lines">@@ -699,6 +765,11 @@
</span><span class="cx">         if (session->message_queue) {
</span><span class="cx">                 if ((status = (switch_status_t) switch_queue_trypop(session->message_queue, &pop)) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                         *message = (switch_core_session_message_t *) pop;
</span><ins>+                        if ((*message)->delivery_time && (*message)->delivery_time > switch_epoch_time_now(NULL)) {
+                                switch_core_session_queue_message(session, *message);
+                                *message = NULL;
+                                status = SWITCH_STATUS_FALSE;
+                        }
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -709,12 +780,8 @@
</span><span class="cx"> {
</span><span class="cx">         switch_core_session_message_t *message;
</span><span class="cx">
</span><del>-        if (switch_core_session_dequeue_message(session, &message) == SWITCH_STATUS_SUCCESS) {
-                if (switch_test_flag(message, SCSMF_DYNAMIC)) {
-                        switch_safe_free(message);
-                } else {
-                        message = NULL;
-                }
</del><ins>+        while (switch_core_session_dequeue_message(session, &message) == SWITCH_STATUS_SUCCESS) {
+                switch_core_session_free_message(&message);
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="lines">@@ -907,17 +974,22 @@
</span><span class="cx">         return session->channel;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-SWITCH_DECLARE(void) switch_core_session_signal_state_change(switch_core_session_t *session)
</del><ins>+SWITCH_DECLARE(void) switch_core_session_wake_session_thread(switch_core_session_t *session)
</ins><span class="cx"> {
</span><del>-        switch_status_t status = SWITCH_STATUS_SUCCESS;
-        switch_io_event_hook_state_change_t *ptr;
-
</del><span class="cx">         /* If trylock fails the signal is already awake so we needn't bother */
</span><span class="cx">         if (switch_mutex_trylock(session->mutex) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                 switch_thread_cond_signal(session->cond);
</span><span class="cx">                 switch_mutex_unlock(session->mutex);
</span><span class="cx">         }
</span><ins>+}
</ins><span class="cx">
</span><ins>+SWITCH_DECLARE(void) switch_core_session_signal_state_change(switch_core_session_t *session)
+{
+        switch_status_t status = SWITCH_STATUS_SUCCESS;
+        switch_io_event_hook_state_change_t *ptr;
+
+        switch_core_session_wake_session_thread(session);
+
</ins><span class="cx">         if (session->endpoint_interface->io_routines->state_change) {
</span><span class="cx">                 status = session->endpoint_interface->io_routines->state_change(session);
</span><span class="cx">         }
</span><span class="lines">@@ -1134,6 +1206,7 @@
</span><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_core_session_set_uuid(switch_core_session_t *session, const char *use_uuid)
</span><span class="cx"> {
</span><span class="cx">         switch_event_t *event;
</span><ins>+        switch_core_session_message_t msg = { 0 };
</ins><span class="cx">
</span><span class="cx">         switch_assert(use_uuid);
</span><span class="cx">
</span><span class="lines">@@ -1144,6 +1217,12 @@
</span><span class="cx"> return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        msg.message_id = SWITCH_MESSAGE_INDICATE_UUID_CHANGE;
+        msg.from = switch_channel_get_name(session->channel);
+        msg.string_array_arg[0] = session->uuid_str;
+        msg.string_array_arg[1] = use_uuid;
+        switch_core_session_receive_message(session, &msg);
+
</ins><span class="cx">         switch_event_create(&event, SWITCH_EVENT_CHANNEL_UUID);
</span><span class="cx">         switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Old-Unique-ID", session->uuid_str);
</span><span class="cx">         switch_core_hash_delete(session_manager.session_table, session->uuid_str);
</span><span class="lines">@@ -1208,7 +1287,6 @@
</span><span class="cx">
</span><span class="cx">         session = switch_core_alloc(usepool, sizeof(*session));
</span><span class="cx">         session->pool = usepool;
</span><del>-        session->thread_id = switch_thread_self();
</del><span class="cx">
</span><span class="cx">         switch_core_memory_pool_set_data(session->pool, "__session", session);
</span><span class="cx">         
</span><span class="lines">@@ -1430,7 +1508,7 @@
</span><span class="cx">                 char *myarg = NULL;
</span><span class="cx">                 if (expanded) {
</span><span class="cx">                         myarg = switch_mprintf("%s(%s)", app, expanded);
</span><del>-                } else if (!switch_strlen_zero(arg)) {
</del><ins>+                } else if (!zstr(arg)) {
</ins><span class="cx">                         myarg = switch_mprintf("%s(%s)", app, arg);
</span><span class="cx">                 } else {
</span><span class="cx">                         myarg = switch_mprintf("%s", app);
</span><span class="lines">@@ -1519,11 +1597,11 @@
</span><span class="cx">         new_profile = switch_caller_profile_clone(session, profile);
</span><span class="cx">         new_profile->destination_number = switch_core_strdup(new_profile->pool, exten);
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(dialplan)) {
</del><ins>+        if (!zstr(dialplan)) {
</ins><span class="cx">                 new_profile->dialplan = switch_core_strdup(new_profile->pool, dialplan);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(context)) {
</del><ins>+        if (!zstr(context)) {
</ins><span class="cx">                 new_profile->context = switch_core_strdup(new_profile->pool, context);
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_speechc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_speech.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_speech.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_speech.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx">         char buf[256] = "";
</span><span class="cx">         char *param = NULL;
</span><span class="cx">
</span><del>-        if (!sh || !flags || switch_strlen_zero(module_name)) {
</del><ins>+        if (!sh || !flags || zstr(module_name)) {
</ins><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx">
</span><span class="cx">         switch_assert(sh != NULL);
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(text)) {
</del><ins>+        if (zstr(text)) {
</ins><span class="cx">                 status = SWITCH_STATUS_FALSE;
</span><span class="cx">                 goto done;
</span><span class="cx">         }
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx">         while (data && *data == ' ') {
</span><span class="cx">                 data++;
</span><span class="cx">         }
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 status = SWITCH_STATUS_FALSE;
</span><span class="cx">                 goto done;
</span><span class="cx">         }
</span><span class="lines">@@ -126,7 +126,7 @@
</span><span class="cx">         if (*data == '{') {
</span><span class="cx">                 param_string = data + 1;
</span><span class="cx">                 data = switch_find_end_paren(data, '{', '}');
</span><del>-                if (switch_strlen_zero(data)) {
</del><ins>+                if (zstr(data)) {
</ins><span class="cx">                         status = SWITCH_STATUS_FALSE;
</span><span class="cx">                         goto done;
</span><span class="cx">                 } else {
</span><span class="lines">@@ -136,7 +136,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         /* set TTS params */
</span><del>-        if (!switch_strlen_zero(param_string)) {
</del><ins>+        if (!zstr(param_string)) {
</ins><span class="cx">                 char *param[256] = { 0 };
</span><span class="cx">                 int i;
</span><span class="cx">                 int argc = switch_separate_string(param_string, ',', param, (sizeof(param) / sizeof(param[0])));
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_sqldbc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_sqldb.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_sqldb.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_sqldb.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -40,6 +40,8 @@
</span><span class="cx">         switch_core_db_t *event_db;
</span><span class="cx">         switch_queue_t *sql_queue[2];
</span><span class="cx">         switch_memory_pool_t *memory_pool;
</span><ins>+        switch_event_node_t *event_node;
+        switch_thread_t *thread;
</ins><span class="cx">         int thread_running;
</span><span class="cx"> } sql_manager;
</span><span class="cx">
</span><span class="lines">@@ -177,7 +179,7 @@
</span><span class="cx">                                 if (itterations == 0) {
</span><span class="cx">                                         trans = 1;
</span><span class="cx">                                 }
</span><del>-
</del><ins>+                                
</ins><span class="cx">                                 /* ignore abnormally large strings sql strings as potential buffer overflow */
</span><span class="cx">                                 if (newlen < SQLLEN) {
</span><span class="cx">                                         itterations++;
</span><span class="lines">@@ -314,7 +316,7 @@
</span><span class="cx">                         char *state = switch_event_get_header_nil(event, "channel-state-number");
</span><span class="cx">                         switch_channel_state_t state_i = CS_DESTROY;
</span><span class="cx">
</span><del>-                        if (!switch_strlen_zero(state)) {
</del><ins>+                        if (!zstr(state)) {
</ins><span class="cx">                                 state_i = atoi(state);
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="lines">@@ -373,7 +375,7 @@
</span><span class="cx">                         const char *syntax = switch_event_get_header_nil(event, "syntax");
</span><span class="cx">                         const char *key = switch_event_get_header_nil(event, "key");
</span><span class="cx">                         const char *filename = switch_event_get_header_nil(event, "filename");
</span><del>-                        if (!switch_strlen_zero(type) && !switch_strlen_zero(name)) {
</del><ins>+                        if (!zstr(type) && !zstr(name)) {
</ins><span class="cx">                                 sql =
</span><span class="cx">                                         switch_mprintf("insert into interfaces (type,name,description,syntax,key,filename) values('%q','%q','%q','%q','%q','%q')",
</span><span class="cx">                                                                  type, name, switch_str_nil(description), switch_str_nil(syntax), switch_str_nil(key), switch_str_nil(filename)
</span><span class="lines">@@ -385,7 +387,7 @@
</span><span class="cx">                 {
</span><span class="cx">                         const char *type = switch_event_get_header_nil(event, "type");
</span><span class="cx">                         const char *name = switch_event_get_header_nil(event, "name");
</span><del>-                        if (!switch_strlen_zero(type) && !switch_strlen_zero(name)) {
</del><ins>+                        if (!zstr(type) && !zstr(name)) {
</ins><span class="cx">                                 sql = switch_mprintf("delete from interfaces where type='%q' and name='%q'", type, name);
</span><span class="cx">                         }
</span><span class="cx">                         break;
</span><span class="lines">@@ -394,7 +396,7 @@
</span><span class="cx">                 {
</span><span class="cx">                         const char *type = switch_event_get_header_nil(event, "secure_type");
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Secure Type: %s\n", type);
</span><del>-                        if (switch_strlen_zero(type)) {
</del><ins>+                        if (zstr(type)) {
</ins><span class="cx">                                 break;
</span><span class="cx">                         }
</span><span class="cx">                         sql = switch_mprintf("update channels set secure='%s' where uuid='%s'",
</span><span class="lines">@@ -440,8 +442,7 @@
</span><span class="cx">
</span><span class="cx"> void switch_core_sqldb_start(switch_memory_pool_t *pool)
</span><span class="cx"> {
</span><del>-        switch_thread_t *thread;
-        switch_threadattr_t *thd_attr;;
</del><ins>+        switch_threadattr_t *thd_attr;
</ins><span class="cx">
</span><span class="cx">         sql_manager.memory_pool = pool;
</span><span class="cx">
</span><span class="lines">@@ -567,7 +568,8 @@
</span><span class="cx">                 switch_core_db_exec(sql_manager.db, create_calls_sql, NULL, NULL, NULL);
</span><span class="cx">                 switch_core_db_exec(sql_manager.db, create_interfaces_sql, NULL, NULL, NULL);
</span><span class="cx">                 switch_core_db_exec(sql_manager.db, create_tasks_sql, NULL, NULL, NULL);
</span><del>-                if (switch_event_bind("core_db", SWITCH_EVENT_ALL, SWITCH_EVENT_SUBCLASS_ANY, core_event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
</del><ins>+
+                if (switch_event_bind_removable("core_db", SWITCH_EVENT_ALL, SWITCH_EVENT_SUBCLASS_ANY, core_event_handler, NULL, &sql_manager.event_node) != SWITCH_STATUS_SUCCESS) {
</ins><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind event handler!\n");
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -576,9 +578,8 @@
</span><span class="cx">         switch_queue_create(&sql_manager.sql_queue[1], SWITCH_SQL_QUEUE_LEN, sql_manager.memory_pool);
</span><span class="cx">
</span><span class="cx">         switch_threadattr_create(&thd_attr, sql_manager.memory_pool);
</span><del>-        switch_threadattr_detach_set(thd_attr, 1);
</del><span class="cx">         switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
</span><del>-        switch_thread_create(&thread, thd_attr, switch_core_sql_thread, NULL, sql_manager.memory_pool);
</del><ins>+        switch_thread_create(&sql_manager.thread, thd_attr, switch_core_sql_thread, NULL, sql_manager.memory_pool);
</ins><span class="cx">
</span><span class="cx">         while (!sql_manager.thread_running) {
</span><span class="cx">                 switch_yield(10000);
</span><span class="lines">@@ -587,16 +588,15 @@
</span><span class="cx">
</span><span class="cx"> void switch_core_sqldb_stop(void)
</span><span class="cx"> {
</span><ins>+        switch_status_t st;
+
+        switch_event_unbind(&sql_manager.event_node);
+
</ins><span class="cx">         switch_queue_push(sql_manager.sql_queue[0], NULL);
</span><span class="cx">         switch_queue_push(sql_manager.sql_queue[1], NULL);
</span><span class="cx">
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Waiting for unfinished SQL transactions\n");
</span><del>-        while (switch_queue_size(sql_manager.sql_queue[0]) > 0) {
-                switch_yield(10000);
-        }
-        while (switch_queue_size(sql_manager.sql_queue[1]) > 0) {
-                switch_yield(10000);
-        }
</del><ins>+        switch_thread_join(&st, sql_manager.thread);
</ins><span class="cx">
</span><span class="cx">         switch_core_db_close(sql_manager.db);
</span><span class="cx">         switch_core_db_close(sql_manager.event_db);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_state_machinec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_state_machine.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_state_machine.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_state_machine.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx">                 char *dp[25];
</span><span class="cx">                 int argc, x, count = 0;
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(caller_profile->dialplan)) {
</del><ins>+                if (!zstr(caller_profile->dialplan)) {
</ins><span class="cx">                         if ((dpstr = switch_core_session_strdup(session, caller_profile->dialplan))) {
</span><span class="cx">                                 expanded = switch_channel_expand_variables(session->channel, dpstr);
</span><span class="cx">                                 argc = switch_separate_string(expanded, ',', dp, (sizeof(dp) / sizeof(dp[0])));
</span><span class="lines">@@ -375,7 +375,21 @@
</span><span class="cx">                                         switch_channel_hangup(session->channel, SWITCH_CAUSE_INVALID_CALL_REFERENCE);
</span><span class="cx">                                 }
</span><span class="cx">                         } else {
</span><ins>+                                switch_core_session_message_t *message;
+                                        
+                                while (switch_core_session_dequeue_message(session, &message) == SWITCH_STATUS_SUCCESS) {
+                                        switch_core_session_receive_message(session, message);
+                                        message = NULL;
+                                }
+
+                                switch_channel_set_flag(session->channel, CF_THREAD_SLEEPING);
</ins><span class="cx">                                 switch_thread_cond_wait(session->cond, session->mutex);
</span><ins>+                                switch_channel_clear_flag(session->channel, CF_THREAD_SLEEPING);
+                                
+                                while (switch_core_session_dequeue_message(session, &message) == SWITCH_STATUS_SUCCESS) {
+                                        switch_core_session_receive_message(session, message);
+                                        message = NULL;
+                                }
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -468,7 +482,7 @@
</span><span class="cx">                 use_session = session;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(hook_var)) {
</del><ins>+        if (!zstr(hook_var)) {
</ins><span class="cx">                 switch_stream_handle_t stream = { 0 };
</span><span class="cx">                 char *cmd = switch_core_session_strdup(session, hook_var);
</span><span class="cx">                 char *arg = NULL;
</span><span class="lines">@@ -538,7 +552,7 @@
</span><span class="cx">         driver_state_handler = endpoint_interface->state_handler;
</span><span class="cx">         switch_assert(driver_state_handler != NULL);
</span><span class="cx">         
</span><del>-        if (!switch_strlen_zero(var)) {
</del><ins>+        if (!zstr(var)) {
</ins><span class="cx">                 if (!strcasecmp(var, "a_only")) {
</span><span class="cx">                         if (switch_channel_get_originator_caller_profile(session->channel)) {
</span><span class="cx">                                 do_extra_handlers = 0;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_core_timerc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_timer.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_timer.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_core_timer.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -61,9 +61,7 @@
</span><span class="cx">                 switch_set_flag(timer, SWITCH_TIMER_FLAG_FREE_POOL);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        timer->timer_interface->timer_init(timer);
-        return SWITCH_STATUS_SUCCESS;
-
</del><ins>+        return timer->timer_interface->timer_init(timer);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_core_timer_next(switch_timer_t *timer)
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_cppcpp"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_cpp.cpp (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_cpp.cpp        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_cpp.cpp        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx">         switch_name_event(event_name, &e_event_id);
</span><span class="cx">         switch_core_new_memory_pool(&pool);
</span><span class="cx">         
</span><del>-        if (!switch_strlen_zero(subclass_name)) {
</del><ins>+        if (!zstr(subclass_name)) {
</ins><span class="cx">                 e_subclass_name = switch_core_strdup(pool, subclass_name);
</span><span class="cx">         } else {
</span><span class="cx">                 e_subclass_name = NULL;
</span><span class="lines">@@ -124,7 +124,7 @@
</span><span class="cx">         menu = NULL;
</span><span class="cx">         switch_core_new_memory_pool(&pool);
</span><span class="cx">         switch_assert(pool);
</span><del>-        if (switch_strlen_zero(name)) {
</del><ins>+        if (zstr(name)) {
</ins><span class="cx">                 name = "no name";
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -227,7 +227,7 @@
</span><span class="cx">                 event_id = SWITCH_EVENT_MESSAGE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(subclass_name) && event_id != SWITCH_EVENT_CUSTOM) {
</del><ins>+        if (!zstr(subclass_name) && event_id != SWITCH_EVENT_CUSTOM) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_WARNING, "Changing event type to custom because you specified a subclass name!\n");
</span><span class="cx">                 event_id = SWITCH_EVENT_CUSTOM;
</span><span class="cx">         }
</span><span class="lines">@@ -981,8 +981,8 @@
</span><span class="cx">                                                          handlers,
</span><span class="cx">                                                          NULL,
</span><span class="cx">                                                          NULL,
</span><del>-                                                         &caller_profile,
</del><span class="cx">                                                          NULL,
</span><ins>+                                                         NULL,
</ins><span class="cx">                                                          SOF_NONE) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Error Creating Outgoing Channel! [%s]\n", dest);
</span><span class="cx">                 goto failed;
</span><span class="lines">@@ -1078,41 +1078,6 @@
</span><span class="cx">
</span><span class="cx"> }
</span><span class="cx">
</span><del>-SWITCH_DECLARE(void) CoreSession::setCallerData(char *var, char *val) {
-
-        this_check_void();
-        sanity_check_noreturn;
-
-        if (strcmp(var, "dialplan") == 0) {
-                caller_profile.dialplan = val;
-        }
-        if (strcmp(var, "context") == 0) {
-                caller_profile.context = val;
-        }
-        if (strcmp(var, "caller_id_name") == 0) {
-                caller_profile.caller_id_name = val;
-        }
-        if (strcmp(var, "caller_id_number") == 0) {
-                caller_profile.caller_id_number = val;
-        }
-        if (strcmp(var, "network_addr") == 0) {
-                caller_profile.network_addr = val;
-        }
-        if (strcmp(var, "ani") == 0) {
-                caller_profile.ani = val;
-        }
-        if (strcmp(var, "aniii") == 0) {
-                caller_profile.aniii = val;
-        }
-        if (strcmp(var, "rdnis") == 0) {
-                caller_profile.rdnis = val;
-        }
-        if (strcmp(var, "username") == 0) {
-                caller_profile.username = val;
-        }
-
-}
-
</del><span class="cx"> SWITCH_DECLARE(void) CoreSession::setHangupHook(void *hangup_func) {
</span><span class="cx">
</span><span class="cx">         this_check_void();
</span><span class="lines">@@ -1239,7 +1204,7 @@
</span><span class="cx">         this_check(SWITCH_STATUS_FALSE);
</span><span class="cx">         sanity_check(SWITCH_STATUS_FALSE);
</span><span class="cx">         
</span><del>- if (switch_strlen_zero(result)) {
</del><ins>+ if (zstr(result)) {
</ins><span class="cx">                 return SWITCH_STATUS_SUCCESS;        
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_eventc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_event.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_event.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_event.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -182,6 +182,7 @@
</span><span class="cx">         "NAT",
</span><span class="cx">         "RECORD_START",
</span><span class="cx">         "RECORD_STOP",
</span><ins>+        "CALL_UPDATE",
</ins><span class="cx">         "ALL"
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -1070,7 +1071,7 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(data)) {
</del><ins>+        if (!zstr(data)) {
</ins><span class="cx">                 body = data;
</span><span class="cx">         } else if (event->body) {
</span><span class="cx">                 body = event->body;
</span><span class="lines">@@ -1605,7 +1606,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">         for (x = 0; prof[x]; x++) {
</span><del>-                if (switch_strlen_zero(prof[x])) {
</del><ins>+                if (zstr(prof[x])) {
</ins><span class="cx">                         continue;
</span><span class="cx">                 }
</span><span class="cx">                 new_len = (strlen(prof[x]) * 3) + 1;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_ivrc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -220,10 +220,10 @@
</span><span class="cx">                         break;
</span><span class="cx">                 }
</span><span class="cx">                 
</span><del>-                if (switch_core_session_private_event_count(session)) {
-                        switch_ivr_parse_all_events(session);
-                }
</del><span class="cx">
</span><ins>+                switch_ivr_parse_all_events(session);
+
+
</ins><span class="cx">                 if (args && (args->input_callback || args->buf || args->buflen)) {
</span><span class="cx">                         switch_dtmf_t dtmf;
</span><span class="cx">                         
</span><span class="lines">@@ -463,7 +463,7 @@
</span><span class="cx">         char *event_lock = switch_event_get_header(event, "event-lock");
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_FALSE;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(cmd)) {
</del><ins>+        if (zstr(cmd)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid Command!\n");
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="lines">@@ -569,19 +569,19 @@
</span><span class="cx">                 char *transport = switch_event_get_header(event, "transport");
</span><span class="cx">                 char *flags = switch_event_get_header(event, "flags");
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(local_ip)) {
</del><ins>+                if (zstr(local_ip)) {
</ins><span class="cx">                         local_ip = "127.0.0.1";
</span><span class="cx">                 }
</span><del>-                if (switch_strlen_zero(remote_ip)) {
</del><ins>+                if (zstr(remote_ip)) {
</ins><span class="cx">                         remote_ip = "127.0.0.1";
</span><span class="cx">                 }
</span><del>-                if (switch_strlen_zero(local_port)) {
</del><ins>+                if (zstr(local_port)) {
</ins><span class="cx">                         local_port = "8025";
</span><span class="cx">                 }
</span><del>-                if (switch_strlen_zero(remote_port)) {
</del><ins>+                if (zstr(remote_port)) {
</ins><span class="cx">                         remote_port = "8026";
</span><span class="cx">                 }
</span><del>-                if (switch_strlen_zero(transport)) {
</del><ins>+                if (zstr(transport)) {
</ins><span class="cx">                         transport = "udp";
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -624,12 +624,33 @@
</span><span class="cx">
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_messages(switch_core_session_t *session)
+{
+        switch_core_session_message_t *message;
+        int i = 0;
+        
+        while (switch_core_session_dequeue_message(session, &message) == SWITCH_STATUS_SUCCESS) {
+                i++;
+                switch_core_session_receive_message(session, message);
+                message = NULL;
+        }
+
+        return i ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
+}
+
</ins><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_events(switch_core_session_t *session)
</span><span class="cx"> {
</span><ins>+        int x = 0;
</ins><span class="cx">
</span><del>-        while (switch_ivr_parse_next_event(session) == SWITCH_STATUS_SUCCESS);
-        switch_ivr_sleep(session, 0, SWITCH_TRUE, NULL);
</del><span class="cx">
</span><ins>+        switch_ivr_parse_all_messages(session);
+
+        while (switch_ivr_parse_next_event(session) == SWITCH_STATUS_SUCCESS) x++;
+
+        if (x) {
+                switch_ivr_sleep(session, 0, SWITCH_TRUE, NULL);
+        }
+
</ins><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -666,6 +687,7 @@
</span><span class="cx">                         expires = switch_epoch_time_now(NULL) + timeout;
</span><span class="cx">                 }
</span><span class="cx">                 switch_channel_set_variable(channel, "park_timeout", NULL);
</span><ins>+                switch_channel_set_variable(channel, SWITCH_PARK_AFTER_BRIDGE_VARIABLE, NULL);
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         switch_channel_set_flag(channel, CF_CONTROLLED);
</span><span class="lines">@@ -772,10 +794,9 @@
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if (switch_core_session_private_event_count(session)) {
-                                switch_ivr_parse_all_events(session);
-                        }
</del><ins>+                        switch_ivr_parse_all_events(session);
</ins><span class="cx">
</span><ins>+
</ins><span class="cx">                         if (switch_channel_has_dtmf(channel)) {
</span><span class="cx">                                 switch_dtmf_t dtmf = { 0 };
</span><span class="cx">                                 switch_channel_dequeue_dtmf(channel, &dtmf);
</span><span class="lines">@@ -858,10 +879,10 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_core_session_private_event_count(session)) {
-                        switch_ivr_parse_all_events(session);
-                }
</del><span class="cx">
</span><ins>+                switch_ivr_parse_all_events(session);
+
+
</ins><span class="cx">                 if (switch_channel_has_dtmf(channel)) {
</span><span class="cx">                         switch_channel_dequeue_dtmf(channel, &dtmf);
</span><span class="cx">                         status = args->input_callback(session, (void *) &dtmf, SWITCH_INPUT_TYPE_DTMF, args->buf, args->buflen);
</span><span class="lines">@@ -951,7 +972,7 @@
</span><span class="cx">                 *terminator = '\0';
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(terminators)) {
</del><ins>+        if (!zstr(terminators)) {
</ins><span class="cx">                 for (i = 0; i < x; i++) {
</span><span class="cx">                         if (strchr(terminators, buf[i]) && terminator != NULL) {
</span><span class="cx">                                 *terminator = buf[i];
</span><span class="lines">@@ -989,10 +1010,10 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_core_session_private_event_count(session)) {
-                        switch_ivr_parse_all_events(session);
-                }
</del><span class="cx">
</span><ins>+                switch_ivr_parse_all_events(session);
+
+
</ins><span class="cx">                 
</span><span class="cx">                 if (eff_timeout) {
</span><span class="cx">                         digit_elapsed = (uint32_t) ((switch_micro_time_now() - digit_started) / 1000);
</span><span class="lines">@@ -1017,7 +1038,7 @@
</span><span class="cx">                                         break;
</span><span class="cx">                                 }
</span><span class="cx">
</span><del>-                                if (!switch_strlen_zero(terminators) && strchr(terminators, dtmf.digit) && terminator != NULL) {
</del><ins>+                                if (!zstr(terminators) && strchr(terminators, dtmf.digit) && terminator != NULL) {
</ins><span class="cx">                                         *terminator = dtmf.digit;
</span><span class="cx">                                         return SWITCH_STATUS_SUCCESS;
</span><span class="cx">                                 }
</span><span class="lines">@@ -1150,7 +1171,7 @@
</span><span class="cx">         if ((session = switch_core_session_locate(uuid))) {
</span><span class="cx">                 channel = switch_core_session_get_channel(session);
</span><span class="cx">
</span><del>-                if ((flags & SMF_REBRIDGE) && !switch_channel_test_flag(channel, CF_ORIGINATOR)) {
</del><ins>+                if ((flags & SMF_REBRIDGE) && !switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) {
</ins><span class="cx">                         swap = 1;
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -1214,7 +1235,7 @@
</span><span class="cx">                 status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">                 channel = switch_core_session_get_channel(session);
</span><span class="cx">
</span><del>-                if ((flags & SMF_REBRIDGE) && !switch_channel_test_flag(channel, CF_ORIGINATOR)) {
</del><ins>+                if ((flags & SMF_REBRIDGE) && !switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) {
</ins><span class="cx">                         swap = 1;
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -1260,7 +1281,7 @@
</span><span class="cx">         const char *forwardvar = switch_channel_get_variable(channel, SWITCH_MAX_FORWARDS_VARIABLE);
</span><span class="cx">         int forwardval = 70;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(forwardvar)) {
</del><ins>+        if (!zstr(forwardvar)) {
</ins><span class="cx">                 forwardval = atoi(forwardvar) - 1;
</span><span class="cx">         }
</span><span class="cx">         if (forwardval <= 0) {
</span><span class="lines">@@ -1280,23 +1301,26 @@
</span><span class="cx">         if ((profile = switch_channel_get_caller_profile(channel))) {
</span><span class="cx">                 const char *var;
</span><span class="cx">                 
</span><del>-                if (switch_strlen_zero(dialplan)) {
</del><ins>+                if (zstr(dialplan)) {
</ins><span class="cx">                         dialplan = profile->dialplan;
</span><ins>+                        if (!zstr(dialplan) && !strcasecmp(dialplan, "inline")) {
+                                dialplan = NULL;
+                        }
</ins><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(context)) {
</del><ins>+                if (zstr(context)) {
</ins><span class="cx">                         context = profile->context;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(dialplan)) {
</del><ins>+                if (zstr(dialplan)) {
</ins><span class="cx">                         dialplan = "XML";
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(context)) {
</del><ins>+                if (zstr(context)) {
</ins><span class="cx">                         context = "default";
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(extension)) {
</del><ins>+                if (zstr(extension)) {
</ins><span class="cx">                         extension = "service";
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -1726,7 +1750,7 @@
</span><span class="cx">                 return off;
</span><span class="cx">
</span><span class="cx">         for (; hi; hi = hi->next) {
</span><del>-                if (!switch_strlen_zero(hi->name) && !switch_strlen_zero(hi->value) && ((variable = switch_xml_add_child_d(xml, hi->name, off++)))) {
</del><ins>+                if (!zstr(hi->name) && !zstr(hi->value) && ((variable = switch_xml_add_child_d(xml, hi->name, off++)))) {
</ins><span class="cx">                         char *data;
</span><span class="cx">                         switch_size_t dlen = strlen(hi->value) * 3;
</span><span class="cx">
</span><span class="lines">@@ -1791,11 +1815,11 @@
</span><span class="cx">                         goto error;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(caller_profile->dialplan)) {
</del><ins>+                if (!zstr(caller_profile->dialplan)) {
</ins><span class="cx">                         switch_xml_set_attr_d(x_callflow, "dialplan", caller_profile->dialplan);
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(caller_profile->profile_index)) {
</del><ins>+                if (!zstr(caller_profile->profile_index)) {
</ins><span class="cx">                         switch_xml_set_attr_d(x_callflow, "profile_index", caller_profile->profile_index);
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -2161,7 +2185,7 @@
</span><span class="cx">         char * prefix_buffer = NULL, *prefix;
</span><span class="cx">         size_t buffer_size =0;
</span><span class="cx">         size_t prefix_size=0;
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 goto error;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -2184,7 +2208,7 @@
</span><span class="cx">
</span><span class="cx">         status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(prefix)) {
</del><ins>+        if (!zstr(prefix)) {
</ins><span class="cx">                 prefix_size = strlen(prefix);
</span><span class="cx">                 buffer_size = 1024 + prefix_size + 1;
</span><span class="cx">                 prefix_buffer = switch_core_session_alloc(session, buffer_size);
</span><span class="lines">@@ -2243,6 +2267,20 @@
</span><span class="cx">         return status;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+SWITCH_DECLARE(switch_bool_t) switch_ivr_uuid_exists(const char *uuid)
+{
+        switch_bool_t exists = SWITCH_FALSE;
+        switch_core_session_t *psession = NULL;
+
+        if ((psession = switch_core_session_locate(uuid))) {
+                switch_core_session_rwunlock(psession);
+                exists = 1;
+        }
+
+        return exists;
+}
+
+
</ins><span class="cx"> /* For Emacs:
</span><span class="cx"> * Local Variables:
</span><span class="cx"> * mode:c
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_ivr_asyncc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_async.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_async.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_async.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -100,9 +100,7 @@
</span><span class="cx">                         break;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_core_session_private_event_count(session)) {
- switch_ivr_parse_all_events(session);
- }
</del><ins>+                switch_ivr_parse_all_events(session);
</ins><span class="cx">
</span><span class="cx">                 if (args && (args->input_callback || args->buf || args->buflen)) {
</span><span class="cx">                         switch_dtmf_t dtmf;
</span><span class="lines">@@ -427,6 +425,7 @@
</span><span class="cx">         char *file;
</span><span class="cx">         switch_file_handle_t *fh;
</span><span class="cx">         uint32_t packet_len;
</span><ins>+        int min_sec;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, switch_abc_type_t type)
</span><span class="lines">@@ -461,23 +460,21 @@
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                         if (rh->fh) {
</span><del>-                                if (switch_channel_test_flag(channel, CF_ANSWERED) || !switch_core_media_bug_test_flag(bug, SMBF_RECORD_ANSWER_REQ)) {
-                                        switch_size_t len;
-                                        uint8_t data[SWITCH_RECOMMENDED_BUFFER_SIZE];
-                                        switch_frame_t frame = { 0 };
</del><ins>+                                switch_size_t len;
+                                uint8_t data[SWITCH_RECOMMENDED_BUFFER_SIZE];
+                                switch_frame_t frame = { 0 };
</ins><span class="cx">                                         
</span><ins>+                                frame.data = data;
+                                frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE;
</ins><span class="cx">                                         
</span><del>-                                        frame.data = data;
-                                        frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE;
-                                        
-                                        while (switch_core_media_bug_read(bug, &frame, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS && !switch_test_flag((&frame), SFF_CNG)) {
-                                                len = (switch_size_t) frame.datalen / 2;
-                                                if (len) switch_core_file_write(rh->fh, data, &len);
-                                        }
</del><ins>+                                while (switch_core_media_bug_read(bug, &frame, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS && !switch_test_flag((&frame), SFF_CNG)) {
+                                        len = (switch_size_t) frame.datalen / 2;
+                                        if (len) switch_core_file_write(rh->fh, data, &len);
</ins><span class="cx">                                 }
</span><ins>+                                
</ins><span class="cx">
</span><span class="cx">                                 switch_core_file_close(rh->fh);
</span><del>-                                if (rh->fh->samples_out < read_impl.samples_per_second * 3) {
</del><ins>+                                if (rh->fh->samples_out < read_impl.samples_per_second * rh->min_sec) {
</ins><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Discarding short file %s\n", rh->file);
</span><span class="cx">                                         switch_file_remove(rh->file, switch_core_session_get_pool(session));
</span><span class="cx">                                 }
</span><span class="lines">@@ -495,12 +492,11 @@
</span><span class="cx">                         frame.data = data;
</span><span class="cx">                         frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE;
</span><span class="cx">                         
</span><del>-                        if (switch_channel_test_flag(channel, CF_ANSWERED) || !switch_core_media_bug_test_flag(bug, SMBF_RECORD_ANSWER_REQ)) {
-                                while (switch_core_media_bug_read(bug, &frame, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS && !switch_test_flag((&frame), SFF_CNG)) {
-                                        len = (switch_size_t) frame.datalen / 2;
-                                        if (len) switch_core_file_write(rh->fh, data, &len);
-                                }
</del><ins>+                        while (switch_core_media_bug_read(bug, &frame, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS && !switch_test_flag((&frame), SFF_CNG)) {
+                                len = (switch_size_t) frame.datalen / 2;
+                                if (len) switch_core_file_write(rh->fh, data, &len);
</ins><span class="cx">                         }
</span><ins>+
</ins><span class="cx">                 }
</span><span class="cx">                 break;
</span><span class="cx">         case SWITCH_ABC_TYPE_WRITE:
</span><span class="lines">@@ -655,7 +651,7 @@
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(require_group)) {
</del><ins>+                if (!zstr(require_group)) {
</ins><span class="cx">                         int argc, i;
</span><span class="cx">                         int ok = 0;
</span><span class="cx">                         char *argv[10] = { 0 };
</span><span class="lines">@@ -753,7 +749,7 @@
</span><span class="cx">                         if (switch_core_session_dequeue_event(session, &event, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                 char *command = switch_event_get_header(event, "eavesdrop-command");
</span><span class="cx">                                 if (command) {
</span><del>-                                        fcommand = command;
</del><ins>+                                        fcommand = switch_core_session_strdup(session, command);
</ins><span class="cx">                                 }
</span><span class="cx">                                 switch_event_destroy(&event);
</span><span class="cx">                         }
</span><span class="lines">@@ -907,13 +903,23 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        if ((p = switch_channel_get_variable(channel, "RECORD_WRITE_ONLY")) && switch_true(p)) {
+                flags &= ~SMBF_READ_STREAM;
+                flags |= SMBF_WRITE_STREAM;
+        }
+
+        if ((p = switch_channel_get_variable(channel, "RECORD_READ_ONLY")) && switch_true(p)) {
+                flags &= ~SMBF_WRITE_STREAM;
+                flags |= SMBF_READ_STREAM;
+        }
+
</ins><span class="cx">         if ((p = switch_channel_get_variable(channel, "RECORD_STEREO")) && switch_true(p)) {
</span><span class="cx">                 flags |= SMBF_STEREO;
</span><span class="cx">                 channels = 2;
</span><span class="cx">         }
</span><span class="cx">                 
</span><span class="cx">         if ((p = switch_channel_get_variable(channel, "RECORD_ANSWER_REQ")) && switch_true(p)) {
</span><del>-                flags |= SMBF_RECORD_ANSWER_REQ;
</del><ins>+                flags |= SMBF_ANSWER_REQ;
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">
</span><span class="lines">@@ -958,7 +964,7 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">                 
</span><del>-                file = switch_core_session_sprintf(session, "%s%s%s%s", switch_str_nil(tfile), tfile ? "]" : "", prefix, SWITCH_PATH_SEPARATOR, file);
</del><ins>+                file = switch_core_session_sprintf(session, "%s%s%s%s%s", switch_str_nil(tfile), tfile ? "]" : "", prefix, SWITCH_PATH_SEPARATOR, file);
</ins><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         if (switch_core_file_open(fh,
</span><span class="lines">@@ -1016,7 +1022,17 @@
</span><span class="cx">         rh->fh = fh;
</span><span class="cx">         rh->file = switch_core_session_strdup(session, file);
</span><span class="cx">         rh->packet_len = read_impl.decoded_bytes_per_packet;
</span><ins>+
+        rh->min_sec = 3;
</ins><span class="cx">         
</span><ins>+        if ((p = switch_channel_get_variable(channel, "RECORD_MIN_SEC"))) {
+                int tmp = atoi(p);
+                if (tmp >= 0) {
+                        rh->min_sec = tmp;
+                }
+        }
+
+        
</ins><span class="cx">         if ((status = switch_core_media_bug_add(session, record_callback, rh, to, flags, &bug)) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error adding media bug for file %s\n", file);
</span><span class="cx">                 switch_core_file_close(fh);
</span><span class="lines">@@ -1168,7 +1184,7 @@
</span><span class="cx">                 int tr;
</span><span class="cx">                 int err = 1;
</span><span class="cx">                 SpeexPreprocessState *st = NULL;
</span><del>-                SpeexEchoState *ec;
</del><ins>+                SpeexEchoState *ec = NULL;
</ins><span class="cx">                 switch_mutex_t *mutex = NULL;
</span><span class="cx">                 int r = 0;
</span><span class="cx">
</span><span class="lines">@@ -1776,7 +1792,7 @@
</span><span class="cx"> switch_core_session_get_read_impl(session, &read_impl);
</span><span class="cx">
</span><span class="cx">         
</span><del>-        if (switch_strlen_zero(key)) {
</del><ins>+        if (zstr(key)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No Key Specified!\n");
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="lines">@@ -1788,7 +1804,7 @@
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 for (i = 0; i < cont->index; i++) {
</span><del>-                        if (!switch_strlen_zero(cont->list[i].key) && !strcasecmp(key, cont->list[i].key)) {
</del><ins>+                        if (!zstr(cont->list[i].key) && !strcasecmp(key, cont->list[i].key)) {
</ins><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Re-enabling %s\n", key);
</span><span class="cx">                                 cont->list[i].up = 1;
</span><span class="cx">                                 cont->list[i].hits = 0;
</span><span class="lines">@@ -1799,7 +1815,7 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(tone_spec)) {
</del><ins>+        if (zstr(tone_spec)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "No Spec Specified!\n");
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="lines">@@ -1878,7 +1894,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(flags)) {
</del><ins>+        if (zstr(flags)) {
</ins><span class="cx">                 bflags = SMBF_READ_REPLACE;
</span><span class="cx">         } else {
</span><span class="cx">                 if (strchr(flags, 'o')) {
</span><span class="lines">@@ -1938,7 +1954,13 @@
</span><span class="cx"> {
</span><span class="cx">         bch_t *bch = (bch_t *) obj;
</span><span class="cx">
</span><ins>+        if (!bch->session) {
+                return NULL;
+        }
+
+        switch_core_session_read_lock(bch->session);
</ins><span class="cx">         switch_ivr_broadcast(switch_core_session_get_uuid(bch->session), bch->app, bch->flags);
</span><ins>+        switch_core_session_rwunlock(bch->session);
</ins><span class="cx">
</span><span class="cx">         return NULL;
</span><span class="cx">
</span><span class="lines">@@ -2031,8 +2053,6 @@
</span><span class="cx">                                         } else {
</span><span class="cx">                                                 flags |= SMF_ECHO_ALEG;
</span><span class="cx">                                         }
</span><del>-                                } else if ((md->sr[direction].map[dval].bind_flags & SBF_EXEC_INLINE)) {
-                                        flags |= SMF_EXEC_INLINE;
</del><span class="cx">                                 } else if ((md->sr[direction].map[dval].bind_flags & SBF_EXEC_ALEG)) {
</span><span class="cx">                                         flags |= SMF_ECHO_ALEG;
</span><span class="cx">                                 } else if ((md->sr[direction].map[dval].bind_flags & SBF_EXEC_BLEG)) {
</span><span class="lines">@@ -2041,6 +2061,10 @@
</span><span class="cx">                                         flags |= SMF_ECHO_ALEG;
</span><span class="cx">                                 }
</span><span class="cx">
</span><ins>+                                if ((md->sr[direction].map[dval].bind_flags & SBF_EXEC_INLINE)) {
+                                        flags |= SMF_EXEC_INLINE;
+                                }
+                                
</ins><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Processing meta digit '%c' [%s]\n",
</span><span class="cx">                                                                  switch_channel_get_name(channel), dtmf->digit, md->sr[direction].map[dval].app);
</span><span class="cx">
</span><span class="lines">@@ -2111,7 +2135,7 @@
</span><span class="cx">                 switch_core_event_hook_add_recv_dtmf(session, meta_on_dtmf);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(app)) {
</del><ins>+        if (!zstr(app)) {
</ins><span class="cx">                 if ((bind_flags & SBF_DIAL_ALEG)) {
</span><span class="cx">                         md->sr[SWITCH_DTMF_RECV].up = 1;
</span><span class="cx">                         md->sr[SWITCH_DTMF_RECV].map[key].app = switch_core_session_strdup(session, app);
</span><span class="lines">@@ -2673,22 +2697,24 @@
</span><span class="cx">
</span><span class="cx">         if ((flags & SMF_ECHO_BLEG) && (other_uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))
</span><span class="cx">                 && (other_session = switch_core_session_locate(other_uuid))) {
</span><del>-                if (switch_event_create(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
-                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
-                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-name", app);
-                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-arg", path);
-                        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "lead-frames", "%d", 5);
-                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event-lock", "true");
-                        if ((flags & SMF_LOOP)) {
-                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "loops", "%d", -1);
-                        }
-                        if ((flags & SMF_HOLD_BLEG)) {
-                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hold-bleg", "true");
-                        }
</del><ins>+                if ((flags & SMF_EXEC_INLINE)) {
+                        switch_core_session_execute_application(other_session, app, path);
+                        nomedia = 0;
+                } else {
+                        if (switch_event_create(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
+                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
+                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-name", app);
+                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-arg", path);
+                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "lead-frames", "%d", 5);
+                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event-lock", "true");
+                                if ((flags & SMF_LOOP)) {
+                                        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "loops", "%d", -1);
+                                }
</ins><span class="cx">
</span><del>-                        if ((flags & SMF_EXEC_INLINE)) {
-                                switch_core_session_execute_application(other_session, app, path);
-                        } else {
</del><ins>+                                if ((flags & SMF_HOLD_BLEG)) {
+                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hold-bleg", "true");
+                                }
+                                
</ins><span class="cx">                                 switch_core_session_queue_private_event(other_session, &event);
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="lines">@@ -2702,21 +2728,26 @@
</span><span class="cx">                 nomedia = 0;
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+
</ins><span class="cx">         if ((flags & SMF_ECHO_ALEG)) {
</span><del>-                if (switch_event_create(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
-                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
-                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-name", app);
-                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-arg", path);
-                        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "lead-frames", "%d", 5);
-                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event-lock", "true");
-                        if ((flags & SMF_LOOP)) {
-                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "loops", "%d", -1);
</del><ins>+                if ((flags & SMF_EXEC_INLINE)) {
+                        switch_core_session_execute_application(session, app, path);
+                        nomedia = 0;
+                } else {
+                        if (switch_event_create(&event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {
+                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
+                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-name", app);
+                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "execute-app-arg", path);
+                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "lead-frames", "%d", 5);
+                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "event-lock", "true");
+                                if ((flags & SMF_LOOP)) {
+                                        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "loops", "%d", -1);
+                                }
+                                if ((flags & SMF_HOLD_BLEG)) {
+                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hold-bleg", "true");
+                                }
+                                switch_core_session_queue_private_event(session, &event);
</ins><span class="cx">                         }
</span><del>-                        if ((flags & SMF_HOLD_BLEG)) {
-                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hold-bleg", "true");
-                        }
-
-                        switch_core_session_queue_private_event(session, &event);
</del><span class="cx">                 }
</span><span class="cx">                 master = session;
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_ivr_bridgec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_bridge.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_bridge.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_bridge.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #include <switch.h>
</span><del>-#define DEFAULT_LEAD_FRAMES 50
</del><ins>+#define DEFAULT_LEAD_FRAMES 5
</ins><span class="cx">
</span><span class="cx"> static const switch_state_handler_table_t audio_bridge_peer_state_handlers;
</span><span class="cx">
</span><span class="lines">@@ -78,6 +78,65 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+
+static void send_display(switch_core_session_t *session, switch_core_session_t *peer_session) {
+
+        switch_core_session_message_t *msg;
+        switch_caller_profile_t *caller_profile;
+        switch_channel_t *caller_channel;
+        const char *name, *number, *p;
+
+        caller_channel = switch_core_session_get_channel(session);
+        caller_profile = switch_channel_get_caller_profile(caller_channel);
+
+        if (switch_channel_direction(caller_channel) == SWITCH_CALL_DIRECTION_OUTBOUND) {
+                name = caller_profile->callee_id_name;
+                number = caller_profile->callee_id_number;
+                
+                if (zstr(name)) {
+                        name = caller_profile->destination_number;
+                }
+                if (zstr(number)) {
+                        number = caller_profile->destination_number;
+                }
+        } else {
+                name = caller_profile->caller_id_name;
+                number = caller_profile->caller_id_number;
+                
+                if (zstr(name)) {
+                        name = caller_profile->destination_number;
+                }
+                if (zstr(number)) {
+                        number = caller_profile->destination_number;
+                }
+        }
+
+        if ((p = strrchr(number, '/'))) {
+                number = p+1;
+        }
+        if ((p = strrchr(name, '/'))) {
+                name = p+1;
+        }
+
+        msg = switch_core_session_alloc(peer_session, sizeof(*msg));
+        MESSAGE_STAMP_FFL(msg);
+        msg->message_id = SWITCH_MESSAGE_INDICATE_DISPLAY;
+        msg->string_array_arg[0] = switch_core_session_strdup(peer_session, name);
+        msg->string_array_arg[1] = switch_core_session_strdup(peer_session, number);
+        msg->from = __FILE__;
+        switch_core_session_queue_message(peer_session, msg);
+
+}
+
+
+SWITCH_DECLARE(void) switch_ivr_bridge_display(switch_core_session_t *session, switch_core_session_t *peer_session)
+{
+
+        send_display(session, peer_session);
+        send_display(peer_session, session);
+
+}
+
</ins><span class="cx"> struct switch_ivr_bridge_data {
</span><span class="cx">         switch_core_session_t *session;
</span><span class="cx">         char b_uuid[SWITCH_UUID_FORMATTED_LENGTH + 1];
</span><span class="lines">@@ -94,7 +153,7 @@
</span><span class="cx">         switch_ivr_bridge_data_t *data = obj;
</span><span class="cx">         int stream_id = 0, pre_b = 0, ans_a = 0, ans_b = 0, originator = 0;
</span><span class="cx">         switch_input_callback_function_t input_callback;
</span><del>-        switch_core_session_message_t *message, msg = { 0 };
</del><ins>+        switch_core_session_message_t msg = { 0 };
</ins><span class="cx">         void *user_data;
</span><span class="cx">         switch_channel_t *chan_a, *chan_b;
</span><span class="cx">         switch_frame_t *read_frame;
</span><span class="lines">@@ -108,6 +167,11 @@
</span><span class="cx">         int16_t silence_data[SWITCH_RECOMMENDED_BUFFER_SIZE/2] = { 0 };
</span><span class="cx">         const char *silence_var, *var;
</span><span class="cx">         int silence_val = 0, bypass_media_after_bridge = 0;
</span><ins>+        const char *bridge_answer_timeout = NULL;
+        int answer_timeout, sent_update = 0;
+        time_t answer_limit = 0;
+        
+
</ins><span class="cx"> #ifdef SWITCH_VIDEO_IN_THREADS
</span><span class="cx">         struct vid_helper vh = { 0 };
</span><span class="cx">         uint32_t vid_launch = 0;
</span><span class="lines">@@ -127,14 +191,23 @@
</span><span class="cx">         chan_b = switch_core_session_get_channel(session_b);
</span><span class="cx">
</span><span class="cx">         ans_a = switch_channel_test_flag(chan_a, CF_ANSWERED);
</span><del>-        if ((originator = switch_channel_test_flag(chan_a, CF_ORIGINATOR))) {
</del><ins>+
+        if ((originator = switch_channel_test_flag(chan_a, CF_BRIDGE_ORIGINATOR))) {
</ins><span class="cx">                 pre_b = switch_channel_test_flag(chan_a, CF_EARLY_MEDIA);
</span><span class="cx">                 ans_b = switch_channel_test_flag(chan_b, CF_ANSWERED);
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         inner_bridge = switch_channel_test_flag(chan_a, CF_INNER_BRIDGE);
</span><ins>+        
+        if (!switch_channel_test_flag(chan_a, CF_ANSWERED) && (bridge_answer_timeout = switch_channel_get_variable(chan_a, "bridge_answer_timeout"))) {
+                if ((answer_timeout = atoi(bridge_answer_timeout)) < 0) {
+                        answer_timeout = 0;
+                } else {
+                        answer_limit = switch_epoch_time_now(NULL) + answer_timeout;
+                }
+        }
+        
</ins><span class="cx">
</span><del>-
</del><span class="cx">         switch_channel_set_flag(chan_a, CF_BRIDGED);
</span><span class="cx">
</span><span class="cx">         switch_channel_wait_for_flag(chan_b, CF_BRIDGED, SWITCH_TRUE, 10000, chan_a);
</span><span class="lines">@@ -148,14 +221,18 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         if ((var = switch_channel_get_variable(chan_a, SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE)) && switch_true(var)) {
</span><ins>+                if (switch_stristr("loopback", switch_channel_get_name(chan_a)) || switch_stristr("loopback", switch_channel_get_name(chan_b))) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot bypass media while bridged to a loopback address.\n");
+                } else {
+                        switch_channel_set_variable(chan_a, SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE, NULL);
+                }
</ins><span class="cx">                 bypass_media_after_bridge = 1;
</span><del>-                switch_channel_set_variable(chan_a, SWITCH_BYPASS_MEDIA_AFTER_BRIDGE_VARIABLE, NULL);
</del><span class="cx">         }
</span><span class="cx">
</span><del>-        if ((silence_var = switch_channel_get_variable(chan_a, "bridge_generate_comfort_noise"))) {
</del><ins>+        if ((silence_var = switch_channel_get_variable(chan_a, "bridge_generate_comfort_noise"))) {                
</ins><span class="cx">                 switch_codec_implementation_t read_impl = {0};
</span><span class="cx">                 switch_core_session_get_read_impl(session_a, &read_impl);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 if (!switch_channel_media_ready(chan_a)) {
</span><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Channel has no media!\n");
</span><span class="cx">                         goto end_of_bridge_loop;
</span><span class="lines">@@ -220,7 +297,7 @@
</span><span class="cx">                         goto end_of_bridge_loop;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (loop_count > DEFAULT_LEAD_FRAMES && switch_core_session_private_event_count(session_a)) {
</del><ins>+                if (loop_count > DEFAULT_LEAD_FRAMES && switch_channel_media_ack(chan_a) && switch_core_session_private_event_count(session_a)) {
</ins><span class="cx">                         switch_channel_set_flag(chan_b, CF_SUSPEND);
</span><span class="cx">                         msg.string_arg = data->b_uuid;
</span><span class="cx">                         msg.message_id = SWITCH_MESSAGE_INDICATE_UNBRIDGE;
</span><span class="lines">@@ -233,6 +310,8 @@
</span><span class="cx">                         switch_core_session_kill_channel(session_b, SWITCH_SIG_BREAK);
</span><span class="cx">                 }
</span><span class="cx">
</span><ins>+                switch_ivr_parse_all_messages(session_a);
+
</ins><span class="cx">                 if (!inner_bridge && (switch_channel_test_flag(chan_a, CF_SUSPEND) || switch_channel_test_flag(chan_b, CF_SUSPEND))) {
</span><span class="cx">                         status = switch_core_session_read_frame(session_a, &read_frame, SWITCH_IO_FLAG_NONE, stream_id);
</span><span class="cx">
</span><span class="lines">@@ -250,7 +329,8 @@
</span><span class="cx">                 }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-                if (loop_count > DEFAULT_LEAD_FRAMES && bypass_media_after_bridge && switch_channel_test_flag(chan_a, CF_ANSWERED) &&
</del><ins>+                if (loop_count > DEFAULT_LEAD_FRAMES && switch_channel_media_ack(chan_a) &&
+                        bypass_media_after_bridge && switch_channel_test_flag(chan_a, CF_ANSWERED) &&
</ins><span class="cx">                         switch_channel_test_flag(chan_b, CF_ANSWERED)) {
</span><span class="cx">                         switch_ivr_nomedia(switch_core_session_get_uuid(session_a), SMF_REBRIDGE);
</span><span class="cx">                         bypass_media_after_bridge = 0;
</span><span class="lines">@@ -291,18 +371,15 @@
</span><span class="cx">
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_core_session_dequeue_message(session_b, &message) == SWITCH_STATUS_SUCCESS) {
-                        switch_core_session_receive_message(session_a, message);
-                        if (switch_test_flag(message, SCSMF_DYNAMIC)) {
-                                switch_safe_free(message);
-                        } else {
-                                message = NULL;
-                        }
</del><ins>+                if (!ans_a && answer_limit && switch_epoch_time_now(NULL) > answer_limit) {
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Answer timeout hit on %s.\n", switch_channel_get_name(chan_a));
+                        switch_channel_hangup(chan_a, SWITCH_CAUSE_ALLOTTED_TIMEOUT);
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 if (!ans_a && originator) {
</span><span class="cx">
</span><span class="cx">                         if (!ans_b && switch_channel_test_flag(chan_b, CF_ANSWERED)) {
</span><ins>+                                switch_channel_pass_callee_id(chan_b, chan_a);
</ins><span class="cx">                                 if (switch_channel_answer(chan_a) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Media Establishment Failed.\n", switch_channel_get_name(chan_a));
</span><span class="cx">                                         goto end_of_bridge_loop;
</span><span class="lines">@@ -325,15 +402,20 @@
</span><span class="cx">                         switch_channel_t *un = ans_a ? chan_b : chan_a;
</span><span class="cx">                         
</span><span class="cx">                         if (!switch_channel_test_flag(un, CF_OUTBOUND)) {
</span><ins>+                                switch_channel_pass_callee_id(un == chan_b ? chan_a : chan_b, un);
</ins><span class="cx">                                 if (switch_channel_answer(un) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Media Establishment Failed.\n", switch_channel_get_name(un));
</span><span class="cx">                                         goto end_of_bridge_loop;
</span><span class="cx">                                 }
</span><del>-                                
-                                if (ans_a) ans_b = 1; else ans_a = 1;
</del><span class="cx">                         }
</span><ins>+
+                        if (ans_a) ans_b = 1; else ans_a = 1;
</ins><span class="cx">                 }
</span><span class="cx">                 
</span><ins>+                if (originator && !sent_update && ans_a && ans_b && switch_channel_media_ack(chan_a) && switch_channel_media_ack(chan_b)) {
+                        switch_ivr_bridge_display(session_a, session_b);
+                        sent_update = 1;
+                }
</ins><span class="cx">
</span><span class="cx"> #ifndef SWITCH_VIDEO_IN_THREADS
</span><span class="cx">                 if (switch_channel_test_flag(chan_a, CF_VIDEO) && switch_channel_test_flag(chan_b, CF_VIDEO)) {
</span><span class="lines">@@ -400,7 +482,7 @@
</span><span class="cx">                 hook_var = switch_channel_get_variable(chan_a, SWITCH_API_BRIDGE_END_VARIABLE);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(hook_var)) {
</del><ins>+        if (!zstr(hook_var)) {
</ins><span class="cx">                 switch_stream_handle_t stream = { 0 };
</span><span class="cx">                 char *cmd = switch_core_session_strdup(session_a, hook_var);
</span><span class="cx">                 char *arg = NULL;
</span><span class="lines">@@ -461,8 +543,10 @@
</span><span class="cx">         int argc;
</span><span class="cx">         char *argv[4] = { 0 };
</span><span class="cx">         char *mydata;
</span><del>-        
-        if (!switch_strlen_zero(where) && (mydata = switch_core_session_strdup(session, where))) {
</del><ins>+
+        switch_channel_set_variable(switch_core_session_get_channel(session), SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE, NULL);
+
+        if (!zstr(where) && (mydata = switch_core_session_strdup(session, where))) {
</ins><span class="cx">                 if ((argc = switch_separate_string(mydata, ':', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) {
</span><span class="cx">                         switch_ivr_session_transfer(session, argv[0], argv[1], argv[2]);
</span><span class="cx">                 } else {
</span><span class="lines">@@ -498,7 +582,8 @@
</span><span class="cx">         } else if (state < CS_HANGUP && (var = switch_channel_get_variable(channel, SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE))) {
</span><span class="cx">                 transfer_after_bridge(session, var);
</span><span class="cx">         } else {
</span><del>-                if (!switch_channel_test_flag(channel, CF_TRANSFER) && !switch_channel_test_flag(channel, CF_REDIRECT) && bd && !bd->clean_exit
</del><ins>+                if (!switch_channel_test_flag(channel, CF_TRANSFER) && !switch_channel_test_flag(channel, CF_REDIRECT) &&
+                        !switch_channel_test_flag(channel, CF_XFER_ZOMBIE) && bd && !bd->clean_exit
</ins><span class="cx">                         && state != CS_PARK && state != CS_ROUTING && !switch_channel_test_flag(channel, CF_INNER_BRIDGE)) {
</span><span class="cx">                         switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
</span><span class="cx">                 }
</span><span class="lines">@@ -566,7 +651,7 @@
</span><span class="cx">
</span><span class="cx">         switch_channel_clear_flag(channel, CF_ORIGINATING);
</span><span class="cx">
</span><del>-        if (switch_channel_test_flag(channel, CF_ORIGINATOR)) {
</del><ins>+        if (switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) {
</ins><span class="cx">                 switch_channel_set_state(channel, CS_SOFT_EXECUTE);
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -588,11 +673,11 @@
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CUSTOM SOFT_EXECUTE\n", switch_channel_get_name(channel));
</span><span class="cx">         switch_channel_clear_state_handler(channel, &uuid_bridge_state_handlers);
</span><span class="cx">
</span><del>-        if (!switch_channel_test_flag(channel, CF_ORIGINATOR)) {
</del><ins>+        if (!switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) {
</ins><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        switch_channel_clear_flag(channel, CF_ORIGINATOR);
</del><ins>+        switch_channel_clear_flag(channel, CF_BRIDGE_ORIGINATOR);
</ins><span class="cx">         
</span><span class="cx">         if ((other_uuid = switch_channel_get_variable(channel, SWITCH_UUID_BRIDGE)) && (other_session = switch_core_session_locate(other_uuid))) {
</span><span class="cx">                 switch_channel_t *other_channel = switch_core_session_get_channel(other_session);
</span><span class="lines">@@ -700,22 +785,35 @@
</span><span class="cx">         if (uuid && (other_session = switch_core_session_locate(uuid))) {
</span><span class="cx"> switch_channel_t *other_channel = switch_core_session_get_channel(other_session);
</span><span class="cx"> const char *sbv = switch_channel_get_variable(other_channel, SWITCH_SIGNAL_BRIDGE_VARIABLE);
</span><ins>+                const char *var;
</ins><span class="cx">
</span><del>- if (!switch_strlen_zero(sbv) && !strcmp(sbv, switch_core_session_get_uuid(session))) {
</del><ins>+ if (!zstr(sbv) && !strcmp(sbv, switch_core_session_get_uuid(session))) {
</ins><span class="cx">
</span><span class="cx"> switch_channel_set_variable(other_channel, SWITCH_SIGNAL_BRIDGE_VARIABLE, NULL);
</span><span class="cx"> switch_channel_set_variable(other_channel, SWITCH_BRIDGE_VARIABLE, NULL);
</span><span class="cx">                         
</span><span class="cx"> if (switch_channel_up(other_channel)) {
</span><del>- switch_channel_hangup(other_channel, switch_channel_get_cause(channel));
</del><ins>+                                
+                                if (switch_true(switch_channel_get_variable(other_channel, SWITCH_PARK_AFTER_BRIDGE_VARIABLE))) {
+                                        switch_ivr_park_session(other_session);
+                                } else if ((var = switch_channel_get_variable(other_channel, SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE))) {
+                                        transfer_after_bridge(other_session, var);
+                                }
+
+                                if (switch_channel_test_flag(other_channel, CF_BRIDGE_ORIGINATOR) &&
+                                        switch_true(switch_channel_get_variable(other_channel, SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE))) {
+                                        switch_channel_hangup(other_channel, switch_channel_get_cause(channel));        
+                                } else {
+                                        switch_channel_set_state(other_channel, CS_EXECUTE);
+                                }
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">                 
</span><span class="cx"> switch_core_session_rwunlock(other_session);
</span><span class="cx"> }
</span><span class="cx">         
</span><del>-        if (switch_channel_test_flag(channel, CF_ORIGINATOR)) {
-                switch_channel_clear_flag(channel, CF_ORIGINATOR);
</del><ins>+        if (switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) {
+                switch_channel_clear_flag(channel, CF_BRIDGE_ORIGINATOR);
</ins><span class="cx">                 if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_UNBRIDGE) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                         switch_channel_event_set_data(channel, event);
</span><span class="cx">                         switch_event_fire(&event);
</span><span class="lines">@@ -755,7 +853,7 @@
</span><span class="cx">         switch_channel_set_variable(caller_channel, SWITCH_SIGNAL_BRIDGE_VARIABLE, switch_core_session_get_uuid(peer_session));
</span><span class="cx">         switch_channel_set_variable(peer_channel, SWITCH_SIGNAL_BRIDGE_VARIABLE, switch_core_session_get_uuid(session));
</span><span class="cx">
</span><del>-        switch_channel_set_flag(caller_channel, CF_ORIGINATOR);
</del><ins>+        switch_channel_set_flag(caller_channel, CF_BRIDGE_ORIGINATOR);
</ins><span class="cx">
</span><span class="cx">         switch_channel_clear_state_handler(caller_channel, NULL);
</span><span class="cx">         switch_channel_clear_state_handler(peer_channel, NULL);
</span><span class="lines">@@ -794,6 +892,8 @@
</span><span class="cx">                 switch_channel_set_flag(peer_channel, CF_TRANSFER);
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+        switch_ivr_bridge_display(session, peer_session);
+
</ins><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -815,7 +915,12 @@
</span><span class="cx">         const char *var;
</span><span class="cx">         switch_call_cause_t cause;
</span><span class="cx">
</span><del>-        switch_channel_set_flag(caller_channel, CF_ORIGINATOR);
</del><ins>+        if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE)) {
+                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Call has no media... Redirecting to signal bridge.\n");
+                return switch_ivr_signal_bridge(session, peer_session);
+        }
+        
+        switch_channel_set_flag(caller_channel, CF_BRIDGE_ORIGINATOR);
</ins><span class="cx">
</span><span class="cx">         b_leg->session = peer_session;
</span><span class="cx">         switch_copy_string(b_leg->b_uuid, switch_core_session_get_uuid(session), sizeof(b_leg->b_uuid));
</span><span class="lines">@@ -834,6 +939,7 @@
</span><span class="cx">         switch_channel_add_state_handler(peer_channel, &audio_bridge_peer_state_handlers);
</span><span class="cx">
</span><span class="cx">         if (switch_channel_test_flag(peer_channel, CF_ANSWERED) && !switch_channel_test_flag(caller_channel, CF_ANSWERED)) {
</span><ins>+                switch_channel_pass_callee_id(peer_channel, caller_channel);
</ins><span class="cx">                 switch_channel_answer(caller_channel);
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -940,7 +1046,7 @@
</span><span class="cx">                         switch_channel_set_state(peer_channel, CS_EXCHANGE_MEDIA);
</span><span class="cx">                         audio_bridge_thread(NULL, (void *) a_leg);
</span><span class="cx">                         
</span><del>-                        switch_channel_clear_flag(caller_channel, CF_ORIGINATOR);
</del><ins>+                        switch_channel_clear_flag(caller_channel, CF_BRIDGE_ORIGINATOR);
</ins><span class="cx">
</span><span class="cx">                         while (switch_channel_get_state(peer_channel) == CS_EXCHANGE_MEDIA) {
</span><span class="cx">                                 switch_cond_next();
</span><span class="lines">@@ -1004,8 +1110,8 @@
</span><span class="cx">
</span><span class="cx">         state = switch_channel_get_state(caller_channel);
</span><span class="cx">         
</span><del>-        if (!switch_channel_test_flag(caller_channel, CF_TRANSFER) && !switch_channel_test_flag(caller_channel, CF_REDIRECT)
-                && !a_leg->clean_exit && !inner_bridge) {
</del><ins>+        if (!switch_channel_test_flag(caller_channel, CF_TRANSFER) && !switch_channel_test_flag(caller_channel, CF_REDIRECT) &&
+                !switch_channel_test_flag(caller_channel, CF_XFER_ZOMBIE) && !a_leg->clean_exit && !inner_bridge) {
</ins><span class="cx">                 if ((state != CS_EXECUTE && state != CS_SOFT_EXECUTE && state != CS_PARK && state != CS_ROUTING) ||
</span><span class="cx">                         (switch_channel_test_flag(peer_channel, CF_ANSWERED) && state < CS_HANGUP)) {
</span><span class="cx">                         if (switch_true(switch_channel_get_variable(caller_channel, SWITCH_PARK_AFTER_BRIDGE_VARIABLE))) {
</span><span class="lines">@@ -1041,7 +1147,7 @@
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Restore media to %s\n", switch_channel_get_name(channel));
</span><span class="cx">                 switch_ivr_media(switch_core_session_get_uuid(session), SMF_IMMEDIATE);
</span><span class="cx">
</span><del>-                if (!switch_strlen_zero(sbv) && (sbsession = switch_core_session_locate(sbv))) {
</del><ins>+                if (!zstr(sbv) && (sbsession = switch_core_session_locate(sbv))) {
</ins><span class="cx">                         switch_channel_t *sbchannel = switch_core_session_get_channel(sbsession);
</span><span class="cx">                         switch_channel_hangup(sbchannel, SWITCH_CAUSE_ATTENDED_TRANSFER);
</span><span class="cx">                         switch_core_session_rwunlock(sbsession);
</span><span class="lines">@@ -1060,8 +1166,7 @@
</span><span class="cx">         switch_core_session_t *originator_session, *originatee_session, *swap_session;
</span><span class="cx">         switch_channel_t *originator_channel, *originatee_channel, *swap_channel;
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_FALSE;
</span><del>-        switch_caller_profile_t *cp, *originator_cp, *originatee_cp;
-        char *p;
</del><ins>+        switch_caller_profile_t *originator_cp, *originatee_cp;
</ins><span class="cx">         switch_channel_state_t state;
</span><span class="cx">
</span><span class="cx">         if ((originator_session = switch_core_session_locate(originator_uuid))) {
</span><span class="lines">@@ -1129,26 +1234,8 @@
</span><span class="cx">                         switch_channel_set_variable(originator_channel, "original_caller_id_name", originator_cp->caller_id_name);
</span><span class="cx">                         switch_channel_set_variable(originator_channel, "original_caller_id_number", originator_cp->caller_id_number);
</span><span class="cx">
</span><del>-                        cp = switch_caller_profile_clone(originatee_session, originatee_cp);
-                        cp->destination_number = switch_core_strdup(cp->pool, originator_cp->caller_id_number);
-                        cp->caller_id_number = switch_core_strdup(cp->pool, originator_cp->caller_id_number);
-                        cp->caller_id_name = switch_core_strdup(cp->pool, originator_cp->caller_id_name);
-                        cp->rdnis = switch_core_strdup(cp->pool, originatee_cp->destination_number);
-                        if ((p = strchr(cp->rdnis, '@'))) {
-                                *p = '\0';
-                        }
-                        switch_channel_set_caller_profile(originatee_channel, cp);
</del><ins>+
</ins><span class="cx">                         switch_channel_set_originator_caller_profile(originatee_channel, switch_caller_profile_clone(originatee_session, originator_cp));
</span><del>-
-                        cp = switch_caller_profile_clone(originator_session, originator_cp);
-                        cp->destination_number = switch_core_strdup(cp->pool, originatee_cp->caller_id_number);
-                        cp->caller_id_number = switch_core_strdup(cp->pool, originatee_cp->caller_id_number);
-                        cp->caller_id_name = switch_core_strdup(cp->pool, originatee_cp->caller_id_name);
-                        cp->rdnis = switch_core_strdup(cp->pool, originator_cp->destination_number);
-                        if ((p = strchr(cp->rdnis, '@'))) {
-                                *p = '\0';
-                        }
-                        switch_channel_set_caller_profile(originator_channel, cp);
</del><span class="cx">                         switch_channel_set_originatee_caller_profile(originator_channel, switch_caller_profile_clone(originator_session, originatee_cp));
</span><span class="cx">
</span><span class="cx">                         switch_channel_stop_broadcast(originator_channel);
</span><span class="lines">@@ -1162,10 +1249,13 @@
</span><span class="cx">                         switch_channel_clear_flag(originatee_channel, CF_ORIGINATING);
</span><span class="cx">
</span><span class="cx">                         /* change the states and let the chips fall where they may */
</span><ins>+
+                        switch_channel_set_variable(originator_channel, SWITCH_PARK_AFTER_BRIDGE_VARIABLE, NULL);
+                        switch_channel_set_variable(originatee_channel, SWITCH_PARK_AFTER_BRIDGE_VARIABLE, NULL);
</ins><span class="cx">                         switch_channel_clear_state_handler(originator_channel, NULL);
</span><span class="cx">                         switch_channel_clear_state_handler(originatee_channel, NULL);
</span><del>-                        switch_channel_set_state_flag(originator_channel, CF_ORIGINATOR);
-                        switch_channel_clear_flag(originatee_channel, CF_ORIGINATOR);
</del><ins>+                        switch_channel_set_state_flag(originator_channel, CF_BRIDGE_ORIGINATOR);
+                        switch_channel_clear_flag(originatee_channel, CF_BRIDGE_ORIGINATOR);
</ins><span class="cx">                         switch_channel_add_state_handler(originator_channel, &uuid_bridge_state_handlers);
</span><span class="cx">                         switch_channel_add_state_handler(originatee_channel, &uuid_bridge_state_handlers);
</span><span class="cx">
</span><span class="lines">@@ -1176,6 +1266,8 @@
</span><span class="cx">                         
</span><span class="cx">                         status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">
</span><ins>+                        switch_ivr_bridge_display(originator_session, originatee_session);
+
</ins><span class="cx">                         /* release the read locks we have on the channels */
</span><span class="cx">                         switch_core_session_rwunlock(originator_session);
</span><span class="cx">                         switch_core_session_rwunlock(originatee_session);
</span><span class="lines">@@ -1229,7 +1321,7 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(uuid) || !(rsession = switch_core_session_locate(uuid))) {
</del><ins>+        if (zstr(uuid) || !(rsession = switch_core_session_locate(uuid))) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "no uuid %s\n", uuid);
</span><span class="cx">                 return;
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_ivr_menuc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_menu.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_menu.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_menu.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -140,35 +140,35 @@
</span><span class="cx">                 inter_timeout = timeout / 2;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(name)) {
</del><ins>+        if (!zstr(name)) {
</ins><span class="cx">                 menu->name = switch_core_strdup(menu->pool, name);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(greeting_sound)) {
</del><ins>+        if (!zstr(greeting_sound)) {
</ins><span class="cx">                 menu->greeting_sound = switch_core_strdup(menu->pool, greeting_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(short_greeting_sound)) {
</del><ins>+        if (!zstr(short_greeting_sound)) {
</ins><span class="cx">                 menu->short_greeting_sound = switch_core_strdup(menu->pool, short_greeting_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(invalid_sound)) {
</del><ins>+        if (!zstr(invalid_sound)) {
</ins><span class="cx">                 menu->invalid_sound = switch_core_strdup(menu->pool, invalid_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(exit_sound)) {
</del><ins>+        if (!zstr(exit_sound)) {
</ins><span class="cx">                 menu->exit_sound = switch_core_strdup(menu->pool, exit_sound);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(confirm_macro)) {
</del><ins>+        if (!zstr(confirm_macro)) {
</ins><span class="cx">                 menu->confirm_macro = switch_core_strdup(menu->pool, confirm_macro);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(tts_engine)) {
</del><ins>+        if (!zstr(tts_engine)) {
</ins><span class="cx">                 menu->tts_engine = switch_core_strdup(menu->pool, tts_engine);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(tts_voice)) {
</del><ins>+        if (!zstr(tts_voice)) {
</ins><span class="cx">                 menu->tts_voice = switch_core_strdup(menu->pool, tts_voice);
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -294,7 +294,7 @@
</span><span class="cx">         char *sound_expanded = sound;
</span><span class="cx">         switch_size_t menu_buf_len = 0;
</span><span class="cx">
</span><del>-        if (!session || !menu || switch_strlen_zero(sound)) {
</del><ins>+        if (!session || !menu || zstr(sound)) {
</ins><span class="cx">                 return status;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -396,7 +396,7 @@
</span><span class="cx">                 switch_goto_status(SWITCH_STATUS_FALSE, end);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!session || !stack || switch_strlen_zero(name)) {
</del><ins>+        if (!session || !stack || zstr(name)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Invalid menu context\n");
</span><span class="cx">                 switch_goto_status(SWITCH_STATUS_FALSE, end);
</span><span class="cx">         }
</span><span class="lines">@@ -408,7 +408,7 @@
</span><span class="cx">                 switch_goto_status(SWITCH_STATUS_FALSE, end);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(menu->tts_engine) && !switch_strlen_zero(menu->tts_voice)) {
</del><ins>+        if (!zstr(menu->tts_engine) && !zstr(menu->tts_voice)) {
</ins><span class="cx">                 switch_channel_set_variable(channel, "tts_engine", menu->tts_engine);
</span><span class="cx">                 switch_channel_set_variable(channel, "tts_voice", menu->tts_voice);
</span><span class="cx">         }
</span><span class="lines">@@ -456,7 +456,7 @@
</span><span class="cx">                                 char substituted[1024];
</span><span class="cx">                                 char *use_arg = ap->arg;
</span><span class="cx">
</span><del>-                                if (!switch_strlen_zero(menu->tts_engine) && !switch_strlen_zero(menu->tts_voice)) {
</del><ins>+                                if (!zstr(menu->tts_engine) && !zstr(menu->tts_voice)) {
</ins><span class="cx">                                         switch_channel_set_variable(channel, "tts_engine", menu->tts_engine);
</span><span class="cx">                                         switch_channel_set_variable(channel, "tts_voice", menu->tts_voice);
</span><span class="cx">                                 }
</span><span class="lines">@@ -516,7 +516,7 @@
</span><span class="cx">
</span><span class="cx">                                                         status = SWITCH_STATUS_FALSE;
</span><span class="cx">
</span><del>-                                                        if (!switch_strlen_zero(aptr)) {
</del><ins>+                                                        if (!zstr(aptr)) {
</ins><span class="cx">                                                                 app_name = switch_core_session_strdup(session, aptr);
</span><span class="cx">                                                                 if ((app_arg = strchr(app_name, ' '))) {
</span><span class="cx">                                                                         *app_arg++ = '\0';
</span><span class="lines">@@ -579,7 +579,7 @@
</span><span class="cx">
</span><span class="cx">         if (stack->stack_count == 1) {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "exit-sound '%s'\n", menu->exit_sound);
</span><del>-                if (!switch_strlen_zero(menu->exit_sound)) {
</del><ins>+                if (!zstr(menu->exit_sound)) {
</ins><span class="cx">                         status = play_and_collect(session, menu, menu->exit_sound, 0);
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -669,7 +669,7 @@
</span><span class="cx"> {
</span><span class="cx">         int i;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(action_name)) {
</del><ins>+        if (!zstr(action_name)) {
</ins><span class="cx">                 for(i = 0;;i++) {
</span><span class="cx">                         if (!iam[i].name) {
</span><span class="cx">                                 break;
</span><span class="lines">@@ -689,7 +689,7 @@
</span><span class="cx"> {
</span><span class="cx">         int i;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(action)) {
</del><ins>+        if (!zstr(action)) {
</ins><span class="cx">                 for(i = 0;;i++) {
</span><span class="cx">                         if (!iam[i].name) {
</span><span class="cx">                                 break;
</span><span class="lines">@@ -770,7 +770,7 @@
</span><span class="cx">
</span><span class="cx">                 switch_ivr_menu_t *menu = NULL;
</span><span class="cx">
</span><del>-                if (switch_strlen_zero(max_timeouts)) {
</del><ins>+                if (zstr(max_timeouts)) {
</ins><span class="cx">                         max_timeouts = max_failures;
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -812,7 +812,7 @@
</span><span class="cx">                                 const char *digits = switch_xml_attr(xml_kvp, "digits");
</span><span class="cx">                                 const char *param = switch_xml_attr_soft(xml_kvp, "param");
</span><span class="cx">
</span><del>-                                if (is_valid_action(action) && !switch_strlen_zero(digits)) {
</del><ins>+                                if (is_valid_action(action) && !zstr(digits)) {
</ins><span class="cx">                                         switch_ivr_menu_xml_map_t *xml_map = xml_menu_ctx->map;
</span><span class="cx">                                         int found = 0;
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_ivr_originatec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_originate.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_originate.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_originate.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -113,11 +113,15 @@
</span><span class="cx">         int monitor_early_media_ring_count;
</span><span class="cx">         int monitor_early_media_ring_total;
</span><span class="cx">         int cancel_timeout;
</span><ins>+        int continue_on_timeout;
+        int ringback_ok;
+        int sending_ringback;
</ins><span class="cx"> } originate_global_t;
</span><span class="cx">
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> typedef enum {
</span><ins>+        IDX_KEY_CANCEL = -4,
</ins><span class="cx">         IDX_TIMEOUT = -3,
</span><span class="cx">         IDX_CANCEL = -2,
</span><span class="cx">         IDX_NADA = -1
</span><span class="lines">@@ -229,17 +233,62 @@
</span><span class="cx">                                                                          int max,
</span><span class="cx">                                                                          time_t start)
</span><span class="cx"> {
</span><del>-        int x = 0,i;
</del><ins>+        int x = 0,i,delayed_channels=0,active_channels=0;
+        uint32_t early_exit_time=0, delayed_min=0;
+
</ins><span class="cx">         time_t elapsed = switch_epoch_time_now(NULL) - start;
</span><span class="cx">
</span><span class="cx">         if (oglobals->cancel_timeout > 0) {
</span><span class="cx">                 return 0;
</span><span class="cx">         }
</span><ins>+        for (i = 0; i < max; i++) {
+                if (originate_status[i].peer_channel && switch_channel_get_state(originate_status[i].peer_channel) != CS_DESTROY &&
+                        switch_channel_get_state(originate_status[i].peer_channel) != CS_REPORTING) {
+                        if (originate_status[i].per_channel_delay_start) {
+                                delayed_channels++;
+                        } else {
+                                active_channels++;
+                        }
+                }
+        }
</ins><span class="cx">
</span><ins>+        if (active_channels == 0 && delayed_channels) {
+                for (i = 0; i < max; i++) {
+                        if ( originate_status[i].peer_channel && originate_status[i].per_channel_delay_start &&
+                                 (! delayed_min || delayed_min > originate_status[i].per_channel_delay_start) ) {
+                                delayed_min = originate_status[i].per_channel_delay_start;
+                        }
+                }
+                early_exit_time = delayed_min - (uint32_t) elapsed;
+        }
</ins><span class="cx">         for (i = 0; i < max; i++) {
</span><del>-                if (originate_status[i].peer_channel && originate_status[i].per_channel_delay_start && elapsed > originate_status[i].per_channel_delay_start) {
-                        switch_channel_clear_flag(originate_status[i].peer_channel, CF_BLOCK_STATE);
-                        originate_status[i].per_channel_delay_start = 0;
</del><ins>+                if (originate_status[i].peer_channel && originate_status[i].per_channel_delay_start &&
+                        (elapsed > originate_status[i].per_channel_delay_start || active_channels == 0) ) {
+                        if (active_channels == 0) {
+                                if (originate_status[i].per_channel_timelimit_sec) {
+                                        if (originate_status[i].per_channel_timelimit_sec > early_exit_time) {
+                                                /* IN theory this check is not needed ( should just be if !0 then -= with no else), if its not 0 it should always be greater.... */
+                                                originate_status[i].per_channel_timelimit_sec -= early_exit_time;
+                                        } else {
+                                                originate_status[i].per_channel_timelimit_sec = 1;
+                                        }
+                                }
+                                if (originate_status[i].per_channel_progress_timelimit_sec) {
+                                        if (originate_status[i].per_channel_progress_timelimit_sec > early_exit_time) {
+                                                /* IN theory this check is not needed ( should just be if !0 then -= with no else), if its not 0 it should always be greater.... */
+                                                originate_status[i].per_channel_progress_timelimit_sec -= early_exit_time;
+                                        } else {
+                                                originate_status[i].per_channel_progress_timelimit_sec = 1;
+                                        }
+                                }
+                                originate_status[i].per_channel_delay_start -= delayed_min;
+                        } else {
+                                originate_status[i].per_channel_delay_start = 0;
+                        }
+
+                        if (! originate_status[i].per_channel_delay_start) {
+                                switch_channel_clear_flag(originate_status[i].peer_channel, CF_BLOCK_STATE);
+                        }
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 if (originate_status[i].peer_channel && switch_channel_up(originate_status[i].peer_channel)) {
</span><span class="lines">@@ -317,6 +366,7 @@
</span><span class="cx">         switch_channel_t *caller_channel = NULL;
</span><span class="cx">         int pindex = -1;
</span><span class="cx">         char bug_key[256] = "";
</span><ins>+        int send_ringback = 0;
</ins><span class="cx">
</span><span class="cx">         oglobals->hups = 0;
</span><span class="cx">         oglobals->idx = IDX_NADA;
</span><span class="lines">@@ -324,6 +374,9 @@
</span><span class="cx">
</span><span class="cx">         if (oglobals->session) {
</span><span class="cx">                 caller_channel = switch_core_session_get_channel(oglobals->session);
</span><ins>+                if (switch_channel_test_flag(caller_channel, CF_XFER_ZOMBIE)) {
+                        caller_channel = NULL;
+                }
</ins><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">
</span><span class="lines">@@ -339,12 +392,34 @@
</span><span class="cx">                                 originate_status[i].ring_ready = 1;
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if (!oglobals->ring_ready) {
-                                oglobals->ring_ready = 1;
</del><ins>+                        if (oglobals->sending_ringback == 1) {
+                                send_ringback++;
+                                pindex = (uint32_t) i;
+                        } else {
+                                if (!oglobals->ring_ready) {
+                                        oglobals->ring_ready = 1;
+                                        if (caller_channel && !oglobals->ignore_ring_ready) {
+                                                if (len == 1) {
+                                                        switch_channel_pass_callee_id(originate_status[0].peer_channel, caller_channel);
+                                                }
+                                                switch_channel_ring_ready(caller_channel);
+                                                oglobals->sent_ring = 1;
+                                        }
+                                }
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 if (switch_channel_test_flag(originate_status[i].peer_channel, CF_EARLY_MEDIA)) {
</span><ins>+
+                        if (oglobals->sending_ringback == 1) {
+                                send_ringback++;
+                                pindex = (uint32_t) i;
+                        } else if (!oglobals->sent_ring && oglobals->ignore_early_media == 2 && len == 1 && caller_channel && !oglobals->ignore_ring_ready) {
+                                switch_channel_pass_callee_id(originate_status[0].peer_channel, caller_channel);
+                                switch_channel_ring_ready(caller_channel);
+                                oglobals->sent_ring = 1;
+                        }
+
</ins><span class="cx">                         if (!originate_status[i].early_media) {
</span><span class="cx">                                 originate_status[i].early_media = 1;
</span><span class="cx">                                 if (oglobals->early_ok) {
</span><span class="lines">@@ -353,7 +428,7 @@
</span><span class="cx">                                 
</span><span class="cx">                                 if (oglobals->monitor_early_media_fail) {
</span><span class="cx">                                         const char *var = switch_channel_get_variable(originate_status[i].peer_channel, "monitor_early_media_fail");
</span><del>-                                        if (!switch_strlen_zero(var)) {
</del><ins>+                                        if (!zstr(var)) {
</ins><span class="cx">                                                 char *fail_array[128] = {0};
</span><span class="cx">                                                 int fail_count = 0;
</span><span class="cx">                                                 char *fail_data = strdup(var);
</span><span class="lines">@@ -420,7 +495,7 @@
</span><span class="cx">                                 if (oglobals->monitor_early_media_ring) {
</span><span class="cx">                                         const char *var = switch_channel_get_variable(originate_status[i].peer_channel, "monitor_early_media_ring");
</span><span class="cx">                                         const char *var_total = switch_channel_get_variable(originate_status[i].peer_channel, "monitor_early_media_ring_total");
</span><del>-                                        if (!switch_strlen_zero(var)) {
</del><ins>+                                        if (!zstr(var)) {
</ins><span class="cx">                                                 char *ring_array[128] = {0};
</span><span class="cx">                                                 int ring_count = 0;
</span><span class="cx">                                                 char *ring_data = strdup(var);
</span><span class="lines">@@ -471,12 +546,13 @@
</span><span class="cx">                                                 if (var_total) {
</span><span class="cx">                                                         int tmp = atoi(var_total);
</span><span class="cx">                                                         if (tmp > 0 && tmp < 100) {
</span><del>-                                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(originate_status[i].peer_session), SWITCH_LOG_DEBUG, "%s setting ring total to %d\n",
</del><ins>+                                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(originate_status[i].peer_session), SWITCH_LOG_DEBUG,
+                                                                                                 "%s setting ring total to %d\n",
</ins><span class="cx">                                                                                                  switch_channel_get_name(originate_status[i].peer_channel), tmp);
</span><span class="cx">                                                                 oglobals->monitor_early_media_ring_total = tmp;
</span><span class="cx">                                                         }
</span><span class="cx">                                                 }
</span><del>-
</del><ins>+                                                
</ins><span class="cx">                                                 switch_safe_free(ring_data);
</span><span class="cx">                                         
</span><span class="cx">                                         }
</span><span class="lines">@@ -491,13 +567,12 @@
</span><span class="cx">                                 
</span><span class="cx">                                 if (!oglobals->ring_ready && !oglobals->ignore_ring_ready) {
</span><span class="cx">                                         oglobals->ring_ready = 1;
</span><ins>+                                        
</ins><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">                 
</span><del>-                if (switch_core_session_private_event_count(originate_status[i].peer_session)) {
-                        switch_ivr_parse_all_events(originate_status[i].peer_session);
-                }
</del><ins>+                switch_ivr_parse_all_events(originate_status[i].peer_session);
</ins><span class="cx">
</span><span class="cx">                 state = switch_channel_get_state(originate_status[i].peer_channel);
</span><span class="cx">                 if (state >= CS_HANGUP || state == CS_RESET || switch_channel_test_flag(originate_status[i].peer_channel, CF_TRANSFER) ||
</span><span class="lines">@@ -514,7 +589,7 @@
</span><span class="cx">                                  && !switch_channel_test_flag(originate_status[i].peer_channel, CF_TAGGED)
</span><span class="cx">                                  ) {
</span><span class="cx">                         
</span><del>-                        if (!switch_strlen_zero(oglobals->key)) {
</del><ins>+                        if (!zstr(oglobals->key)) {
</ins><span class="cx">                                 struct key_collect *collect;
</span><span class="cx">
</span><span class="cx">                                 if (oglobals->cancel_timeout < 0) {
</span><span class="lines">@@ -523,10 +598,10 @@
</span><span class="cx">
</span><span class="cx">                                 if ((collect = switch_core_session_alloc(originate_status[i].peer_session, sizeof(*collect)))) {
</span><span class="cx">                                         switch_channel_set_flag(originate_status[i].peer_channel, CF_TAGGED);
</span><del>-                                        if (!switch_strlen_zero(oglobals->key)) {
</del><ins>+                                        if (!zstr(oglobals->key)) {
</ins><span class="cx">                                                 collect->key = switch_core_session_strdup(originate_status[i].peer_session, oglobals->key);
</span><span class="cx">                                         }
</span><del>-                                        if (!switch_strlen_zero(oglobals->file)) {
</del><ins>+                                        if (!zstr(oglobals->file)) {
</ins><span class="cx">                                                 collect->file = switch_core_session_strdup(originate_status[i].peer_session, oglobals->file);
</span><span class="cx">                                         }
</span><span class="cx">                                         switch_channel_audio_sync(originate_status[i].peer_channel);
</span><span class="lines">@@ -566,16 +641,21 @@
</span><span class="cx">                         if (switch_core_session_get_read_impl(originate_status[pindex].peer_session, &impl) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                 switch_snprintf(tmp, sizeof(tmp), "%s@%uh@%ui", impl.iananame, impl.samples_per_second, impl.microseconds_per_packet / 1000);
</span><span class="cx">                                 switch_channel_set_variable(caller_channel, "absolute_codec_string", tmp);
</span><del>-                                switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(caller_channel), SWITCH_LOG_DEBUG, "Setting codec string on %s to %s\n", switch_channel_get_name(caller_channel), tmp);
</del><ins>+                                switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(caller_channel), SWITCH_LOG_DEBUG, "Setting codec string on %s to %s\n",
+                                                                 switch_channel_get_name(caller_channel), tmp);
</ins><span class="cx">                         } else {
</span><del>-                                switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(originate_status[pindex].peer_channel), SWITCH_LOG_WARNING, "Error inheriting codec. Channel %s has no read codec yet.\n",
</del><ins>+                                switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(originate_status[pindex].peer_channel), SWITCH_LOG_WARNING,
+                                                                 "Error inheriting codec. Channel %s has no read codec yet.\n",
</ins><span class="cx">                                                                  switch_channel_get_name(originate_status[pindex].peer_channel));
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
</del><span class="cx">
</span><ins>+        if (send_ringback) {
+                oglobals->sending_ringback++;        
+        }
+
</ins><span class="cx">         return rval;
</span><span class="cx">
</span><span class="cx"> }
</span><span class="lines">@@ -616,16 +696,20 @@
</span><span class="cx">         switch_codec_t *read_codec = switch_core_session_get_read_codec(session);
</span><span class="cx">         uint8_t pass = 0;
</span><span class="cx">         ringback_t ringback = { 0 };
</span><del>-        switch_core_session_message_t *message = NULL;
</del><span class="cx">         switch_frame_t *read_frame = NULL;
</span><span class="cx">         switch_status_t status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">         int timelimit = 60;
</span><span class="cx">         const char *var;
</span><span class="cx">         switch_time_t start = 0;
</span><span class="cx">         const char *cancel_key = NULL;
</span><ins>+        switch_channel_state_t wait_state = 0;
</ins><span class="cx">
</span><span class="cx">         switch_assert(peer_channel);
</span><span class="cx">         
</span><ins>+        if (switch_channel_get_state(peer_channel) == CS_RESET) {
+                switch_channel_set_state(peer_channel, CS_SOFT_EXECUTE);
+        }
+
</ins><span class="cx">         if (session) {
</span><span class="cx">                 caller_channel = switch_core_session_get_channel(session);
</span><span class="cx">         }
</span><span class="lines">@@ -660,7 +744,7 @@
</span><span class="cx">
</span><span class="cx">                 if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE) || switch_channel_test_flag(caller_channel, CF_PROXY_MEDIA)) {
</span><span class="cx">                         ringback_data = NULL;
</span><del>-                } else if (switch_strlen_zero(ringback_data)) {
</del><ins>+                } else if (zstr(ringback_data)) {
</ins><span class="cx">                         if ((var = switch_channel_get_variable(caller_channel, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE))) {
</span><span class="cx">                                 int sval = atoi(var);
</span><span class="cx">
</span><span class="lines">@@ -682,7 +766,7 @@
</span><span class="cx">
</span><span class="cx">                 
</span><span class="cx">                 if (!ringback.asis) {
</span><del>-                        if (!(pass = (uint8_t) switch_test_flag(read_codec, SWITCH_CODEC_FLAG_PASSTHROUGH))) {
</del><ins>+                        if ((pass = (uint8_t) switch_test_flag(read_codec, SWITCH_CODEC_FLAG_PASSTHROUGH))) {
</ins><span class="cx">                                 goto no_ringback;
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="lines">@@ -711,7 +795,11 @@
</span><span class="cx">                                 switch_core_session_set_read_codec(session, &write_codec);
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-                        
</del><ins>+                
+                if (switch_channel_test_flag(caller_channel, CF_DISABLE_RINGBACK)) {
+                        ringback_data = NULL;
+                }
+
</ins><span class="cx">                 if (ringback_data) {
</span><span class="cx">                         char *tmp_data = NULL;
</span><span class="cx">
</span><span class="lines">@@ -772,8 +860,11 @@
</span><span class="cx">
</span><span class="cx"> no_ringback:
</span><span class="cx">
</span><del>-        while (switch_channel_ready(peer_channel)
-                 && !(switch_channel_test_flag(peer_channel, CF_ANSWERED) || switch_channel_test_flag(peer_channel, CF_EARLY_MEDIA))) {
</del><ins>+        if (caller_channel) {
+                wait_state = switch_channel_get_state(caller_channel);
+        }
+
+        while (switch_channel_ready(peer_channel) && !switch_channel_media_ready(peer_channel)) {
</ins><span class="cx">                 int diff = (int) (switch_micro_time_now() - start);
</span><span class="cx">
</span><span class="cx">                 if (caller_channel && cancel_key) {
</span><span class="lines">@@ -788,20 +879,15 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">
</span><ins>+                if (caller_channel && switch_channel_get_state(caller_channel) != wait_state) {
+                        goto done;
+                }
+
</ins><span class="cx">                 if (diff > timelimit) {
</span><span class="cx">                         status = SWITCH_STATUS_TIMEOUT;
</span><span class="cx">                         goto done;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-
-                if (switch_core_session_dequeue_message(peer_session, &message) == SWITCH_STATUS_SUCCESS) {
-                        if (switch_test_flag(message, SCSMF_DYNAMIC)) {
-                                switch_safe_free(message);
-                        } else {
-                                message = NULL;
-                        }
-                }
-                
</del><span class="cx">                 if (switch_channel_media_ready(caller_channel)) {
</span><span class="cx">                         status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
</span><span class="cx">                         if (!SWITCH_READ_ACCEPTABLE(status)) {
</span><span class="lines">@@ -880,7 +966,18 @@
</span><span class="cx">
</span><span class="cx"> end:
</span><span class="cx">
</span><del>-        return (!caller_channel || switch_channel_ready(caller_channel)) ? status : SWITCH_STATUS_FALSE;
</del><ins>+        if (!switch_channel_media_ready(peer_channel)) {
+                if (switch_channel_up(peer_channel)) {
+                        switch_channel_hangup(peer_channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+                }
+                status = SWITCH_STATUS_FALSE;
+        }
+        
+        if (caller_channel && !switch_channel_ready(caller_channel)) {
+                status = SWITCH_STATUS_FALSE;
+        }
+
+        return status;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SWITCH_DECLARE(void) switch_process_import(switch_core_session_t *session, switch_channel_t *peer_channel, const char *varname)
</span><span class="lines">@@ -907,6 +1004,143 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+static switch_status_t setup_ringback(originate_global_t *oglobals,
+                                                                         const char *ringback_data,
+                                                                         ringback_t *ringback,
+                                                                         switch_frame_t *write_frame,
+                                                                         switch_codec_t *write_codec)
+{
+        switch_status_t status = SWITCH_STATUS_SUCCESS;
+        switch_channel_t *caller_channel = switch_core_session_get_channel(oglobals->session);
+        switch_codec_t *read_codec = NULL;
+        char *tmp_data = NULL;
+
+        if (!ringback_data) {
+                switch_goto_status(SWITCH_STATUS_GENERR, end);
+        }
+
+        if (!switch_channel_test_flag(caller_channel, CF_ANSWERED)
+                && !switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA)) {
+                if ((status = switch_channel_pre_answer(caller_channel)) != SWITCH_STATUS_SUCCESS) {
+                        switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(caller_channel), SWITCH_LOG_DEBUG, "%s Media Establishment Failed.\n",
+                                                         switch_channel_get_name(caller_channel));
+                        switch_goto_status(SWITCH_STATUS_BREAK, end);
+                }
+        }
+
+        if (oglobals->session && (read_codec = switch_core_session_get_read_codec(oglobals->session))) {
+                if (switch_is_file_path(ringback_data)) {
+                        if (!(strrchr(ringback_data, '.') || strstr(ringback_data, SWITCH_URL_SEPARATOR))) {
+                                ringback->asis++;
+                        }
+                }
+                                
+                if (!ringback->asis) {
+                        if (switch_test_flag(read_codec, SWITCH_CODEC_FLAG_PASSTHROUGH)) {
+                                switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(caller_channel), SWITCH_LOG_WARNING, "%s Ringback not supported in passthrough codec mode.\n",
+                                                                 switch_channel_get_name(caller_channel));
+                                switch_goto_status(SWITCH_STATUS_GENERR, end);
+                        }
+
+                        if (switch_core_codec_init(write_codec,
+                                                                         "L16",
+                                                                         NULL,
+                                                                         read_codec->implementation->actual_samples_per_second,
+                                                                         read_codec->implementation->microseconds_per_packet / 1000,
+                                                                         1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
+                                                                         switch_core_session_get_pool(oglobals->session)) == SWITCH_STATUS_SUCCESS) {
+
+
+                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(oglobals->session), SWITCH_LOG_DEBUG,
+                                                                 "Raw Codec Activation Success L16@%uhz 1 channel %dms\n",
+                                                                 read_codec->implementation->actual_samples_per_second,
+                                                                 read_codec->implementation->microseconds_per_packet / 1000);
+                                write_frame->codec = write_codec;
+                                write_frame->datalen = read_codec->implementation->decoded_bytes_per_packet;
+                                write_frame->samples = write_frame->datalen / 2;
+                                memset(write_frame->data, 255, write_frame->datalen);
+                                switch_core_session_set_read_codec(oglobals->session, write_codec);
+                        } else {
+                                switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(caller_channel), SWITCH_LOG_ERROR, "Codec Error!\n");
+                                switch_channel_hangup(caller_channel, SWITCH_CAUSE_NORMAL_TEMPORARY_FAILURE);
+                                read_codec = NULL;
+                                switch_goto_status(SWITCH_STATUS_BREAK, end);
+                        }
+                }        
+
+                oglobals->gen_ringback = 1;
+
+                if (switch_is_file_path(ringback_data)) {
+                        char *ext;
+
+                        if (ringback->asis) {
+                                write_frame->codec = read_codec;
+                                ext = read_codec->implementation->iananame;
+                                tmp_data = switch_mprintf("%s.%s", ringback_data, ext);
+                                ringback_data = tmp_data;
+                        }
+
+                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(oglobals->session), SWITCH_LOG_DEBUG, "Play Ringback File [%s]\n", ringback_data);
+                        
+                        ringback->fhb.channels = read_codec->implementation->number_of_channels;
+                        ringback->fhb.samplerate = read_codec->implementation->actual_samples_per_second;
+                        if (switch_core_file_open(&ringback->fhb,
+                                                                         ringback_data,
+                                                                         read_codec->implementation->number_of_channels,
+                                                                         read_codec->implementation->actual_samples_per_second,
+                                                                         SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL) != SWITCH_STATUS_SUCCESS) {
+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Playing File\n");
+                                switch_safe_free(tmp_data);
+                                switch_goto_status(SWITCH_STATUS_GENERR, end);
+                                //switch_goto_status(SWITCH_STATUS_FALSE, end);
+                        }
+                        ringback->fh = &ringback->fhb;
+
+                } else if (!strncasecmp(ringback_data, "silence", 7)) {
+                        const char *c = ringback_data + 7;
+                        if (*c == ':') {
+                                c++;
+                                if (c) {
+                                        ringback->silence = atoi(c);
+                                }
+                        }
+                        if (ringback->silence <= 0) {
+                                ringback->silence = 400;
+                        }
+                } else {
+                        switch_buffer_create_dynamic(&ringback->audio_buffer, 512, 1024, 0);
+                        switch_buffer_set_loops(ringback->audio_buffer, -1);
+
+                        teletone_init_session(&ringback->ts, 0, teletone_handler, ringback);
+                        ringback->ts.rate = read_codec->implementation->actual_samples_per_second;
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Play Ringback Tone [%s]\n", ringback_data);
+                        /* ringback->ts.debug = 1;
+                         ringback->ts.debug_stream = switch_core_get_console(); */
+                        
+                        if (teletone_run(&ringback->ts, ringback_data)) {
+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Playing Tone\n");
+                                teletone_destroy_session(&ringback->ts);
+                                switch_buffer_destroy(&ringback->audio_buffer);
+                                switch_goto_status(SWITCH_STATUS_GENERR, end);
+                        }
+                }
+        }
+                        
+ end:
+
+        switch_safe_free(tmp_data);
+
+        return status;
+
+}
+
+
+#define peer_eligible(_peer) (_peer && !(switch_channel_test_flag(_peer, CF_TRANSFER) || \
+                                                                                 switch_channel_test_flag(_peer, CF_REDIRECT) || \
+                                                                                 switch_channel_test_flag(_peer, CF_BRIDGED) || \
+                                                                                 switch_channel_get_state(_peer) == CS_RESET || \
+                                                                                 !switch_channel_test_flag(_peer, CF_ORIGINATING)))
+
</ins><span class="cx"> #define MAX_PEERS 128
</span><span class="cx"> SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *session,
</span><span class="cx">                                                                                                          switch_core_session_t **bleg,
</span><span class="lines">@@ -940,16 +1174,14 @@
</span><span class="cx">         int32_t sleep_ms = 1000, try = 0, retries = 1;
</span><span class="cx">         switch_codec_t write_codec = { 0 };
</span><span class="cx">         switch_frame_t write_frame = { 0 };
</span><del>-        uint8_t pass = 0;
</del><span class="cx">         char *odata, *var;
</span><span class="cx">         switch_call_cause_t reason = SWITCH_CAUSE_NONE;
</span><ins>+        switch_call_cause_t force_reason = SWITCH_CAUSE_NONE;
</ins><span class="cx">         uint8_t to = 0;
</span><span class="cx">         char *var_val, *vars = NULL;
</span><span class="cx">         int var_block_count = 0;
</span><span class="cx">         char *e = NULL;
</span><span class="cx">         const char *ringback_data = NULL;
</span><del>-        switch_codec_t *read_codec = NULL;
-        switch_core_session_message_t *message = NULL;
</del><span class="cx">         switch_event_t *var_event = NULL;
</span><span class="cx">         uint8_t fail_on_single_reject = 0;
</span><span class="cx">         char *fail_on_single_reject_var = NULL;
</span><span class="lines">@@ -960,12 +1192,55 @@
</span><span class="cx">         int cdr_total = 0;
</span><span class="cx">         int local_clobber = 0;
</span><span class="cx">         const char *cancel_key = NULL;
</span><ins>+        const char *holding = NULL;
</ins><span class="cx">
</span><ins>+        oglobals.ringback_ok = 1;
+
+        if (session) {
+                const char *to_var;
+                caller_channel = switch_core_session_get_channel(session);
+                switch_channel_set_flag(caller_channel, CF_ORIGINATOR);
+                oglobals.session = session;
+
+
+                if ((to_var = switch_channel_get_variable(caller_channel, SWITCH_CALL_TIMEOUT_VARIABLE))) {
+                        timelimit_sec = atoi(to_var);
+                }
+
+                if (switch_true(switch_channel_get_variable(caller_channel, SWITCH_PROXY_MEDIA_VARIABLE))) {
+                        switch_channel_set_flag(caller_channel, CF_PROXY_MEDIA);
+                }
+
+                if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE)
+                        || (switch_true(switch_channel_get_variable(caller_channel, SWITCH_BYPASS_MEDIA_VARIABLE)))) {
+                        if (!switch_channel_test_flag(caller_channel, CF_ANSWERED)
+                                && !switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA)) {
+                                switch_channel_set_flag(caller_channel, CF_PROXY_MODE);
+                        } else {
+                                if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE)) {
+                                        switch_ivr_media(switch_core_session_get_uuid(session), SMF_REBRIDGE);
+                                        switch_channel_set_flag(caller_channel, CF_PROXY_MODE);
+                                } else {
+                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG,
+                                                                         "Channel is already up, delaying proxy mode 'till both legs are answered.\n");
+                                        switch_channel_set_variable(caller_channel, "bypass_media_after_bridge", "true");
+                                        switch_channel_set_variable(caller_channel, SWITCH_BYPASS_MEDIA_VARIABLE, NULL);
+                                        switch_channel_clear_flag(caller_channel, CF_PROXY_MODE);
+                                }
+                        }
+                }
+        }
+
+        if (timelimit_sec <= 0) {
+                timelimit_sec = 60;
+        }
+
+        
</ins><span class="cx">         oglobals.idx = IDX_NADA;
</span><span class="cx">         oglobals.early_ok = 1;
</span><del>-        oglobals.session = session;
</del><span class="cx">
</span><span class="cx">
</span><ins>+
</ins><span class="cx">         *bleg = NULL;
</span><span class="cx">
</span><span class="cx">         switch_zmalloc(write_frame.data, SWITCH_RECOMMENDED_BUFFER_SIZE);
</span><span class="lines">@@ -1028,7 +1303,7 @@
</span><span class="cx">                 data++;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(data)) {
</del><ins>+        if (zstr(data)) {
</ins><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "No origination URL specified!\n");
</span><span class="cx">                 status = SWITCH_STATUS_GENERR;
</span><span class="cx">                 goto done;
</span><span class="lines">@@ -1069,8 +1344,6 @@
</span><span class="cx">                 switch_event_header_t *hi;
</span><span class="cx">                 const char *cdr_total_var;
</span><span class="cx">
</span><del>-                caller_channel = switch_core_session_get_channel(oglobals.session);
-
</del><span class="cx">                 if ((cdr_total_var = switch_channel_get_variable(caller_channel, "failed_xml_cdr_total"))) {
</span><span class="cx">                         int tmp = atoi(cdr_total_var);
</span><span class="cx">                         if (tmp > 0) {
</span><span class="lines">@@ -1095,6 +1368,8 @@
</span><span class="cx">                                         ok = 1;
</span><span class="cx">                                 } else if (!strcasecmp((char *) hi->name, "ignore_early_media")) {
</span><span class="cx">                                         ok = 1;
</span><ins>+                                } else if (!strcasecmp((char *) hi->name, "originate_continue_on_timeout")) {
+                                        ok = 1;
</ins><span class="cx">                                 } else if (!strcasecmp((char *) hi->name, "ignore_ring_ready")) {
</span><span class="cx">                                         ok = 1;
</span><span class="cx">                                 } else if (!strcasecmp((char *) hi->name, "monitor_early_media_ring")) {
</span><span class="lines">@@ -1148,7 +1423,7 @@
</span><span class="cx">
</span><span class="cx">                 if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE) || switch_channel_test_flag(caller_channel, CF_PROXY_MEDIA)) {
</span><span class="cx">                         ringback_data = NULL;
</span><del>-                } else if (switch_strlen_zero(ringback_data)) {
</del><ins>+                } else if (zstr(ringback_data)) {
</ins><span class="cx">                         const char *vvar;
</span><span class="cx">                         
</span><span class="cx">                         if ((vvar = switch_channel_get_variable(caller_channel, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE))) {
</span><span class="lines">@@ -1162,9 +1437,12 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><ins>+#if 0
+        /* changing behaviour ignore_early_media=true must also be explicitly set for previous behaviour */
</ins><span class="cx">         if (ringback_data) {
</span><span class="cx">                 oglobals.early_ok = 0;
</span><span class="cx">         }
</span><ins>+#endif
</ins><span class="cx">
</span><span class="cx">         if (switch_true(switch_event_get_header(var_event, "group_confirm_cancel_timeout"))) {
</span><span class="cx">                 oglobals.cancel_timeout = -1;
</span><span class="lines">@@ -1190,11 +1468,20 @@
</span><span class="cx">                 *oglobals.file = '\0';
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if ((var_val = switch_event_get_header(var_event, "ignore_early_media")) && switch_true(var_val)) {
-                oglobals.early_ok = 0;
-                oglobals.ignore_early_media = 1;
</del><ins>+        if ((var_val = switch_event_get_header(var_event, "ignore_early_media"))) {
+                if (switch_true(var_val)) {
+                        oglobals.early_ok = 0;
+                        oglobals.ignore_early_media = 1;
+                } else if (!strcmp(var_val, "ring_ready")) {
+                        oglobals.early_ok = 0;
+                        oglobals.ignore_early_media = 2;
+                }
</ins><span class="cx">         }
</span><span class="cx">
</span><ins>+        if ((var_val = switch_event_get_header(var_event, "originate_continue_on_timeout")) && switch_true(var_val)) {
+                oglobals.continue_on_timeout = 1;
+        }
+
</ins><span class="cx">         if ((var_val = switch_event_get_header(var_event, "ignore_ring_ready")) && switch_true(var_val)) {
</span><span class="cx">                 oglobals.ignore_ring_ready = 1;
</span><span class="cx">         }
</span><span class="lines">@@ -1317,7 +1604,7 @@
</span><span class="cx">                         start = 0;
</span><span class="cx">                         read_frame = NULL;
</span><span class="cx">                         pool = NULL;
</span><del>-                        pass = 0;
</del><ins>+                        oglobals.ringback_ok = 1;
</ins><span class="cx">                         var = NULL;
</span><span class="cx">                         to = 0;
</span><span class="cx">                         oglobals.sent_ring = 0;
</span><span class="lines">@@ -1614,6 +1901,14 @@
</span><span class="cx">                                 if (originate_status[i].peer_channel) {
</span><span class="cx">                                         const char *vvar;
</span><span class="cx">                                         
</span><ins>+                                        if ((vvar = switch_channel_get_variable(originate_status[i].peer_channel, "origination_callee_id_name"))) {
+                                                switch_channel_set_profile_var(originate_status[i].peer_channel, "callee_id_name", vvar);
+                                        }
+
+                                        if ((vvar = switch_channel_get_variable(originate_status[i].peer_channel, "origination_callee_id_number"))) {
+                                                switch_channel_set_profile_var(originate_status[i].peer_channel, "callee_id_number", vvar);
+                                        }
+
</ins><span class="cx">                                         if ((vvar = switch_channel_get_variable(originate_status[i].peer_channel, "leg_timeout"))) {
</span><span class="cx">                                                 int val = atoi(vvar);
</span><span class="cx">                                                 if (val > 0) {
</span><span class="lines">@@ -1638,18 +1933,24 @@
</span><span class="cx">                                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Setting leg delay start to %d\n",
</span><span class="cx">                                                                                          switch_channel_get_name(originate_status[i].peer_channel), val);
</span><span class="cx">                                                         originate_status[i].per_channel_delay_start = (uint32_t) val;
</span><ins>+
+                                                        if (originate_status[i].per_channel_progress_timelimit_sec != 0) {
+                                                                originate_status[i].per_channel_progress_timelimit_sec += originate_status[i].per_channel_delay_start;
+                                                        }
+
+                                                        if (originate_status[i].per_channel_timelimit_sec != 0) {
+                                                                originate_status[i].per_channel_timelimit_sec += originate_status[i].per_channel_delay_start;
+                                                        }
</ins><span class="cx">                                                 }
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><span class="cx">
</span><del>-                                if (!table) {
-                                        table = &originate_state_handlers;
-                                }
-
</del><span class="cx">                                 if (table) {
</span><span class="cx">                                         switch_channel_add_state_handler(originate_status[i].peer_channel, table);
</span><span class="cx">                                 }
</span><span class="cx">
</span><ins>+                                switch_channel_add_state_handler(originate_status[i].peer_channel, &originate_state_handlers);
+
</ins><span class="cx">                                 if ((flags & SOF_NOBLOCK) && originate_status[i].peer_session) {
</span><span class="cx">                                         status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">                                         *bleg = originate_status[i].peer_session;
</span><span class="lines">@@ -1701,7 +2002,8 @@
</span><span class="cx">                                                 goto notready;
</span><span class="cx">                                         }
</span><span class="cx">
</span><del>-                                        if (!oglobals.sent_ring && !oglobals.progress && (progress_timelimit_sec && elapsed > (time_t) progress_timelimit_sec)) {
</del><ins>+                                        if (!oglobals.sent_ring && !oglobals.ignore_ring_ready &&
+                                                !oglobals.progress && (progress_timelimit_sec && elapsed > (time_t) progress_timelimit_sec)) {
</ins><span class="cx">                                                 to++;
</span><span class="cx">                                                 oglobals.idx = IDX_TIMEOUT;
</span><span class="cx">                                                 goto notready;
</span><span class="lines">@@ -1723,138 +2025,34 @@
</span><span class="cx">                 endfor1:
</span><span class="cx">
</span><span class="cx">                         if (caller_channel) {
</span><del>-                                if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE) || switch_channel_test_flag(caller_channel, CF_PROXY_MEDIA)) {
</del><ins>+                                if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE) ||
+                                        switch_channel_test_flag(caller_channel, CF_PROXY_MEDIA) || switch_channel_test_flag(caller_channel, CF_DISABLE_RINGBACK)) {
</ins><span class="cx">                                         ringback_data = NULL;
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if (ringback_data && !switch_channel_test_flag(caller_channel, CF_ANSWERED)
-                                && !switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA)) {
-                                if ((status = switch_channel_pre_answer(caller_channel)) != SWITCH_STATUS_SUCCESS) {
-                                        switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(caller_channel), SWITCH_LOG_DEBUG, "%s Media Establishment Failed.\n", switch_channel_get_name(caller_channel));
-                                        goto done;
-                                }
-                        }
-
-                        if (oglobals.session && (read_codec = switch_core_session_get_read_codec(oglobals.session)) && ringback_data) {
-                                if (switch_is_file_path(ringback_data)) {
-                                        if (!(strrchr(ringback_data, '.') || strstr(ringback_data, SWITCH_URL_SEPARATOR))) {
-                                                ringback.asis++;
-                                        }
-                                }
-                                
-                                if (!ringback.asis) {
-                                        if (!(pass = (uint8_t) switch_test_flag(read_codec, SWITCH_CODEC_FLAG_PASSTHROUGH))) {
-                                                ringback_data = NULL;
-                                                goto no_ringback;
-                                        }
-
-                                        if (switch_core_codec_init(&write_codec,
-                                                                                         "L16",
-                                                                                         NULL,
-                                                                                         read_codec->implementation->actual_samples_per_second,
-                                                                                         read_codec->implementation->microseconds_per_packet / 1000,
-                                                                                         1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
-                                                                                         switch_core_session_get_pool(oglobals.session)) == SWITCH_STATUS_SUCCESS) {
-
-
-                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(oglobals.session), SWITCH_LOG_DEBUG,
-                                                                                 "Raw Codec Activation Success L16@%uhz 1 channel %dms\n",
-                                                                                 read_codec->implementation->actual_samples_per_second,
-                                                                                 read_codec->implementation->microseconds_per_packet / 1000);
-                                                write_frame.codec = &write_codec;
-                                                write_frame.datalen = read_codec->implementation->decoded_bytes_per_packet;
-                                                write_frame.samples = write_frame.datalen / 2;
-                                                memset(write_frame.data, 255, write_frame.datalen);
-                                                switch_core_session_set_read_codec(oglobals.session, &write_codec);
-                                        } else {
-                                                switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(caller_channel), SWITCH_LOG_ERROR, "Codec Error!\n");
-                                                switch_channel_hangup(caller_channel, SWITCH_CAUSE_NORMAL_TEMPORARY_FAILURE);
-                                                read_codec = NULL;
-                                                goto done;
-                                        }
-                                }        
-
-                                if (ringback_data) {
-                                        char *tmp_data = NULL;
-
-                                        oglobals.gen_ringback = 1;
-
-                                        if (switch_is_file_path(ringback_data)) {
-                                                char *ext;
-
-                                                if (ringback.asis) {
-                                                        write_frame.codec = read_codec;
-                                                        ext = read_codec->implementation->iananame;
-                                                        tmp_data = switch_mprintf("%s.%s", ringback_data, ext);
-                                                        ringback_data = tmp_data;
-                                                }
-
-                                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(oglobals.session), SWITCH_LOG_DEBUG, "Play Ringback File [%s]\n", ringback_data);
-
-                                                ringback.fhb.channels = read_codec->implementation->number_of_channels;
-                                                ringback.fhb.samplerate = read_codec->implementation->actual_samples_per_second;
-                                                if (switch_core_file_open(&ringback.fhb,
-                                                                                                 ringback_data,
-                                                                                                 read_codec->implementation->number_of_channels,
-                                                                                                 read_codec->implementation->actual_samples_per_second,
-                                                                                                 SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL) != SWITCH_STATUS_SUCCESS) {
-                                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Playing File\n");
-                                                        switch_safe_free(tmp_data);
-                                                        goto notready;
-                                                }
-                                                ringback.fh = &ringback.fhb;
-
-                                        } else if (!strncasecmp(ringback_data, "silence", 7)) {
-                                                const char *c = ringback_data + 7;
-                                                if (*c == ':') {
-                                                        c++;
-                                                        if (c) {
-                                                                ringback.silence = atoi(c);
-                                                        }
-                                                }
-                                                if (ringback.silence <= 0) {
-                                                        ringback.silence = 400;
-                                                }
-                                        } else {
-                                                switch_buffer_create_dynamic(&ringback.audio_buffer, 512, 1024, 0);
-                                                switch_buffer_set_loops(ringback.audio_buffer, -1);
-
-                                                teletone_init_session(&ringback.ts, 0, teletone_handler, &ringback);
-                                                ringback.ts.rate = read_codec->implementation->actual_samples_per_second;
-                                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Play Ringback Tone [%s]\n", ringback_data);
-                                                /* ringback.ts.debug = 1;
-                                                 ringback.ts.debug_stream = switch_core_get_console();
-                                                */
-                                                if (teletone_run(&ringback.ts, ringback_data)) {
-                                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Playing Tone\n");
-                                                        teletone_destroy_session(&ringback.ts);
-                                                        switch_buffer_destroy(&ringback.audio_buffer);
-                                                        ringback_data = NULL;
-                                                }
-                                        }
-                                        switch_safe_free(tmp_data);
-                                }
-                        }
</del><span class="cx">                         
</span><del>-                        
-                no_ringback:
</del><span class="cx">
</span><ins>+#if 0
+                        /* changing behaviour ignore_early_media=true must also be explicitly set for previous behaviour */
</ins><span class="cx">                         if (ringback_data) {
</span><span class="cx">                                 oglobals.early_ok = 0;
</span><span class="cx">                         }
</span><ins>+#endif
</ins><span class="cx">
</span><del>-                        while ((!caller_channel || switch_channel_ready(caller_channel)) && check_channel_status(&oglobals, originate_status, and_argc)) {
</del><ins>+                        if (ringback_data) {
+                                oglobals.sending_ringback = 1;
+                        } else {
+                                oglobals.ringback_ok = 0;
+                        }
+                        
+                        while ((!caller_channel || switch_channel_ready(caller_channel) || switch_channel_test_flag(caller_channel, CF_XFER_ZOMBIE)) &&
+                                 check_channel_status(&oglobals, originate_status, and_argc)) {
</ins><span class="cx">                                 time_t elapsed = switch_epoch_time_now(NULL) - start;
</span><del>-                                if (caller_channel && !oglobals.sent_ring && oglobals.ring_ready && !oglobals.return_ring_ready) {
-                                        switch_channel_ring_ready(caller_channel);
-                                        oglobals.sent_ring = 1;
-                                }
-                                /* When the AND operator is being used, and fail_on_single_reject is set, a hangup indicates that the call should fail. */
</del><span class="cx">                                 
</span><span class="cx">                                 check_per_channel_timeouts(&oglobals, originate_status, and_argc, start);
</span><span class="cx">
</span><del>-                                if (oglobals.session && switch_core_session_private_event_count(oglobals.session)) {
</del><ins>+                                if (oglobals.session) {
</ins><span class="cx">                                         switch_ivr_parse_all_events(oglobals.session);
</span><span class="cx">                                 }
</span><span class="cx">
</span><span class="lines">@@ -1876,7 +2074,7 @@
</span><span class="cx">                                                                 continue;
</span><span class="cx">                                                         }
</span><span class="cx">                                                         pchannel = switch_core_session_get_channel(originate_status[i].peer_session);
</span><del>-
</del><ins>+                                                        
</ins><span class="cx">                                                         if (switch_channel_down(pchannel)) {
</span><span class="cx">                                                                 cause_str = switch_channel_cause2str(switch_channel_get_cause(pchannel));
</span><span class="cx">                                                                 if (switch_stristr(cause_str, fail_on_single_reject_var)) {
</span><span class="lines">@@ -1891,28 +2089,15 @@
</span><span class="cx">                                                 goto notready;
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><del>-
-                                if (originate_status[0].peer_session
-                                        && switch_core_session_dequeue_message(originate_status[0].peer_session, &message) == SWITCH_STATUS_SUCCESS) {
-                                        if (oglobals.session && !ringback_data && or_argc == 1 && and_argc == 1) {        
-                                                /* when there is only 1 channel to call and bridge and no ringback */
-                                                switch_core_session_receive_message(oglobals.session, message);
-                                        }
-
-                                        if (switch_test_flag(message, SCSMF_DYNAMIC)) {
-                                                switch_safe_free(message);
-                                        } else {
-                                                message = NULL;
-                                        }
-                                }
-
</del><ins>+                                
</ins><span class="cx">                                 /* read from the channel while we wait if the audio is up on it */
</span><span class="cx">                                 if (oglobals.session &&
</span><span class="cx">                                         !switch_channel_test_flag(caller_channel, CF_PROXY_MODE) &&
</span><span class="cx">                                         !switch_channel_test_flag(caller_channel, CF_PROXY_MEDIA) &&
</span><del>-                                        (ringback_data
</del><ins>+                                        !switch_channel_test_flag(caller_channel, CF_XFER_ZOMBIE) &&
+                                        (oglobals.ringback_ok
</ins><span class="cx">                                          || (switch_channel_test_flag(caller_channel, CF_ANSWERED) || switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA)))) {
</span><del>-
</del><ins>+                                        
</ins><span class="cx">                                         switch_status_t tstatus = SWITCH_STATUS_SUCCESS;
</span><span class="cx">                                         int silence = 0;
</span><span class="cx">
</span><span class="lines">@@ -1921,7 +2106,7 @@
</span><span class="cx">                                                         switch_dtmf_t dtmf = { 0, 0 };
</span><span class="cx">                                                         if (switch_channel_dequeue_dtmf(caller_channel, &dtmf) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                                                 if (dtmf.digit == *cancel_key) {
</span><del>-                                                                        oglobals.idx = IDX_CANCEL;
</del><ins>+                                                                        oglobals.idx = IDX_KEY_CANCEL;
</ins><span class="cx">                                                                         goto notready;
</span><span class="cx">                                                                 }
</span><span class="cx">                                                         }
</span><span class="lines">@@ -1931,13 +2116,39 @@
</span><span class="cx">                                         if (switch_channel_media_ready(caller_channel)) {
</span><span class="cx">                                                 tstatus = switch_core_session_read_frame(oglobals.session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
</span><span class="cx">                                                 if (!SWITCH_READ_ACCEPTABLE(tstatus)) {
</span><ins>+                                                        if (switch_channel_test_flag(caller_channel, CF_XFER_ZOMBIE)) {
+                                                                continue;
+                                                        }
</ins><span class="cx">                                                         break;
</span><span class="cx">                                                 }
</span><span class="cx">                                         } else {
</span><span class="cx">                                                 read_frame = NULL;
</span><span class="cx">                                         }
</span><span class="cx">                                         
</span><del>-                                        if ((oglobals.ring_ready || oglobals.instant_ringback) && read_frame && !pass) {
</del><ins>+                                        if (oglobals.ringback_ok && (oglobals.ring_ready || oglobals.instant_ringback || oglobals.sending_ringback > 1)) {
+                                                if (oglobals.ringback_ok == 1) {
+                                                        switch_status_t rst = setup_ringback(&oglobals, ringback_data, &ringback, &write_frame, &write_codec);
+
+                                                        switch (rst) {
+                                                        case SWITCH_STATUS_SUCCESS:
+                                                                oglobals.ringback_ok++;
+                                                                break;
+                                                        case SWITCH_STATUS_FALSE:
+                                                                goto notready;
+                                                                break;
+                                                        case SWITCH_STATUS_BREAK:
+                                                                goto done;
+                                                                break;
+                                                        default:
+                                                                ringback_data = NULL;
+                                                                oglobals.ringback_ok = 0;
+                                                                oglobals.sending_ringback = 0;
+                                                                break;
+                                                        }
+
+                                                        continue;
+                                                }
+                                                        
</ins><span class="cx">                                                 if (ringback.fh) {
</span><span class="cx">                                                         switch_size_t mlen, olen;
</span><span class="cx">                                                         unsigned int pos = 0;
</span><span class="lines">@@ -1986,6 +2197,9 @@
</span><span class="cx">                                                 }
</span><span class="cx">                                                 
</span><span class="cx">                                                 if (switch_core_session_write_frame(oglobals.session, &write_frame, SWITCH_IO_FLAG_NONE, 0) != SWITCH_STATUS_SUCCESS) {
</span><ins>+                                                        if (switch_channel_test_flag(caller_channel, CF_XFER_ZOMBIE)) {
+                                                                continue;
+                                                        }
</ins><span class="cx">                                                         break;
</span><span class="cx">                                                 }
</span><span class="cx">                                         }
</span><span class="lines">@@ -1998,7 +2212,18 @@
</span><span class="cx">
</span><span class="cx">                  notready:
</span><span class="cx">
</span><del>-                        if (caller_channel && !switch_channel_ready(caller_channel)) {
</del><ins>+                        if (caller_channel) {
+                                const char *soft_holding = switch_channel_get_variable(caller_channel, SWITCH_SOFT_HOLDING_UUID_VARIABLE);
+                                holding = switch_channel_get_variable(caller_channel, SWITCH_HOLDING_UUID_VARIABLE);
+                                switch_channel_set_variable(caller_channel, SWITCH_HOLDING_UUID_VARIABLE, NULL);
+
+                                if (soft_holding && switch_channel_test_flag(caller_channel, CF_XFER_ZOMBIE)) {
+                                        holding = soft_holding;
+                                        switch_channel_set_variable(caller_channel, SWITCH_SOFT_HOLDING_UUID_VARIABLE, NULL);
+                                }
+                        }
+                        
+                        if (caller_channel && !switch_channel_ready(caller_channel) && !switch_channel_test_flag(caller_channel, CF_XFER_ZOMBIE)) {
</ins><span class="cx">                                 oglobals.idx = IDX_CANCEL;
</span><span class="cx">                         }
</span><span class="cx">
</span><span class="lines">@@ -2007,24 +2232,145 @@
</span><span class="cx">                                 switch_core_session_reset(oglobals.session, SWITCH_FALSE, SWITCH_TRUE);
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        for (i = 0; i < and_argc; i++) {
-                                if (!originate_status[i].peer_channel) {
-                                        continue;
</del><ins>+                        if (holding) {
+                                if (oglobals.idx > IDX_NADA) {
+                                        peer_session = originate_status[oglobals.idx].peer_session;
+                                        peer_channel = originate_status[oglobals.idx].peer_channel;
+                                        originate_status[oglobals.idx].peer_channel = NULL;
+                                } else if (and_argc == 1) {
+                                        peer_session = originate_status[0].peer_session;
+                                        peer_channel = originate_status[0].peer_channel;
+                                        originate_status[0].peer_channel = NULL;
+                                } else {
+                                        for (i = 0; i < and_argc; i++) {
+                                                if (!peer_eligible(originate_status[i].peer_channel)) {
+                                                        continue;
+                                                }
+                                                if (switch_channel_media_ready(originate_status[i].peer_channel)) {
+                                                        peer_session = originate_status[i].peer_session;
+                                                        peer_channel = originate_status[i].peer_channel;
+                                                        originate_status[i].peer_channel = NULL;
+                                                        goto end_search;
+                                                }
+                                        }
+                                        for (i = 0; i < and_argc; i++) {
+                                                if (!peer_eligible(originate_status[i].peer_channel)) {
+                                                        continue;
+                                                }
+                                                if (switch_channel_up(originate_status[i].peer_channel)) {
+                                                        peer_session = originate_status[i].peer_session;
+                                                        peer_channel = originate_status[i].peer_channel;
+                                                        originate_status[i].peer_channel = NULL;
+                                                        break;
+                                                }
+                                        }
</ins><span class="cx">                                 }
</span><ins>+                                
+                        end_search:
</ins><span class="cx">
</span><del>-                                //switch_channel_clear_flag(originate_status[i].peer_channel, CF_BLOCK_STATE);
</del><ins>+                                if (peer_channel && switch_channel_down(peer_channel)) {
+                                        switch_core_session_rwunlock(peer_session);
+                                        peer_session = NULL;
+                                        peer_channel = NULL;
</ins><span class="cx">
</span><del>-                                if (switch_channel_test_flag(originate_status[i].peer_channel, CF_TRANSFER)
-                                        || switch_channel_test_flag(originate_status[i].peer_channel, CF_REDIRECT)
-                                        || switch_channel_test_flag(originate_status[i].peer_channel, CF_BRIDGED) ||
-                                        switch_channel_get_state(originate_status[i].peer_channel) == CS_RESET ||
-                                        !switch_channel_test_flag(originate_status[i].peer_channel, CF_ORIGINATING)
-                                        ) {
</del><ins>+                                }
+                                
+                                if (oglobals.idx == IDX_TIMEOUT || to || oglobals.idx == IDX_KEY_CANCEL || oglobals.idx == IDX_CANCEL ||
+                                        (!peer_session && oglobals.idx == IDX_NADA)) {
+                                        const char *dest = NULL;
+                                        const char *context = NULL;
+                                        const char *dialplan = NULL;
+                                        switch_core_session_t *holding_session;
+                                        
+                                        if (caller_channel) {
+                                                if (zstr(context)) {
+                                                        context = switch_channel_get_variable(caller_channel, "context");
+                                                }
+                                                if (zstr(dialplan)) {
+                                                        dialplan = switch_channel_get_variable(caller_channel, "dialplan");
+                                                }
+                                        }
+                                        
+                                        if (zstr(context)) {
+                                                context = "default";
+                                        }
+
+                                        if (zstr(context)) {
+                                                dialplan = "XML";
+                                        }
+
+                                        if ((holding_session = switch_core_session_locate(holding))) {
+                                                switch_channel_t *holding_channel = switch_core_session_get_channel(holding_session);
+                                                switch_status_t mstatus = SWITCH_STATUS_FALSE;
+                                                
+                                                if (caller_channel) {
+                                                        if ((mstatus = switch_channel_caller_extension_masquerade(caller_channel, holding_channel, 1)) == SWITCH_STATUS_SUCCESS) {
+                                                                switch_channel_restart(holding_channel);
+                                                        }
+                                                }
+
+                                                if (mstatus != SWITCH_STATUS_SUCCESS) {
+                                                        if (peer_channel) {
+                                                                dest = switch_channel_get_variable(peer_channel, "destination_number");
+                                                                context = switch_channel_get_variable(peer_channel, "context");
+                                                                dialplan = switch_channel_get_variable(peer_channel, "dialplan");
+                                                        } else if (caller_channel) {
+                                                                dest = switch_channel_get_variable(caller_channel, "destination_number");
+                                                        }
+                                                        if (dest) {
+                                                                switch_ivr_session_transfer(holding_session, dest, dialplan, context);
+                                                        }
+                                                }
+
+                                                switch_core_session_rwunlock(holding_session);
+                                                holding = NULL;
+                                                holding_session = NULL;
+                                        }
+
+                                        if (peer_channel) {
+                                                switch_channel_hangup(peer_channel, SWITCH_CAUSE_ATTENDED_TRANSFER);
+                                                switch_core_session_rwunlock(peer_session);
+                                        }
+                                        force_reason = SWITCH_CAUSE_ATTENDED_TRANSFER;
+                                } else {
+                                        if (peer_channel && switch_channel_ready(peer_channel)) {
+                                                force_reason = SWITCH_CAUSE_ATTENDED_TRANSFER;
+                                                switch_ivr_uuid_bridge(holding, switch_core_session_get_uuid(peer_session));
+                                                oglobals.idx = IDX_NADA;
+                                                if (caller_channel && switch_channel_up(caller_channel)) {
+                                                        switch_channel_hangup(caller_channel, SWITCH_CAUSE_ATTENDED_TRANSFER);
+                                                }
+                                                caller_channel = NULL;
+                                                oglobals.session = NULL;
+                                                session = NULL;
+                                                switch_core_session_rwunlock(peer_session);
+                                        } else {
+                                                switch_core_session_t *holding_session;
+
+                                                if ((holding_session = switch_core_session_locate(holding))) {
+                                                        switch_channel_t *holding_channel = switch_core_session_get_channel(holding_session);
+                                                        if (caller_channel && switch_channel_ready(caller_channel)) {
+                                                                switch_ivr_uuid_bridge(holding, switch_core_session_get_uuid(session));
+                                                        } else {
+                                                                switch_channel_hangup(holding_channel, SWITCH_CAUSE_NORMAL_UNSPECIFIED);
+                                                        }
+                                                        switch_core_session_rwunlock(holding_session);
+                                                }
+                                        }
+                                }
+
+                                peer_session = NULL;
+                                peer_channel = NULL;
+                                
+                        }
+                        
+                        for (i = 0; i < and_argc; i++) {
+                                if (!peer_eligible(originate_status[i].peer_channel)) {
</ins><span class="cx">                                         continue;
</span><span class="cx">                                 }
</span><del>-
</del><ins>+                                
</ins><span class="cx">                                 if (i != oglobals.idx) {
</span><del>-                                        const char *holding = NULL;
</del><ins>+                                        holding = NULL;
</ins><span class="cx">
</span><span class="cx">                                         if (oglobals.idx == IDX_TIMEOUT || to) {
</span><span class="cx">                                                 reason = SWITCH_CAUSE_NO_ANSWER;
</span><span class="lines">@@ -2041,19 +2387,19 @@
</span><span class="cx">                                         }
</span><span class="cx">                                         if (switch_channel_up(originate_status[i].peer_channel)) {
</span><span class="cx">                                                 if (caller_channel && i == 0) {
</span><del>-                                                        holding = switch_channel_get_variable(caller_channel, SWITCH_HOLDING_UUID_VARIABLE);
-                                                        switch_channel_set_variable(caller_channel, SWITCH_HOLDING_UUID_VARIABLE, NULL);
-                                                }
-                                                if (holding && oglobals.idx != IDX_TIMEOUT && oglobals.idx != IDX_CANCEL) {
-                                                        switch_ivr_uuid_bridge(holding, switch_core_session_get_uuid(originate_status[i].peer_session));
-                                                } else {
</del><ins>+ holding = switch_channel_get_variable(caller_channel, SWITCH_SOFT_HOLDING_UUID_VARIABLE);
+ switch_channel_set_variable(caller_channel, SWITCH_SOFT_HOLDING_UUID_VARIABLE, NULL);
+ }
+                                                
+                                                if (holding && oglobals.idx != IDX_TIMEOUT && oglobals.idx != IDX_KEY_CANCEL) {
+ switch_ivr_uuid_bridge(holding, switch_core_session_get_uuid(originate_status[i].peer_session));
+ } else {
</ins><span class="cx">                                                         switch_channel_hangup(originate_status[i].peer_channel, reason);
</span><span class="cx">                                                 }
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><del>-
-
</del><ins>+                        
</ins><span class="cx">                         if (oglobals.idx > IDX_NADA) {
</span><span class="cx">                                 peer_session = originate_status[oglobals.idx].peer_session;
</span><span class="cx">                                 peer_channel = originate_status[oglobals.idx].peer_channel;
</span><span class="lines">@@ -2068,6 +2414,7 @@
</span><span class="cx">
</span><span class="cx">                         if (caller_channel) {
</span><span class="cx">                                 if (switch_channel_test_flag(peer_channel, CF_ANSWERED)) {
</span><ins>+                                        switch_channel_pass_callee_id(peer_channel, caller_channel);
</ins><span class="cx">                                         status = switch_channel_answer(caller_channel);
</span><span class="cx">                                 } else if (switch_channel_test_flag(peer_channel, CF_EARLY_MEDIA)) {
</span><span class="cx">                                         status = switch_channel_pre_answer(caller_channel);
</span><span class="lines">@@ -2076,7 +2423,8 @@
</span><span class="cx">                                 }
</span><span class="cx">
</span><span class="cx">                                 if (status != SWITCH_STATUS_SUCCESS) {
</span><del>-                                        switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(peer_channel), SWITCH_LOG_DEBUG, "%s Media Establishment Failed.\n", switch_channel_get_name(caller_channel));
</del><ins>+                                        switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(peer_channel), SWITCH_LOG_DEBUG, "%s Media Establishment Failed.\n",
+                                                                         switch_channel_get_name(caller_channel));
</ins><span class="cx">                                         switch_channel_hangup(peer_channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION);
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="lines">@@ -2112,7 +2460,8 @@
</span><span class="cx">                                                 switch_process_import(oglobals.session, peer_channel, "import");
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><del>-                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(oglobals.session), SWITCH_LOG_DEBUG, "Originate Resulted in Success: [%s]\n", switch_channel_get_name(peer_channel));
</del><ins>+                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(oglobals.session), SWITCH_LOG_DEBUG, "Originate Resulted in Success: [%s]\n",
+                                                                 switch_channel_get_name(peer_channel));
</ins><span class="cx">                                 *cause = SWITCH_CAUSE_SUCCESS;
</span><span class="cx">
</span><span class="cx">                         } else {
</span><span class="lines">@@ -2188,6 +2537,8 @@
</span><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(oglobals.session), SWITCH_LOG_DEBUG,
</span><span class="cx">                                                                          "Originate Cancelled by originator termination Cause: %d [%s]\n", *cause, switch_channel_cause2str(*cause));
</span><span class="cx">
</span><ins>+                                } else if (oglobals.idx == IDX_TIMEOUT) {
+                                        *cause = SWITCH_CAUSE_NO_ANSWER;
</ins><span class="cx">                                 } else {
</span><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(oglobals.session), SWITCH_LOG_DEBUG,
</span><span class="cx">                                                                          "Originate Resulted in Error Cause: %d [%s]\n", *cause, switch_channel_cause2str(*cause));
</span><span class="lines">@@ -2264,9 +2615,13 @@
</span><span class="cx">                                                 }
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><del>-                                if (!ok) {
</del><ins>+                                if (ok) {
</ins><span class="cx">                                         goto outer_for;
</span><span class="cx">                                 }
</span><ins>+
+                                if (to && !oglobals.continue_on_timeout) {
+                                        goto outer_for;
+                                }
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -2302,7 +2657,16 @@
</span><span class="cx">
</span><span class="cx">         switch_safe_free(write_frame.data);
</span><span class="cx">         switch_safe_free(fail_on_single_reject_var);
</span><ins>+        
+        if (caller_channel) {
+                switch_channel_clear_flag(caller_channel, CF_ORIGINATOR);
+                switch_channel_clear_flag(caller_channel, CF_XFER_ZOMBIE);
+        }
</ins><span class="cx">
</span><ins>+        if (force_reason != SWITCH_CAUSE_NONE) {
+                *cause = force_reason;
+        }
+
</ins><span class="cx">         return status;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_ivr_play_sayc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_play_say.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_play_say.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_ivr_play_say.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -274,6 +274,9 @@
</span><span class="cx">
</span><span class="cx">                                         if (!strcasecmp(func, "play-file")) {
</span><span class="cx">                                                 status = switch_ivr_play_file(session, NULL, odata, args);
</span><ins>+                                        } else if (!strcasecmp(func, "phrase")) {
+                                                char *name = (char *) switch_xml_attr_soft(action, "phrase");
+                                                status = switch_ivr_phrase_macro(session, name, odata, chan_lang, args);
</ins><span class="cx">                                         } else if (!strcasecmp(func, "break")) {
</span><span class="cx">                                                 done = 1;
</span><span class="cx">                                                 /* must allow the switch_safe_free below to execute or we leak - do not break here */
</span><span class="lines">@@ -324,7 +327,7 @@
</span><span class="cx">                                                 if (!my_tts_voice) {
</span><span class="cx">                                                         my_tts_voice = tts_voice;
</span><span class="cx">                                                 }
</span><del>-                                                if (switch_strlen_zero(tts_engine) || switch_strlen_zero(tts_voice)) {
</del><ins>+                                                if (zstr(tts_engine) || zstr(tts_voice)) {
</ins><span class="cx">                                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "TTS is not configured\n");
</span><span class="cx">                                                 } else {
</span><span class="cx">                                                         status = switch_ivr_speak_text(session, my_tts_engine, my_tts_voice, odata, args);
</span><span class="lines">@@ -401,7 +404,7 @@
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_channel_pre_answer(channel) != SWITCH_STATUS_SUCCESS) {
</del><ins>+        if (switch_channel_answer(channel) != SWITCH_STATUS_SUCCESS) {
</ins><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="lines">@@ -480,7 +483,7 @@
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                         
</span><del>-                        file = switch_core_session_sprintf(session, "%s%s%s%s", switch_str_nil(tfile), tfile ? "]" : "", prefix, SWITCH_PATH_SEPARATOR, file);
</del><ins>+                        file = switch_core_session_sprintf(session, "%s%s%s%s%s", switch_str_nil(tfile), tfile ? "]" : "", prefix, SWITCH_PATH_SEPARATOR, file);
</ins><span class="cx">                 }
</span><span class="cx">                 if ((ext = strrchr(file, '.'))) {
</span><span class="cx">                         ext++;
</span><span class="lines">@@ -510,10 +513,6 @@
</span><span class="cx">                 asis = 1;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_channel_pre_answer(channel) != SWITCH_STATUS_SUCCESS) {
-                return SWITCH_STATUS_FALSE;
-        }
-
</del><span class="cx">         if ((p = switch_channel_get_variable(channel, "RECORD_TITLE"))) {
</span><span class="cx">                 vval = switch_core_session_strdup(session, p);
</span><span class="cx">                 switch_core_file_set_string(fh, SWITCH_AUDIO_COL_STR_TITLE, vval);
</span><span class="lines">@@ -609,9 +608,7 @@
</span><span class="cx">                         break;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_core_session_private_event_count(session)) {
-                        switch_ivr_parse_all_events(session);
-                }
</del><ins>+                switch_ivr_parse_all_events(session);
</ins><span class="cx">
</span><span class="cx">                 if (start && (switch_epoch_time_now(NULL) - start) > limit) {
</span><span class="cx">                         break;
</span><span class="lines">@@ -714,10 +711,16 @@
</span><span class="cx">                 switch_core_codec_destroy(&write_codec);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        switch_channel_set_variable_printf(channel, "record_ms", "%d", fh->samples_in / read_impl.samples_per_second);
-        switch_channel_set_variable_printf(channel, "record_samples", "%d", fh->samples_in);
</del><ins>+        switch_core_file_close(fh);
</ins><span class="cx">
</span><del>-        switch_core_file_close(fh);
</del><ins>+        if (read_impl.samples_per_second) {
+                switch_channel_set_variable_printf(channel, "record_seconds", "%d", fh->samples_out / read_impl.samples_per_second);
+                switch_channel_set_variable_printf(channel, "record_ms", "%d", fh->samples_out / (read_impl.samples_per_second / 1000));
+
+        }
+
+        switch_channel_set_variable_printf(channel, "record_samples", "%d", fh->samples_out);
+
</ins><span class="cx">         switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE);
</span><span class="cx">         return status;
</span><span class="cx"> }
</span><span class="lines">@@ -800,9 +803,7 @@
</span><span class="cx">                         break;
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (switch_core_session_private_event_count(session)) {
- switch_ivr_parse_all_events(session);
- }
</del><ins>+                switch_ivr_parse_all_events(session);
</ins><span class="cx">
</span><span class="cx">                 if (args && (args->input_callback || args->buf || args->buflen)) {
</span><span class="cx">                         /*
</span><span class="lines">@@ -919,7 +920,7 @@
</span><span class="cx">         prefix = switch_channel_get_variable(channel, "sound_prefix");
</span><span class="cx">         timer_name = switch_channel_get_variable(channel, "timer_name");
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(file) || !switch_channel_media_ready(channel)) {
</del><ins>+        if (zstr(file) || !switch_channel_media_ready(channel)) {
</ins><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -977,21 +978,21 @@
</span><span class="cx">                                 dup = switch_core_session_strdup(session, alt);
</span><span class="cx">                                 engine = dup;
</span><span class="cx">
</span><del>-                                if (!switch_strlen_zero(engine)) {
</del><ins>+                                if (!zstr(engine)) {
</ins><span class="cx">                                         if ((voice = strchr(engine, ':'))) {
</span><span class="cx">                                                 *voice++ = '\0';
</span><del>-                                                if (!switch_strlen_zero(voice) && (text = strchr(voice, ':'))) {
</del><ins>+                                                if (!zstr(voice) && (text = strchr(voice, ':'))) {
</ins><span class="cx">                                                         *text++ = '\0';
</span><span class="cx">                                                 }
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><span class="cx">
</span><del>-                                if (!switch_strlen_zero(engine) && !switch_strlen_zero(voice) && !switch_strlen_zero(text)) {
</del><ins>+                                if (!zstr(engine) && !zstr(voice) && !zstr(text)) {
</ins><span class="cx">                                         if ((status = switch_ivr_speak_text(session, engine, voice, text, args)) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                                 return status;
</span><span class="cx">                                         }
</span><span class="cx">                                         continue;
</span><del>-                                } else if (!switch_strlen_zero(engine) && !(voice && text)) {
</del><ins>+                                } else if (!zstr(engine) && !(voice && text)) {
</ins><span class="cx">                                         text = engine;
</span><span class="cx">                                         engine = (char *) switch_channel_get_variable(channel, "tts_engine");
</span><span class="cx">                                         voice = (char *) switch_channel_get_variable(channel, "tts_voice");
</span><span class="lines">@@ -1131,7 +1132,7 @@
</span><span class="cx">                                                                                  codec_name,
</span><span class="cx">                                                                                  NULL,
</span><span class="cx">                                                                                  fh->samplerate,
</span><del>-                                                                                 interval, fh->channels, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, pool) == SWITCH_STATUS_SUCCESS) {
</del><ins>+                                                                                 interval, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, pool) == SWITCH_STATUS_SUCCESS) {
</ins><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session),
</span><span class="cx">                                                                          SWITCH_LOG_DEBUG, "Codec Activated %s@%uhz %u channels %dms\n", codec_name, fh->samplerate, fh->channels, interval);
</span><span class="cx">                                 
</span><span class="lines">@@ -1190,9 +1191,7 @@
</span><span class="cx">                                 break;
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if (switch_core_session_private_event_count(session)) {
-                                switch_ivr_parse_all_events(session);
-                        }
</del><ins>+                        switch_ivr_parse_all_events(session);
</ins><span class="cx">
</span><span class="cx">                         if (args && (args->input_callback || args->buf || args->buflen)) {
</span><span class="cx">                                 /*
</span><span class="lines">@@ -1428,7 +1427,12 @@
</span><span class="cx">
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "done playing file\n");
</span><span class="cx">                 
</span><del>-                if (read_impl.samples_per_second) switch_channel_set_variable_printf(channel, "playback_ms", "%d", fh->samples_out / read_impl.samples_per_second);
</del><ins>+                if (read_impl.samples_per_second) {
+                        switch_channel_set_variable_printf(channel, "playback_seconds",
+                                                                                         "%d", fh->samples_out / read_impl.samples_per_second);
+                        switch_channel_set_variable_printf(channel, "playback_ms",
+                                                                                         "%d", fh->samples_out / (read_impl.samples_per_second / 1000) );
+                }
</ins><span class="cx">                 switch_channel_set_variable_printf(channel, "playback_samples", "%d", fh->samples_out);
</span><span class="cx">
</span><span class="cx">                 switch_core_file_close(fh);
</span><span class="lines">@@ -1631,7 +1635,7 @@
</span><span class="cx">         args.buf = digit_buffer;
</span><span class="cx">         args.buflen = (uint32_t) digit_buffer_length;
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(prompt_audio_file) && strcasecmp(prompt_audio_file, "silence")) {
</del><ins>+        if (!zstr(prompt_audio_file) && strcasecmp(prompt_audio_file, "silence")) {
</ins><span class="cx">                 if ((status = switch_ivr_play_file(session, NULL, prompt_audio_file, &args)) == SWITCH_STATUS_BREAK) {
</span><span class="cx">                         status = SWITCH_STATUS_SUCCESS;
</span><span class="cx">                 }
</span><span class="lines">@@ -1678,7 +1682,7 @@
</span><span class="cx">                 *digit_buffer = '\0';
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (var_name && !switch_strlen_zero(digit_buffer)) {
</del><ins>+        if (var_name && !zstr(digit_buffer)) {
</ins><span class="cx">                 switch_channel_set_variable(channel, var_name, digit_buffer);
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1713,8 +1717,8 @@
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 if (status == SWITCH_STATUS_SUCCESS) {
</span><del>-                        if (!switch_strlen_zero(digit_buffer)) {
-                                if (switch_strlen_zero(digits_regex)) {
</del><ins>+                        if (!zstr(digit_buffer)) {
+                                if (zstr(digits_regex)) {
</ins><span class="cx">                                         return SWITCH_STATUS_SUCCESS;
</span><span class="cx">                                 }
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Test Regex [%s][%s]\n", digit_buffer, digits_regex);
</span><span class="lines">@@ -2209,7 +2213,7 @@
</span><span class="cx">                                 moh = switch_channel_get_variable(other_channel, "hold_music");
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if (!switch_strlen_zero(moh) && strcasecmp(moh, "silence") && !switch_channel_test_flag(other_channel, CF_BROADCAST)) {
</del><ins>+                        if (!zstr(moh) && strcasecmp(moh, "silence") && !switch_channel_test_flag(other_channel, CF_BROADCAST)) {
</ins><span class="cx">                                 switch_ivr_broadcast(other_uuid, moh, SMF_ECHO_ALEG | SMF_LOOP);
</span><span class="cx">                                 moh_br++;
</span><span class="cx">                         }
</span><span class="lines">@@ -2220,7 +2224,7 @@
</span><span class="cx">                                 moh = switch_channel_get_variable(channel, "hold_music");
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if (!switch_strlen_zero(moh) && strcasecmp(moh, "silence")) {
</del><ins>+                        if (!zstr(moh) && strcasecmp(moh, "silence")) {
</ins><span class="cx">                                 switch_ivr_play_file(session, NULL, moh, &args);
</span><span class="cx">                         } else {
</span><span class="cx">                                 switch_ivr_collect_digits_callback(session, &args, 0, 0);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_loadable_modulec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_loadable_module.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_loadable_module.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_loadable_module.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -960,7 +960,7 @@
</span><span class="cx"> {
</span><span class="cx">         switch_status_t status;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(mod)) {
</del><ins>+        if (zstr(mod)) {
</ins><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1166,7 +1166,7 @@
</span><span class="cx">                                 switch_bool_t global = SWITCH_FALSE;
</span><span class="cx">                                 const char *val = switch_xml_attr_soft(ld, "module");
</span><span class="cx">                                 const char *sglobal = switch_xml_attr_soft(ld, "global");
</span><del>-                                if (switch_strlen_zero(val) || (strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT))) {
</del><ins>+                                if (zstr(val) || (strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT))) {
</ins><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Invalid extension for %s\n", val);
</span><span class="cx">                                         continue;
</span><span class="cx">                                 }
</span><span class="lines">@@ -1189,7 +1189,7 @@
</span><span class="cx">                                 switch_bool_t global = SWITCH_FALSE;
</span><span class="cx">                                 const char *val = switch_xml_attr_soft(ld, "module");
</span><span class="cx">                                 const char *sglobal = switch_xml_attr_soft(ld, "global");
</span><del>-                                if (switch_strlen_zero(val) || (strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT))) {
</del><ins>+                                if (zstr(val) || (strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT))) {
</ins><span class="cx">                                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Invalid extension for %s\n", val);
</span><span class="cx">                                         continue;
</span><span class="cx">                                 }
</span><span class="lines">@@ -1230,7 +1230,7 @@
</span><span class="cx">                                 continue;
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if (switch_strlen_zero(fname) || (!strstr(fname, ext) && !strstr(fname, EXT))) {
</del><ins>+                        if (zstr(fname) || (!strstr(fname, ext) && !strstr(fname, EXT))) {
</ins><span class="cx">                                 continue;
</span><span class="cx">                         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_logc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_log.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_log.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_log.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -103,12 +103,12 @@
</span><span class="cx">         
</span><span class="cx">         *newnode = *node;
</span><span class="cx">         
</span><del>-        if (!switch_strlen_zero(node->data)) {
</del><ins>+        if (!zstr(node->data)) {
</ins><span class="cx">                 newnode->data = strdup(node->data);        
</span><span class="cx">                 switch_assert(node->data);
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        if (!switch_strlen_zero(node->userdata)) {
</del><ins>+        if (!zstr(node->userdata)) {
</ins><span class="cx">                 newnode->userdata = strdup(node->userdata);
</span><span class="cx">                 switch_assert(node->userdata);
</span><span class="cx">         }
</span><span class="lines">@@ -398,7 +398,7 @@
</span><span class="cx">                         switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Log-Function", funcp);
</span><span class="cx">                         switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-Line", "%d", line);
</span><span class="cx">                         switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-Level", "%d", (int) level);
</span><del>-                        if (!switch_strlen_zero(userdata)) {
</del><ins>+                        if (!zstr(userdata)) {
</ins><span class="cx">                                 switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "User-Data", userdata);
</span><span class="cx">                         }
</span><span class="cx">                         switch_event_fire(&event);
</span><span class="lines">@@ -458,7 +458,7 @@
</span><span class="cx">                 node->content = content;
</span><span class="cx">                 node->timestamp = now;
</span><span class="cx">                 node->channel = channel;
</span><del>-                node->userdata = !switch_strlen_zero(userdata) ? strdup(userdata) : NULL;
</del><ins>+                node->userdata = !zstr(userdata) ? strdup(userdata) : NULL;
</ins><span class="cx">
</span><span class="cx">                 if (switch_queue_trypush(LOG_QUEUE, node) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                         switch_log_node_free(&node);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_natc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_nat.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_nat.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_nat.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">         if (UPNP_GetExternalIPAddress(nat_globals.urls.controlURL,
</span><span class="cx">                                                                  nat_globals.data.servicetype,
</span><span class="cx">                                                                  pub_addr) == UPNPCOMMAND_SUCCESS) {
</span><del>-                if (!strcmp(pub_addr, "0.0.0.0") || switch_strlen_zero_buf(pub_addr)) {
</del><ins>+                if (!strcmp(pub_addr, "0.0.0.0") || zstr_buf(pub_addr)) {
</ins><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
</span><span class="cx">                                                          "uPNP Device (url: %s) returned an invalid external address of '%s'. Disabling uPNP\n", nat_globals.urls.controlURL, pub_addr);
</span><span class="cx">                         return SWITCH_STATUS_GENERR;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_odbcc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_odbc.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_odbc.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_odbc.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -524,7 +524,7 @@
</span><span class="cx">         
</span><span class="cx">         if (stmt) {
</span><span class="cx">                 err_str = switch_odbc_handle_get_error(handle, stmt);
</span><del>-                if (!switch_strlen_zero(err_str)) {
</del><ins>+                if (!zstr(err_str)) {
</ins><span class="cx">                         switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_ERROR, "ERR: [%s]\n[%s]\n", sql, switch_str_nil(err_str));
</span><span class="cx">                 }
</span><span class="cx">                 switch_safe_free(err_str);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_pcmc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_pcm.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_pcm.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_pcm.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -515,24 +515,33 @@
</span><span class="cx">                 
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        switch_core_codec_add_implementation(pool, codec_interface,
-                                                                                 SWITCH_CODEC_TYPE_AUDIO,        /* enumeration defining the type of the codec */
-                                                                                 118,                                                 /* the IANA code number */
-                                                                                 "L16",                                                /* the IANA code name */
-                                                                                 NULL,                                                /* default fmtp to send (can be overridden by the init function) */
-                                                                                 48000,                                                /* samples transferred per second */
-                                                                                 48000,                                                /* actual samples transferred per second */
-                                                                                 768000,                                        /* bits transferred per second */
-                                                                                 20000,                                                /* number of microseconds per frame */
-                                                                                 960,                                                /* number of samples per frame */
-                                                                                 1920,                                                /* number of bytes per frame decompressed */
-                                                                                 1920,                                                /* number of bytes per frame compressed */
-                                                                                 1,                                                        /* number of channels represented */
-                                                                                 1,                                                        /* number of frames per network packet */
-                                                                                 switch_raw_init,                        /* function to initialize a codec handle using this implementation */
-                                                                                 switch_raw_encode,                        /* function to encode raw data into encoded data */
-                                                                                 switch_raw_decode,                        /* function to decode encoded data into raw data */
-                                                                                 switch_raw_destroy);                /* deinitalize a codec handle using this implementation */
</del><ins>+        samples_per_frame = 960;
+        bytes_per_frame = 1920;
+        ms_per_frame = 20000;
+        /* 10ms is already registered */
+        for (x = 0; x < 3; x++) {
+                switch_core_codec_add_implementation(pool, codec_interface,
+                                                                                         SWITCH_CODEC_TYPE_AUDIO,        /* enumeration defining the type of the codec */
+                                                                                         118,                                                 /* the IANA code number */
+                                                                                         "L16",                                                /* the IANA code name */
+                                                                                         NULL,                                                /* default fmtp to send (can be overridden by the init function) */
+                                                                                         48000,                                                /* samples transferred per second */
+                                                                                         48000,                                                /* actual samples transferred per second */
+                                                                                         768000,                                        /* bits transferred per second */
+                                                                                         ms_per_frame,                                /* number of microseconds per frame */
+                                                                                         samples_per_frame,                        /* number of samples per frame */
+                                                                                         bytes_per_frame,                        /* number of bytes per frame decompressed */
+                                                                                         bytes_per_frame,                        /* number of bytes per frame compressed */
+                                                                                         1,                                                        /* number of channels represented */
+                                                                                         1,                                                        /* number of frames per network packet */
+                                                                                         switch_raw_init,                        /* function to initialize a codec handle using this implementation */
+                                                                                         switch_raw_encode,                        /* function to encode raw data into encoded data */
+                                                                                         switch_raw_decode,                        /* function to decode encoded data into raw data */
+                                                                                         switch_raw_destroy);                /* deinitalize a codec handle using this implementation */
+                samples_per_frame += 480;
+                bytes_per_frame += 960;
+                ms_per_frame += 10000;
+        }
</ins><span class="cx">
</span><span class="cx">         switch_core_codec_add_implementation(pool, codec_interface,
</span><span class="cx">                                                                                  SWITCH_CODEC_TYPE_AUDIO,        /* enumeration defining the type of the codec */
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_rtpc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_rtp.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_rtp.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_rtp.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -765,7 +765,7 @@
</span><span class="cx">
</span><span class="cx">         *err = NULL;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(host) || !port) {
</del><ins>+        if (zstr(host) || !port) {
</ins><span class="cx">                 *err = "Address Error";
</span><span class="cx">                 goto done;
</span><span class="cx">         }
</span><span class="lines">@@ -869,7 +869,7 @@
</span><span class="cx">
</span><span class="cx"> SWITCH_DECLARE(char *) switch_rtp_get_remote_host(switch_rtp_t *rtp_session)
</span><span class="cx"> {
</span><del>-        return switch_strlen_zero(rtp_session->remote_host_str) ? "0.0.0.0" : rtp_session->remote_host_str;
</del><ins>+        return zstr(rtp_session->remote_host_str) ? "0.0.0.0" : rtp_session->remote_host_str;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SWITCH_DECLARE(switch_port_t) switch_rtp_get_remote_port(switch_rtp_t *rtp_session)
</span><span class="lines">@@ -1138,15 +1138,15 @@
</span><span class="cx">         switch_rtp_set_interval(rtp_session, ms_per_packet, samples_per_interval);
</span><span class="cx">         rtp_session->conf_samples_per_interval = samples_per_interval;
</span><span class="cx">
</span><del>-        if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER) && switch_strlen_zero(timer_name)) {
</del><ins>+        if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER) && zstr(timer_name)) {
</ins><span class="cx">                 timer_name = "soft";
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(timer_name) && !strcasecmp(timer_name, "none")) {
</del><ins>+        if (!zstr(timer_name) && !strcasecmp(timer_name, "none")) {
</ins><span class="cx">                 timer_name = NULL;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(timer_name)) {
</del><ins>+        if (!zstr(timer_name)) {
</ins><span class="cx">                 rtp_session->timer_name = switch_core_strdup(pool, timer_name);
</span><span class="cx">                 switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_USE_TIMER);
</span><span class="cx">                 switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_NOBLOCK);
</span><span class="lines">@@ -1229,7 +1229,7 @@
</span><span class="cx"> {
</span><span class="cx">         switch_rtp_t *rtp_session = NULL;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(rx_host)) {
</del><ins>+        if (zstr(rx_host)) {
</ins><span class="cx">                 *err = "Missing local host";
</span><span class="cx">                 goto end;
</span><span class="cx">         }
</span><span class="lines">@@ -1239,7 +1239,7 @@
</span><span class="cx">                 goto end;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(tx_host)) {
</del><ins>+        if (zstr(tx_host)) {
</ins><span class="cx">                 *err = "Missing remote host";
</span><span class="cx">                 goto end;
</span><span class="cx">         }
</span><span class="lines">@@ -1528,6 +1528,7 @@
</span><span class="cx">         if (flags & SWITCH_RTP_FLAG_AUTOADJ) {
</span><span class="cx">                 rtp_session->autoadj_window = 20;
</span><span class="cx">                 rtp_session->autoadj_tally = 0;
</span><ins>+                rtp_flush_read_buffer(rtp_session, SWITCH_RTP_FLUSH_ONCE);
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1678,6 +1679,20 @@
</span><span class="cx">         READ_INC(rtp_session);
</span><span class="cx">
</span><span class="cx">         if (switch_rtp_ready(rtp_session)) {
</span><ins>+
+                if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_DEBUG_RTP_READ)) {
+                        switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session");
+                        if (!session) {
+                                switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_DEBUG_RTP_READ);
+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "RTP HAS NO SESSION!\n");
+                        } else {
+                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session),
+                                                                 SWITCH_LOG_CONSOLE, "%s FLUSH\n",
+                                                                 switch_channel_get_name(switch_core_session_get_channel(session))
+                                                                 );
+                        }
+                }
+
</ins><span class="cx">                 if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_NOBLOCK)) {
</span><span class="cx">                         was_blocking = 1;
</span><span class="cx">                         switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_NOBLOCK);                
</span><span class="lines">@@ -1889,26 +1904,73 @@
</span><span class="cx">                         rtp_flush_read_buffer(rtp_session, SWITCH_RTP_FLUSH_ONCE);
</span><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (bytes && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ) && switch_sockaddr_get_port(rtp_session->from_addr)) {
-                        if (++rtp_session->autoadj_tally >= 10) {
</del><ins>+
+                if (bytes && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_DEBUG_RTP_READ)) {
+                        switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session");
+
+                        if (!session) {
+                                switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_DEBUG_RTP_READ);
+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "RTP HAS NO SESSION!\n");
+                        } else {
</ins><span class="cx">                                 const char *tx_host;
</span><span class="cx">                                 const char *old_host;
</span><del>-                                char bufa[30], bufb[30];
</del><ins>+                                const char *my_host;
</ins><span class="cx">
</span><ins>+                                char bufa[30], bufb[30], bufc[30];
+                                
+                                
</ins><span class="cx">                                 tx_host = switch_get_addr(bufa, sizeof(bufa), rtp_session->from_addr);
</span><span class="cx">                                 old_host = switch_get_addr(bufb, sizeof(bufb), rtp_session->remote_addr);
</span><del>-                                if ((switch_sockaddr_get_port(rtp_session->from_addr) != rtp_session->remote_port) || strcmp(tx_host, old_host)) {
</del><ins>+                                my_host = switch_get_addr(bufc, sizeof(bufc), rtp_session->local_addr);
+
+                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG_CLEAN(session), SWITCH_LOG_CONSOLE,
+                                                                 "R %s b=%ld %s:%u %s:%u %s:%u pt=%d ts=%u m=%d\n",
+                                                                 switch_channel_get_name(switch_core_session_get_channel(session)),
+                                                                 (long)bytes,
+                                                                 my_host, switch_sockaddr_get_port(rtp_session->local_addr),
+                                                                 old_host, rtp_session->remote_port,
+                                                                 tx_host, switch_sockaddr_get_port(rtp_session->from_addr),
+                                                                 rtp_session->recv_msg.header.pt, ntohl(rtp_session->recv_msg.header.ts), rtp_session->recv_msg.header.m);
+                        
+                        }
+                }
+                
+                /* ignore packets not meant for us unless the auto-adjust window is open */
+                if (bytes) {
+                        if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ)) {
+                                if (((rtp_session->cng_pt && rtp_session->recv_msg.header.pt == rtp_session->cng_pt) || rtp_session->recv_msg.header.pt == 13)) {
+                                        bytes = 0;
+                                        goto recvfrom;                        
+                                        
+                                }
+                        } else if (!switch_cmp_addr(rtp_session->from_addr, rtp_session->remote_addr)) {
+                                bytes = 0;
+                                goto recvfrom;                        
+                                
+                        }
+                }
+
+                if (bytes && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ) && switch_sockaddr_get_port(rtp_session->from_addr)) {
+                        if (!switch_cmp_addr(rtp_session->from_addr, rtp_session->remote_addr)) {
+                                if (++rtp_session->autoadj_tally >= 10) {
</ins><span class="cx">                                         const char *err;
</span><span class="cx">                                         uint32_t old = rtp_session->remote_port;
</span><ins>+                                        const char *tx_host;
+                                        const char *old_host;
+                                        char bufa[30], bufb[30];
</ins><span class="cx">                                         
</span><del>-                                        if (!switch_strlen_zero(tx_host) && switch_sockaddr_get_port(rtp_session->from_addr) > 0) {
-                                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
-                                                                                 "Auto Changing port from %s:%u to %s:%u\n", old_host, old, tx_host,
-                                                                                 switch_sockaddr_get_port(rtp_session->from_addr));
-                                                switch_rtp_set_remote_address(rtp_session, tx_host, switch_sockaddr_get_port(rtp_session->from_addr), SWITCH_FALSE, &err);
-                                                switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
-                                        }
</del><ins>+                                        tx_host = switch_get_addr(bufa, sizeof(bufa), rtp_session->from_addr);
+                                        old_host = switch_get_addr(bufb, sizeof(bufb), rtp_session->remote_addr);                        
+        
+                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
+                                                                         "Auto Changing port from %s:%u to %s:%u\n", old_host, old, tx_host,
+                                                                         switch_sockaddr_get_port(rtp_session->from_addr));
+                                        switch_rtp_set_remote_address(rtp_session, tx_host, switch_sockaddr_get_port(rtp_session->from_addr), SWITCH_FALSE, &err);
+                                        switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
</ins><span class="cx">                                 }
</span><ins>+                        } else {
+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Correct ip/port confirmed.\n");
+                                switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_AUTOADJ);
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">                 
</span><span class="lines">@@ -2695,6 +2757,37 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx">
</span><ins>+                if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_DEBUG_RTP_WRITE)) {
+                        switch_core_session_t *session = switch_core_memory_pool_get_data(rtp_session->pool, "__session");
+
+                        if (!session) {
+                                switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_DEBUG_RTP_WRITE);
+                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "RTP HAS NO SESSION!\n");
+                        } else {
+                                const char *tx_host;
+                                const char *old_host;
+                                const char *my_host;
+
+                                char bufa[30], bufb[30], bufc[30];
+                                
+                                
+                                tx_host = switch_get_addr(bufa, sizeof(bufa), rtp_session->from_addr);
+                                old_host = switch_get_addr(bufb, sizeof(bufb), rtp_session->remote_addr);
+                                my_host = switch_get_addr(bufc, sizeof(bufc), rtp_session->local_addr);
+
+                                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG_CLEAN(session), SWITCH_LOG_CONSOLE,
+                                                                 "W %s b=%ld %s:%u %s:%u %s:%u pt=%d ts=%u m=%d\n",
+                                                                 switch_channel_get_name(switch_core_session_get_channel(session)),
+                                                                 (long)bytes,
+                                                                 my_host, switch_sockaddr_get_port(rtp_session->local_addr),
+                                                                 old_host, rtp_session->remote_port,
+                                                                 tx_host, switch_sockaddr_get_port(rtp_session->from_addr),
+                                                                 send_msg->header.pt, ntohl(send_msg->header.ts), send_msg->header.m);
+                        
+                        }
+                }
+
+
</ins><span class="cx">                 if (switch_socket_sendto(rtp_session->sock_output, rtp_session->remote_addr, 0, (void *) send_msg, &bytes) != SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                         rtp_session->seq--;
</span><span class="cx">                         ret = -1;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_schedulerc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_scheduler.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_scheduler.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_scheduler.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -263,7 +263,7 @@
</span><span class="cx">
</span><span class="cx">         switch_mutex_lock(globals.task_mutex);
</span><span class="cx">         for (tp = globals.task_list; tp; tp = tp->next) {
</span><del>-                if (!switch_strlen_zero(group) && !strcmp(tp->task.group, group)) {
</del><ins>+                if (!zstr(group) && !strcmp(tp->task.group, group)) {
</ins><span class="cx">                         if (switch_test_flag(tp, SSHF_NO_DEL)) {
</span><span class="cx">                                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Attempt made to delete undeletable task #%u (group %s)\n",
</span><span class="cx">                                                                  tp->task.task_id, group);
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_swigc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_swig.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_swig.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_swig.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">         switch_status_t status;
</span><span class="cx">         const char *err = NULL;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(path)) {
</del><ins>+        if (zstr(path)) {
</ins><span class="cx">                 path = NULL;
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_timec"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_time.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_time.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_time.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -233,8 +233,8 @@
</span><span class="cx">
</span><span class="cx">         while (globals.STARTED == 0) {
</span><span class="cx">                 do_sleep(100000);
</span><del>-                if (++sanity == 10) {
-                        break;
</del><ins>+                if (++sanity == 300) {
+                        abort();
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -640,11 +640,11 @@
</span><span class="cx">                                 const char *name = switch_xml_attr(x_list, "name");
</span><span class="cx">                                 const char *value= switch_xml_attr(x_list, "value");
</span><span class="cx">
</span><del>-                                if (switch_strlen_zero(name)) {
</del><ins>+                                if (zstr(name)) {
</ins><span class="cx">                                         continue;
</span><span class="cx">                                 }
</span><span class="cx">
</span><del>-                                if (switch_strlen_zero(value)) {
</del><ins>+                                if (zstr(value)) {
</ins><span class="cx">                                         continue;
</span><span class="cx">                                 }
</span><span class="cx">
</span><span class="lines">@@ -683,7 +683,7 @@
</span><span class="cx">
</span><span class="cx">         timep = (thetime) / (int64_t) (1000000);
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(tz_name)) {
</del><ins>+        if (!zstr(tz_name)) {
</ins><span class="cx">                 tzdef = switch_lookup_timezone( tz_name );
</span><span class="cx">         } else {
</span><span class="cx">                 /* We set the default timezone to GMT. */
</span><span class="lines">@@ -719,7 +719,7 @@
</span><span class="cx">
</span><span class="cx">         timep = (thetime) / (int64_t) (1000000);
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(tz_name)) {
</del><ins>+        if (!zstr(tz_name)) {
</ins><span class="cx">                 tzdef = switch_lookup_timezone( tz_name );
</span><span class="cx">         } else {
</span><span class="cx">                 /* We set the default timezone to GMT. */
</span><span class="lines">@@ -730,8 +730,8 @@
</span><span class="cx">         if (tzdef) { /* The lookup of the zone may fail. */
</span><span class="cx">                 tztime( &timep, tzdef, &tm );
</span><span class="cx">                 tm2switchtime( &tm, &stm );
</span><del>-                switch_strftime_nocheck(date, &retsize, len, switch_strlen_zero(format) ? "%Y-%m-%d %T" : format, &stm);
-                if (!switch_strlen_zero_buf(date)) {
</del><ins>+                switch_strftime_nocheck(date, &retsize, len, zstr(format) ? "%Y-%m-%d %T" : format, &stm);
+                if (!zstr_buf(date)) {
</ins><span class="cx">                         return SWITCH_STATUS_SUCCESS;
</span><span class="cx">                 }
</span><span class="cx">         }
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_utilsc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_utils.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_utils.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_utils.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -181,7 +181,7 @@
</span><span class="cx">         node->bits = bits;
</span><span class="cx">         node->str = switch_core_strdup(list->pool, cidr_str);
</span><span class="cx">
</span><del>-        if (!switch_strlen_zero(token)) {
</del><ins>+        if (!zstr(token)) {
</ins><span class="cx">                 node->token = switch_core_strdup(list->pool, token);
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="lines">@@ -429,7 +429,13 @@
</span><span class="cx">         return 1;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to, const char *from, const char *headers, const char *body, const char *file)
</del><ins>+SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to,
+                                                                                                 const char *from,
+                                                                                                 const char *headers,
+                                                                                                 const char *body,
+                                                                                                 const char *file,
+                                                                                                 const char *convert_cmd,
+                                                                                                 const char *convert_ext)
</ins><span class="cx"> {
</span><span class="cx">         char *bound = "XXXX_boundary_XXXX";
</span><span class="cx">         const char *mime_type = "audio/inline";
</span><span class="lines">@@ -439,37 +445,68 @@
</span><span class="cx">         unsigned int b = 0, l = 0;
</span><span class="cx">         unsigned char in[B64BUFFLEN];
</span><span class="cx">         unsigned char out[B64BUFFLEN + 512];
</span><ins>+        char *dupfile = NULL, *ext = NULL;
+        char *newfile = NULL;
+        switch_bool_t rval = SWITCH_FALSE;
</ins><span class="cx">
</span><ins>+        if (!zstr(file) && !zstr(convert_cmd) && !zstr(convert_ext)) {
+                if ((ext = strrchr(file, '.'))) {
+                        dupfile = strdup(file);
+                        if ((ext = strrchr(dupfile, '.'))) {
+                                *ext++ = '\0';
+                                newfile = switch_mprintf("%s.%s", dupfile, convert_ext);
+                        }
+                }
+                
+                if (newfile) {
+                        char cmd[1024] = "";
+                        switch_snprintf(cmd, sizeof(cmd), "%s %s %s", convert_cmd, file, newfile);
+                        switch_system(cmd, SWITCH_TRUE);
+                        file = newfile;
+                }
+
+                switch_safe_free(dupfile);
+        }
+
</ins><span class="cx">         switch_snprintf(filename, 80, "%smail.%d%04x", SWITCH_GLOBAL_dirs.temp_dir, (int) switch_epoch_time_now(NULL), rand() & 0xffff);
</span><span class="cx">
</span><span class="cx">         if ((fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0644))) {
</span><span class="cx">                 if (file) {
</span><span class="cx">                         if ((ifd = open(file, O_RDONLY | O_BINARY)) < 1) {
</span><del>-                                return SWITCH_FALSE;
</del><ins>+                                rval = SWITCH_FALSE;
+                                goto end;
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">                 switch_snprintf(buf, B64BUFFLEN, "MIME-Version: 1.0\nContent-Type: multipart/mixed; boundary=\"%s\"\n", bound);
</span><span class="cx">                 if (!write_buf(fd, buf)) {
</span><del>-                        return SWITCH_FALSE;
</del><ins>+                        rval = SWITCH_FALSE;
+                        goto end;
</ins><span class="cx">                 }
</span><span class="cx">
</span><del>-                if (headers && !write_buf(fd, headers))
-                        return SWITCH_FALSE;
</del><ins>+                if (headers && !write_buf(fd, headers)) {
+                        rval = SWITCH_FALSE;
+                        goto end;
+                }
</ins><span class="cx">
</span><del>-                if (!write_buf(fd, "\n\n"))
-                        return SWITCH_FALSE;
</del><ins>+                if (!write_buf(fd, "\n\n")) {
+                        rval = SWITCH_FALSE;
+                        goto end;
+                }
</ins><span class="cx">
</span><span class="cx">                 if (body && switch_stristr("content-type", body)) {
</span><span class="cx">                         switch_snprintf(buf, B64BUFFLEN, "--%s\n", bound);
</span><span class="cx">                 } else {
</span><span class="cx">                         switch_snprintf(buf, B64BUFFLEN, "--%s\nContent-Type: text/plain\n\n", bound);
</span><span class="cx">                 }
</span><del>-                if (!write_buf(fd, buf))
-                        return SWITCH_FALSE;
</del><ins>+                if (!write_buf(fd, buf)) {
+                        rval = SWITCH_FALSE;
+                        goto end;
+                }
</ins><span class="cx">
</span><span class="cx">                 if (body) {
</span><span class="cx">                         if (!write_buf(fd, body)) {
</span><del>-                                return SWITCH_FALSE;
</del><ins>+                                rval = SWITCH_FALSE;
+                                goto end;
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -491,8 +528,10 @@
</span><span class="cx">                                                         "Content-Transfer-Encoding: base64\n"
</span><span class="cx">                                                         "Content-Description: Sound attachment.\n"
</span><span class="cx">                                                         "Content-Disposition: attachment; filename=\"%s\"\n\n", bound, mime_type, stipped_file, stipped_file);
</span><del>-                        if (!write_buf(fd, buf))
-                                return SWITCH_FALSE;
</del><ins>+                        if (!write_buf(fd, buf)) {
+                                rval = SWITCH_FALSE;
+                                goto end;
+                        }
</ins><span class="cx">
</span><span class="cx">                         while ((ilen = read(ifd, in, B64BUFFLEN))) {
</span><span class="cx">                                 for (x = 0; x < ilen; x++) {
</span><span class="lines">@@ -507,7 +546,7 @@
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><span class="cx">                                 if (write(fd, &out, bytes) != bytes) {
</span><del>-                                        return -1;
</del><ins>+                                        rval = -1;
</ins><span class="cx">                                 } else
</span><span class="cx">                                         bytes = 0;
</span><span class="cx">
</span><span class="lines">@@ -521,14 +560,17 @@
</span><span class="cx">                                         out[bytes++] = '=', l += 2;
</span><span class="cx">                                 }
</span><span class="cx">                         if (write(fd, &out, bytes) != bytes) {
</span><del>-                                return -1;
</del><ins>+                                rval = -1;
</ins><span class="cx">                         }
</span><span class="cx">
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 switch_snprintf(buf, B64BUFFLEN, "\n\n--%s--\n.\n", bound);
</span><del>-                if (!write_buf(fd, buf))
-                        return SWITCH_FALSE;
</del><ins>+
+                if (!write_buf(fd, buf)) {
+                        rval = SWITCH_FALSE;
+                        goto end;
+                }
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         if (fd) {
</span><span class="lines">@@ -537,10 +579,15 @@
</span><span class="cx">         if (ifd) {
</span><span class="cx">                 close(ifd);
</span><span class="cx">         }
</span><ins>+
+        if (zstr(from)) {
+                from = "freeswitch";
+        }
+
</ins><span class="cx"> #ifdef WIN32
</span><del>-        switch_snprintf(buf, B64BUFFLEN, "type %s | %s %s %s", filename, runtime.mailer_app, runtime.mailer_app_args, to);
</del><ins>+        switch_snprintf(buf, B64BUFFLEN, "type %s | %s -f %s %s %s", filename, runtime.mailer_app, from, runtime.mailer_app_args, to);
</ins><span class="cx"> #else
</span><del>-        switch_snprintf(buf, B64BUFFLEN, "/bin/cat %s | %s %s %s", filename, runtime.mailer_app, runtime.mailer_app_args, to);
</del><ins>+        switch_snprintf(buf, B64BUFFLEN, "/bin/cat %s | %s -f %s %s %s", filename, runtime.mailer_app, from, runtime.mailer_app_args, to);
</ins><span class="cx"> #endif
</span><span class="cx">         if (switch_system(buf, SWITCH_TRUE) < 0) {
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to execute command: %s\n", buf);
</span><span class="lines">@@ -556,12 +603,21 @@
</span><span class="cx">                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Emailed data to [%s]\n", to);
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        return SWITCH_TRUE;
</del><ins>+        rval = SWITCH_TRUE;
+
+ end:        
+        
+        if (newfile) {
+                unlink(newfile);
+                free(newfile);
+        }
+
+        return rval;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SWITCH_DECLARE(switch_bool_t) switch_is_lan_addr(const char *ip)
</span><span class="cx"> {
</span><del>-        if (switch_strlen_zero(ip))
</del><ins>+        if (zstr(ip))
</ins><span class="cx">                 return SWITCH_FALSE;
</span><span class="cx">
</span><span class="cx">         return (strncmp(ip, "10.", 3) &&
</span><span class="lines">@@ -1282,10 +1338,55 @@
</span><span class="cx">
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+SWITCH_DECLARE(int) get_addr_int(switch_sockaddr_t *sa)
+{
+        struct sockaddr_in *s = (struct sockaddr_in *)&sa->sa;
+
+        return ntohs((unsigned short)s->sin_addr.s_addr);
+}
+
+
+SWITCH_DECLARE(int) switch_cmp_addr(switch_sockaddr_t *sa1, switch_sockaddr_t *sa2)
+{
+        struct sockaddr_in *s1;
+        struct sockaddr_in *s2;
+
+        struct sockaddr_in6 *s16;
+        struct sockaddr_in6 *s26;
+
+        struct sockaddr *ss1;
+        struct sockaddr *ss2;
+
+        if (!(sa1 && sa2)) return 0;
+
+        s1 = (struct sockaddr_in *)&sa1->sa;
+        s2 = (struct sockaddr_in *)&sa2->sa;
+
+        s16 = (struct sockaddr_in6 *)&sa1->sa;
+        s26 = (struct sockaddr_in6 *)&sa2->sa;
+
+        ss1 = (struct sockaddr *)&sa1->sa;
+        ss2 = (struct sockaddr *)&sa2->sa;
+        
+        if (ss1->sa_family != ss2->sa_family) return 0;
+
+        switch (ss1->sa_family) {
+        case AF_INET:
+                return (s1->sin_addr.s_addr == s2->sin_addr.s_addr && s1->sin_port == s2->sin_port);        
+        case AF_INET6:
+                return (s16->sin6_addr.s6_addr && s26->sin6_addr.s6_addr &&
+                                *s16->sin6_addr.s6_addr == *s26->sin6_addr.s6_addr && s16->sin6_port == s26->sin6_port);        
+        }
+        
+        return 0;        
+}
+
+
</ins><span class="cx"> SWITCH_DECLARE(char *) get_addr(char *buf, switch_size_t len, struct sockaddr *sa, socklen_t salen)
</span><span class="cx"> {
</span><span class="cx">         switch_assert(buf);
</span><span class="cx">         *buf = '\0';
</span><ins>+
</ins><span class="cx">         if (sa) {
</span><span class="cx">                 getnameinfo(sa, salen, buf, (socklen_t)len, NULL, 0, NI_NUMERICHOST);
</span><span class="cx">         }
</span><span class="lines">@@ -1768,7 +1869,7 @@
</span><span class="cx">         char *o;
</span><span class="cx">         unsigned int tmp;
</span><span class="cx">
</span><del>-        if (switch_strlen_zero(s)) {
</del><ins>+        if (zstr(s)) {
</ins><span class="cx">                 return s;
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_xmlc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_xml.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_xml.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_xml.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -1551,7 +1551,7 @@
</span><span class="cx">                         const char *err = NULL;
</span><span class="cx">
</span><span class="cx">                         err = switch_xml_error(xml);
</span><del>-                        if (switch_strlen_zero(err)) {
</del><ins>+                        if (zstr(err)) {
</ins><span class="cx">                                 if ((conf = switch_xml_find_child(xml, "section", "name", "result"))) {
</span><span class="cx">                                         switch_xml_t p;
</span><span class="cx">                                         const char *aname;
</span><span class="lines">@@ -1890,7 +1890,7 @@
</span><span class="cx">                 *err = switch_xml_error(new_main);
</span><span class="cx">                 switch_copy_string(not_so_threadsafe_error_buffer, *err, sizeof(not_so_threadsafe_error_buffer));
</span><span class="cx">                 *err = not_so_threadsafe_error_buffer;
</span><del>-                if (!switch_strlen_zero(*err)) {
</del><ins>+                if (!zstr(*err)) {
</ins><span class="cx">                         switch_xml_free(new_main);
</span><span class="cx">                         new_main = NULL;
</span><span class="cx">                         errcnt++;
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsrcswitch_xml_configc"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_xml_config.c (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_xml_config.c        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/src/switch_xml_config.c        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -208,7 +208,7 @@
</span><span class="cx">                                         
</span><span class="cx">                                         /* Perform validation */
</span><span class="cx">                                         if (value) {
</span><del>-                                                if (!switch_strlen_zero(string_options->validation_regex)) {
</del><ins>+                                                if (!zstr(string_options->validation_regex)) {
</ins><span class="cx">                                                         if (switch_regex_match(value, string_options->validation_regex) == SWITCH_STATUS_SUCCESS) {
</span><span class="cx">                                                                 newstring = value; /* Regex match, accept value*/
</span><span class="cx">                                                         } else {
</span></span></pre></div>
<a id="freeswitchbranchesjoshriversmod_managed_experimental_refactorsupportdfscore_pb"></a>
<div class="modfile"><h4>Modified: freeswitch/branches/joshrivers/mod_managed_experimental_refactor/support-d/fscore_pb (15313 => 15314)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/branches/joshrivers/mod_managed_experimental_refactor/support-d/fscore_pb        2009-11-02 08:01:08 UTC (rev 15313)
+++ freeswitch/branches/joshrivers/mod_managed_experimental_refactor/support-d/fscore_pb        2009-11-02 10:10:22 UTC (rev 15314)
</span><span class="lines">@@ -1,11 +1,35 @@
</span><del>-core=`ls -rt core.* 2> /dev/null`
</del><ins>+#!/bin/bash
</ins><span class="cx">
</span><ins>+arg=$1
+shift
+
+prefix=$(cat config.status | grep @prefix@ | awk -F, '{print $3}')
+
+if [ -z "$prefix" ] ; then
+        echo "Cannot determine prefix!"
+        exit 255
+fi
+
+if [ "$arg" = "gcore" ] ; then
+        user=$1
+        shift
+        fspid=`cat $prefix/log/freeswitch.pid`
+        echo "pulling gcore $fspid"
+        gcore -o core $fspid
+exit
+else
+ user=$arg
+fi
+
+
+core=`ls -1t core.* | head -1 2> /dev/null`
+
</ins><span class="cx"> if [ -z "$core" ] ; then
</span><del>-        core=`ls -rt core 2> /dev/null`
</del><ins>+        core=`ls -1 core 2> /dev/null`
</ins><span class="cx"> fi
</span><span class="cx">
</span><span class="cx"> if [ -z "$core" ] ; then
</span><del>-        core=`ls -rt freeswitch.core 2> /dev/null`
</del><ins>+        core=`ls -1 freeswitch.core 2> /dev/null`
</ins><span class="cx"> fi
</span><span class="cx">
</span><span class="cx"> if [ -z "$core" ] ; then
</span><span class="lines">@@ -18,15 +42,15 @@
</span><span class="cx"> exit 255
</span><span class="cx"> fi
</span><span class="cx">
</span><ins>+echo "core is $core"
</ins><span class="cx">
</span><span class="cx"> line="--------------------------------------------------------------------------------"
</span><span class="cx">
</span><span class="cx"> mypwd=`pwd`
</span><span class="cx"> tmpdir=/tmp/fscore_pb.tmp
</span><del>-post_file=$pwd/fscore_pb.post
-user=$1
-shift
</del><ins>+post_file=$mypwd/fscore_pb.post
</ins><span class="cx">
</span><ins>+
</ins><span class="cx"> if [ -z $user ] ; then
</span><span class="cx">         user=$SUDO_USER
</span><span class="cx"> fi
</span><span class="lines">@@ -61,7 +85,7 @@
</span><span class="cx"> echo "GDB BACKTRACE:" >> $post_file
</span><span class="cx"> echo $line >> $post_file
</span><span class="cx">
</span><del>-gdb /usr/local/freeswitch/bin/freeswitch `echo $core | tail -n1` \
</del><ins>+gdb $prefix/bin/freeswitch `echo $core | tail -n1` \
</ins><span class="cx"> --eval-command="echo \n\n" \
</span><span class="cx"> --eval-command="set pagination off" \
</span><span class="cx"> --eval-command="echo Stack Trace\n" \
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>