Offnetwork mms restrict

Offnetwork mms restrict SearchSearch
Author Message
No Name
New member
Username: Ncblx

Post Number: 26
Registered: 02-2014
Posted on Thursday, April 16, 2015 - 02:51 pm:   

Hello.
How can i restricte sending mms other operator (offnetwork) if not have MMSRoute to other operator?

i use MMSRoutingURL, but this script check only portin or portout number.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5262
Registered: 08-2008
Posted on Thursday, April 16, 2015 - 02:56 pm:   

Hi,

Specify Route=Deny to reject the message.

--
Des
NowSMS Support
No Name
New member
Username: Ncblx

Post Number: 27
Registered: 02-2014
Posted on Thursday, April 16, 2015 - 02:59 pm:   

Sorry, dont understund.
No Name
New member
Username: Ncblx

Post Number: 28
Registered: 02-2014
Posted on Thursday, April 16, 2015 - 02:59 pm:   

i need restricte send mms if this route note have MMSROUTE.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5263
Registered: 08-2008
Posted on Thursday, April 16, 2015 - 03:02 pm:   

If there is a route, response says:

Route=XXXXXXXXX

If no route available, use this response:

Route=Deny

--
Des
NowSMS Support
No Name
New member
Username: Ncblx

Post Number: 29
Registered: 02-2014
Posted on Thursday, April 16, 2015 - 03:03 pm:   

[MMSC]
SMTPPort=25
RelayHost=10.10.10.10
DomainName=mms.mms.com
SMTPRequireAuth=No
SMSEMail=Yes
SMSDomainName=sms.mms.com
SMSPerEMail=6
SMSEMailSender=715
WebPort=80
HostName=mmsc.mms.com
EnableDeliveryNotification=Yes
ConvertImages=Yes
ConvertScaleToScreen=Yes
MSISDNHeader=MSISDN
MSISDNHeaderDefaultCountryCode=994
MSISDNHeaderLocalPrefix=0
MMSMessageSizeLimit=300
#ForceRoutingCallback=Yes
#DisableMMSDirectDelivery=Yes
MMSRoutingURL=http://nowsmslocal/php/mnp.php
MMSAccountingURL=http://nowsmslocal/php/cb.php
#MMSAccountingURL=http://nowsmslocal/php/diam.php
DebugLogDirectory=D:\MMSC\MMSCLogs\
LogDirectory=D:\MMSC\MMSCLogs\
MMSCUsersDir=D:\MMSC\MMSCUSERS\
MMSSMSDataDir=D:\MMSC\MMSSMS\
DataDir=\10.10.10.10\mmsc\MMSCDATA
VASPQDir=\10.10.10.10\mmsc\VASPQ
SystemUser1=mmss@mms.mms.com
Debug=Yes
SMSEMailTrackSender=Yes
SMSEMailReceiptRequested=Yes
DefaultOutboundRoute=Direct




mnp.php


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

$outboundRoute = "";

/* Check to make sure this is an MMS Routing callback, the Type=MMSRouteCheck parameter should be set,
and a To= parameter should be present */
if (!strcasecmp ($_REQUEST['Type'], "MMSRouteCheck")) {
if (isset($_REQUEST['To'])) {

/* Load URL parameters into local variables */
$to = $_REQUEST['To'];
//$from = $_REQUEST['From'];
$vaspin = $_REQUEST['VASPIN'];


$to = substr($to, -9);
$conn = oci_connect("MMS", "MMS", "MMS");
$select = "SELECT
DECODE (RECIPENTID, 1, 'D200', 2, 'D300', 3, 'D100')
AS RECIPIENT_PERFEX
FROM med.ent_mnp
where MSISDN like '%$to'";

$stid = oci_parse($conn, $select);
oci_execute($stid);
$row = oci_fetch_all($stid, $result);
if ($row == 1){
echo $result['RECIPIENT_PERFEX'][0];
$to = $result['RECIPIENT_PERFEX'][0].'xxx'.$to;
}
else if($row > 1){
$outboundRoute = "Deny";
}
else {
$outboundRoute = "";
}
oci_close($conn);


if ($outboundRoute == "") {
if (!strncmp ($to, "D", 1)) {
if (!strncmp ($to, "D300", 4)) {
$outboundRoute = "Direct";
}
else if (!strncmp ($to, "D100", 4)) {
$outboundRoute = "AAAA";
}
else if (!strncmp ($to, "D200", 4)) {
$outboundRoute = "BBBB";
}
else {
$outboundRoute = "";
}
}
else {
/* In this example, if the recipient is outside of the +44 country code, the $outboundRoute is not set by
this script, and the routing definitions in the NowSMS MMSC are used instead of this script. */
}
}
}
else {
//echo "ERROR : 'To' (destination recipient) parameter missing from request\r\n";
}
}
else {
//echo "ERROR: 'Type=MMSRouteCheck' parameter missing from request\r\n";
}

