Using individual meta-data fields on urls
With the addition of meta-data functionality in Kannel, now it’s possible to pass meta-data between different smsc’s and services.
When defining services or urls to send messages, the new %D parameter gets replaced with the complete meta-data information available.
However, there wasn’t any way to use only part of that data when posting to url’s. This is why I’ve created this patch that allows you to use individual meta-data fields in your urls.
To use it, a new set of parameters is defined, with the following format:
Where group is the meta-data group (for example: smpp, http or foo) and parameter is the individual meta-data parameter you want to replace.
For example, let’s suppose we’re using a generic http-smsc, and we want to pass a couple of extra parameters for a dynamic username and password (some aggregators do that). Right now, that would require patching the source code and inventing some method to pass the extra parameters from the sendsms interface.
With the patch applied, this would be as simple as this:
1. Pass the meta-data parameter on the sendsms request (urlencoded):
2. Define the send-url parameter on your http-smsc to pass those parameters:
send-url = http://myhost/sms?….&username=%#http#user#&password=#http#pass#
Note: I’m defining the http group here, but it could be anything, even the smpp group coming from an smpp bind, in which case the syntax would be #smpp#username# instead.
Download the patch from here.
Please try it and let me know if it works for you.