The voipms Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The voipms Reference Manual

This is the voipms Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Tue Nov 15 05:15:14 2022 GMT+0.

Table of Contents


1 Introduction

Common Lisp HTTP api client to the voip.ms api.

Sample usage:

(defparameter *voipms-auth*
  (make-voipms-auth :username
                    (sb-posix:getenv "VOIPMS_USERNAME")
                    :password
                    (sb-posix:getenv "VOIPMS_PASSWORD")))

(loop for sms in
              (voipms:get-sms *voipms-auth*
                              :contact "8004664411"
                              :from (voipms:date-n-days-ago 10))
      do
         (with-json-paths sms
             (message type did contact id date)
           (let ((received-p (= (parse-integer type) 1)))
             (format t "Message received from ~A to ~A on ~A: ~A"
                     (if received-p contact did)
                     (if received-p did contact)
                     date
                     message))))

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 voipms

Common Lisp HTTP api client to the voip.ms api.

Author

Ernesto Alfonso <erjoalgo@gmail.com>

License

BSD

Dependencies
  • erjoalgo-webutil (system).
  • local-time (system).
Source

voipms.asd.

Child Component

voipms.lisp (file).


3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.1 voipms/voipms.asd

Source

voipms.asd.

Parent Component

voipms (system).

ASDF Systems

voipms.


Previous: , Up: Lisp   [Contents][Index]

3.1.2 voipms/voipms.lisp

Source

voipms.asd.

Parent Component

voipms (system).

Packages

voipms.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 voipms

Source

voipms.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Public Interface


5.1.1 Special variables

Special Variable: +local-time-timestring-format+

The LOCAL-TIME::FORMAT-TIMESTRING format that the voip.ms API expects in date parameters.

Package

voipms.

Source

voipms.lisp.


5.1.2 Ordinary functions

Function: date-n-days-ago (days)

Returns a date string n DAYS in the past.

Useful as the FROM (date) parameter in various api, e.g. getSMS which defaults FROM to today.

Package

voipms.

Source

voipms.lisp.

Function: get-sms (auth &key from to contact did limit type sms)

voip.ms api call for getSMS. Supports the query parameters: (FROM TO CONTACT DID LIMIT TYPE SMS).

Package

voipms.

Source

voipms.lisp.

Function: make-voipms-auth (&key username password)
Package

voipms.

Source

voipms.lisp.

Function: request (auth method &optional qparams no-error allowed-statuses)

Makes an HTTP request to the voip.ms API.

AUTH is an VOIPMS-AUTH struct specifying credentials.
METHOD is the voip.ms api method.
QPARAMS is an alist of query parameters.

If NO-ERROR is non-nil, no error is raised on non-success statuses. If ALLOWED-STATUSES is non-nil, no error is raised on any non-success statuses contained in this list.

For API docs, see https://voip.ms/m/apidocs.php.

Package

voipms.

Source

voipms.lisp.

Function: send-sms (auth &key did dst message)

voip.ms api call for sendSMS. Supports the query parameters: (DID DST MESSAGE).

Package

voipms.

Source

voipms.lisp.


5.2 Internals


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.1 Special variables

Special Variable: base-url
Package

voipms.

Source

voipms.lisp.


5.2.2 Macros

Macro: def-endpoint (name method params &key allowed-statuses)

Define a function NAME which makes a request to the voip.ms api

with the given METHOD and query parameters.

ALLOWED-STATUSES
specifies a list of non-success statuses returned by the API to be considered non-errors.

Package

voipms.

Source

voipms.lisp.


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.3 Ordinary functions

Function: alist-get (key alist)
Package

voipms.

Source

voipms.lisp.

Function: cancel-did (auth &key did cancelcomment portout test)

voip.ms api call for cancelDID. Supports the query parameters: (DID CANCELCOMMENT PORTOUT TEST).

Package

voipms.

Source

voipms.lisp.

Function: copy-voipms-auth (instance)
Package

voipms.

Source

voipms.lisp.

Function: get-allowed-codecs (auth &key)

voip.ms api call for getAllowedCodecs. Supports the query parameters: NIL.

Package

voipms.

Source

voipms.lisp.

Function: get-auth-types (auth &key)

voip.ms api call for getAuthTypes. Supports the query parameters: NIL.

Package

voipms.

Source

voipms.lisp.

Function: get-device-types (auth &key)

voip.ms api call for getDeviceTypes. Supports the query parameters: NIL.

Package

voipms.

Source

voipms.lisp.

Function: get-dids-info (auth &key client did)

voip.ms api call for getDIDsInfo. Supports the query parameters: (CLIENT DID).

