NewmanTelOnAsterisk14

Using NVFaxDetect (1.0.6), NVBackgroundDetect, etc from Newman Telecom on Asterisk 1.4.0

You may wish to use software fax detection on Asterisk 1.4.0. When you try to compile NVFaxDetect (or the like) on a new version of Asterisk, you'll see a few errors. The following instructions can help you

Source Modifications

For each respective source file, you will need to do the following. Always backup files prior to changing them!

(To comment out lines, just add "//" (without the quotes) at the beginning of the line. For example, "//LOCAL_USER_ADD(u);" is commented out.)
  • Search for and comment out all lines with: "LOCAL_USER_ADD(u);".
  • Search for and comment out all lines with: "LOCAL_USER_REMOVE(u);".
  • Search for and comment out all lines with: "STANDARD_HANGUP_LOCALUSERS;".
  • Add the following line to the very end of the file (change the second parameter/description to something that is applicable): "AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Fax Detection Application");".
  • Save the modified files.

Installation

After making all of your modifications, you will need to install the updated module. This follows the standard installation instructions.

Please do not attempt installation on live production systems without a fallback plan in place.

  • Type "cd /usr/src/asterisk" (or respective Asterisk directory)
  • Build Modules: Type "make".
  • Install Modules: If the build is successful, type "make install".
  • Restart Asterisk: When Asterisk is running, you can do this from your shell prompt with "asterisk -rx "restart now"". Be careful if you have calls active, as this will drop them immediately. If asterisk is not running, skip to the next step.
  • If Asterisk is running, type "asterisk -vvvvr". If Asterisk is not running, type "asterisk -vvvvc". The CLI should appear.
  • Verify Module: From the Asterisk CLI, type "core show application <app name>" (app name = NVFaxDetect or respective Newman Telecom module). If it shows the module's help, you are in business.

If you run into any problems, temporarily remove the module from the modules directory and restart Asterisk.

Patches for NVFaxDetect

app_nv_faxdetect.c.1.4.patch


