- WebUI by React, Daisyui and Tailwind CSS
- Http api
- Websocket server
- A single binary with embed static files
Need install Gammu and configure the gammu.
apt install libgammu-dev
gammu-web -h
Usage of ./gammu-web:
-debug
Debug mode
-gammu-conf string
Gammu config file (default "~/.gammurc")
-log string
Log to file, default to stdout
-port string
Server listen port (default "21234")
-test
Test mode, and not start gammu service
-token string
Api access token
# Firstly, clone the repo from github
git clone https://github.com/ctaoist/gammu-web.git
# build golang progarm
go mod tidy
go build -ldflags "-s -w"
# build react src
cd gammu-web/src-web
npm install -g vite
npm install
vite build
# dev run, need run golang program at first.
vite
example: /api/get_phone_info?token=xxxxx
response:
Filed | Type | Description |
---|---|---|
ownNumber |
string | The number of the SIM card |
request:
Filed | Type | Description |
---|---|---|
number |
string | Send SMS to the phone number |
text |
string | The content to send |
example: /api/send_sms?token=xxx&number=xxxxxx&text=1234gammu
response:
{
"retCode": 0,
"errorMsg": ""
}
request:
Filed | Type | Description |
---|---|---|
number |
string | The phone number to get sms |
page |
int | The page to request. There is 20 messages per page. Default is 0 . |
example: /api/get_messages?token=xxx&number=xxxxxx&page=0
response:
{
"retCode": 0,
"errorMsg": "",
"data": [Msg{}, ...]
}
Msg{}
:
Filed | Type | Description |
---|---|---|
id |
string | The id of msg |
self_number |
string | The number of the SIM card |
number |
string | The phone number to get sms |
text |
string | The content of sms |
sent |
bool | Send or Receive sms |
time |
int64 | The time stamp |
request:
Filed | Type | Description |
---|---|---|
number |
string | The phone number to delete |
example: /api/delete_sms?token=xxx&number=xxxxxx
response:
{
"retCode": 0,
"errorMsg": ""
}
e.g.: /log?token=xxxxxxxxx
e.g.: '/api/clear_log?token=xxxxxx'
This software is released under the GPL2.0 license.