![]() |
BillMax Billing Solutions 877.245.5629 sales@billmax.com |
This following documentation is intended for use when developing an alternate interface client (e.g. replacement for bmui.cgi). It may also be helpful for understanding the client/server interaction for debugging purposes.
In general, the data passed between the server and client is of two forms: simple string and parameter list. Simple strings typically convey some message while parameter lists typically contain data.
Each record exchanged is prefixed with a code (number). Here are the currently supported codes:
Simple string message indicating success.
Operation was successful, parameter list returned.
Simple string message indicating failure.
Operation failed, parameter list returned.
Simple string message indicating a fatal error. Server terminates.
Fatal error, parameter list returned. Server terminates.
End of parameter list.
End of parameter list set.
Parameter lists are formatted as a series of 'variable=value' single quoted strings. For example: 'lname=Smith''fname=Bill'. They are usually terminated with the code 4000.
Shown below are the currently supported commands. C indicates client requests and S indicates successful bmuid responses. Failure results aren't shown. In general, the client should be coded to handle any of the codes listed above.
C->
S-> 1000 Command OK.
The VIRTUALCOMPANY command is optional. If supplied, it must be the first command issued, otherwise it is ignored.
C-> VIRTUALCOMPANY <n>
S-> 1000 Command OK.
The VERSION command can be issued anytime.
C-> VERSION
S-> 1001 'BMUIDVERS=<v>''BMUIDDATE=<d>''BILLMAXVER=<v>'
S-> 4000
The USER and PASS commands authenticate the particular combination of client/server. They must be must be issued and accepted before the AUTH command.
C-> USER <user>
S-> User name okay, need password.
C-> PASS <password>
S-> 1000 User logged in, proceed.
The AUTH command authenticates the end user. The user_login name and user_password are ciphered if the bmui_cidx value is > 0.
C-> AUTH 'bmui_cidx=<n>''bmui_d01=<user_login_name>''bmui_d02=<user_password>'
S-> 1001 ACCT=<n>''USER=<n>''SRVC=<n>''LABEL=<n>'
'VIRTUALCOMPANY=<n>''bmui_cidx=<n>''bmui_d01=<s>''bmui_d02=<s>'
The remaining commands (with the exception of QUIT) can only be issued after the user has been authenticated. The GETLIST command can only be used to retrieve lists whose names end in a 's'. When requesting a list specify the name without the 's'. For Example: 'list=mspeed' for the list named mspeeds.
C-> GETLIST 'list=name'
C-> 4000
S-> 1001 'item_0=<value>:<description>:<0|1>''item_1=<value>:<description>:<0|1>'...
S-> 4000
GETCONFIGURATION returns a list of parameters from the globalconf table. The columns returned are dictated by the tabledefaults entries.
C-> GETCONFIGURATION
S-> 1001 'column_name=value''column_name=value'...
S-> 4000
DETPOPDATA returns pop data and a pop number that matches the supplied filters. POP_FIELDS is optional, if not supplied, PHONENUMBER is the default.
C-> DETPOPDATA ['POP_FIELDS=<f>']['pf1=<f>']...['pf10=<f>']
C-> 4000
S-> 1001 'SERVICE_pop=<n>''<var>select_0=<value>:<description>:<0|1>'...
S-> 4000
SERVDEFS returns a list of service definitions that match the passed search filters. Note that what is returned is dependent on the servdefselection table contents and the VIRTUALCOMPANY value, if any. If action=getsrvc and number is also passed, the list of eligible servdefs for service changes (from number's servdef) is returned instead. A list is returned for every matched servdef. Each list is terminated by the end of list code (4000). The end of the results is denote by the 5000 code.
C-> SERVDEFS ['action=getsrvc''number=<n>']['sdf1=filter']...['sdf10=filter']
C-> 4000
S-> 1001 'column_name=value''column_name=value'...
S-> 4000
S-> 1001 'column_name=value''column_name=value'...
S-> 4000
S-> 5000
GETACCT retrieves all the READ and READ/WRITE columns for the specified account. It can't be used to retrieve an account that hasn't been authenticated. If the optional 'T' flag is supplied, additional labels for each branch of the account/user/service tree are also returned.
C-> GETACCT <n> [T]
S-> 1001 'column_name=value''column_name=value'...
S-> 4000
GETUSER retrieves all the READ and READ/WRITE columns for the specified user. It can't be used to retrieve a user that hasn't been authenticated. If the optional 'T' flag is supplied, additional labels for each branch of the user/service tree are also returned.
C-> GETUSER <n> [T]
S-> 1001 'column_name=value''column_name=value'...
S-> 4000
GETSRVC retrieves all the READ and READ/WRITE columns for the specified service.
C-> GETSRVC <n>
S-> 1001 'column_name=value''column_name=value'...
S-> 4000
GETSTMT returns a customer statement using the as of date supplied. Date is formatted as 'YYYY-MM-DD'. Note that non ascii characters are hex escaped (for example \n becomes =0A) in the output.
C-> GETSTMT <date>
S-> 1001 'line0=<text>''line1=<text>'...
S-> 4000
GETCALL returns datacall statistics for the user. Note the non terminated list call.
C-> GETCALL 'service=<n>'['limit=<n>']'startdate_year=<y>''startdate_month=<m>'
'startdate_day=<d>''enddate_year=<y>''enddate_month=<m>''enddate_day=<d>'
S-> 1001 'line0=<text>''line1=<text>'...
S-> 4000
CREATECUST creates an account/user/service triplet and optionally charges a credit card. It must be passed all the required values (from tabledefaults) for each of these tables.
C-> CREATECUST 'column_name=value''column_name=value'...
C-> 4000
S-> 1001 'line0=<text>''line1=<text>'...
S-> 4000
UPDATEACCT updates an account record. It must be passed all the required columns.
C-> UPDATEACCT 'column_name=value''column_name=value'...
C-> 4000
S-> 1000 Command OK.
UPDATEUSER updates a user record. It must be passed all the required columns.
C-> UPDATEUSER 'column_name=value''column_name=value'...
C-> 4000
S-> 1000 Command OK.
UPDATESERVICE updates a user record. It must be passed all the required columns.
C-> UPDATESERVICE 'column_name=value''column_name=value'...
C-> 4000
S-> 1000 Command OK.
CHANGESERVICE converts an existing service from one service definition to another.
C-> CHANGESERVICE 'number=<n>''servdef=<n>''column_name=value'...
C-> 4000
S-> 1000 Command OK.
ADDUSER adds a user and a service to an existing account.
C-> ADDUSER 'ACCT=<n>''column_name=value''column_name=value'...
C-> 4000
S-> 1000 Command OK.
ADDSRVC adds a service to an user.
C-> ADDSRVC 'ACCT=<n>''SERVICE_user=<n>''column_name=value''column_name=value'...
C-> 4000
S-> 1000 Command OK.
QUIT terminates the connection. The daemon instance is shut down.
C-> QUIT