]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
- flash-to-digits: Defines the digits to be sent when the FLASH is detected on FXS
authorGeovani Ricardo Wiedenhoft <grw@geovani.(none)>
Thu, 4 Nov 2010 12:04:19 +0000 (10:04 -0200)
committerGeovani Ricardo Wiedenhoft <grw@geovani.(none)>
Thu, 4 Nov 2010 12:04:19 +0000 (10:04 -0200)
channels;
- Updated documentation.

13 files changed:
src/mod/endpoints/mod_khomp/Install/files/khomp.conf.xml
src/mod/endpoints/mod_khomp/docs/Manual.html
src/mod/endpoints/mod_khomp/docs/Manual.pdf
src/mod/endpoints/mod_khomp/docs/README.pdf
src/mod/endpoints/mod_khomp/docs/README_en.pdf
src/mod/endpoints/mod_khomp/docs/User_Guide.html
src/mod/endpoints/mod_khomp/docs/User_Guide.pdf
src/mod/endpoints/mod_khomp/include/khomp_pvt_kxe1.h
src/mod/endpoints/mod_khomp/include/opt.h
src/mod/endpoints/mod_khomp/include/revision.h
src/mod/endpoints/mod_khomp/src/khomp_pvt_kxe1.cpp
src/mod/endpoints/mod_khomp/src/opt.cpp
src/mod/endpoints/mod_khomp/src/utils.cpp

index ec02ca7ba644cd89df0f0971b15640d955e2948c..45268f304bbd7754e1cdb49c5a09480c76f5bbe1 100644 (file)
@@ -412,6 +412,12 @@ to be used to initialize a call transfer using PBX-to-PBX signaling.
 <param name="user-transfer-digits" value="#2"/>
 -->
 
+<!--
+Defines the digits to be sent when the flash is detected.
+
+<param name="flash-to-digits" value="*1"/>
+-->
+
 <!--
 ;;;;;;;;;;;;;;;;;;;; CONTEXTS WILDCARDS ;;;;;;;;;;;;;;;;;;;;;;
 
@@ -512,16 +518,17 @@ In the example above, the branch numbered 804 will call the number
 <!--
 In this section, you should define options using the following syntax:
 
-'orig_prefix = option1:value | option2:value | option3:value' ...
+orig_prefix = option1:value | option2:value | option3:value ...
 
-ex: <param name="804" value="output-volume:+2' />
+ex: <param name="804" value="output-volume:+2" />
 
 In the example above, the branch numbered 804 will have specific
 configuration for default output volume set to +2.
 
 Possible values to options is:
 context, input-volume, output-volume language,
-mohclass, amaflags, accountcode, calleridnum, calleridname, mailbox.
+mohclass, amaflags, accountcode, calleridnum, 
+calleridname, mailbox, flash-to-digits.
 -->
 </fxs-options>
 
index d0699551f61581d2dbd319aa93b20612b4f59117..863ef76847a1ecc5a5f2a017a93a6f8ef3b04263 100644 (file)
@@ -60,6 +60,7 @@
 </li><li><b>suppression-delay</b>: Ativa ("yes") ou desativa ("no") o delay necessário para supressão DTMF. Se desativado ("no"), também desativa supressão de DTMFs; 
 </li><li><b>trace</b>: Define opções de depuração. Não deve ser utilizado em produção a não ser que estritamente necessário;
 </li><li><b>user-transfer-digits</b>: Define uma seqüência de dígitos DTMF para iniciar a transferencia entre o FreeSWITCH&reg; e um outro PABX (utilizando sinalização de usuário, como QSig ou FXO FLASH);
+</li><li><b>flash-to-digits</b>: Define os dígitos para serem enviados quando o FLASH é detectado na FXS;
 </li></ul>
 <p><br />
 </p>
 </li><li>accountcode; 
 </li><li>calleridnum; 
 </li><li>calleridname;
-</li><li>mailbox.
+</li><li>mailbox;
+</li><li>flash-to-digits.
 </li></ul>
 <p>Cada opção é separada uma da outra por um pipe "|" ou uma barra "/" e definidas após dois pontos ":", exemplo:
 </p>
