Class Net_SMS_sms2email_http

Description

Net_SMS_sms2email_http Class implements the HTTP API for accessing the sms2email (www.sms2email.com) SMS gateway.

Copyright 2003-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

$Horde: framework/Net_SMS/SMS/sms2email_http.php,v 1.23.10.15 2009/01/06 15:23:28 jan Exp $

Located in /Net_SMS/SMS/sms2email_http.php (line 25)

Net_SMS
   |
   --Net_SMS_sms2email_http
Variable Summary
Method Summary
 mixed addContact (string $name, integer $number)
 mixed deleteContact (integer $id)
 mixed getAddressBook ()
 mixed getError (integer $error, [ $error_text = ''], string $text)
 array getInfo ()
 mixed getList (string $id)
 mixed getLists ()
 array getParams ()
 array getSendParams ( $params)
 mixed listCreate (string $name, array $numbers)
 mixed listDelete (string $id)
 mixed listRename (string $id, string $name)
 mixed listUpdate (string $id, string $name, [string $numbers = array()])
 mixed updateContact (integer $id, string $name, integer $number)
Variables
array $capabilities = array('auth' => false,
'batch' => 100,
'multi' => true,
'receive' => false,
'credit' => true,
'addressbook' => true,
'lists' => true)
(line 43)

An array of capabilities, so that the driver can report which

operations it supports and which it doesn't. Possible values are:

   auth        - The gateway requires authentication before sending;
   batch       - Batch sending is supported;
   multi       - Sending of messages to multiple recipients is supported;
   receive     - Whether this driver is capable of receiving SMS;
   credit      - Is use of the gateway based on credits;
   addressbook - Are gateway addressbooks supported;
   lists       - Gateway support for distribution lists.

mixed $_base_url = 'horde.sms2email.com/horde/' (line 27)

Inherited Variables

Inherited from Net_SMS

Net_SMS::$_auth
Net_SMS::$_params
Methods
addContact (line 178)

Adds a contact to the gateway's addressbook.

  • return: The remote contact ID on success or PEAR Error on failure.
mixed addContact (string $name, integer $number)
  • string $name: The name for this contact
  • integer $number: The contact's phone number.
deleteContact (line 239)

Deletes a contact in the gateway's addressbook.

  • return: True on success or PEAR Error on failure.
mixed deleteContact (integer $id)
  • integer $id: The contact's ID on the gateway.
getAddressBook (line 270)

Fetches the entire address book from the gateway.

  • return: Array of contacts on success or PEAR Error on failure. Format of the returned contacts is for example:
    1.                    array(<uniqueid> => array('name'   => <name>,
    2.                                              'number' => <number>),
    3.                          <uniqueid> => array('name'   => <name>,
    4.                                              'number' => <number>));
mixed getAddressBook ()
getDefaultSendParams (line 564)

Returns the parameters that can be set as default for sending messages using this gateway driver and displayed when sending messages.

  • return: Array of parameters that can be set as default.
array getDefaultSendParams ()

Redefinition of:
Net_SMS::getDefaultSendParams()
Returns send parameters for a gateway from the driver subclass getDefaultSendParams()function. These are parameters which are available to the user during sending, such as setting a time for delivery, or type of SMS (normal text or flash), or source address, etc.
getError (line 634)

Returns a string representation of an error code.

  • return: A textual message corresponding to the error code or a PEAR Error if passed an existing error text.
  • todo: Check which of these are actually required and trim down the list.
mixed getError (integer $error, [ $error_text = ''], string $text)
  • integer $error: The error code to look up.
  • string $text: An existing error text to use to raise a PEAR Error.
  • $error_text
getInfo (line 521)

Identifies this gateway driver and returns a brief description.

  • return: Array of driver info.
array getInfo ()
getList (line 479)

Fetches a specific distribution list from the gateway.

  • return: An array of numbers in the list on success or PEAR Error on failure.
mixed getList (string $id)
  • string $id: The ID of the distribution list to fetch.
getLists (line 433)

Fetches a listing of available distribution lists on the server.

  • return: An array of lists on success or PEAR Error on failure. Format of the returned lists is for example:
    1.                    array(<uniqueid> => array('name'   => <name>),
    2.                          <uniqueid> => array('name'   => <name>));
mixed getLists ()
getParams (line 542)

Returns the required parameters for this gateway driver. The settable

parameters for this gateway are:

   - user            - The username for authentication on the gateway;
   - password        - The password for authentication on the gateway;
   - ssl             - Whether or not to use SSL for communication with
                       the gateway.
   - delivery_report - A URL for a script which would accept delivery
                       report from the gateway.

  • return: Array of required parameters.
array getParams ()
getSendParams (line 594)

Returns the parameters for sending messages using this gateway driver, displayed when sending messages. These are filtered out using the default values set up when creating the gateway.

  • return: Array of required parameters.
  • todo: Would be nice to use a time/date setup rather than minutes from now for the delivery time. Upload field for ringtones/logos?
array getSendParams ( $params)
  • $params
listCreate (line 316)

Creates a new distribution list on the gateway.

  • return: Gateway ID for the created list on success or PEAR Error on failure.
mixed listCreate (string $name, array $numbers)
  • string $name: An arbitrary name for the new list.
  • array $numbers: A simple array of numbers to add to the list.
listDelete (line 349)

Deletes a distribution list from the gateway.

  • return: True on success or PEAR Error on failure.
mixed listDelete (string $id)
  • string $id: The gateway ID for the list to delete.
listRename (line 419)

Renames a distribution list on the gateway. Does nothing other than calling the listUpdate() function with just the $id and $name variables.

  • return: True on success or PEAR Error on failure.
mixed listRename (string $id, string $name)
  • string $id: The gateway ID for the list to update.
  • string $name: The new arbitrary name for the list.
listUpdate (line 382)

Updates a distribution list on the gateway.

  • return: True on success or PEAR Error on failure.
mixed listUpdate (string $id, string $name, [string $numbers = array()])
  • string $id: The gateway ID for the list to update.
  • string $name: The arbitrary name of the list. If different from the original name that the list was created under, the list will be renamed.
  • string $numbers: The new list of numbers in the list. If left empty, the result will be the same as calling the listRename() function.
updateContact (line 210)

Updates a contact in the gateway's addressbook.

  • return: True on success or PEAR Error on failure.
mixed updateContact (integer $id, string $name, integer $number)
  • integer $id: The contact's ID on the gateway.
  • string $name: The name for this contact
  • integer $number: The contact's phone number.

Inherited Methods

Inherited From Net_SMS

 Net_SMS::Net_SMS()
 Net_SMS::authenticate()
 Net_SMS::factory()
 Net_SMS::getBalance()
 Net_SMS::getDefaultSendParams()
 Net_SMS::getDrivers()
 Net_SMS::getGatewayInfo()
 Net_SMS::getGatewayParams()
 Net_SMS::hasCapability()
 Net_SMS::send()
 Net_SMS::singleton()

Documentation generated on Sun, 30 Jan 2011 05:21:36 +0000 by phpDocumentor 1.4.3