/* If the script set the $outboundRoute variable, return it back to the MMSC */

if ($outboundRoute != "") {
echo "Route=" . $outboundRoute . "\r\n";
}

?>
No Name
New member
Username: Ncblx

Post Number: 30
Registered: 02-2014
Posted on Thursday, April 16, 2015 - 03:21 pm:   

i send mms +4478. this route not have. but sms success sendind.
No Name
New member
Username: Ncblx

Post Number: 31
Registered: 02-2014
Posted on Thursday, April 16, 2015 - 03:40 pm:   

9:36:28:620 [42] InternalProcessConnection: Thread started
19:36:28:620 [42] ThreadProcessConnection: Processing connection from 10.20.0.219...
19:36:28:886 [42] ThreadProcessConnection: Got application/vnd.wap.mms-message
19:36:28:886 [42] ThreadProcessConnection: Got m-send-req
19:36:28:886 [42] ThreadProcessConnection: msisdnHeader auth for user +994772011310
19:36:28:886 [42] ThreadProcessConnection: TO: +33149909900/TYPE=PLMN
19:36:28:886 [42] CheckLawfulIntercept: C:\PROGRA~1\NowSMS\LawfulIntercept.INI
19:36:28:886 [42] CheckLawfulIntercept: +999999999999
19:36:28:886 [42] CheckLawfulIntercept: +33149909900
19:36:28:886 [42] MMSRoutingCallback: +33149909900/TYPE=PLMN
19:36:28:886 [42] RetrieveURL: Retrieving http://nowsmslocal/php/mnp.php?Type=MMSRouteCheck&From=%2B999999999999&To=%2B331 49909900&Size=5162
19:36:28:886 [42] InetServerConnect: Connected to 127.0.0.1 (127.0.0.1:8800)
19:36:28:886 [42] RetrieveURL: Retrieving php/mnp.php?Type=MMSRouteCheck&From=%2B999999999999&To=%2B33149909900&Size=5162
19:36:28:886 [42] RetrieveURL: GET /php/mnp.php?Type=MMSRouteCheck&From=%2B999999999999&To=%2B33149909900&Size=5162 HTTP/1.1
User-Agent: NowSMS MMSC v2014.12.09
Accept: */*
Host: 127.0.0.1:8800

9:36:28:620 [42] InternalProcessConnection: Thread started
19:36:28:620 [42] ThreadProcessConnection: Processing connection from 10.20.0.219...
19:36:28:886 [42] ThreadProcessConnection: Got application/vnd.wap.mms-message
19:36:28:886 [42] ThreadProcessConnection: Got m-send-req
19:36:28:886 [42] ThreadProcessConnection: msisdnHeader auth for user +999999999999
19:36:28:886 [42] ThreadProcessConnection: TO: +33149909900/TYPE=PLMN
19:36:28:886 [42] CheckLawfulIntercept: C:\PROGRA~1\NowSMS\LawfulIntercept.INI
19:36:28:886 [42] CheckLawfulIntercept: +999999999999
19:36:28:886 [42] CheckLawfulIntercept: +33149909900
19:36:28:886 [42] MMSRoutingCallback: +33149909900/TYPE=PLMN
19:36:28:886 [42] RetrieveURL: Retrieving http://nowsmslocal/php/mnp.php?Type=MMSRouteCheck&From=%2B999999999999&To=%2B331 49909900&Size=5162
19:36:28:886 [42] InetServerConnect: Connected to 127.0.0.1 (127.0.0.1:8800)
19:36:28:886 [42] RetrieveURL: Retrieving php/mnp.php?Type=MMSRouteCheck&From=%2B999999999999&To=%2B33149909900&Size=5162
19:36:28:886 [42] RetrieveURL: GET /php/mnp.php?Type=MMSRouteCheck&From=%2B999999999999&To=%2B33149909900&Size=5162 HTTP/1.1
User-Agent: NowSMS MMSC v2014.12.09
Accept: */*
Host: 127.0.0.1:8800