index 665be58ee3b76614e2d787029c423f543781d6b7..935b299dbc821be862d801ecf934e5131acf1044 100644 (file)
Binary files a/src/mod/endpoints/mod_khomp/docs/Manual.pdf and b/src/mod/endpoints/mod_khomp/docs/Manual.pdf differ
index a65cc28d66f1f2de6288c4a62ef0ccd1a7bfd068..2b95cfaad4d41964e1155d28a906699c0227b1a1 100644 (file)
Binary files a/src/mod/endpoints/mod_khomp/docs/README.pdf and b/src/mod/endpoints/mod_khomp/docs/README.pdf differ
index 2864e403fca13bb436047954a77a8c7b3464d9ea..25be8ab0b2ba117d73349bcb90ecc453e5c0858f 100644 (file)
Binary files a/src/mod/endpoints/mod_khomp/docs/README_en.pdf and b/src/mod/endpoints/mod_khomp/docs/README_en.pdf differ
index ceb520b0d2176107c1e0418e4e401c4b4fd84887..eb5cfc6c4e9c82c1f583439ffb82e0af03ce7cc0 100644 (file)
@@ -61,6 +61,7 @@ If you need to set advanced parameters of the board and/or signaling, the progra
 </li><li><b>suppression-delay</b> (former <b>suppressiondelay</b>): Activate ("yes") or disables ("no") the delay necessary to suppress DTMF. If disabled ("no"), also disables suppression of DTMF (local option);
 </li><li><b>trace</b>: Set debugging options. Should not be used in production unless absolutely necessary;
 </li><li><b>user-transfer-digits</b>: Defines a sequence of DTMF digits to initiate the transfer between FreeSWITCH&reg; and another PBX (using user signaling, like QSig or FXO FLASH).
+</li><li><b>flash-to-digits</b>: Defines the digits to be sent when the FLASH is detected on FXS channels..
 </li></ul>
 <p><br />
 </p>
@@ -123,7 +124,8 @@ For details, please refer to the configuration file for examples.
 </li><li>accountcode; 
 </li><li>calleridnum; 
 </li><li>calleridname;
-</li><li>mailbox.
+</li><li>mailbox;
+</li><li>flash-to-digits.
 </li></ul>
 <p>Each option is separated from each other by a pipe "|" or a slash "/" and defined after the colon ":". Example:
 </p>
index fd8027ba2b29bcfae0670899279dfec11473750a..832596bdb255ccbd3bc03c675d3afe7a590008b7 100644 (file)
Binary files a/src/mod/endpoints/mod_khomp/docs/User_Guide.pdf and b/src/mod/endpoints/mod_khomp/docs/User_Guide.pdf differ
index 85b1af0e174277d1df9a892ca4b667b8c71ccc22..722bd80737e90e8ae1c9f98ec334862e23dcd883 100644 (file)
@@ -995,6 +995,7 @@ struct KhompPvtFXS: public KhompPvt
     std::string _language;
     std::string _accountcode;
     std::string _mailbox;
+    std::string _flash;
 
     static Opt::OrigToNseqMapType generateNseqMap();
     static void dialTimer(KhompPvt * pvt);
index 0f93215a2b0f9a2bc5c50014e8c2c3bd71ff4a5a..3458f9e9dee7105607ff884565508f807cab475d 100644 (file)
@@ -155,6 +155,7 @@ public:
 
     static unsigned int _transferdigittimeout;
 
+    static std::string _flash;
     static std::string _blindxfer;
     static std::string _atxfer;
 
index bbb7f6b61b270199e7681d584969ecb5d8081e6b..fe9ef9eb474e018252cb236c6ed0ccd07cafebbb 100644 (file)
@@ -1 +1 @@
-#define MOD_KHOMP_VERSION "1.0 - (rev: 5823)"
+#define MOD_KHOMP_VERSION "1.0 - (rev: 5841)"
index b5acfd18e6c94a9594e0d5087a6ed3794b5212c2..c0eb1a3403ad83e83921820bb3b102dcdb4fbbce 100644 (file)
@@ -2055,6 +2055,7 @@ void BoardE1::KhompPvtFXS::loadOptions()
     _language = Opt::_global_language;
     _accountcode = Opt::_accountcode;
     _mailbox.clear();
