Hi,

For WAP1 devices resolving requests from IP address to MSISDN is done
nicely by Kannel.  For WAP2 devices there is a little gap...  we would
like to share the following 2 scripts that we use to resolve IP's to
MSISDN for WAP2 devices on a Mbuni installation.

- the first script is used in the mbuni config as the mbuni detokenize
shell.  Config is something like this:
  detokenizer-library = /usr/local/lib/mbuni/libmmsc_detokenize_shell.so
  detokenizer-module-parameters = /home/mbuni/bin/detokenizer
- the second is used inside squid to add the msisdn into the URL.
Squid config looks something like this:
  redirect_program /usr/local/bin/msisdn-from-radius
  acl msisdn_domains dstdomain my.mmsc.dns.name
  redirector_access allow msisdn_domains

So: perhaps it is of use to some other people as well...




#!/bin/bash
# If the request is coming from the localhost, the client is making the
# request via the local proxy (SQUID).  So then we get the MSISDN out of
# the URL.
# For other direct connections, it gets the MSISDN from our server that gets
# the radius accounting messages from the GGSN.
# http://www.truteq.co.za

DATE=`date`
MSISDN=""
if [ $2 == "127.0.0.1" ]
then
  MSISDN=`echo "$1" | awk -F'=' '{print $2}'`
else
  MSISDN=`echo "$2" | nc 192.168.100.10 50163`
fi
echo "$DATE $0 $1 $2 $3 = $MSISDN" >> /var/log/mbuni/detokenizer.log
echo "$MSISDN"





#!/bin/bash
# A little squid url redirect module.  It will append the MSISDN to the URL
# provided.  It gets the MSISDN from our server that gets the radius
# accounting messages from the GGSN.
# http://www.truteq.co.za
# TODO:
#   Currently not checking if there is already "?" in the URL

while read line  # For as many lines as the input file has...
do
  DATE=`date`
  URL=`echo $line | awk '{print $1}'`
  IP_ADDRESS=`echo $line | awk '{print $2}' | awk -F'/' '{print $1}'`
  MSISDN=`echo "$IP_ADDRESS" | nc 192.168.100.10 50163`
  echo "$DATE $line: $IP_ADDRESS = $MSISDN" >> /var/log/squid/msisdn.log
  echo "$URL&msisdn=$MSISDN"
done
exit 0

_______________________________________________
Users mailing list
[email protected]
http://mbuni.org/mailman/listinfo/users_mbuni.org

Reply via email to