GOIP SMS Interface
Initialization
Communication of this system use clear text for transmission over UDP
transport layer. Please setup the retransmission mechanism for reduces the
packet loss between the SMS server and GoIP.
SMS Server Initialization: Set the authentication ID and password for GOIP,
and save the list of IDs and passwords. Open the UDP port then start listening.
GOIP Parameters: Enable “SMS Sender” on the configuration page, fills your
SMS server address and port, authentication ID and password (refer to above
“SMS Server Initialization” for setting). Then restart the GOIP terminal.
Registration and Keepalive
GoIP SMS Server
[Link] and Keepalive
[Link] Ack
Step Description
[Link] GOIP will send a keepalive packet to server every 30s.
ster Format:
and req:$count;id:$id;pass:$password;num:$gsm_num;signal:$gsm_sign
Keep al;gsm_status:$gsm_status;voip_status:$voip_status;
alive Variable:
$count: counter for sending packets. Initialize to 1 when GOIP
power up and increase by 1 after a packet is sent out.
$id: authentication id set in configuration page.
$password: authentication password set in configuration page.
$gsm_num: sim card number
$gsm_signal: sim signal
$gsm_status: LOGIN or LOGOUT
$voip_status: status of SIP or H323, LOGIN or LOGOUT
[Link] SMS server will verify the authentication id and password of the
palive keepalive packet received. And send keepalive ack if the id and
ack password are matched with the authentication list.
Format:
reg:$count;status:$status;
e.g.
GOIP send the keepalive with “req:10;id:goipid1;pass:password1;” to SMS
server. SMS server send the keepalive ack with “reg:10;status:0;” if goipid1
and password1 is valid.)
Process for Bulk SMS
[Link]
[Link]/BulkSMSReject
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
Step Description
1. BulkSMSRequest At the beginning, SMS server will send a bulk SMS
Request to GOIP, include the SMS content and
length in utf8 format. The SMS content should be
limited to 3000 bytes or less.
Format: MSG $sendid $length $msg\n
Variable:
$sendid: Integer, as a bulk SMS session identifier.
Note, all messages described below should use the
same “sendid” defined here if they are belong to a
same bulk SMS session.
$length: Integer in utf8 format, as the SMS
content length
$msg: SMS content in utf8 format
[Link] GOIP will do the initialization for the bulk SMS
BulkSMSReject when Bulk SMS Request received. Note, the other
messages of this bulk SMS should be received in
90s after Bulk SMS Request received. Or, GOIP will
stop the session and release.
(1) When the initialization successful, GOIP will
send a BulkRequest Confirm to server and request
for authentication
Format: PASSWORD $sendid\n
Variable:
$sendid: Integer, bulk SMS session identifier in
BulkSMSRequest.
(2) When the initialization failed, GOIP will send a
BulkSMSReject to server, include the error
message.
Format: ERROR $sendid $errormsg\n
Variable:
$sendid: Integer, bulk SMS session identifier in
BulkSMSRequest.
$errormsg: String, Error message. Now too many
request for bulk SMS received at the same time is
the main reason of the failure. Note, GOIP only
support 5 bulk SMS session at the same time. And,
server should stop the session when receive
bulkSMSRequest Reject. Then, try again later.
[Link] SMS server should send a AuthenticationRequest
with the password to GOIP.
Format: PASSWORD $sendid $password\n
Variable:
$sendid: Integer, bulk SMS session identifier in
BulkSMSRequest.
$password: The registration password of GOIP
[Link] GOIP will verify the password in
AuthenticationReject AuthenticationRequest and return the result to
server.
(1) When authentication successful, GOIP will send
a AuthenticationConfirm to server.
Format: SEND $sendid\n
Variable:
$sendid: Integer, bulk SMS session identifier in
BulkSMSRequest.
(2) When authentication failed, GOIP will send a
AuthenticationReject to server and wait for the
next AuthenticationRequest or the EndRequest
Format: ERROR $sendid PASSWORD\n
Variable:
$sendid: Integer, bulk SMS session identifier in
BulkSMSRequest.
[Link] GOIP need about 2-5 seconds to send a SMS. So, to
avoid packet loos, SMS server could send a
SubmitNumberRequest to GOIP to get the sending
status of an appointed number every serial
seconds until the SMS is sent successfully. Note,
the number should be in the full format of
international telephone code. E.g. China:
+86XXXXXX, H.K.: +852XXXXXXX. And, GOIP only
save the sending status of the last 10 numbers in
this group
Format: SEND $sendid $telid $telnum\n
Variable:
$sendid: Integer, bulk SMS session identifier in
BulkSMSRequest.
$telid: Integer, the unique
SubmitNumberRequest sequence number defined
by server.
$teinum: String, telephone number
6. SubmitNumberStatus GOIP will send a SubmitNumberStatus to server
when the SubmitNumberRequest received.
(1) when sending SMS to appointed number
successful, GOIP will send a
SubmitNumberStatus with OK to server.
Format: OK $sendid $telid\n
Variable:
$sendid: Integer, bulk SMS session identifier in
BulkSMSRequest.
$telid: Integer, unique sequence number in
SubmitNumberRequest.
(2) When sending failed, GOIP will send a
SubmitNumberStatus with ERROR to server.
Format: ERROR $sendid $telid
errorstatus:$errorid\n
Variable:
$sendid: Integer, bulk SMS session identifier in
BulkSMSRequest.
$telid: Integer, unique sequence number in
SubmitNumberRequest.
$errorid: Integer, error code. Usually it is equal
to 1.
(3) When the telid in SubmitNumberRequest is not
in the list of which save the recent 10 sending
number, GOIP will save the telid in the waiting
list and send a SubmitNumberStatus with WAIT.
Format: WAIT $sendid $telid\n
Variable:
$sendid: Integer, bulk SMS session identifier in
BulkSMSRequest.
$telid: Integer, unique sequence number in
SubmitNumberRequest.
[Link] Note, SMS server should send the next
SubmitNumberRequest to GOIP after the
SubmitNumberStatus with OK or ERROR received
Same as 5
8. SubmitNumberStatus Same as 6
9. EndReqeust SMS server could send a EndRequest to GOIP to
finish the bulk SMS session.
Format: DONE $sendid\n
Variable:
$sendid: Integer, bulk SMS session identifier in
BulkSMSRequest.
[Link] GOIP will release the bulk SMS session resource
when EndRequest received. And return a
EndConfirm to server
Format: DONE $sendid\n
Variable:
$sendid: Integer, bulk SMS session identifier in
BulkSMSRequest.
Example:
Assume: sendid: 11, SMS content: hello, Goip password:password1
MSG 11 5 hello\n
PASSWORD 11\n
PASSWORD 11 password1\n
SEND 11\n
SEND 11 1 +8613800138000\n
OK 11 1\n
SEND 11 2 +8613800138001\n
WAIT 11 2\n
SEND 11 2 +8613800138001\n
OK 11 2\n
DONE 11 \n
DONE 11 \n
RECEIVE SMS
Goip Sms Server
Data of received SMS
Server ACK
Step Description
[Link] data If received SMS, Goip will relay the SMS to Server. Goip will resend
of the data if Server no response in 3 seconds, most resend 3 times.
receiverSM Format:
S to Server. RECEIVE:$recvid;id:$id;password:$password;srcnum:$srcnum;msg:$
msg
Variable:
$recvid:int, count with the current time stamp decreasing;
$id: authentication id set in configuration page.
$password: authentication password set in configuration page.
$srcnum: Source mobile number
$msg: Content of SMS,utf8 format
[Link] Sms server will receive SMS and check the goip id and password, then
ACK send a ACK.
Successful Format:RECEIVE $recvid OK\n
Error Format:RECEIVE $recvid ERROR $errmsg
Variable:$recvid: int, the goip count; $errmsg:error massge
Example:
Assume: A Goip(id:goipid1, password:password1 )received a SMS “just a
test” from mobile “+8613513415667”. And it got a count 1270197307, then will send
to SMS Server like this:
”RECEIVE:1270197307;id:goipid1;pass:password1;srcnum:+8613513415
667;msg:just a test”
Sms server check goip id and password, Saved the SMS data, and reply:
”RECEIVE 1270197307 OK”