Even / Not Even case

Even / Not Even case SearchSearch
Author Message
New member
Username: Forikfunk

Post Number: 5
Registered: 10-2013
Posted on Friday, February 21, 2014 - 07:22 am:   

Hi Des,

i want to back to this discussion

I have 2 diameter server, each one have base of own subscribers. My question is how I can divide request based on subscriber numbers?
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 4820
Registered: 08-2008
Posted on Friday, February 21, 2014 - 05:02 pm:   

Hi forkifunk,

It is a little confusing, but the basic idea is that we use the MMSSend PreAuth Accounting callback.

The HTTP response can indicate which Diameter server should be used.

Here is some more detail ...

Enabling MM9 Diameter for Only Select Subscribers

In some environments, it may be desirable to use MM9 Diameter charging for only some subscribers. For example, MM9 Diameter charging might only be used for prepaid subscribers.
In other environments, it may be desirable to use different Diameter charging servers for different groups of customers (for example, when the MMSC is hosting subscribers from multiple countries, or multiple MVNOs).

Both of these scenarios are facilitated through accounting callbacks, which are documented at http://www.nowsms.com/doc/advanced-configuration-settings/mms-accounting-callbac ks.

The MMSSend PreAuth callback can return a response indicating that a Diameter charge should be attempted. In this scenario, CallbackTriggerOnly=Yes should be added to the [MM9Diameter] section of MMSC.INI to indicate that the MMSC should only generate Diameter charges if directed to do so by the response to the MMSSend PreAuth callback. The callback response should include the text MM9Diameter=Yes to indicate that a Diameter charge is required for the transaction.

Multiple Diameter servers can be configured by creating additional sections in MMSC.INI, similar to the [MM9Diameter] section documented here. Use a section name of [MM9Diameter-xxxxxxxx] where xxxxxxxx is a name to be associated with this Diameter server. The MMSSend PreAuth callback response can trigger a Diameter charge to this server by including MM9Diameter=xxxxxxxx in the text of the response. (MM9Diameter=Yes triggers a charge for the server defined in [MM9Diameter]. Values other than Yes trigger a charge for a different Diameter server.)

NowSMS Support
New member
Username: Forikfunk

Post Number: 6
Registered: 10-2013
Posted on Tuesday, March 04, 2014 - 06:49 am:   

Hi Des,

Your solution is suitable for us. But i can't understood in which format php should display output variable. Can you provide a sample code to define output format?
Thank you
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 8081
Registered: 10-2002
Posted on Tuesday, March 04, 2014 - 03:47 pm:   

Hi forkifunk,

Here's a simple example PHP callback script. This script only processes MMSSend PreAuth requests.

The script looks at the sender address and takes one of four different actions:

1. Trigger Diameter charge against primary server.

2. Trigger Diameter charge against a non-primary server.

3. Reject the message immediately.

4. Accept the message without recording a Diameter charge (add an interface to charge via non-Diameter system).

This example is simple and its test is based upon sender address ranges. You would need to lookup against your databases to determine what action to take.

header ("Content-Type: text/plain");

/* Process only MMSSend PreAuth requests */
if (!strcasecmp ($_REQUEST['Type'], "MMSSend") && !strcasecmp ($_REQUEST['PreAuth'], "Yes")) {

$sender = $_REQUEST['Sender'];

/* Test sender value and direct to different Diameter servers */
if (!strncmp ($sender, "+1111", 5)) {
/* Trigger Diameter request to primary server [MM9Diameter] */
echo "MM9Diameter=Yes"\r\n";
else if (!strncmp ($sender, "+2222", 5)) {
/* Trigger Diameter request to server defined in [MM9Diameter-d2] */
echo "MM9Diameter=d2"\r\n";
else if (!strncmp ($sender, "+3333", 5)) {
/* Example where we are not doing a Diameter check, but want to reject the message for credit reasons */
echo "PreAuth=Deny"\r\n";
else {
/* Add code to record a charge for post-paid user */



Bryce Norwood
Now SMS/MMS Support