19:36:28:964 [42] MMSRoutingCallback: Checking user database
19:36:28:964 [42] MMSRoutingCallback: +33149909900/TYPE=PLMN
19:36:28:964 [42] MMSRoutingCallback: User is not provisioned
19:36:28:964 [42] MMSRoutingCallback: +33149909900/TYPE=PLMN
19:36:28:964 [42] RetrieveURL: Retrieving http://nowsmslocal/php/cb.php?PreAuth=Yes&Type=MMSSend&From=%2B999999999999&To=% 2B33149909900&MsgCount=1&Size=5162
19:36:28:964 [42] InetServerConnect: Connected to 127.0.0.1 (127.0.0.1:8800)
19:36:28:964 [42] RetrieveURL: Retrieving php/cb.php?PreAuth=Yes&Type=MMSSend&From=%2B999999999999&To=%2B33149909900&MsgCo unt=1&Size=5162
19:36:28:964 [42] RetrieveURL: GET /php/cb.php?PreAuth=Yes&Type=MMSSend&From=%2B999999999999&To=%2B33149909900&MsgC ount=1&Size=5162 HTTP/1.1
User-Agent: NowSMS MMSC v2014.12.09
Accept: */*
Host: 127.0.0.1:8800

19:36:29:464 [42] DeliverMMSMessage: TO: +33149909900/TYPE=PLMN
19:36:29:464 [42] DeliverMMSMessage: Before MMSLocalIDAdd
19:36:29:464 [42] DeliverMMSMessage: After MMSLocalIDAdd
19:36:29:464 [42] DeliverMMSMessage: TO: +33149909900/TYPE=PLMN
19:36:29:464 [42] DeliverMMSMessage: Found Phone Recip
19:36:29:480 [42] GetMmsAccountingKeepAlive: Re-using keep-alive socket
19:36:29:480 [42] RetrieveURL: Retrieving http://nowsmslocal/php/cb.php?Type=MMSSend&From=%2B999999999999&To=%2B3314990990 0&MessageID=20150416-19-90A5596C@mmsc.mms.com&Size=5162
19:36:29:480 [42] RetrieveURL: Using keep-alive socket
19:36:29:480 [42] RetrieveURL: Retrieving php/cb.php?Type=MMSSend&From=%2B999999999999&To=%2B33149909900&MessageID=20150416-19-90A5596C@mmsc.mms.com&Size=5162
19:36:29:480 [42] RetrieveURL: GET /php/cb.php?Type=MMSSend&From=%2B999999999999&To=%2B33149909900&MessageID=20150416-19-90A5596C@mmsc.mms.com&Size=5162 HTTP/1.1
User-Agent: NowSMS MMSC v2014.12.09
Accept: */*
Host: 127.0.0.1:8800
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5264
Registered: 08-2008
Posted on Thursday, April 16, 2015 - 05:18 pm:   

Try the callback request URL in a browser and confirm the script is returning the expected response.

For example

http://nowsmslocal/php/mnp.php?Type=MMSRouteCheck&From=%2B999999999999&To=%2B331 49909900&Size=5162

Change to this to try from browser

http://127.0.0.1:8800/php/mnp.php?Type=MMSRouteCheck&From=%2B999999999999&To=%2B 33149909900&Size=5162


You should see Route=Deny in the response if the script is blocking the recipient.

--
Des
NowSMS Support
No Name
New member
Username: Ncblx

Post Number: 32
Registered: 02-2014
Posted on Friday, April 17, 2015 - 05:15 am:   

Same problem.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5265
Registered: 08-2008
Posted on Friday, April 17, 2015 - 01:53 pm:   

Same problem as what?

What do you see in the browser when you connect to the PHP script?


If the PHP script is returning a blank response, I would suggest adding echo statements to help debug the script.

--
Des
NowSMS Support
No Name
New member
Username: Ncblx

Post Number: 33
Registered: 02-2014
Posted on Wednesday, April 22, 2015 - 06:01 am:   

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

$outboundRoute = "";