Package

voipms.

Source

voipms.lisp.

Function: get-dids-usa (auth &key state ratecenter)

voip.ms api call for getDIDsUSA. Supports the query parameters: (STATE RATECENTER).

Package

voipms.

Source

voipms.lisp.

Function: get-dtmf-modes (auth &key)

voip.ms api call for getDTMFModes. Supports the query parameters: NIL.

Package

voipms.

Source

voipms.lisp.

Function: get-lock-international (auth &key)

voip.ms api call for getLockInternational. Supports the query parameters: NIL.

Package

voipms.

Source

voipms.lisp.

Function: get-music-on-holdp (auth &key)

voip.ms api call for getMusicOnHold. Supports the query parameters: NIL.

Package

voipms.

Source

voipms.lisp.

Function: get-nat (auth &key)

voip.ms api call for getNAT. Supports the query parameters: NIL.

Package

voipms.

Source

voipms.lisp.

Function: get-rate-centers-usa (auth &key state)

voip.ms api call for getRateCentersUSA. Supports the query parameters: (STATE).

Package

voipms.

Source

voipms.lisp.

Function: get-ring-groups (auth &key ring_group)

voip.ms api call for getRingGroups. Supports the query parameters: (RING_GROUP).

Package

voipms.

Source

voipms.lisp.

Function: get-routes (auth &key)

voip.ms api call for getRoutes. Supports the query parameters: NIL.

Package

voipms.

Source

voipms.lisp.

Function: get-servers-info (auth &key server_pop)

voip.ms api call for getServersInfo. Supports the query parameters: (SERVER_POP).

Package

voipms.

Source

voipms.lisp.

Function: get-sub-accounts (auth &key account)

voip.ms api call for getSubAccounts. Supports the query parameters: (ACCOUNT).

Package

voipms.

Source

voipms.lisp.

Function: order-did (auth &key did routing failover_busy failover_unreachable failover_noanswer voicemail pop dialtime cnam callerid_prefix note billing_type account monthly setup minute test)

voip.ms api call for orderDID. Supports the query parameters: (DID ROUTING FAILOVER_BUSY FAILOVER_UNREACHABLE FAILOVER_NOANSWER VOICEMAIL POP DIALTIME CNAM CALLERID_PREFIX NOTE BILLING_TYPE ACCOUNT MONTHLY SETUP MINUTE TEST).

Package

voipms.

Source

voipms.lisp.

Function: send-mms (auth &key did dst message media1 media2 media3)

voip.ms api call for sendMMS. Supports the query parameters: (DID DST MESSAGE MEDIA1 MEDIA2 MEDIA3).

Package

voipms.

Source

voipms.lisp.

Function: set-sms (auth &key did enable email_enabled email_address sms_forward_enable sms_forward url_callback_enable url_callback_retry url_callback smpp_enabled smpp_url smpp_user smpp_pass)

voip.ms api call for setSMS. Supports the query parameters: (DID ENABLE EMAIL_ENABLED EMAIL_ADDRESS SMS_FORWARD_ENABLE SMS_FORWARD URL_CALLBACK_ENABLE URL_CALLBACK_RETRY URL_CALLBACK SMPP_ENABLED SMPP_URL SMPP_USER SMPP_PASS).

Package

voipms.

Source

voipms.lisp.

Function: set-sub-account (auth &key id description auth_type password ip device_type callerid_number canada_routing lock_international international_route music_on_hold language record_calls allowed_codecs dtmf_mode nat sip_traffic max_expiry rtp_timeout rtp_hold_timeout ip_restriction enable_ip_restriction pop_restriction enable_pop_restriction send_bye internal_extension internal_voicemail internal_dialtime reseller_client reseller_package reseller_nextbilling reseller_chargesetup)

voip.ms api call for setSubAccount. Supports the query parameters: (ID DESCRIPTION AUTH_TYPE
PASSWORD IP DEVICE_TYPE CALLERID_NUMBER CANADA_ROUTING LOCK_INTERNATIONAL INTERNATIONAL_ROUTE MUSIC_ON_HOLD LANGUAGE RECORD_CALLS ALLOWED_CODECS DTMF_MODE NAT SIP_TRAFFIC MAX_EXPIRY RTP_TIMEOUT RTP_HOLD_TIMEOUT IP_RESTRICTION ENABLE_IP_RESTRICTION POP_RESTRICTION ENABLE_POP_RESTRICTION SEND_BYE INTERNAL_EXTENSION INTERNAL_VOICEMAIL INTERNAL_DIALTIME RESELLER_CLIENT RESELLER_PACKAGE RESELLER_NEXTBILLING RESELLER_CHARGESETUP).

