Configure this event to handle delivery confirmation information uploaded by Listeners. If the status parameter returns 0, then the push request identified by request_id was successfully received by the Listener identified by the remote_device parameters.
You can use the request_option parameter to initiate an action in response to the delivery confirmation. If request_option is 0, the confirmation_handler event initiates the default action, where the request_delete event is executed to delete the original push request. If the device sending the delivery confirmation does not match the device identified by the request_id, the default action is to send the original push request through a secondary gateway.
Use the dblsn -x option to allow Listeners to upload delivery confirmation information. Use the dblsn -ni option if you want delivery confirmation but do not want IP tracking. See Listener options for Windows.
This event requires the use of a system procedure. You can not configure this event directly using the Sybase Central method. See MobiLink server settings for server-initiated synchronization.
The following parameters can be captured using the confirmation_handler event:
Script parameter | Type | Description |
---|---|---|
request_option (out) | Integer |
Controls what the Notifier does to the request after the handler returns. The following values can be returned:
|
status (in) | Integer |
The situation summary. The status can be used during development to identify problems such as incorrect filters and handler attributes. The following values can be returned:
|
request_id (in) | Integer | The request ID. Your request_cursor event must contain a request ID column to use the confirmation_handler event. |
remote_code (in) | Integer |
The summary reported by the remote Listener. The following values can be returned:
|
remote_device (in) | Varchar | The device name of the responding Listener. |
remote_mluser (in) | Varchar | The MobiLink user name of the responding Listener. |
remote_action_return (in) | Varchar | The return code of the remote action. |
remote_action (in) | Varchar | Reserved for the action command. |
gateway (in) | Varchar | The gateway associated with the request. |
address (in) | Varchar | The address associated with the request. |
subject (in) | Varchar | The subject associated with the request. |
content (in) | Varchar | The content associated with the request. |
In the following example, you create a table called CustomConfirmation and then log confirmations to it using a stored procedure named CustomConfirmationHandler. The output parameter request_option is always set to 0, which means that default Notifier handling is used.
CREATE TABLE CustomConfirmation( error_code integer, request_id integer, remote_code integer, remote_device varchar(128), remote_mluser varchar(128), remote_action_return varchar(128), remote_action varchar(128), gateway varchar(255), address varchar(255), subject varchar(255), content varchar(255), occurAt timestamp not null default timestamp ) CREATE PROCEDURE CustomConfirmationHandler( out @request_option integer, in @error_code integer, in @request_id integer, in @remote_code integer, in @remote_device varchar(128), in @remote_mluser varchar(128), in @remote_action_return varchar(128), in @remote_action varchar(128), in @gateway varchar(255), in @address varchar(255), in @subject varchar(255), in @content varchar(255) ) BEGIN INSERT INTO CustomConfirmation( error_code, request_id, remote_code, remote_device, remote_mluser, remote_action_return, remote_action, gateway, address, subject, content) VALUES ( @error_code, @request_id, @remote_code, @remote_device, @remote_mluser, @remote_action_return, @remote_action, @gateway, @address, @subject, @content ); SET @request_option = 0; END |
To use the ml_add_property system procedure with a SQL Anywhere consolidated database, run the following command:
call ml_add_property( 'SIS', 'Notifier(myNotifier)', 'confirmation_handler', 'call CustomConfirmation(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); |
Alternatively, you can call this event by adding the following line to a Notifier configuration file:
Notifier(myNotifier).confirmation_handler = call CustomConfirmation(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) |
Run the file using the mlsrv11 -notifier option. For more information on how to configure a Notifier configuration file, see Configuring server-side settings using the Notifier configuration file.
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |