Sipgate-CLI/README.md

47 lines
1.7 KiB
Markdown
Raw Normal View History

2021-03-04 16:57:48 +00:00
# Sipgate CLI
This is a small hack to send faxes via the sipgate REST API from the command line.
## Deployment
Install [jq](https://stedolan.github.io/jq/download/).
2021-03-13 13:50:48 +00:00
Add your login credentials to `login_credentials_muster.sh` and rename the file to `.env`
2021-04-07 16:36:18 +00:00
If you use Letterheads Address database, uncomment the last line of that file and add `your/path/to/Letterhead`
2021-03-04 16:57:48 +00:00
## Usage
2021-03-04 17:59:13 +00:00
`./fax.sh <letter.pdf> <recipient>`
2021-04-07 17:09:47 +00:00
with a german fax number `<recipient>`
2021-04-07 16:37:16 +00:00
2021-04-07 16:36:18 +00:00
`./fax.sh <letter.pdf> -handle <handle>`
2021-04-07 17:09:47 +00:00
asks Letterhead's address database for <handle>'s fax number.
2021-04-07 16:37:16 +00:00
2021-04-07 17:09:47 +00:00
` ./fax.sh -help`
prints usage Message and exits
2021-03-04 17:59:13 +00:00
2021-03-04 16:57:48 +00:00
sipgate doesn't accept pdf files larger than 30 pages or 10MB.
2021-03-04 17:59:13 +00:00
2021-03-04 17:31:10 +00:00
~~For now, `<recipient>` has to be numbers-only, starting with `+49`. It is planned to parse different number formats.~~ Should be done.
2021-04-07 17:09:47 +00:00
~~Spaces in filename seem to make trouble at the moment - avoid them.~~ Spaces in filenames are difficult. No guarantee, but should be handled now.
2021-03-04 19:41:00 +00:00
`status.sh` shows ID, Date and Status of the last ten fax set from this device.
2021-03-04 17:31:10 +00:00
`balance.sh` just gives your account balance.
`faxreport.sh [options] [id]` loads the report of a given fax id (as shown by status.sh). If no `id` ist given, it takes the last fax sent from this machine.
2021-03-14 11:58:34 +00:00
Options:
* `-p` to only print and not save the report
* `-d` to delete the given id from `.fax_history`
2021-03-14 10:38:08 +00:00
2021-03-04 19:25:39 +00:00
## Recommendation
Put
```
alias fax="/your/path/to/this/project/fax.sh"
alias faxstatus="/your/path/to/this/project/status.sh"
alias faxbalance="/your/path/to/this/project/balance.sh"
2021-04-07 16:31:15 +00:00
# The following is obsolete, but for documentation/compatibility reasons:
fax-from-handle () { fax $1 "$(/your/path/to/this/project/Letterhead/Adressen/address.sh -f $2)"; }
2021-03-04 19:25:39 +00:00
```
2021-03-04 19:26:48 +00:00
into your `.bashrc` or `.bash_aliases`
2021-03-04 19:25:39 +00:00