When i needed this, i found that the %P parameter didn't work, it printed out the port number. i made this enormous hack to fetch the number from my access.log using shell_exec() from inside PHP.

first i add the message id to the log format in the core group config:

access-log-format= "%I %t %l [SMSC:%i] [SVC:%n] [ACT:%A] [BINF:%B] [from:%p] [to:%P] [flags:%m:%c:%M:%C:%d] [msg:%L:%b] [udh:%U:%u]"

then i call this PHP method to fetch the number based on the id passed in (with the %I parameter):

function getDestination()
{
    $id = $_GET['id'];
    return trim(shell_exec('egrep "'.$id.'" /tmp/access.log | sed 
"s/.*to:\+\([0-9]*\).*/+\1/g"'));
}

someone mentioned something about having to include a "my-number" parameter in order for %P to work, however i need to receive many numbers on a single SMPP service, and choose which service they go to based on the destination number rather than a keyword.

i also put together this php script for stitching together long messages in kannel version 1.4.1:

http://www.workingsoftware.com.au/concatenate_mo.php.txt

cheers

iain


On Sat, 26 Apr 2008, seik wrote:

http://www.kannel.org/download/1.4.1/userguide-1.4.1/userguide.html#AEN3463

example post-url
http://localhost/smpp.php?from=%p&message=%a&received=%T&coding=%c&charset=%C&to=%P&smsc_id=%i&kannel_id=%I&udh=%u&dcs=%m&mwi=%M&sms-service=%n&binmess=%b&billinfo=%B&account_id=%f


resulting real request:
http://localhost/smpp.php?from=%2B359800000000&message=.Veselina.3dravei%2C+Geri.+Da+po3dravim+s+%2FVeligden%2Fvsi4ki+hristiani+s+edno+ho+ro+nachensko+da+po4uvstvat+pra3-+nika%2C+kakto+i+nach-+te+gosti+ot+Makedo+nia.+Sirakov.&received=1209203629&coding=0&charset=ISO-8859-1&to=1914&smsc_id=BTC&kannel_id=7a8f94a2-59f3-4f5d-908d-1ae1fc7f2bd2&udh=&dcs=-1&mwi=-1&sms-service=default&binmess=.Veselina.3dravei%2C+++++Geri.+Da+po3dravim++s+%2FVeligden%2Fvsi4ki++hristiani+s+edno+ho++ro+nachensko+da++++++po4uvstvat+pra3-+++nika%2C+kakto+i+nach-++te+gosti+ot+Makedo++nia.+Sirakov.&billinfo=&account_id=


-----Original Message-----
From: [email protected] [EMAIL PROTECTED]
Sent: 26 ????? 2008 ?.
To: seik
Subject:Multiple Numbers

How do I distinguish to which number the sms was sent,
I have one bind with five numbers and need to know
to which number the client sent the sms ?

Thanks Steven










Reply via email to