Package

voipms.

Source

voipms.lisp.

Function: set-sub-account-sparse (auth account-name &rest args &key id description auth-type password ip device-type callerid-number canada-routing lock-international international-route music-on-hold language record-calls allowed-codecs dtmf-mode nat sip-traffic max-expiry rtp-timeout rtp-hold-timeout ip-restriction enable-ip-restriction pop-restriction enable-pop-restriction send-bye internal-extension internal-voicemail internal-dialtime reseller-client reseller-package reseller-nextbilling reseller-chargesetup)
Package

voipms.

Source

voipms.lisp.

Function: voipms-auth-p (object)
Package

voipms.

Source

voipms.lisp.

Reader: voipms-auth-password (instance)
Writer: (setf voipms-auth-password) (instance)
Package

voipms.

Source

voipms.lisp.

Target Slot

password.

Reader: voipms-auth-username (instance)
Writer: (setf voipms-auth-username) (instance)
Package

voipms.

Source

voipms.lisp.

Target Slot

username.


5.2.4 Structures

Structure: voipms-auth
Package

voipms.

Source

voipms.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: username
Readers

voipms-auth-username.

Writers

(setf voipms-auth-username).

Slot: password
Readers

voipms-auth-password.

Writers

(setf voipms-auth-password).


Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts


Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
A   C   D   F   G   M   O   R   S   V  
Index Entry  Section

(
(setf voipms-auth-password): Private ordinary functions
(setf voipms-auth-username): Private ordinary functions

A
alist-get: Private ordinary functions

C
cancel-did: Private ordinary functions
copy-voipms-auth: Private ordinary functions

D
date-n-days-ago: Public ordinary functions
def-endpoint: Private macros

F
Function, (setf voipms-auth-password): Private ordinary functions
Function, (setf voipms-auth-username): Private ordinary functions
Function, alist-get: Private ordinary functions
Function, cancel-did: Private ordinary functions
Function, copy-voipms-auth: Private ordinary functions
Function, date-n-days-ago: Public ordinary functions
Function, get-allowed-codecs: Private ordinary functions
Function, get-auth-types: Private ordinary functions
Function, get-device-types: Private ordinary functions
Function, get-dids-info: Private ordinary functions
Function, get-dids-usa: Private ordinary functions
Function, get-dtmf-modes: Private ordinary functions
Function, get-lock-international: Private ordinary functions
Function, get-music-on-holdp: Private ordinary functions
Function, get-nat: Private ordinary functions
Function, get-rate-centers-usa: Private ordinary functions
Function, get-ring-groups: Private ordinary functions
Function, get-routes: Private ordinary functions
Function, get-servers-info: Private ordinary functions
Function, get-sms: Public ordinary functions
Function, get-sub-accounts: Private ordinary functions
Function, make-voipms-auth: Public ordinary functions
Function, order-did: Private ordinary functions
Function, request: Public ordinary functions
Function, send-mms: Private ordinary functions
Function, send-sms: Public ordinary functions
Function, set-sms: Private ordinary functions
Function, set-sub-account: Private ordinary functions
Function, set-sub-account-sparse: Private ordinary functions
Function, voipms-auth-p: Private ordinary functions
Function, voipms-auth-password: Private ordinary functions
Function, voipms-auth-username: Private ordinary functions

G
get-allowed-codecs: Private ordinary functions
get-auth-types: Private ordinary functions
get-device-types: Private ordinary functions
get-dids-info: Private ordinary functions
get-dids-usa: Private ordinary functions
get-dtmf-modes: Private ordinary functions
get-lock-international: Private ordinary functions
get-music-on-holdp: Private ordinary functions
get-nat: Private ordinary functions
get-rate-centers-usa: Private ordinary functions
get-ring-groups: Private ordinary functions
get-routes: Private ordinary functions
get-servers-info: Private ordinary functions
get-sms: Public ordinary functions
get-sub-accounts: Private ordinary functions

M
Macro, def-endpoint: Private macros
make-voipms-auth: Public ordinary functions

O
order-did: Private ordinary functions

R
request: Public ordinary functions

S
send-mms: Private ordinary functions
send-sms: Public ordinary functions
set-sms: Private ordinary functions
set-sub-account: Private ordinary functions
set-sub-account-sparse: Private ordinary functions

V
voipms-auth-p: Private ordinary functions
voipms-auth-password: Private ordinary functions
voipms-auth-username: Private ordinary functions

Jump to:   (  
A   C   D   F   G   M   O   R   S   V