Base | --GatewayListener
Located in File: Program_Root/sdk/GatewayListener.php
This class connects to the gateway and listens for incoming SMS and notifications.
When an SMS message arrives the method 'onSMSReceive' is called with the actual SMS object, which makes it possible to process the incoming SMS however you want, save to db or whatever you like.
When a notification arrives the method 'onNotificationReceive' is called with the actual Notification object, which makes it possible to process the notification as you like.
Magnus Rosenquist, Zyneo
Class Variable Summary |
$server
Default Value:
|
Inherited Class Variable Summary | |||||||||||||||||||||
Inherited From Class Base
|
Method Summary |
void constructor GatewayListener ( )
Initializes the class |
void onNotificationReceive ( $notification )
Called when a Notification is received. As specified in the XML/TCP adapter documentation, an incoming Notification must be acknowledged. This is achieved by creating a sdk.protocol.receive.Response object and send it back to the gateway. |
void onSMSReceive ( $sms )
Called when an SMS is received. As specified in the XML/TCP adapter documentation, an incoming SMS must be acknowledged. This is achieved by creating a sdk.protocol.receive.Response object and send it back to the gateway. |
void run ( )
Starts the GatewayListener and listens for incoming SMS and |
Inherited Method Summary |
Inherited From Class Base
|
Method Detail |
void GatewayListener( )
Initializes the class[ Top ]
void onNotificationReceive( Notification $notification)
Called when a Notification is received. As specified in the XML/TCP adapter documentation, an incoming Notification must be acknowledged. This is achieved by creating a sdk.protocol.receive.Response object and send it back to the gateway.- Notification $notification:
Response
[ Top ]
void onSMSReceive( Sms $sms)
Called when an SMS is received. As specified in the XML/TCP adapter documentation, an incoming SMS must be acknowledged. This is achieved by creating a sdk.protocol.receive.Response object and send it back to the gateway.- Sms $sms: the received SMS message.
Response
[ Top ]
void run( )
Starts the GatewayListener and listens for incoming SMS andNotifications. Connects to the gateway by opening a socket to '_LISTENER_HOST' and port '_LISTENER_PORT' found in 'config.inc'
config.inc
[ Top ]
Variable Detail |
ClientSocket 0: Connects to the gateway, also sends acknowledgements.
[ Top ]