MMS Server behind firewall

MMS Server behind firewall SearchSearch
Author Message
Perpuwet
Posted on Friday, July 11, 2003 - 07:21 pm:   

Hi,

How do I setup my server if I'm running behind a firewall?

When I setup the MMSC service it asks for the local host name or address which for me is 10.10.0.2, but does this mean that when my phone receives the notification will it try to connect to 10.10.0.2 to retrieve the message?

Please advise.
Bryce Norwood - NowSMS Support
Posted on Friday, July 11, 2003 - 07:45 pm:   

Yes, your understanding is correct.

You want that "local host name or IP address" to be set to an external host name or IP address that your mobile phone will be able to connect to.

Unfortunately, when you use the web interface to send an MMS message ... NowSMS also wants to try to validate that the URL that it creates for the MMS message is valid, and it will try to connect to this address as well.

This can cause a problem with some firewalls which will not let internal hosts make connections to a public IP address back through the firewall.

For example, let's say that your public IP address is 212.100.225.164, and that you have the firewall configured to map the HTTP port for the MMSC on that address back to 10.10.0.2.

With many firewall configurations, the PC on 10.10.0.2 cannot make a connection to 212.100.225.164 that gets routed back through the firewall to the local PC.

The only solution to deal with this is to assign a DNS host name to the public IP address (e.g., mms.domain.com). Then in the HOSTS file (in the \winnt\system32\drivers\etc directory) on the NowSMS PC, point that same DNS host name back to the private IP address.

That way, when the gateway itself tries to connect to mms.domain.com, it gets the local address. When the phone connects to mms.domain.com, it goes through the public address exposed by the firewall.

