There is specific functionality provided by the SDK for customers who wish to have a premium rate short code. This functionality is all accessed by the account event handler, for information on how to set up an account event handler see Account Event Handler.
The particular event that corresponds to premium rate traffic is the Subscription Event. You will receive a subscription event when an SMS is sent to your short code for one of three things:
In all of the above cases you will receive both the subscription event and a message, as two separate events. The following is a breakdown of a subscription event.
Mobile: This is the mobile number that the event came from.
Contact ID: This is the unique identifier that Esendex assigns to the contact object for this user.
Event Type: This is the type of the event that has been received, subscribe, unsubscribe or resubscribe.
Occurred At: This is the time we received the message.
Depending on what your requirements are you will have to strip the details out of the event and process them, the following example on the Account Event Handler page simply writes the details to a file.