The following patch makes app_nv_faxdetect.c compile against Asterisk 1.4.x (tested with 1.4.10). It follows the steps described in the previous section.
The compilation process still issues some warnings that shouldn't interfere with the application's behaviour.


 --- app_nv_faxdetect.c.old  2006-02-24 04:52:29.000000000 +0100-+
 +++ app_nv_faxdetect.c  2007-08-16 03:40:21.000000000 +0200
 @@ -77,7 +77,7 @@
 static int nv_detectfax_exec(struct ast_channel *chan, void *data)
 {
     int res = 0;
 -   struct localuser *u; 
 +   //struct localuser *u;
     char tmp[256] = "\0";
     char *p = NULL;
     char *waitstr = NULL; 
 @@ -157,7 +157,7 @@
     ast_log(LOG_DEBUG, "Preparing detect of fax (waitdur=%dms, sildur=%dms, mindur=%dms, maxdur=%dms)\n",
                        waitdur, sildur, mindur, maxdur);

 -   LOCAL_USER_ADD(u); 
 +   //LOCAL_USER_ADD(u);
    if (chan->_state != AST_STATE_UP && !skipanswer) {
        /* Otherwise answer unless we're supposed to send this while on-hook */
        res = ast_answer(chan);
 @@ -307,14 +307,14 @@
    if (dsp)
        ast_dsp_free(dsp);

 -   LOCAL_USER_REMOVE(u);
 +   //LOCAL_USER_REMOVE(u);

    return res;
 }

 int unload_module(void)
 {
 -   STANDARD_HANGUP_LOCALUSERS;
 +   //STANDARD_HANGUP_LOCALUSERS;
    return ast_unregister_application(app);
 }

 @@ -339,3 +339,5 @@
  {
    return ASTERISK_GPL_KEY;
  }
 +
 +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Fax detection application");



Put the file in the apps/ subdirectory of the Asterisk source tree, put the original app_nv_faxdetect.c file in the same dir and then issue the command
patch app_nv_faxdetect.c app_nv_faxdetect.c.1.4.patch

menuselect-deps.in.patch

This small patch adds app_nv_faxdetect to the menu configuration interface of asterisk (make menuselect).



+++ menuselect-deps.in 2007-08-16 03:32:32.000000000 +0200@@ -14,6 +14,7 @@
NBS=@PBX_NBS@
NETSNMP=@PBX_NETSNMP@
NEWT=@PBX_NEWT@
+NV_DETECT=@PBX_NV_DETECT@OGG=@PBX_OGG@
OSPTK=@PBX_OSPTK@
OSSAUDIO=@PBX_OSS@


To apply the patch, copy the patchfile to the build_tools subdir of the Asterisk source tree, and then issue the command
patch menuselect-deps.in menuselect-deps.in.patch


Error(s) that many have directed you here:

I'm including the following mostly to be sure that Google will direct people here that search for the compiling error.
[CC] app_nv_faxdetect.c -> app_nv_faxdetect.o
In file included from app_nv_faxdetect.c:19:
/usr/src/asterisk/include/asterisk/file.h:27:2: #error You must include stdio.h before file.h!
app_nv_faxdetect.c:64: warning: type defaults to `int' in declaration of `STANDARD_LOCAL_USER'
app_nv_faxdetect.c:64: warning: data definition has no type or storage class
app_nv_faxdetect.c:66: warning: type defaults to `int' in declaration of `LOCAL_USER_DECL'
app_nv_faxdetect.c:66: warning: data definition has no type or storage class
app_nv_faxdetect.c: In function `nv_detectfax_exec':
app_nv_faxdetect.c:151: warning: implicit declaration of function `LOCAL_USER_ADD'
app_nv_faxdetect.c:301: warning: implicit declaration of function `LOCAL_USER_REMOVE'
app_nv_faxdetect.c: At top level:
app_nv_faxdetect.c:307: warning: no previous prototype for 'unload_module'
app_nv_faxdetect.c: In function `unload_module':
app_nv_faxdetect.c:308: error: `STANDARD_HANGUP_LOCALUSERS' undeclared (first use in this function)
app_nv_faxdetect.c:308: error: (Each undeclared identifier is reported only once
app_nv_faxdetect.c:308: error: for each function it appears in.)
app_nv_faxdetect.c: At top level:
app_nv_faxdetect.c:313: warning: no previous prototype for 'load_module'
app_nv_faxdetect.c:318: warning: no previous prototype for 'description'
app_nv_faxdetect.c:323: warning: no previous prototype for 'usecount'
app_nv_faxdetect.c: In function `usecount':
app_nv_faxdetect.c:325: warning: implicit declaration of function `STANDARD_USECOUNT'
app_nv_faxdetect.c: At top level:
app_nv_faxdetect.c:330: warning: function declaration isn't a prototype
make[1]: *** [app_nv_faxdetect.o] Error 1
make: *** [apps] Error 2


UPDATE FOR ASTERISK 1.4.24+ USERS


Working version for Asterisk 1.4.24+

http://www.austechpartnerships.com/app_nv_1.4.2x_07052010.tar.gz

Tested with 1.4.26, 1.4.26.1, 1.4.31.

Also includes NVBackgroundDetect but was untested. Module compiles and loads into Asterisk properly so presumptions would be that it works as well.

Files included in tarball:
app_nv_backgrounddetect.c
app_nv_backgrounddetect.c.1.4.2x.patch
app_nv_faxdetect.c
app_nv_faxdetect.c.1.4.2x.patch
app_nv_Makefile.patch
README

Enjoy!!!
//Drew Thomson


See also

  • NVFaxDetect - Detects fax, talk, DMTF, and other tones on IAX, SIP, ZAP, and other channels
  • NVBackgroundDetect - Detects fax, talk, DMTF, and other tones on IAX, SIP, ZAP, and other channels
  • NVLineDetect - Detects answer, busy, congestion, dialtone, dead, and others on IAX, SIP, ZAP, and other channels
  • NVFaxEmail - Integration of SpanDSP, RxFax, and e-mail; quick and simple to use without scripts
  • NVMachineDetect - Answering machine, PBX, and talk detection

Using NVFaxDetect (1.0.6), NVBackgroundDetect, etc from Newman Telecom on Asterisk 1.4.0

You may wish to use software fax detection on Asterisk 1.4.0. When you try to compile NVFaxDetect (or the like) on a new version of Asterisk, you'll see a few errors. The following instructions can help you

Source Modifications

For each respective source file, you will need to do the following. Always backup files prior to changing them!

(To comment out lines, just add "//" (without the quotes) at the beginning of the line. For example, "//LOCAL_USER_ADD(u);" is commented out.)
  • Search for and comment out all lines with: "LOCAL_USER_ADD(u);".
  • Search for and comment out all lines with: "LOCAL_USER_REMOVE(u);".
  • Search for and comment out all lines with: "STANDARD_HANGUP_LOCALUSERS;".
  • Add the following line to the very end of the file (change the second parameter/description to something that is applicable): "AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Fax Detection Application");".
  • Save the modified files.

Installation

After making all of your modifications, you will need to install the updated module. This follows the standard installation instructions.

Please do not attempt installation on live production systems without a fallback plan in place.

  • Type "cd /usr/src/asterisk" (or respective Asterisk directory)
  • Build Modules: Type "make".
  • Install Modules: If the build is successful, type "make install".
  • Restart Asterisk: When Asterisk is running, you can do this from your shell prompt with "asterisk -rx "restart now"". Be careful if you have calls active, as this will drop them immediately. If asterisk is not running, skip to the next step.
  • If Asterisk is running, type "asterisk -vvvvr". If Asterisk is not running, type "asterisk -vvvvc". The CLI should appear.
  • Verify Module: From the Asterisk CLI, type "core show application <app name>" (app name = NVFaxDetect or respective Newman Telecom module). If it shows the module's help, you are in business.

If you run into any problems, temporarily remove the module from the modules directory and restart Asterisk.

Patches for NVFaxDetect

app_nv_faxdetect.c.1.4.patch


The following patch makes app_nv_faxdetect.c compile against Asterisk 1.4.x (tested with 1.4.10). It follows the steps described in the previous section.
The compilation process still issues some warnings that shouldn't interfere with the application's behaviour.


 --- app_nv_faxdetect.c.old  2006-02-24 04:52:29.000000000 +0100-+
 +++ app_nv_faxdetect.c  2007-08-16 03:40:21.000000000 +0200
 @@ -77,7 +77,7 @@
 static int nv_detectfax_exec(struct ast_channel *chan, void *data)
 {
     int res = 0;
 -   struct localuser *u; 
 +   //struct localuser *u;
     char tmp[256] = "\0";
     char *p = NULL;
     char *waitstr = NULL; 
 @@ -157,7 +157,7 @@
     ast_log(LOG_DEBUG, "Preparing detect of fax (waitdur=%dms, sildur=%dms, mindur=%dms, maxdur=%dms)\n",
                        waitdur, sildur, mindur, maxdur);

 -   LOCAL_USER_ADD(u); 
 +   //LOCAL_USER_ADD(u);
    if (chan->_state != AST_STATE_UP && !skipanswer) {
        /* Otherwise answer unless we're supposed to send this while on-hook */
        res = ast_answer(chan);
 @@ -307,14 +307,14 @@
    if (dsp)
        ast_dsp_free(dsp);

 -   LOCAL_USER_REMOVE(u);
 +   //LOCAL_USER_REMOVE(u);

    return res;
 }

 int unload_module(void)
 {
 -   STANDARD_HANGUP_LOCALUSERS;
 +   //STANDARD_HANGUP_LOCALUSERS;
    return ast_unregister_application(app);
 }

 @@ -339,3 +339,5 @@
  {
    return ASTERISK_GPL_KEY;
  }
 +
 +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Fax detection application");



Put the file in the apps/ subdirectory of the Asterisk source tree, put the original app_nv_faxdetect.c file in the same dir and then issue the command
patch app_nv_faxdetect.c app_nv_faxdetect.c.1.4.patch

menuselect-deps.in.patch

This small patch adds app_nv_faxdetect to the menu configuration interface of asterisk (make menuselect).



+++ menuselect-deps.in 2007-08-16 03:32:32.000000000 +0200@@ -14,6 +14,7 @@
NBS=@PBX_NBS@
NETSNMP=@PBX_NETSNMP@
NEWT=@PBX_NEWT@
+NV_DETECT=@PBX_NV_DETECT@OGG=@PBX_OGG@
OSPTK=@PBX_OSPTK@
OSSAUDIO=@PBX_OSS@


To apply the patch, copy the patchfile to the build_tools subdir of the Asterisk source tree, and then issue the command
patch menuselect-deps.in menuselect-deps.in.patch


Error(s) that many have directed you here:

I'm including the following mostly to be sure that Google will direct people here that search for the compiling error.
[CC] app_nv_faxdetect.c -> app_nv_faxdetect.o
In file included from app_nv_faxdetect.c:19:
/usr/src/asterisk/include/asterisk/file.h:27:2: #error You must include stdio.h before file.h!
app_nv_faxdetect.c:64: warning: type defaults to `int' in declaration of `STANDARD_LOCAL_USER'
app_nv_faxdetect.c:64: warning: data definition has no type or storage class
app_nv_faxdetect.c:66: warning: type defaults to `int' in declaration of `LOCAL_USER_DECL'
app_nv_faxdetect.c:66: warning: data definition has no type or storage class
app_nv_faxdetect.c: In function `nv_detectfax_exec':
app_nv_faxdetect.c:151: warning: implicit declaration of function `LOCAL_USER_ADD'
app_nv_faxdetect.c:301: warning: implicit declaration of function `LOCAL_USER_REMOVE'
app_nv_faxdetect.c: At top level:
app_nv_faxdetect.c:307: warning: no previous prototype for 'unload_module'
app_nv_faxdetect.c: In function `unload_module':
app_nv_faxdetect.c:308: error: `STANDARD_HANGUP_LOCALUSERS' undeclared (first use in this function)
app_nv_faxdetect.c:308: error: (Each undeclared identifier is reported only once
app_nv_faxdetect.c:308: error: for each function it appears in.)
app_nv_faxdetect.c: At top level:
app_nv_faxdetect.c:313: warning: no previous prototype for 'load_module'
app_nv_faxdetect.c:318: warning: no previous prototype for 'description'
app_nv_faxdetect.c:323: warning: no previous prototype for 'usecount'
app_nv_faxdetect.c: In function `usecount':
app_nv_faxdetect.c:325: warning: implicit declaration of function `STANDARD_USECOUNT'
app_nv_faxdetect.c: At top level:
app_nv_faxdetect.c:330: warning: function declaration isn't a prototype
make[1]: *** [app_nv_faxdetect.o] Error 1
make: *** [apps] Error 2


UPDATE FOR ASTERISK 1.4.24+ USERS


Working version for Asterisk 1.4.24+

http://www.austechpartnerships.com/app_nv_1.4.2x_07052010.tar.gz

Tested with 1.4.26, 1.4.26.1, 1.4.31.

Also includes NVBackgroundDetect but was untested. Module compiles and loads into Asterisk properly so presumptions would be that it works as well.

Files included in tarball:
app_nv_backgrounddetect.c
app_nv_backgrounddetect.c.1.4.2x.patch
app_nv_faxdetect.c
app_nv_faxdetect.c.1.4.2x.patch
app_nv_Makefile.patch
README

Enjoy!!!
//Drew Thomson


See also

  • NVFaxDetect - Detects fax, talk, DMTF, and other tones on IAX, SIP, ZAP, and other channels
  • NVBackgroundDetect - Detects fax, talk, DMTF, and other tones on IAX, SIP, ZAP, and other channels
  • NVLineDetect - Detects answer, busy, congestion, dialtone, dead, and others on IAX, SIP, ZAP, and other channels
  • NVFaxEmail - Integration of SpanDSP, RxFax, and e-mail; quick and simple to use without scripts
  • NVMachineDetect - Answering machine, PBX, and talk detection
Created by: SwitzerBusinessSolutions, Last modification: Fri 01 of Jun, 2012 (05:08 UTC) by admin
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+