The only catch is that the HTTP port number that you are using for the MMSC must be mapped through the firewall as the same port number (you can't remap the port number so that it is one value outside the firewall and another value on the PC running the gateway).

Hopefully my explanation makes sense ... if not, let me know, and I'll clarify. But basically, a simple HOSTS file entry should get things sorted for you.

-bn
Perpuwet
Posted on Saturday, July 12, 2003 - 12:34 am:   

Thanks Bryce!

Right now I edited my Hosts file to include the following line:

10.10.0.2 jwap.xxt.cd

In the mmsc settings, it shouldn't matter if I use 10.10.0.2 or jwap.xxt.cd, right?

Also, I can see the my phone tries to retrieve the message but it won't fully return successful. It then retries a number or times but I'm not even sure if it's connecting to the right gateway.

Thanks again Bryce!
Bryce Norwood - NowSMS Support
Posted on Saturday, July 12, 2003 - 02:57 am:   

You're almost there ... I probably should have been more clear.

The value that you set for the "local host name or IP address" must be valid for both the PC running the gateway software itself ... and the mobile device that ultimately receives the MMS message.

When the MMS message is packaged by the gateway, an MMS notification message is sent out to the recipient device over binary SMS. That notification message contains MMS message headers, and a URL host pointer (http://local.host.name.or.ip.address:port/path/filename.mms) that the recipient device accesses to fetch the actual MMS message content.

So the host name or IP address needs to be valid for the recipient device to access.

NowSMS validates the URL before it sends it out ... that's why it must also be valid for the gateway itself.

The HOSTS file can help out when you have to access using a different IP address from inside the firewall vs. outside the firewall. You assign a public DNS name that points to the external address ... and a HOSTS file entry that remaps the DNS name to a local address in order to pass the NowSMS URL validation test before the notification gets sent out.

Does that make it clearer?

-bn
Perpuwet
Posted on Saturday, July 12, 2003 - 03:32 am:   

Thanks Bryce!

I'm able to send an MMS from the web interface but my phone is still unable to download the message. It showed retreiving message and then nothing happens.

How do I check if the phone is connecting to the gateway? Is there a log file I can check for gateway activity?

What else should I check since my phone cannot retreive the message?

I hope you don't mind asking too many questions.

Thank you very much for all your support. My friends are going to be really glad once I get this working.
Perpuwet
Posted on Saturday, July 12, 2003 - 04:00 am:   

Hi Bryce!

I enabled debug logging for the gateway and I can see that it is sending out the right address.

My phone displays retrieving message, connects via GPRS and then does nothing.

I feel I'm getting close but I need your guidance.

Thanks!
Bryce Norwood - NowSMS Support
Posted on Saturday, July 12, 2003 - 05:42 am:   

I should probably ask what carrier you're on.

There is an issue that the default MMS settings on some carrier networks prevent access to MMS messages originating on content servers other than the operator's MMSC (unless you have a commercial arrangement with the operator).

Before we get into that, verify that the URL that the notification is being posted for is actually accessible from outside the firewall. Fetch the URL with a web browser, and it should tell you that it is downloading a file ... and you should see an entry in the MMSC-yyyymmdd.LOG that shows the download (mmsretrieve) access.

Also, if you're not using port 80 as the HTTP port number for the MMSC, note that some operator WAP gateways block access to ports other than 80 for WAP/MMS content for no good reason.

Assuming you can indeed access the URL externally, then it may be restrictive MMS settings on the recipient MMS phone.

The MMS client on a mobile phone has WAP settings similar to those that are configured for the WAP browser on the phone. There is a GPRS APN (Access Point Name) which is what you connect to via GPRS to get IP connectivity. And then there is the IP address of a WAP gateway ... which acts as your proxy for accessing WAP or MMS content. Compare the settings for the WAP browser vs. those for the MMS client. If different, try configuring the MMS client to use the same GPRS APN and WAP gateway IP address as the WAP client.

(You can also try creating a simple WML file in the MMSCDATA subdirectory of the NowSMS installation, and try accessing that file via the WAP browser as http://ip.address.of.mmsc:port/filename.wml to verify that the settings for the WAP browser can actually connect to the MMSC.)

Unfortunately, if you have to change those MMS settings, that does not bode well for being able to send MMS messages to other subscribers of that operator ... as it is often not practical to change the settings for the average user.

For those instances, there are two alternatives:

1.) In the current version of NowSMS, you can use multimedia WAP push to push content to the WAP browser instead of the MMS client.

2.) The next version of NowSMS, coming to a beta release mid-next-week, will have an option that allows it to use a GPRS/GSM modem to send MMS messages through an operator MMSC, the same way that an MMS client on an actual mobile phone would submit a message. This option typically costs more than the current approach (charge for sending an MMS vs. charge for sending 2 SMS when you act as your own MMSC). We will also support MM7 and/or EAIF connectivity to the few operator MMSCs that are open to that type of connectivity.

-bn
Perpuwet
Posted on Sunday, July 13, 2003 - 05:43 pm:   

Hi Bryce.

I verified with both my computer and my phone that I can access the URL externally. With internet explorer it displayed the download dialog and with my phone wap browser I got an error "Unknown file format" which I think it's because the wap browser doesn't know how to handle the .mms file.

My carrier is cingular (US) and they currently don't offer MMS so I'm using my settings for GPRS connectivity and seems like it is not "walled" because I can access external sites.

I have configured my phone per the quick start guide. I used my GPRS settings and changed my home page.

Is there anyting else I'm missing?

Do you still have a link to the operator settings Nowmms provided before? I would like to try that also.

Thanks again.
Bryce Norwood - NowSMS Support
Posted on Monday, July 14, 2003 - 04:39 pm:   

Cingular shouldn't be a problem. If your MMSC is not on port 80, you might want to try that.

I've got two sets of settings for Cingular:

Their WAP settings are:

GPRS APN = wap.cingular
username = WAP@CINGULARGPRS.COM
password = CINGULAR1
WAP Gateway IP = 66.209.11.61 (different phones have different settings for the connection type, either connection-oriented, permanent or port 9201)

If you have a subscription that allows access to their internet APN (ISP Cingular), it's settings are:

GPRS APN = isp.cingular
username = WIXDC001@W5.MYCINGULAR.COM
password = ZXY203DC9K0402

With the internet APN settings, you either specify your own WAP gateway IP, or the IP of a public WAP gateway such as 213.48.20.10.


Here's a link to a site that has a good bit of information on settings for the Cingular WAP gateway:

http://navasgrp.home.att.net/tech/cingular/semc_wap.htm

-bn
Jay perpuwet
Posted on Monday, July 14, 2003 - 11:13 pm:   

I tried using the public gateway you provided 213.48.20.10 but I wasn't able to connect to any wap site at all.

66.209.11.61 works though.

I think I have a bit understanding of how MMS works. Please correct me if I'm wrong.

1. MMSC will send notification to mobile client that a new mms is available for download by sending a binay sms containing the link of the .mms file.

2. The mobile client connects to wap and fetches the .mms file.

3. A mobile client cannot just download the .mms via wap without the MMSC initiating the transaction because the browser doesn't undestand the MIME file.

I know it's a lot more involved and several pdu's are sent and received between the client and the server but in essence that is what's happening, right?

If I were to setup my own http/jsp server, maybe with tomcat, how do I process the stream? Is the stream in binary format? I can decode/encode to mms spec by using Nokia Java MM lib. But I don't know how to read the mms file to decode. Do you know where I can get an easy-to-understand example other than the WDP and WSP specs? I'm not quite at that level yet so I can't really absorb what the specs are covering.

Thank you very much for your support.

Bryce Norwood - NowSMS Support
Posted on Tuesday, July 15, 2003 - 06:31 pm:   

There's an MMS book by Scott Guthery that you can find for sale on Amazon (I did technical editing on the book), which is pretty good.

I'm not sure it will have as much detail as you want, but it does step through a couple of encoding examples.

The HTTP stream is standard HTTP with binary content ... HTTP GET and POST of "application/vnd.wap.mms-message" content.

The WAP protocols really only come to play when you need to push a notification out to a device (WAP PUSH over SMS)... or if you are writing an MMS client as the "de facto" standard for MMS clients is that they talk through a WAP gateway using WSP instead of direct to the MMSC over HTTP.

Here's a few links out here that give some pretty good hints on how to use the specs to figure out encoding/decoding:

http://support.nowsms.com/discus/messages/12/404.html

http://support.nowsms.com/discus/messages/1/136.html#POST1623

-bn
Jay
Posted on Wednesday, July 16, 2003 - 09:57 pm:   

Thank you very much Bryce. I was able to send MMS from the web interface to my phone and a friend's phone (Both Cingular) and retrieve it as well.

However, my brother is with T-Mobile and he is unable to receive notification of new MMS.

I'm using 3650 as my GSM modem and so does he. I tried to send him a business card just to see if I can send binary sms to other network (T-Mobile in this case) and he was unable to receive it. I guess it's a limitation of Cingular, correct?

Do you know any other way I can send binary SMS if it is in fact Cingular's network is why he can't receive the notification?

By the way, he tried to send me a business card from his phone and I wasn't able to receive it.

Thanks again.
Bryce Norwood - NowSMS Support
Posted on Thursday, July 17, 2003 - 04:02 am:   

Jay,

T-Mobile and Cingular used to have binary SMS message interoperability, but I think they now route to each other through InphoMatch, which doesn't seem to be able to route between binary messages between carriers, even if both are GSM.

I know of one customer who was using a GSM modem with a Cingular SIM, and it stopped routing binary messages through to T-Mobile phones about 2 months ago. That customer switched to using a T-Mobile SIM, but most, if not all of their users were on T-Mobile as well.

If you e-mail me your Cingular mobile number (e-mail it to nowsms@now.co.uk and remind me of this thread), I'll setup a test tomorrow to send you a binary message from a T-Mobile US SIM.

You might need to go away from the GSM modem approach. We've got a couple of customers that I know of who are using our gateway in conjunction with the SMPP service from TSI Connections. I know that Clickatell also supports getting binary messages through to both Cingular and T-Mobile (they didn't support getting binary messages through to AT&T Wireless when I tested them earlier this year, whereas TSI Connections does ... but I think they do now).

-bn
Jay
Posted on Friday, July 18, 2003 - 11:50 pm:   

Hi Bryce,

I received the text message you sent prior to the binary SMS that I never received. That proves that Cingular and T-Mobile doesn't have binary sms interoperabilty.

Thank you for all your help.

Jay