Net_SMPP
[ class tree: Net_SMPP ] [ index: Net_SMPP ] [ all elements ]

Class: SMPPLib

Source Location: /Net_SMPP-0.4.5/docs/examples/SMPPLib.php

Class Overview


SMPPLib class


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • Portions of the documentation (c) Copyright 1999 SMPP Developers Forum.

Methods


Inherited Variables

Inherited Methods


Class Details

[line 85]
SMPPLib class

This is an example of a client set up to use Net_SMPP.



[ Top ]


Method Detail

__construct (Constructor)   [line 158]

void __construct( string $host, int $port)

Class constructor

Sets the connection variables


Parameters:

string   $host     the ip address to connect to
int   $port     the port to connect to

[ Top ]

ackRecvd   [line 792]

bool ackRecvd( int $seqNum)

Checks to see if an ACK has been received for a PDU

Takes the PDU seq number and checks to see if it is on the PDU send stack

  • Return: true if ACK has been recieved, false otherwise

Parameters:

int   $seqNum     PDU sequence number to check

[ Top ]

authenticate   [line 331]

bool authenticate( mixed $authArgs, int $esmeType)

Authenticates with the SMSC

Sends a bind_transmitter/receiver PDU

  • Return: success/faliure of send

Parameters:

mixed   $authArgs     authentication details (user/password/etc)
int   $esmeType     type of PDU to send

[ Top ]

connect   [line 284]

bool connect( )

Connects to the SMSC
  • Return: success/faliure of connection

[ Top ]

deauthenticate   [line 357]

bool deauthenticate( )

Deauthenticates with SMSC

Sends an unbind PDU

  • Return: success/faliure of send

[ Top ]

disconnect   [line 308]

bool disconnect( )

Disconnects from the SMSC
  • Return: success/faliure of connection

[ Top ]

handleRequest   [line 692]

void handleRequest( NET_SMPP::PDU &$reqPdu, int $cmd)

Automatically deals with recieved request PDUs

Sets the connection state if this is necessary


Parameters:

NET_SMPP::PDU   &$reqPdu     request PDU recieved
int   $cmd     command_id of request PDU received

[ Top ]

handleResponse   [line 630]

void handleResponse( NET_SMPP::PDU &$resPdu, int $cmd)

Automatically deals with recieved response PDUs

Sets the connection state if this is necessary


Parameters:

NET_SMPP::PDU   &$resPdu     response PDU recieved
int   $cmd     command_id of response PDU received

[ Top ]

initHandler   [line 171]

void initHandler( )

Sets up the signal handler

[ Top ]

killChildren   [line 270]

void killChildren( )

Kills all spawned time processes

Not currently used


[ Top ]

log   [line 555]

void log( int $debugLevel, string $msg)

Logs a message

Parameters:

int   $debugLevel     the level of debugging this message is at
string   $msg     the message to log

[ Top ]

popPDU   [line 513]

bool popPDU( NET_SMPP::PDU &$pdu)

Takes a PDU which has being ACK'd off the stack

This function also kills (SIGTERM) any child timer who is waiting for the ACK

  • Return: success/faliure of pop

Parameters:

NET_SMPP::PDU   &$pdu     the ACK recieved

[ Top ]

printSendStack   [line 762]

void printSendStack( )

Logs the current state of the sending stack

[ Top ]

pushPDU   [line 498]

void pushPDU( NET_SMPP::PDU &$pdu)

Places a PDU on the stack, waiting for an ACK

Parameters:

NET_SMPP::PDU   &$pdu     the packet which is waiting for an ACK

[ Top ]

readPDU   [line 571]

mixed readPDU( )

Reads a PDU from the socket

If there is a PDU on the socket, it is read. Standard requests are responded to with ACKs. Standard responses are also dealt with.

  • Return: bool on success/faliure, NET_SMPP::PDU if this is a request message, as this could be a deliver_sm

[ Top ]

resetRetryCounter   [line 778]

void resetRetryCounter( )

Resets the state of SMPP_Lib in case of a reconnect command

Empties the pdu send stack, the retransmission counter and childPID list


[ Top ]

sendMsg   [line 411]

mixed sendMsg( mixed $msgArgs)

Send a SMS message

Sends a submit_sm PDU

  • Return: false on send fail, int message sequence number on success

Parameters:

mixed   $msgArgs     PDU arguments (addresses/message/etc)

[ Top ]

sendPDU   [line 438]

int sendPDU( NET_SMPP::PDU &$pdu)

Send a PDU down a socket

Generates and sends a PDU. Pushes it onto the send stack to wait for ACK. Responses do not need to be ACK'd.

  • Return: PDU sequence number

Parameters:

NET_SMPP::PDU   &$pdu     PDU packet to be sent

[ Top ]

sendPing   [line 383]

bool sendPing( )

Sends an enquire_link 'ping' PDU

Pinging keeps the connection alive

  • Return: success/faliure of ping

[ Top ]

sendStackFull   [line 805]

bool sendStackFull( )

Checks to see if the sending stack is full
  • Return: true if full, false otherwise

[ Top ]

startTimer   [line 470]

void startTimer( int $seqNum)

Starts a retry timer

Forks off a child to count to $timeout and exit. Adds childs PID to PID list


Parameters:

int   $seqNum     the PDU sequence number this child belongs to

[ Top ]

timerFinishedHandler   [line 186]

void timerFinishedHandler( int $signal)

Catches a retry timer timing out

Is called when a child process exits correctly, after the retry timer has timed out. Retries send or connection depending on situation


Parameters:

int   $signal     the signal caught

[ Top ]


Documentation generated on Tue, 01 Jun 2010 10:30:07 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.