dellmont-credit-checker v4.5.3 [09 Sep 2019] by Dominic
Description
GNU/Linux program to notify if credit on one or more Dellmont/Finarea/Betamax voip provider accounts is running low. Once successfully tested it can be run as daily cron job with -q option and -m email_address option so that an email is generated when action to top up credit on the account is required. Can also run under MS Windows using Cygwin (https://www.cygwin.com/), or can be run as CGI job on Linux/Apache webserver.
Usage
dellmont-credit-checker.sh [option]
Conffile
A conffile should be in the same directory as dellmont-credit-checker.sh with name dellmont-credit-checker.conf, or if elsewhere or differently named then be specified by option -f, and should contain one or more lines giving the Dellmont/Finarea/Betamax account details in the form:
website username password [test_credit_level_in_cents/pence] [credit_reduction_in_cents/pence] [credit_recordfile]
where the test_credit_level_in_cents/pence is >=100 or 0 (0 means 'never send email'). If you don't specify a test_credit_level_in_cents/pence then the current credit level is always displayed (but no email is ever sent).
If you specify them, the credit_reduction and credit_recordfile work together to perform an additional test. The program will record in credit_recordfile the amount of credit for the given portal each time it is run, and notify you if the credit has reduced since the last time by more than the credit_reduction. This can be useful to warn you of unusual activity on the account or of a change in tariffs that is significant for you. Set the credit_reduction_in_cents/pence to a level that is more than you would expect to see consumed between consecutive (e.g. daily) runs of dellmont-credit-checker.sh e.g. 2000 (for 20 euros/day or 20 dollars/day).
Here's an example single-line conffile to generate a warning email if the credit on the www.voipdiscount.com account falls below 3 euros (or dollars):
Temporary_Files
Temporary files are saved with 600 permissions in $TEMP which is set to a standard location, normally /tmp, unless it is already defined (so you can define it if you want a special location). Unless run with debug option, all such files are deleted after running - except the cookiejar file which is retained so it can be reused. (The same cookiejar file is also used, if found, by get-vt-cdrs.sh.)
Call Records History
You can use options -r and -t to download call records and append them to a specified file.
CGI_Usage
Here is an example of how you could use dellmont-credit-checker.sh on your own (presumably internal) website (with CGI configured appropriately on your webserver):
http://www.mywebsite.com/dellmont-credit-checker.sh?options=-vf%20/path/to/my_conf_file.conf%20-m%20me@mymailaddress.com
Options
-c [path] - save captcha images (if any) at path (default is current path)
-d debug - be very verbose and retain temporary files
-f [path/conffile] - path and name of conffile
-h show this help and exit
-l show changelog and exit
-m [emailaddress] - send any messages about low credit or too-rapidly-falling credit to the specified address (assumes sendmail is available and working)
-M "[month-year-page]" - specify a specific earlier month and page for call record history retrieval (with -r option) - format '/MM/YYYY/P'
-n delete any existing cookies and start over
-p pause on cookie expiry - wait 2 minutes if cookies have expired before trying to login (because cookies are usually for 24 hours exactly this should allow a second login 24 hours later without requiring new cookies)
-q quiet
-r [path/file] - specify a directory for call record history files (per website and account) - data is appended to any existing files
-s skip if captcha code is requested (e.g. for unattended process)
-t [char] - if extracting call records (-r), this specifies the field separator character (default comma)
-u set umask for any created files (default 177: files are readable/writable only by current user)
-v be more verbose
Dependencies
awk bash coreutils curl grep openssl sed [sendmail] umask
License
Copyright © 2022 Dominic Raferd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Portal List
Here is a list of websites / sip portals belonging to and/or operated by Dellmont. To find more, google "is a service from dellmont sarl" (with the quotes). Try a portal with dellmont-credit-checker.sh - it might work!
If one of these (or another which you know is run by Dellmont) does not work, run dellmont-credit-checker.sh with -d option and drop me an email attaching the temporary files (two or three per portal, password is stripped out anyway).
https://www.12voip.com
https://www.actionvoip.com
https://www.aptvoip.com
https://www.bestvoipreselling.com
https://www.calleasy.com
https://www.callingcredit.com
https://www.cheapbuzzer.com
https://www.cheapvoip.com
https://www.cosmovoip.com
https://www.dialcheap.com
https://www.dialnow.com
https://www.discountvoip.co.uk
https://www.easyvoip.com
https://www.freecall.com
https://www.freevoipdeal.com
https://www.frynga.com
https://www.hotvoip.com
https://www.internetcalls.com
https://www.intervoip.com
https://www.jumblo.com
https://www.justvoip.com
https://www.lowratevoip.com
https://www.megavoip.com
https://www.netappel.fr
https://www.nonoh.net
https://www.pennyconnect.com
https://www.poivy.com
https://www.powervoip.com
https://www.rebvoice.com
https://www.rynga.com
https://www.scydo.com
https://www.sipdiscount.com
https://www.smartvoip.com
https://www.smsdiscount.com
https://www.smslisto.com
https://www.stuntcalls.com
https://www.supervoip.com
https://www.voicetrading.com
https://www.voipblast.com
https://www.voipblazer.com
https://www.voipbuster.com
https://www.voipbusterpro.com
https://www.voipcheap.co.uk
https://www.voipcheap.com
https://www.voipdiscount.com
https://www.voipgain.com
https://www.voipmove.com
https://www.voippro.com
https://www.voipraider.com
https://www.voipsmash.com
https://www.voipstunt.com
https://www.voipwise.com
https://www.voipzoom.com
https://www.webcalldirect.com
A page showing relative prices for many of these sites may be found at http://backsla.sh/betamax - it may or may not still be current.
Changelog
4.5.3 [09 Sep 2019]: read gpg2-encrypted conf file (if .gpg filename extension)
4.5.2 [15 Aug 2019]: bugfix for freedays, add -M option (kudos: Mathias Rothe)
4.5.1 [12 Aug 2019]: bugfixes, change -r option to set the output directory (not file)
4.5.0 [07 Aug 2019]: add -r and -t options and show Freedays (if any) (kudos: Mathias Rothe)
4.4.6 [16 Jun 2019]: hide openssl 1.1.1 'deprecated key derivation' message when decrypting
4.4.5 [11 Apr 2019]: update to work with pounds sterling (kudos: Mathias Rothe)
4.4.4 [10 Apr 2019]: update to try to work with captcha
4.4.3 [31 Jul 2018]: update to work with OpenSSL 1.1.0g (backwards compatible)
4.4.2 [27 Mar 2017]: add -u option (set umask)
4.4.1 [29 Jun 2016]: rename cookiejar and temporary files to include userid (number) rather than username
4.4.0 [25 Mar 2016]: bugfix
4.3.9 [16 Mar 2016]: bugfix
4.3.8 [15 Mar 2016]: set permissions of all files created to 600, to secure from other users, move cookiejar files back to $TEMP and rename cookiejar filename to include $USER so that multiple users do not overwrite one another's cookiejars
4.3.7 [19 Feb 2016]: if the specified credit_recordfile can't be accessed, show warning instead of failing
4.3.6 [08 Feb 2016]: bugfix for credit <100 eurocents
4.3.5 [18 May 2015]: move cookiejar file location to /var/tmp
4.3.4 [01 Oct 2014]: minor bugfix
4.3.3 [06 Sep 2014]: allow checking of multiple accounts for same provider
4.3.2 [05 Sep 2014]: improvements to debug text and error output
4.3.1 [23 Jul 2014]: warning message if no lines found in conf file
4.3.0 [28 Nov 2013]: use local openssl for decryption (when required) instead of remote web call (thanks Loran)
4.2.0 [03 Nov 2013]: a lot of changes! Enable CGI usage, remove command-line setting of conffile and email and instead specify these by -f and -m options. Test_credit_level_in_cents is now optional in conffile. Add -v (verbose) option. Squash a bug causing failure if a captcha was requested.
4.1.1 [01 Nov 2013]: select the reported 'user-agent' randomly from a few
4.1.0 [01 Nov 2013]: local solution is tried before relying on remote decryption call (thanks Loran)
4.0.5 [01 Nov 2013]: fix for low-balance or $ currency
4.0.1 [30 Oct 2013]: fix magictag decryption
4.0.0 [29 Oct 2013]: works again, requires an additional decryption web call - note a change to conf file format
3.6 [21 Oct 2013]: works sometimes...
3.5 [04 Oct 2013]: small tweaks but more reliable I think...
3.4 [03 Oct 2013]: retrieves captcha image but still not reliable :(
3.3 [29 Sep 2013]: correction for new credit display code
3.2 [18 Sep 2013]: corrected for new login procedure
3.1 [10 Oct 2012]: minor text improvements
3.0 [27 Aug 2012]: minor text correction for credit reduction
2.9 [16 Aug 2012]: added optional credit reduction notification
2.8 [27 Jun 2012]: now works with www.cheapbuzzer.com, added a list of untested Dellmont websites to the help information
2.7 [25 May 2012]: now works with www.webcalldirect.com
2.6 [25 May 2012]: fix to show correct credit amounts if >=1000
2.5 [15 May 2012]: fix for added hidden field on voipdiscount.com
2.4 [10 May 2012]: improved debug information, voicetrading.com uses method 2, rename previously-named fincheck.sh as dellmont-credit-checker.sh
2.3 [04 May 2012]: improved debug information
2.2 [03 May 2012]: further bugfixes
2.1 [03 May 2012]: now works with www.voipbuster.com
2.0315 [15 Mar 2012]: allow comment lines (beginning with hash #) in conffile
2.0313 [13 Mar 2012]: changes to email and help text and changelog layout, and better removal of temporary files
2.0312 [10 Mar 2012]: improve help, add -l changelog option, remove deprecated methods, add -d debug option, tidy up temporary files, use conffile instead of embedding account data directly in script, first public release
2.0207 [07 Feb 2012]: new code uses curl for voipdiscount.com
2.0103 [03 Jan 2012]: no longer uses finchecker.php or fincheck.php unless you select deprecated method; has 2 different approaches, one currently works for voipdiscount, the other for voicetrading.
1.3 [21 Jun 2010]: stop using external betamax.sh, now uses external fincheck.php via finchecker.php, from http://simong.net/finarea/, using fincheck.phps for fincheck.php; finchecker.php is adapted from example.phps
1.2 [03 Dec 2008]: uses external betamax.sh script
1.1 [17 May 2007]: allow the warning_credit_level_in_euros to be set separately on each call
1.0 [05 Jan 2007]: written by Dominic, it is short and sweet and it works!
Download dellmont-credit-checker.sh
Donation
I have provided this software free gratis and for nothing. If you would like to thank me with a contribution, please let me know and I will send you a link. Thank you!
My Other Sites
- TimeDicer - Onsite/offsite data backup for Windows (uses rdiff-backup)
- Finding a 4D Backup Solution
- Web Scraping How To - extracting data from web sites
My Programs
Here is a selection of some (other) programs I have written, most of which run from the command line (CLI), are freely available and can be obtained by clicking on the links. Dependencies are shown and while in most cases written for a conventional Linux server, they should run on a Raspberry Pi, and many can run under Windows using Windows Subsystem for Linux (WSL) or Cygwin. Email me if you have problems or questions, or if you think I could help with a programming requirement.
Backup Utilities
- TimeDicer - Onsite/offsite data backup for Windows (uses rdiff-backup) [ GNU/Linux & MS Windows©: 2008-20 ]
- rdiff-backup-regress - GNU/Linux script to regress an rdiff-backup archive. [ GNU/Linux: 2012-16 ]
Debian/Ubuntu kernel and LVM Utilities
- kernel-remove - GNU/Linux script to list the installed GNU/Linux kernels in a Debian-based distro (e.g. Ubuntu), and can be used to remove an unwanted kernel and related packages, updating grub appropriately. [ GNU/Linux-Debian/Ubuntu: 2010-22 ]
- lvm-usage - GNU/Linux script to show available disk space and how it is used; run as cron job to warn if usage is above a set percentage. Provides additional information if LVM is in use. [ GNU/Linux: 2012-21 ]
- lvm-delete-snapshot - GNU/Linux script to remove LVM snapshot that has been left over by another process. [ GNU/Linux: 2012-21 ]
- netnames - GNU/Linux script shows current name, biosdevname and 'predictable name' of network device - helps with network device name scheme migration. [ GNU/Linux-Debian/Ubuntu: 2020-20 ]
- lv-convert2cache - GNU/Linux script to convert an existing LV into a cache LV using a smaller faster device as a cache. [ GNU/Linux: 2022-22 ]
Dellmont - VoIP and Mobile Phone Account Utilities
- sms-sender - GNU/Linux script to send text messages using Dellmont’s voicetrading.com. [ GNU/Linux: 2012-18 ]
- get-vt-cdrs - GNU/Linux script to download CDRs (call detail records) from Dellmont’s voicetrading.com or voippro.com. [ GNU/Linux: 2010-19 ]
- saynoto0870 - For UK, a GNU/Linux script which performs automated lookup of the www.saynoto0870.com database, finding cheap or free geographic number replacements for expensive non-geographic (087* or 084*) numbers. [ GNU/Linux: 2012-12 ]
Miscellaneous Programs
- sleepwalker - Windows© program which can be run from a remote machine to 'wake up' a Windows© machine behind a router, wait for it to start and then initiate Remote Desktop session. [MS Windows©: 2008-16]
- relay-enforcer - GNU/Linux program enabling a postfix-based mail server relaying to Gmail to act on reports from Gmail about blocked emails. [ GNU/Linux: 2016-22 ]
- bind9-resolved-switch - GNU/Linux program for switching permanently between using bind9 or systemd-resolved as the system DNS resolver. [ GNU/Linux: 2016-22 ]
- unlock - GNU/Linux remote program for easy entering of decrypt passphrase on a remote machine which has root dm-crypt+LUKS. [ GNU/Linux: 2017-18 ]
- wifi-updown - GNU/Linux program to take down wifi interface if there is a working wired interface (or restore wifi if not). [ GNU/Linux: 2018-22 ]
- routefix - GNU/Linux program to restore a default ip traffic route if there is none such (e.g. after running wifi-updown). [ GNU/Linux: 2018-19 ]
- pdf-compress - GNU/Linux program to create smaller b/w pdf file from an original large pdf file, especially when original resulted from scanning. [ GNU/Linux: 2016-22 ]
- form-extractor - GNU/Linux program to extract form tags from a web page or downloaded file. [ GNU/Linux: 2012-20 ]
- mythic-dns-sync - GNU/Linux program to update DNS record at mythic-beasts.com to match local external ip. [ GNU/Linux: 2016-22 ]
- tiny-device-monitor - GNU/Linux program to test webpages (including password-protected) or machines to check they are live; use as a cron job for your own websites, for hardware presenting a webpage, or for any machines with a presence on your local LAN or on the internet. [ GNU/Linux: 2009-22 ]
- dutree - GNU/Linux program to show a tree-style list of files and directories at the specified location and greater than the specified size (default 1GB). [ GNU/Linux: 2012-20 ]
- Accounts - Multi-business multi-currency accounting software, uses Access [MS Windows©: 1996-2022]
- Rents Program - Residential lettings/landlord front office program, with many special features for UK market [MS Windows©: 1991-2022]
If you have a comment or question, please email me, thank you.
Sorry, Wasim, not directly. However if you install fincheck.sh on your (linux) web server, you can easily save the output to a file for display from a browser.
So if your web home directory on your server is at /var/www/mysite/htdocs then you could have regular cron job like:
/opt/fincheck.sh /opt/fincheck.conf|sed '1s/^/<pre>/;$s/$/<\/pre>/'>/var/www/mysite/htdocs/fincheck. htm
Then you can browse to fincheck.htm to see the output.
thanks for the feedback - fixed now I think in v2.6.
Thanks,
I do not see the capcha code...
The same captcha style appears when you go to singup or create and account.
It seems to be made specifically to avoid console or text browsers to avoid brute force attacks from scripts?
I look forward to hearing how users get on with it...
I agree the guys have tried to stop scripting access, while I can understand they don't want their sites hacked it does seem silly that they make legitimate logins so difficult. There are two problems:
- they provide 10 login forms on each login page and then use a javascript encryption function to pick the right one, so this has to be emulated in code to find which is the right form. If you pick the wrong form your session expires immediately.
- they call for a captcha image for 'new' logins.
Just 2 suggestions for improvement:
- When the credit goes very low, the class you parse is changed from class="balance" to class="low-balance" (for example they change the color to red).
Can you add some more logic if no value detected in balance to try low-balance as well?
- Some providers instead of "euro" symbol use "$". The rest is identical. Can you also add this logic too? (If no euros -> check for dollars, just in case :)
It is based on one very powerful Jsoup library (Java stuff). Probably same idea as yours could be ported too.
I can't avoid the dependencies, but it should run under Windows with Cygwin.
Yes, I managed to use the script. It works!
I think, if you make also a linux server style CGI variant to run say with several query parameters (login, pass, provider) and return just the balance it would be great.
Regards
Take a look to "gibberish-aes-php" and "simpletest scriptable browser". They make possible a PHP variant, where cиrl or php-cиrl are not needed, but Mcrypt (or OpenSSL) on the PHP engine. mail me if you are interested.
I think, there is another way to avoid the remote decryption by doing it within the script itself - this will work for all cases.
I sent you an e-email with details.
I just found your script - thanks for that fabulous piece of software! I'm searching for a way to automatically download the CDRs from voippro[DOT]com - do you plan to implement sth. like that into your script? BTW: voippro[DOT]com is not listed in your "Portal List" but works fine with your script.
I am sending the diff in pastebin
This option saves all the recent calls from the previous month in the home of the User.
To use requires w3m
option
-r save the historic use of the previous month in the home
pastebin[dot]com/80asNMai
pastebin[dot]com/WxsGgjNa
$ ./dellmont-credit-checker.sh -d
dellmont-credit-checker.sh v4.3.0 [28 Nov 2013] by Dominic
==========================
Debug mode
CONFFILE: './dellmont-credit-checker.conf'
Selected user agent: "Mozilla/5.0 (Windows NT 6.2; rv:22.0) Gecko/20130405 Firefox/23.0"
Completed with ERRS: '0'
But credit of 19.36 ¤ is displayed as 1936
It worked on time but now stopped working.
I simply copied .sh and .conf into /usr/lib/cgi-bin and tried to execute....
error....
if I try to execute into shell :
./dellmont-credit-checker.sh: line 1: www . freevoipdeal. com: command not found
Why?
you need to make sure that the user running cgi-bin scripts from webpage has the necessary permissions.
my only thought re the shell error is that maybe you tried to execute conf file instead of sh file?
But now another problem:
here a part of the log:
[FAIL] - captcha code requested
if I use -c option it doesn't work with this error:
No argument value for option c
first, thanks for the great job.
Using it for voipcheap, it works for one user, but not for antoher one. If I activate "debug" the only difference I see is:
working:
--------
Visited : voipcheap/login
Saved as : /(text not allowed!)
Cookies saved as : (text not allowed!)-COOKIEJAR.txt
We are already logged in, retrieving info from original page
Credit (cents) : '717'
-----------------
not working :
-----------
Visited : voipcheap/login
Saved as : (text not allowed!)
Cookies saved as : (text not allowed!)m-COOKIEJAR.txt
Unable to find correct version of hidden tag directly, using remote decryption
Encrypted Magictag: ""
Key : ""
Requesting remote decryption...
error reading input file
An error occurred extracting magictag, aborting...
---------------
both users can login on the website, so user/pass are ok.
thanks for your support
I just have to use the "-n" option to delete cookies between several checks, so that I am able to check multiple acccounts on the same website.
Sorry for disturbance and many thanks again!
Laurent
I have created a github repo at github[dot]com/jvhaarst/dellmont-credit-checker
For now I have disabled the wiki and issues, as I do not want to interfere with this page.
Dag,
Jan
site is waiting for captcha Input which is not given.
Running script interactively in verbose mode outputs
"Please enter Captcha code" and is waiting but I need this script in non interactive mode.
Thank you,
Arthur
Error: w w w.voipbuster.c o m / username - CREDITCENTS is blank
Great tool!
But could you revert the hard-coded paths to sensibly set variables?
Now there's /var/tmp for cookie jar (but not user-unique), /tmp for user agent, and $TEMP for other (sensitive!) files.
I use the script with custom $TEMP variable to safely store stuff outside public directories. Now I need to patch it to stay secure.
Probably best to check the script's basedir for read-write permissions and only fall back to public tmp when no other options seem available. And of course, only set defaults at top of the script, and no hard-coded paths further down. :-)
Best,
Mrtn
For v4.3.7 I have changed file permissions for all created files to 600 (via umask), moved cookiejar and useragents files to $TEMP (i.e. no longer hard-coded) and renamed cookiejar so the name includes $USER.
As you know, you can use custom $TEMP to store stuff elsewhere; this is now explained in help.
Works like a charm with JustVoip and SIPDiscount
Thanks