/* Check to make sure this is an MMS Routing callback, the Type=MMSRouteCheck parameter should be set,
and a To= parameter should be present */
if (!strcasecmp ($_REQUEST['Type'], "MMSRouteCheck")) {
if (isset($_REQUEST['To'])) {

/* Load URL parameters into local variables */
$to = $_REQUEST['To'];
//$from = $_REQUEST['From'];
$vaspin = $_REQUEST['VASPIN'];


$to = substr($to, -9);
$conn = oci_connect("MMS", "MMS", "MMS");
$select = "SELECT
DECODE (RECIPENTID, 1, 'D200', 2, 'D300', 3, 'D100')
AS RECIPIENT_PERFEX
FROM med.ent_mnp
where MSISDN like '%$to'";

$stid = oci_parse($conn, $select);
oci_execute($stid);
$row = oci_fetch_all($stid, $result);
if ($row == 1){
echo $result['RECIPIENT_PERFEX'][0];
$to = $result['RECIPIENT_PERFEX'][0].'xxx'.$to;
}
else if($row > 1){
$outboundRoute = "Deny";
}
else {
$outboundRoute = "";
}
oci_close($conn);


if ($outboundRoute == "") {
if (!strncmp ($to, "D", 1)) {
if (!strncmp ($to, "D300", 4)) {
$outboundRoute = "Direct";
}
else if (!strncmp ($to, "D100", 4)) {
$outboundRoute = "AAAA";
}
else if (!strncmp ($to, "D200", 4)) {
$outboundRoute = "BBBB";
}
else {
$outboundRoute = "";
}
}
else {
/* In this example, if the recipient is outside of the +44 country code, the $outboundRoute is not set by
this script, and the routing definitions in the NowSMS MMSC are used instead of this script. */
}
}
}
else {
//echo "ERROR : 'To' (destination recipient) parameter missing from request\r\n";
}
}
else {
//echo "ERROR: 'Type=MMSRouteCheck' parameter missing from request\r\n";
}

/* If the script set the $outboundRoute variable, return it back to the MMSC */

if ($outboundRoute != "") {
echo "Route=" . $outboundRoute . "\r\n";
}

?>
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5270
Registered: 08-2008
Posted on Wednesday, April 22, 2015 - 09:24 pm:   

I'm sorry, but I do not understand.

Are you saying that you see the content of the PHP script when you connect with a web browser?

Instead of the script running, you see the code?

--
Des
NowSMS Support
No Name
New member
Username: Ncblx

Post Number: 34
Registered: 02-2014
Posted on Thursday, April 23, 2015 - 05:40 am:   

No, I posted the contents of the script.
When connecting to the Web browser, there is no response
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5271
Registered: 08-2008
Posted on Thursday, April 23, 2015 - 02:58 pm:   

OK. What I am suggesting is that you add a number of debug statements....

For example...

echo "Debug 1\r\n";
echo "Debug 2\r\n";

This will help determine where the script is not doing what is expected.

When i try it, it stops at oci_connect, as I don't have database modules setup.

--
Des
NowSMS Support
No Name
New member
Username: Ncblx

Post Number: 35
Registered: 02-2014
Posted on Friday, April 24, 2015 - 05:54 am:   

