Menu

No hangup from blacklist match (?)

Help
chuck gelm
2017-02-27
2017-02-27
  • chuck gelm

    chuck gelm - 2017-02-27

    I can view calls using ncid v1.6 GUI on server host.

    ncidd not hanging up on blacklist match. (?)

    Zoom 3095 (CX93001-EIS_V0.2012-V92) USB modem
    ncidd v1.6
    Linux Mint mate 18.1
    soft link '/dev/modem -> /dev/ttyACM0'.
    Appended to ncidd.blacklist:
    937?776?####
    937776####
    (uh, #### I obfuscated the last 4 digits of my cell phone#. Those are really 4 real digits. ;-)
    (should those "?" be "-" ?)
    Here is my ncidd.conf lines that don't start with "#":
    send cidlog
    send cidinfo
    set hangup = 3
    set announce = NumberDisconnected.rmd
    AT+VSM=?
    AT+VSM=130 # CONEXANT
    set ttyport = /dev/ttyACM0 # Linux USB modem 0
    -and-
    With minicom, both 'AT+VSM=?' and 'AT+VSM=130' return 'ERROR'

    Errors and/or omissions please,
    Chuck

     
  • John L. Chmielewski

    Hi Chuck,

    You should always include the ncidd startup file. Startup ends with

    End of startup: <date> <time>
    

    The provided startup information is the ncidd command line and configuration, your OS, and your modem.

    The easiest way to provide it is using this command line:

    ncidd -Dv3 -L T-log -P T-pid -H 1
    

    In your case I also need the log file to contain a call with the problem. You can edit the telephone number as you did before but best if you use something like 9375551212. The number in the black list must match the number in cidcall.log. If you have a dash in your blacklist number, that is the reason it does not match.

    No need to be root if you can write in the current directory. Abort with <CTRL><C> after you reach end of startup or after a test call. The ncidd startup will be in T-log.

    If you try to view the VSM values with minicom, the modem to be placed in voice mode. After minicom connects to the modem, this should work for you:

    at+fclass=8
    at+vsm=?
    at+vsm=130
    

    When you have a problem, use hangup mode 1 as in the above command line just in case the problem is in the modem voice mode.

     

    Last edit: John L. Chmielewski 2017-02-27
  • chuck gelm

    chuck gelm - 2017-02-27

    Thank you for your help.

    There were some phone numbers in /var/log/cidcall.log,
    but not the latest one from my cell phone. Was it due to
    your recommended debugging startup command line?

    I edited ncidd.conf to 'hangup=1'.
    restarted ncidd with your arguments. Started ncid and when
    I called from my cell phone I watched more than 3 rings occur without a hangup.

    I replaced my cell phone number with 9375551212.
    Here is T-log:

    Started: 02/27/2017 14:54:09
    Server: ncidd (NCID) 1.6
    API: 1.5 Feature Set 1 2 3 4 5
    Sysname: Linux
    Machine: x86_64
    Release: 4.4.0-53-generic
    Version: #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016
    Command line: ncidd
    -Dv3
    -L T-log
    -P t-pid
    -H 1
    Logfile: T-log
    Processed config file: /usr/local/etc/ncid/ncidd.conf
    Verbose level: 3
    Configured to send 'cidlog' to clients.
    Configured to send 'cidinfo' to clients.
    Helper tools:
    /usr/local/bin/cidupdate
    /usr/local/bin/ncidutil
    Using simple expressions for aliases
    Using simple expressions for blacklist/whitelist entries

    Begin: Loading alias, blacklist, and whitelist files [14:54:09]
    Processed alias file: /usr/local/etc/ncid/ncidd.alias
    Alias Table:
    Number of Entries: 1
    Processed blacklist file: /usr/local/etc/ncid/ncidd.blacklist
    Blacklist Table:
    Number of Entries: 18
    Calls in the blacklist file will be terminated
    Processed whitelist file: /usr/local/etc/ncid/ncidd.whitelist
    Whitelist Table:
    Number of Entries: 0
    Calls in the whitelist file will not be terminated
    Leading 1 in call & alias/blacklist/whitelist not ignored
    End: Loaded alias, blacklist, and whitelist files [14:54:09]

    CID logfile: /var/log/cidcall.log
    CID logfile maximum size: 110000 bytes
    Data logfile not present: /var/log/ciddata.log
    Maximum number of clients/gateways: 50
    Telephone Line Identifier: -
    TTY port opened: /dev/modem
    TTY port speed: 115200
    TTY lock file: /var/lock/lockdev/LCK..modem
    TTY port control signals enabled
    TTY port initialized in ICANON mode.
    Checking Modem Capabilities...
    TTY port changed to RAW mode.
    Sent Modem 20 of 20 characters:
    AT Z S0=0 E1 V1 Q0
    Modem response: 26 characters in 1 read:
    AT Z S0=0 E1 V1 Q0

    OK

    Modem Initialized
    Sent Modem 6 of 6 characters:
    ATI3
    Modem response: 39 characters in 1 read:
    ATI3

    CX93001-EIS_V0.2002-V92

    OK

    Modem Identifier: CX93001-EIS_V0.2002-V92
    Sent Modem 9 of 9 characters:
    AT+GCI?
    Modem response: 27 characters in 1 read:
    AT+GCI?

    +GCI: B5

    OK

    Modem country code: B5 United States
    Sent Modem 6 of 6 characters:
    AT&V
    Modem response: 824 characters in 1 read:
    AT&V

    ACTIVE PROFILE:
    B1 E1 L2 M1 N0 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T5 &X0 &Y0
    S00:000 S01:000 S02:043 S03:013 S04:010 S05:008 S06:002 S07:050 S08:001 S09:006
    S10:014 S11:085 S12:050 S18:000 S25:005 S26:001 S36:007 S38:020 S46:138 S48:007
    S95:000

    STORED PROFILE 0:
    B1 E1 L1 M1 N0 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T5 &X0
    S00:000 S02:043 S06:002 S07:050 S08:001 S09:006 S10:014 S11:085 S12:050 S18:000
    S36:007 S40:104 S41:195 S46:138 S95:000

    STORED PROFILE 1:
    B1 E1 L1 M1 N0 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T5 &X0
    S00:000 S02:043 S06:002 S07:050 S08:001 S09:006 S10:014 S11:085 S12:050 S18:000
    S36:007 S40:104 S41:195 S46:138 S95:000

    TELEPHONE NUMBERS:
    0= 1=
    2= 3=

    OK

    Modem ACTIVE PROFILE:
    B1 E1 L2 M1 N0 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T5 &X0 &Y0
    S00:000 S01:000 S02:043 S03:013 S04:010 S05:008 S06:002 S07:050 S08:001 S09:006
    S10:014 S11:085 S12:050 S18:000 S25:005 S26:001 S36:007 S38:020 S46:138 S48:007
    S95:000

    STORED PROFILE 0:
    B1 E1 L1 M1 N0 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T5 &X0
    S00:000 S02:043 S06:002 S07:050 S08:001 S09:006 S10:014 S11:085 S12:050 S18:000
    S36:007 S40:104 S41:195 S46:138 S95:000

    STORED PROFILE 1:
    B1 E1 L1 M1 N0 Q0 T V1 W0 X4 Y0 &C1 &D2 &G0 &J0 &K3 &Q5 &R1 &S0 &T5 &X0
    S00:000 S02:043 S06:002 S07:050 S08:001 S09:006 S10:014 S11:085 S12:050 S18:000
    S36:007 S40:104 S41:195 S46:138 S95:000

    TELEPHONE NUMBERS:
    0= 1=
    2= 3=
    Sent Modem 13 of 13 characters:
    AT+FCLASS=?
    Modem response: 32 characters in 1 read:
    AT+FCLASS=?

    0,1,1.0,8

    OK

    Modem supports Data Mode
    Modem supports FAX Mode 1
    Modem supports VOICE Mode
    TTY port changed to ICANON mode.
    TTY port changed to RAW mode.
    Sent Modem 20 of 20 characters:
    AT Z S0=0 E1 V1 Q0
    Modem response: 26 characters in 1 read:
    AT Z S0=0 E1 V1 Q0

    OK

    Modem initialized.
    Sent Modem 11 of 11 characters:
    AT+VCID=1
    Modem response: 17 characters in 1 read:
    AT+VCID=1

    OK

    Modem set for CallerID.
    TTY port changed to ICANON mode.
    CallerID from AT Modem and optional gateways
    Does not handle modem calls without Caller ID
    Modem used for CallerID and to terminate calls
    Internal Hangup Mode = 1: hangup on a blacklisted call
    Network Port: 3333
    Debug Mode
    Wrote pid 12368 in pidfile: t-pid
    Modem is fd 4
    NCID connection socket is sd 5 pos 1
    End of startup: 02/27/2017 14:54:09

    Client 6 pos 2 from 127.0.0.1 [localhost] connected 02/27/2017 14:54:27
    200 Server: ncidd (NCID) 1.6
    210 API: 1.5 Feature Set 1 2 3 4 5
    Client Sent: HELLO: IDENT: client ncid (NCID) 1.6
    Client Ident: client ncid (NCID) 1.6
    Client Sent: no data
    Sent call log: /var/log/cidcall.log
    250 End of call log
    Sent 'hangup-1' option to client
    300 End of connection startup

    RING
    CIDINFO: LINEPOTSRING1TIME14:58:30*

    DATE =
    TIME =
    NMBR = 9375551212
    NAME = "9375551212"
    Whitelist empty
    Checked Blacklist for match flag=0 ret=0 nmbrmatch=0
    CID: DATE02272017TIME1458LINEPOTSNMBR9375551212MESGNONENAME"9375551212"*

    RING
    CIDINFO: LINEPOTSRING2TIME14:58:34*

    RING
    CIDINFO: LINEPOTSRING3TIME14:58:38*

    RING
    CIDINFO: LINEPOTSRING4TIME14:58:42*

    RING
    CIDINFO: LINEPOTSRING5TIME14:58:46
    CIDINFO:
    LINEPOTSRING0TIME14:58:54

     
  • chuck gelm

    chuck gelm - 2017-02-28

    However, there is still no hangup.
    Still hoping to send a *.rmd file to blacklisted callers.

     
  • John L. Chmielewski

    Your problem is shown by this line in the T-log file:

    Checked Blacklist for match flag=0 ret=0 nmbrmatch=0
    

    The ret=0 says your call did not match the number in the blacklist. Please check the entry in the memory table using ncidd -Dv8. Compare it to the name received in the CID line. You need to determine why the match fails. Maybe you have a unprintable character like a <CR>.

    One thing to try if you are matching on the name. Match instead on the number. The quotes around the name maybe causing the problem,

     
  • chuck gelm

    chuck gelm - 2017-02-28

    Thanks.

    Hmmm, maybe I am not understanding the syntax in ncidd.blacklist.

    ncidd -Dv8 displays the 18 default blacklist expressions, but not the number I added.

    Below is 'etc/ncid/ncidd.blacklist' and 'T-log'.

    ncidd.hangup blacklist file

    File last changed: Jul 4, 2016

    This file contains the names or numbers of telephone calls to

    be terminated automatically using the hangup option.

    Definitions and Line format

    The number must be a string of digits as they appear in

    /var/log/cidcall.log. A leading '1' is required if it is

    in /var/log/cidcall.log.

    A partial name or number can match.

    There are three types of lines: blank, comment, and entry

    Blank lines and comment lines are ignored.

    Entry lines are processed.

    Entry lines contain one or more expressions and an

    optional comment. An expression is either a string of

    non-blank characters or everything between double quotes.

    Multiple expressions are separated by spaces. A comment

    must be last.

    If a number or name begins with a '#' it bust be inside double quotes.

    Entry line comments are either normal comments or match name comments.

    A normal comment begins with a '#' and must not be immediately

    followed by an equals sign. Anything after the '#' is ignored.

    A match name comment begins with '#=' and is followed by a name to

    display for the caller when the entry matches either the number

    or name of a call. Do not use double quotes around the name.

    NOTES

    - Each expression is compared to the caller name and number.

    - If simple expressions are used (regex = 0 in ncidd.conf):

    * A '^' at the beginning an expression means it must match

    at the start of a name or number

    * A "^1?" at the beginning makes a leading 1 optional.

    This is only useful for US numbers.

    * Upper and lower case letters are significant.

    * A partial name or number can match.

    - If regular expressions are used (regex = 1 in ncidd.conf):

    * POSIX Extended Regular Expression syntax is used.

    https://en.wikipedia.org/wiki/Regular_expression

    * Introduction to Regular Expressions

    http://www.regular-expressions.info/quickstart.html

    - A leading '1' is required if it is in /var/log/cidcall.log

    - If an expression is longer than the name or number, it

    will never match.

    A hangup Name can be given in the comment field

    A "#=" indicates the comment field is a match name

    Do not use double quotes around the name

    Example: 407-555-5670 #= Unwanted Marketing Call

    EXAMPLES

    Blacklist the entire 999 areacode (if no leading 1 needed): ^999

    Blacklist the entire 999 areacode (if leading 1 needed): ^1999

    Blacklist the entire 999 areacode (with/without leading 1): ^1?999

    Blacklist callers with the name "BAD MARKETING": "BAD MARKETING"

    Blacklist anything with "MARKETING" in the name: MARKETING

    Blacklist name and number on one line: Ogre 13215551212

    DEFAULT ENTRIES

    Compatible with either the simple expressions or regular expressions.

    999 - spoofing see http://wiki.answers.com/Q/Which_city_has_area_code_999

    ^1?999 # unassigned and used for spoofing calls

    Expensive international calling area codes and 900 Pay-Per-Call

    https://www.fcc.gov/guides/900-pay-call-and-other-information-services

    https://www.fcc.gov/guides/one-ring-wireless-phone-scam

    http://www.forbes.com/sites/josephsteinberg/2014/02/01/dont-return-calls-from-these-area-codes-its-a-scam/

    ^1?264 # Antiqua
    ^1?268 # Antiqua
    ^1?284 # British Virgin Islands
    ^1?273 # Grenada
    ^1?345 # Cayman Islands
    ^1?441 # Bermuda
    ^1?473 # Grenada, Carriacou and Petite Martinique
    ^1?649 # Turks and Caicos Islands
    ^1?664 # Montserrat
    ^1?758 # St Lucia
    ^1?767 # Dominica
    ^1?784 # St. Vincent & Grenadines
    ^1?876 # Jamica
    ^1?809 # Dominican Republic
    ^1?829 # Dominican Republic
    ^1?849 # Dominican Republic
    ^1?900 # Pay-Per-Call Service
    9375551212

    Add Expressions here

    T-Log:

    Started: 02/28/2017 16:29:25
    Server: ncidd (NCID) 1.6
    API: 1.5 Feature Set 1 2 3 4 5
    Sysname: Linux
    Machine: x86_64
    Release: 4.4.0-53-generic
    Version: #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016
    Command line: ncidd
    -Dv8
    -L T-log
    Logfile: T-log
    Processed config file: /usr/local/etc/ncid/ncidd.conf
    Verbose level: 8
    Configured to send 'cidlog' to clients.
    Configured to send 'cidinfo' to clients.
    Helper tools:
    /usr/local/bin/cidupdate
    /usr/local/bin/ncidutil
    Using simple expressions for aliases

    Begin: Loading alias, blacklist, and whitelist files [16:29:25]
    Processed alias file: /usr/local/etc/ncid/ncidd.alias
    Alias Table:
    Number of Entries: 1
    SLOT TYPE FROM TO DEPEND
    ---- ---- ---- -- ------
    000 LINEONLY - POTS
    Processed blacklist file: /usr/local/etc/ncid/ncidd.blacklist
    Blacklist Table:
    Number of Entries: 18
    SLOT ENTRY MATCH NAME
    ---- ----- ----------
    000 "^1?999"
    001 "^1?264"
    002 "^1?268"
    003 "^1?284"
    004 "^1?273"
    005 "^1?345"
    006 "^1?441"
    007 "^1?473"
    008 "^1?649"
    009 "^1?664"
    010 "^1?758"
    011 "^1?767"
    012 "^1?784"
    013 "^1?876"
    014 "^1?809"
    015 "^1?829"
    016 "^1?849"
    017 "^1?900"
    Processed whitelist file: /usr/local/etc/ncid/ncidd.whitelist
    Whitelist Table:
    Number of Entries: 0
    Leading 1 in call & alias/blacklist/whitelist not ignored
    End: Loaded alias, blacklist, and whitelist files [16:29:25]

    Terminated by Verbose Level 8: 02/28/2017 16:29:25

    Chuck

     
  • John L. Chmielewski

    Chuck,

    You seem to have compiled NCID. I do not know if you reviewed the generic install in the NCID User Manual but some parts are somewhat confusing and will be improved on the website.

    If compiling for Linux Mint, you could do

    make package
    sudo make package-install
    

    but Linux Mint is based on Ubuntu so you should instead do

    make ubuntu
    sudo make ubuntu-install
    

    Your problem is you are adding the phone number to /etc/ncid/ncidd.blacklist when the ncidd server is using /usr/local/etc/ncid/ncidd.blacklist. Your T-log file specified the location by the line:

    Processed blacklist file: /usr/local/etc/ncid/ncidd.blacklist
    

    The fix is to compile and install as above so the files are placed in /usr and /etc instead of /usr/local. Better yet, if your processor is 64 bit, download the server deb package from NCID at sourceforge and install it. Refer to the Ubuntu DEB Package Install

    In the future, please attach files instead of posting them.

     

    Last edit: John L. Chmielewski 2017-03-01
  • chuck gelm

    chuck gelm - 2017-03-01

    Thanks.

    I just noticed, a few minutes ago, the
    /etc/ncid/
    .vs.
    /usr/local/etc/ncid/
    mishap. This I can work around.
    I can create a soft link in /etc/ncid to /usr/local/etc/ncid .

    I do have a 64 bit cpu and 64 bit kernel on the current host (my LAMP server).
    However, it is likely that I will also try 'ncid' out on my Raspberry Pi(s).
    I would like to have the locations of the configuration files as similar as practical
    among all my hosts
    [home server,
    other hosts as ncid-clients, and
    Raspberry Pi(s) as portable server/client]
    .

    You recommended using a 'DEB package install. At
    https://sourceforge.net/projects/ncid/files/ncid/1.6/
    I see many files including
    'ncid-client_1.6-1_all.deb'.
    However, I do not see a 'ncid-server*.deb' file.
    :-| ?

    I am baffled as to what I need, how to compile it, and where to configure it.
    :-|

    I have tried

    make
    sudo make
    -install

    where * = each of package, debian, ubuntu

    but ncidd -Dv8 always indicates the ncidd.blacklist file is in /usr/local/etc/ncid/
    do I need a 'make clean' or 'make dist-clean' between each trial?

     
    • Todd Andrews

      Todd Andrews - 2017-03-03

      Hi Chuck,

      Is there a particular reason you wanted to compile NCID from source instead of using the available packages?

      We do take feedback about the documentation very seriously, and your comments would be from the unique perspective of someone setting up NCID for the first time. It would be helpful to eventually know what important pieces of information you wish the documentation had communicated, either something that was inadvertently ommitted or that requires clarification.

      NCID has a lot of documentation and we're conscious of the fact that the HTML version especially is not always easy to navigate. I'm hoping we can eventually switch to http://www.mkdocs.org/ but its current version would require a lot of work and would significantly break the automatic procedures John has in place for releasing new versions of NCID.

       
  • John L. Chmielewski

    You need to do a make clobber when doing a new compile and install. When compiled, ncidd has the configuration files locations hard coded. A make and install places packages in /usr/local. Do a make for usage on the various make and install types.

    The ncid package contains the server and support programs. The other packages are marked ncid-client, ncid-gateways, etc. Here are the server programs for Ubuntu and Raspbian (Raspberry Pi):

    ncid_1.6-1_amd64.deb    (64 bit server package)
    ncid_1.6-1_armhf.deb    (Raspbian server package)
    

    The noarch deb packages can be used with either server, they are scripts.

    When you compile NCID, you make the entire system, but when you use the deb or rpm packages you only install what is needed. If you compile review my previous post.

    You should review the online NCID User Manual which provides guidence on getting started with NCID and using various options. We encourage feedback to help improve it.

    The ncidd server configuration files between Ubuntu and Raspbian are interchangable provided you did not modify the configuration file for something specific to Ubuntu or Raspbian. For example, maybe the modems require different init scripts or each system has specific options.

     
  • chuck gelm

    chuck gelm - 2017-03-02

    Will
    sudo dpkg -i ncid_1.6-1_amd64.deb
    overwrite ncidd and then ncidd will no longer be looking in
    /usr/local/etc/ncid/ and
    /usr/local/share/ncid/
    for .conf, .alias, .blacklist, .whitelist, /extensions/, and /recordings/
    ?
    Meanwhile, I'll be re-reading the manual.

    Oh, by the way, I have a new error:
    The folder 'lockdev' does not exist as in
    /var/lock/lockdev/LCK..modem
    .
    A log is attached.
    ( I had to allow <script> from 'truste.com' to include an attachment. )

     
  • John L. Chmielewski

    The new error is beccause you do not have permission to write in the /var/lock/lockdev directory. When debugging you need to use the option -l T-lck if you want to play a recording or run ncidd as root using sudo.

    The dpkg command will install the package but you need to review INSTALL-Ubuntu or INSTALL-Raspbian Method 3 in the INSTALL or UPGRADE section. The package will overwrite /usr/sbin/ncidd so it will look into /usr and /etc for files.

     

Log in to post a comment.