+    _flash = Opt::_flash;
 
     Opt::BranchToOptMapType::iterator it3 = Opt::_branch_options.find(_fxs_orig_addr);
 
@@ -2181,6 +2182,10 @@ bool BoardE1::KhompPvtFXS::parseBranchOptions(std::string options_str)
             {
                 _mailbox = opt_value;
             }
+            else if (opt_name == "flash-to-digits")
+            {
+                _flash = opt_value;
+            }
             else
             {
                 DBG(FUNC, PVT_FMT(_target, "[fxs-options] invalid option on branch %s: \"%s\".") % _fxs_orig_addr.c_str() % opt_name.c_str());
@@ -3001,12 +3006,23 @@ bool BoardE1::KhompPvtFXS::onDtmfSendFinish(K3L_EVENT *e)
 
 bool BoardE1::KhompPvtFXS::onFlashDetected(K3L_EVENT *e)
 {
-    DBG(FUNC, PVT_FMT(_target, "(FXS) c"));
+    DBG(FUNC, PVT_FMT(_target, "(FXS) c (%s)") % _flash);
 
     try
     {
         ScopedPvtLock lock(this);
 
+        for(std::string::const_iterator it = _flash.begin(); it != _flash.end(); it++)
+        {
+            signalDTMF(*it);
+        }
+
+        DBG(FUNC, PVT_FMT(_target, "(FXS) r"));
+
+        return true;
+
+/******************************************************************************/
+        //Old implementation, not used
         if(callFXS()->_flags.check(Kflags::FXS_FLASH_TRANSFER))
         {
             DBG(FUNC, PVT_FMT(_target, "(FXS) transfer canceled"));
@@ -3043,6 +3059,7 @@ bool BoardE1::KhompPvtFXS::onFlashDetected(K3L_EVENT *e)
             DBG(FUNC, PVT_FMT(target(), "(FXS) r (unable to start transfer)"));
             return false;
         }
+/******************************************************************************/
 
     }
     catch (ScopedLockFailed & err)
index 946f508528809e0fdf3f9e9ba0a4728e1fa6420c..8a08023b371c2e05080303152c35c89a10d3647a 100644 (file)
@@ -79,6 +79,7 @@ unsigned int Opt::_fxs_digit_timeout;
 
 unsigned int Opt::_transferdigittimeout;
 
+std::string Opt::_flash;
 std::string Opt::_atxfer;
 std::string Opt::_blindxfer;
 
@@ -154,7 +155,9 @@ void Opt::initialize(void)
 
     Globals::options.add(ConfigOption("transferdigittimeout", _transferdigittimeout, 3000u, 0u, 90000u));
 
-    Globals::options.add(ConfigOption("atxfer", _atxfer, ""));
+    Globals::options.add(ConfigOption("flash-to-digits", _flash,  "*1"));
+
+    Globals::options.add(ConfigOption("atxfer",    _atxfer, ""));
     Globals::options.add(ConfigOption("blindxfer", _blindxfer, ""));
 
     Globals::options.add(ConfigOption("delay-ringback-co",  _ringback_co_delay,  1500u, 0u, 999000u)); 
index a0e68563225b949276b6a78d9091a649d543f304..cc6eaef0824ab3eb381e2cf0b2b016f4a0d4d6f4 100644 (file)
@@ -249,6 +249,12 @@ bool MatchExtension::canMatch(std::string & context, std::string & exten,
 
     if(finished != std::string::npos)
     {
+        if(exten.size() <= 1)
+        {
+            DBG(FUNC, FMT("exten=%s size=%d") % exten % exten.size());
+            return true;
+        }
+
         exten.erase(finished);
         DBG(FUNC, FMT("match exact!!! exten=%s") % exten);
         return false;