09:49:31:487 [43] ThreadProcessConnection: Got application/vnd.wap.mms-message
09:49:31:487 [43] ThreadProcessConnection: Got m-send-req
09:49:31:487 [43] ThreadProcessConnection: msisdnHeader auth for user +994772011310
09:49:31:487 [43] ThreadProcessConnection: TO: +447836191191/TYPE=PLMN
09:49:31:487 [43] CheckLawfulIntercept: C:\PROGRA~1\NowSMS\LawfulIntercept.INI
09:49:31:487 [43] CheckLawfulIntercept: +112332012345
09:49:31:487 [43] CheckLawfulIntercept: +447836191191
09:49:31:487 [43] MMSRoutingCallback: +447836191191/TYPE=PLMN
09:49:31:487 [43] GetMmsRoutingKeepAlive: Closing keep-alive socket
09:49:31:487 [43] RetrieveURL: Retrieving http://nowsmslocal/php/mnp.php?Type=MMSRouteCheck&From=%2B112332012345&To=%2B447 836191191&Size=5163
09:49:31:487 [43] InetServerConnect: Connected to 127.0.0.1 (127.0.0.1:8800)
09:49:31:487 [43] RetrieveURL: Retrieving php/mnp.php?Type=MMSRouteCheck&From=%2B112332012345&To=%2B447836191191&Size=5163
09:49:31:487 [43] RetrieveURL: GET /php/mnp.php?Type=MMSRouteCheck&From=%2B112332012345&To=%2B447836191191&Size=516 3 HTTP/1.1
User-Agent: NowSMS MMSC v2014.12.09
Accept: */*
Host: 127.0.0.1:8800


09:49:31:565 [43] HttpResponseWait: Received 128 bytes
09:49:31:565 [43] HttpResponseWait: Ok
09:49:31:565 [43] RetrieveURL: Saving keep-alive socket
09:49:31:565 [43] RetrieveURL: got success response
09:49:31:565 [43] RetrieveURL: text/plain
09:49:31:565 [43] MMSRoutingCallback: HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 13
X-Powered-By: PHP/5.3.27
Content-Type: text/plain

Route=Deny

09:49:31:565 [43] MMSRoutingCallback: Got route from callback
09:49:31:565 [43] MMSRoutingCallback: Deny
09:49:31:565 [43] MMSRoutingCallback: +447836191191/TYPE=VASP:Deny
09:49:31:565 [43] GetMmsAccountingKeepAlive: Closing keep-alive socket
09:49:31:565 [43] RetrieveURL: Retrieving http://nowsmslocal/php/cb.php?PreAuth=Yes&Type=MMSSend&From=%2B112332012345&To=% 2B447836191191&VASP=Deny&MsgCount=1&Size=5163
09:49:31:565 [43] InetServerConnect: Connected to 127.0.0.1 (127.0.0.1:8800)
09:49:31:565 [43] RetrieveURL: Retrieving php/cb.php?PreAuth=Yes&Type=MMSSend&From=%2B112332012345&To=%2B447836191191&VASP =Deny&MsgCount=1&Size=5163
09:49:31:565 [43] RetrieveURL: GET /php/cb.php?PreAuth=Yes&Type=MMSSend&From=%2B112332012345&To=%2B447836191191&VAS P=Deny&MsgCount=1&Size=5163 HTTP/1.1
User-Agent: NowSMS MMSC v2014.12.09
Accept: */*
Host: 127.0.0.1:8800

09:49:37:081 [43] DeliverMMSMessage: TO: +447836191191/TYPE=VASP:Deny
09:49:37:081 [43] DeliverMMSMessage: Before MMSLocalIDAdd
09:49:37:081 [43] DeliverMMSMessage: After MMSLocalIDAdd
09:49:37:081 [43] DeliverMMSMessage: TO: +447836191191/TYPE=VASP:Deny
09:49:37:081 [43] DeliverMMSMessage: Found VASP Recip - Deny
09:49:37:081 [43] DeliverMMSMessage-VASP: TO: +447836191191/TYPE=VASP:Deny
09:49:37:081 [43] DeliverMMSMessage-VASP: +447836191191
09:49:37:081 [43] GetMmsAccountingKeepAlive: Re-using keep-alive socket
09:49:37:081 [43] RetrieveURL: Retrieving http://nowsmslocal/php/cb.php?Type=MMSSend&From=%2B112332012345&VASP=Deny&To=%2B 447836191191&MessageID=20150424-09-0B9FFEA4@mmsc.nar.az&Size=5163
09:49:37:081 [43] RetrieveURL: Using keep-alive socket
09:49:37:081 [43] RetrieveURL: Retrieving php/cb.php?Type=MMSSend&From=%2B112332012345&VASP=Deny&To=%2B447836191191&Messag eID=20150424-09-0B9FFEA4@mmsc.nar.az&Size=5163
09:49:37:081 [43] RetrieveURL: GET /php/cb.php?Type=MMSSend&From=%2B112332012345&VASP=Deny&To=%2B447836191191&Messa geID=20150424-09-0B9FFEA4@mmsc.nar.az&Size=5163 HTTP/1.1
User-Agent: NowSMS MMSC v2014.12.09
Accept: */*
Host: 127.0.0.1:8800
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5274
Registered: 08-2008
Posted on Friday, April 24, 2015 - 04:40 pm:   

Hi,

Sorry for the confusion, I gave incorrect information.


DO NOT use Route=Deny

Instead use Route=BlockMessage

That should produce the desired result.


--
Des
NowSMS Support
No Name
New member
Username: Ncblx

Post Number: 36
Registered: 02-2014
Posted on Tuesday, April 28, 2015 - 10:29 am:   

Problem solved.

Thanks.