Custom XenMobile SMS Provider

1:56 PM
Custom XenMobile SMS Provider -

So you want to be able to enroll the user to XenMobile by sending an SMS with all the necessary connections?

Well, basically, you have two options off-the-shelf: support

  1. XenMobile SMS Provider Nexmo out of the box. Nexmo is an SMS gateway that allows you to subscribe by most countries in the world, and their prices are competitive. So for the easiest integration, please create an account at http://www.nexmo.com, go into your XenMobile Settings, and under "Notification Server", add an SMS provider with the details of your Nexmo account.
  2. Most SMS gateway providers actually an SMTP interface to make their services available. So your second choice, which is almost as easy as with Nexmo, is easy to create an SMTP providers who create on your internal mail server, or change and notification templates. In this case, you would remove the "SMS" from your notification templates, and set the SMTP recipient to be something like: "$ {user.mobile}@smsgateway.myprovider.com". In this particular example, I use the "Mobile" field of the Active Directory object of the user. With this method, you can easily send SMS'es for enrollment. But working to this method, you must ensure that your phone number without spaces or hyphens formatted in AD.

If these methods, you do not get where you want, how would you go through a custom SMS Provider in XenMobile configuration?

Well, you can not really do that today. But hey, I can provide you with a method available that achieve exactly although Citrix can not support directly to this solution.

The basic idea here is that, "if you have XenMobile installed, you may also have a NetScaler." And after all NetScaler is the Swiss army knife of any data center, is not it? So, basically we can XenMobile believe that it sends a SMS request to Nexmo but have NetScaler intercept it, and transform it the SMS gateway of your choice to fit before it is sent to the correct SMS provider. Sounds interesting?

it easier to follow, I will provide instructions for NetScaler GUI set this up. The method was tested with NetScaler 11 toward a limited number of SMS provider, but as long as you have a documentation of the format expected by your provider, this should work for most providers. However, it is tested only with the Latin alphabet, so I have no idea how it would react different alphabets. Please enter comments below if you want to test it with a different alphabet, to tell me how it was!

Let's go!

NetScaler configuration

it was, when this blog post was first written possible regular HTTP (port 80) from XenMobile use rest.nexmo.com towards. Unfortunately, due to changes in Nexmo, this is no longer possible, so now you need on your SMS gateway having vServer SSL certificate. My recommended approach for this is the following:

-With called the new root certificate and key on NetScaler something like "LocalNexmo CA"

-With a new certificate on NetScaler for the common name ( CN) of "rest.nexmo.com", and sign it with the "LocalNexmo CA" root certificate.

Import of "LocaNexmo CA" certificate as a trusted root on XenMobile.

By doing it this way, you rely on a separate root specifically for this purpose, so that it houses the control of the certificate. The single server, they should trust, your XenMobile Server. This is in fact an "impersonation", which is a bit dirty, so, to keep it as clean as possible, we should "trust only by XenMobile Server" to use this approach.

create URL transformation

go in AppExpert -> Rewrite -> URL transformation -.> Profile and create a new profile TransformAction

Then go to the new profile that you created, and press "Submit" to create a new profile. Make sure that you set a valid priority and check the "Enable" checkbox. Paste the following text in the "Request URL from" field:

/sms/xml?username=(.*)(?:&password)(?:=)(.*)(?:&from).*(?:to=)(.*)(?:&type).*(?:text=)(.*)(?:&).*

This extracts the interesting fields the request URL, and assigns them the following variable:

Username = $ 1

password = $ 2

SMS = $ 3

Message = $ 4

the "request URL in the" box, specify the text that is required for your SMS gateway provider. As an example, this is the URL of a provider is required:

http://sms.example.com/send?username=myuser&password=secretpass&to=%2B46701234567&from=%2B46701234567&text=Hello+world

For this particular sample, we would the following in the insert "request URL in" field (assuming that the "from" parameter can be alphanumeric, if not, use a number):

/send?username=$1&password=$2&to=$3&from=XenMobile&text=$4

Press OK and OK to exit the profile

Now go in AppExpert. - Create> Politics and Policy -> Rewrite -> URL transformation. The policy expression can be as simple as "true", but I chose "HTTP.REQ.URL.CONTAINS (" Status Report-req ")" to use because I know SMS URLs generated by XenMobile contain this string. For "Profile", select the profile you created above

TransformPolicy

create a vServer and bind the URL to transform it

Go Traffic Management - .> load balancing -> Server, and add object a server that points your supplier Web server on, for example:

LBServerObject

Well, go to Traffic management -> load balancing -> service oR Traffic management -> load Balancing -> service groups, and create either a service or service group that refers to your SMS supplier SMS gateway. Make sure that you can be sure the correct protocol (HTTP or SSL) and port, the non-standard. Example:

LBService

Monitor bond is optional, some providers may not like if you send unsolicited tcp requests. In this case, you can "Health Monitoring" Disable the service / service group. Otherwise, I would as an HTTP monitor to an SMS gateway runs using the default TCP Monitor, recommend is unlikely to give the required HTTP status code. (The HTTP Monitor expects an HTTP 0 (OK) response if the default URL of site requests, but SMS gateways are unlikely to respond to a "default site".)

Next to use to create a vServer this service. This is by done in Traffic Management -> Load Balancing. -> Virtual Server and chosing "Add"

First a name for your VPS, choose to use SSL as the protocol, and specify an IP address, use the XenMobile through this virtual server.

For Load Balancing service or service group binding, select the object that you created in step to "talk".

Now click on "guidelines", and then the "+" sign in the box Policies:

LBPolicy

Set the "select Policy" on "transform, and let the" Select type "box stay" inquiry ".

SetPolicy

Select the URL policy transformation you 1 created this guide in step have, and press OK.

InsertTransform

Select "Server certificate" under "Certificates", and add the server certificate that you have for "rest.nexmo. com "created.

Press" Done "to save and exit from this new VPS. this is the work on the NetScaler.

Configure hosts XenMobile server file (s)

(This step for all XenMobile server must be repeated using the SMS gateway)

use hypervisor-based console or SSH to log on to the console of your XenMobile Server (if you have enabled it). Select 2 (System) and 4 (update hosts file). You will now be able to make your XenMobile NetScaler vServer contact instead Nexmo contacting the sending of SMS. Add the following entry:

rest.nexmo.com:

Top For my example, I gave the NetScaler vServer the address 10.0.0.20, so my entry would be:

rest.nexmo.com:10.0.0.20

after this change, you can check by typing "4" again:

XenMobileConsole

to leave this menu, a period (.) and enter. You can now exit the shell, and test the solution of XenMobile.

Troubleshooting

order, log into your NetScaler through your favorite SSH client (Putty), and enter "Shell [fix" to go into a shell

Now enter the following command in the window .:

nstcpdump.sh -A -s 0 '(TCP port and host ) or (TCP port and host ) and (((ip [2:2] - ((ip [0] & 0xf) <<2)) – ((tcp[12]&0xf0)>> 2)) = 0) "

[1945003Dies] allows you to see , in real time, go the visitors to your vServer NetScaler, and the traffic of the NetScaler go your provider SMS gateway for the environment I have used as an example above, the final command would use

nstcpdump.sh. - A -s 0 '(TCP port 8080 and host 193.54.2.21) or (TCP port 80 and host 10.0.0.20) and (((ip [2:2] - ((ip [0] & 0xf) <<2)) – ((tcp[12]&0xf0)> > 2))! = 0) "

Previous
Next Post »

1 comment

  1. Recently, Bulk SMS marketing is widely being used as one of the most successful strategies for promoting the services and the products of a business.

    ReplyDelete