table of contents
TWIPING(1) | General Commands Manual | TWIPING(1) |
NAME¶
twiping
— Send SMS
ping via the Twilio REST API
SYNOPSIS¶
twiping |
[-c config-file]
[-C curl-flag]
[-F from-number]
[-f format]
[-m reply-pattern]
[-t testcode]
[-u account-sid]
[-p auth-token]
[-P ]
[-w timeout] dest-number |
DESCRIPTION¶
twiping
attempts to transmit a single
outoing SMS message containing a unique test code to the specified
number, and then waits for an SMS response containing
the same test code, using the Twilio REST API.
By default, the test message has the form
TESTxxxxxxxx where the `x' characters are replaced by
random hex digits, and only the hex digits (the
xxxxxxxx part) are matched in the reply. This behavior
can be changed using the -t
and
-m
flags.
Phone numbers must be specified in E.164 format, i.e., with a leading plus sign and followed by the country code, or as a 5 or 6 digit short code.
OPTIONS¶
-c
- Specify the configuration file.
This file is simply a shell script that when sourced must define the ACCOUNT_SID and AUTH_TOKEN shell variables containing the corresponding Twilio credentials. This file must also define FROM_NUMBER shell variable if the
-F
flag is not used to specify the sending SMS phone number.If the
-c
flag is not specified, /etc/twilio.conf is assumed. -C
- Pass flag to curl(1).
-f
- Specify an alternate printf(1) format string; the default is TEST%s. The format string should contain one instance of %s, which will be replaced by the test code.
-F
- Specify the sending SMS phone number. This flag is required if the configuration file does not define a default FROM_NUMBER.
-p
- Specify authentication token, overriding AUTH_TOKEN from the configuration file, if any.
-m
- Match responses using the specified extended regular expression. Any occurrences of @TESTCODE@ within reply-pattern will be replaced with the test code.
-P
- Read authentication token from the terminal.
-t
- Don't generate or send a test code. Instead, assume the specified testcode has just been sent and expect a reply normally.
-u
- Specify Account SID, overriding ACCOUNT_SID from the configuration file, if any.
-w
- Wait up to timeout seconds for a reply. The default timeout is 30 seconds.
EXIT STATUS¶
twiping
exits zero normally, 1 an error
occurs, or 2 if no reponse is received within the specified timeout.
Errors returned from the Twilio REST API are reported to standard error.
BUGS¶
The Twilio API is unable to communicate with other short codes, whether managed by Twilio or not.
SEE ALSO¶
curl(1), smslen(1), twimsg(1), twils(1), twirm(1), twilog(1).
AUTHOR¶
Archie L. Cobbs ⟨archie.cobbs@gmail.com⟩
October 2, 2019 | Linux 6.13.6-1-default |