SMPP Class
Properties Methods Events Configuration Settings Errors
The Smpp Component implements a lightweight message transmission interface using the Short Message Peer-to-Peer protocol, most known for its use in cellular text messaging.
Class Name
IPWorks_SMPP
Procedural Interface
ipworks_smpp_open(); ipworks_smpp_close($res); ipworks_smpp_register_callback($res, $id, $function); ipworks_smpp_get_last_error($res); ipworks_smpp_get_last_error_code($res); ipworks_smpp_set($res, $id, $index, $value); ipworks_smpp_get($res, $id, $index); ipworks_smpp_do_addrecipient($res, $recipienttype, $recipientaddress); ipworks_smpp_do_cancelmessage($res, $messageid); ipworks_smpp_do_checklink($res); ipworks_smpp_do_checkmessagestatus($res, $messageid); ipworks_smpp_do_config($res, $configurationstring); ipworks_smpp_do_connect($res, $userid, $password); ipworks_smpp_do_disconnect($res); ipworks_smpp_do_doevents($res); ipworks_smpp_do_interrupt($res); ipworks_smpp_do_replacemessage($res, $messageid, $newmessage); ipworks_smpp_do_sendcommand($res, $commandid, $payload); ipworks_smpp_do_senddata($res, $data); ipworks_smpp_do_sendmessage($res, $message);
Remarks
The Smpp Class will bind as a transceiver, and thus can send and receive messages from the server. Additionally, it can send single and multi-recipient messages, and can upload data.
Using Smpp is quite easy. First, simply set the SMPPServer, SMPPPort, and, if needed, the SMPPVersion properties. Second, a single call to the Connect method with a specified user id and password will connect the class.
Transmitting messages is just as easy. You can manipulate the Recipients properties directly, or just use AddRecipient method to add recipients one-by-one to the recipient list. After all recipients have been added, a single call to the SendMessage method will transmit the specified message. If the send is successful, the method will set and return the value of the MessageId property. Otherwise, an Error event will fire for each unsuccessful message destination.
The Smpp Class supports message and data transmission, as well as auxiliary operations such as CheckMessageStatus and ReplaceMessage. All non-implemented features of the protocol are supported through the SendCommand method and PITrail event. Due to the nature of the protocol, all methods and operations are implemented synchronously.
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
Connected | Indicates whether or not the component is bound. |
FirewallAutoDetect | This property tells the component whether or not to automatically detect and use firewall system settings, if available. |
FirewallType | This property determines the type of firewall to connect through. |
FirewallHost | This property contains the name or IP address of firewall (optional). |
FirewallPassword | This property contains a password if authentication is to be used when connecting through the firewall. |
FirewallPort | This property contains the TCP port for the firewall Host . |
FirewallUser | This property contains a user name if authentication is to be used connecting through a firewall. |
Idle | The current status of the component. |
LocalHost | The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
MessageExpiration | Denotes the validity period of the current message. |
MessageId | The identifier of the most recently sent message. |
MessagePriority | The priority level of the current message. |
Password | Contains the user's password. |
Protocol | The SMPP protocol to be used. |
RecipientCount | The number of records in the Recipient arrays. |
RecipientAddress | This property contains the email address of a particular recipient. |
RecipientType | This property contains the type of a particular recipient. |
ScheduledDelivery | Tells the server when to deliver the current message. |
SenderAddress | The address of the ESME. |
ServiceType | Indicates the type of service for the current message. |
SMPPPort | The server port for SMPP (default 2775). |
SMPPServer | The SMPP entity to which the component will connect. |
SMPPVersion | The SMPP version to be used throughout the connection. |
SystemType | A string representing the type of system during a connection. |
Timeout | A timeout for the component. |
UserId | Used for identification with the SMPP service. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
AddRecipient | Will add a recipient of the specified type to the recipient list. |
CancelMessage | Will cancel the specified message. |
CheckLink | Will check the connection to the server. |
CheckMessageStatus | Will retrieve the status of the specified message. |
Config | Sets or retrieves a configuration setting . |
Connect | Will bind as a transceiver to the SMPP service. |
Disconnect | Will disconnect from the SMPP service. |
DoEvents | Processes events from the internal message queue. |
Interrupt | Interrupt the current method. |
ReplaceMessage | Replaces a previously sent message with a new one. |
SendCommand | Will format and send a PDU using the specified command identifier and payload. |
SendData | Sends raw data to Recipients . |
SendMessage | Sends a message to all recipients in the recipient list. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
Connected | This event is fired after a successful bind operation. |
ConnectionStatus | Fired to indicate changes in connection state. |
Disconnected | This event is fired when connection to the SMS service is lost. |
Error | This event is fired when the server detects an error. |
MessageIn | This event is fired upon receipt of a message. |
MessageStatus | This event is fired upon receipt of a message. |
PITrail | This event is fired once for each PDU sent between the client and server. |
ReadyToSend | Fired when IPPort is ready to send data. |
Configuration Settings
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
AddressRange | Specifies the addr_range parameter when binding. |
BindAsReceiver | Causes the component to bind as a receiver. |
BindAsTransmitter | Causes the component to bind as a transmitter. |
DataCoding | The data encoding mechanism to be used for the current message. |
DecodeHexStrings | Will decode an ascii hex-representation of binary data prior to transmission. |
DestinationNPI | The Number Planning Indicator for the destination ESME. |
DestinationTON | The Type of Number for the destination ESME. |
DoSplitLargeMessages | Splits long messages and returns the UDH and Message Parts. |
HexString | A hex-encoded binary string to be sent to the current recipient. |
IncomingDestinationAddress | Returns the dest_addr field inside the received message. |
IntermediateNotification | Causes the component to request intermediate notification. |
MaxCIMDSMSLength | Indicates the maximum SMS message length for the CIMD protocol. |
MaxSMSLength | Indicates the maximum SMS message length. |
MCReceipt | The Type of MC Delivery Receipt requested. |
MessageInReceiptedMessageId | The receipted_message_id field of an incoming deliver_sm PDU. |
MessageMode | The Type of Messaging Mode requested. |
MessageType | The Type of Message. |
ProtocolId | The protocol identifier. |
SMEAcknowledgement | The Type of SME originated acknowledgement requested. |
SplitLargeMessages | Determines whether large messages are split into multiple parts. |
SplitMessageMethod | Determines how large messages are split into multiple parts. |
SourceNPI | The Number Planning Indicator for the ESME. |
SourceTON | The Type of Number for the ESME. |
SynchronousSendCommand | Controls whether SendCommand behaves synchronously or asynchronously. |
SynchronousSendMessage | Controls whether SendMessage behaves synchronously or asynchronously. |
CustomTLV | Optional TLV parameters added after the mandatory parameters and before the payload. |
SubAddr | Defines a unique index for application instance. |
StatusReportRequest | Defines in what cases a status report is created by the server. |
WaitForBanner | Specifies the CIMD2 banner the component will wait for when connecting. |
ConnectionTimeout | Sets a separate timeout value for establishing a connection. |
FirewallAutoDetect | Tells the component whether or not to automatically detect and use firewall system settings, if available. |
FirewallHost | Name or IP address of firewall (optional). |
FirewallPassword | Password to be used if authentication is to be used when connecting through the firewall. |
FirewallPort | The TCP port for the FirewallHost;. |
FirewallType | Determines the type of firewall to connect through. |
FirewallUser | A user name if authentication is to be used connecting through a firewall. |
KeepAliveTime | The inactivity time in milliseconds before a TCP keep-alive packet is sent. |
KeepAliveInterval | The retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received. |
Linger | When set to True, connections are terminated gracefully. |
LingerTime | Time in seconds to have the connection linger. |
LocalHost | The name of the local host through which connections are initiated or accepted. |
LocalPort | The TCP port in the local host where the component binds. |
MaxLineLength | The maximum amount of data to accumulate when no EOL is found. |
MaxTransferRate | The transfer rate limit in bytes per second. |
RecordLength | The length of received data records. |
TCPKeepAlive | Determines whether or not the keep alive socket option is enabled. |
UseIPv6 | Whether to use IPv6. |
TcpNoDelay | Whether or not to delay when sending packets. |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
FirewallData | Used to send extra data to the firewall. |
InBufferSize | The size in bytes of the incoming queue of the socket. |
OutBufferSize | The size in bytes of the outgoing queue of the socket. |
CodePage | The system code page used for Unicode to Multibyte translations. |