Text Message between SS phones

Getting started with the SIP Sorcery
andresvr
Posts: 9
Joined: Wed Nov 11, 2009 12:19 pm

Text Message between SS phones

Post by andresvr » Tue Mar 13, 2012 4:49 pm

Hello everyone,

I would like to know if it is possible to send text messages from a SS phone to another SS phone as we do between cell phones (SMS like in a SIP-based system).

If yes, how do we do this?

Thanks,

André

User avatar
Aaron
Site Admin
Posts: 4551
Joined: Thu Jul 12, 2007 12:13 am

Re: Text Message between SS phones

Post by Aaron » Wed Mar 14, 2012 10:55 am

The SIP protocol does have provision for supporting text messages and there is a dedicated RFC for it and it's commonly referred to as SIMPLE. Despite that it's never taken off and support for SIMPLE in SIP devices is patchy at best.

As far as sipsorcery goes it does support processing MESSAGE requests in your dialplan but there are a few tricks to it. If you can get a MESSAGE request to sipsorcery form your device I'll be able to help you from there.

MrDoo
Posts: 23
Joined: Wed Apr 06, 2011 7:56 pm

Re: Text Message between SS phones

Post by MrDoo » Thu Mar 15, 2012 3:24 pm

Tropo has support for SMS. You could easily create a script to send a text to your Sipsorcery SIP URI to test it out. I don't know what it will do, but it's easy to try!

SwampLynx
Posts: 6
Joined: Thu Oct 06, 2011 9:29 pm

Re: Text Message between SS phones

Post by SwampLynx » Wed Apr 25, 2012 5:44 pm

Aaron,
I have Bria sending MESSAGE requests to SS, but am not sure what sort of magic in needed in my dailplan to get it to work. I'm getting "MESSAGE request failed with a response status of 480" after the request goes through the part of my dialplan that normally handles direct SIP URI calls. Many thanks for pointing me in the right direction.

- CM

User avatar
Aaron
Site Admin
Posts: 4551
Joined: Thu Jul 12, 2007 12:13 am

Re: Text Message between SS phones

Post by Aaron » Fri Apr 27, 2012 12:33 pm

I'll get back to you on that one. I have to dig up my sample of how to handle MESSAGE requests in a sipsorcery dialplan.

User avatar
Aaron
Site Admin
Posts: 4551
Joined: Thu Jul 12, 2007 12:13 am

Re: Text Message between SS phones

Post by Aaron » Sun Apr 29, 2012 10:44 am

To accept MESSAGE requests in your dialplan you need to check the "Accept Non-Invite" check box that's available when you login to the Silverlight portal. Once you do that you'll need to check the method of incoming requests so you can process MESSAGE and INVITE requests differently.

Code: Select all

if req.Method.to_s == "MESSAGE"
  # Do something with MESSAGE requests.
else
  # Do normal INVITE request processing.
end

calvinng
Posts: 20
Joined: Thu Mar 01, 2012 1:08 am

Re: Text Message between SS phones

Post by calvinng » Tue Sep 11, 2012 7:32 pm

Hello Aaron,

Do you have any sample Ruby code for the portion where you wrote:
"# Do something with MESSAGE requests." ?

I have a Bria phone which supports SIP SIMPLE and I want to put some code into my dialplan to process the SIMPLE message to send to my recipient. Do I need special code in my dialpan for the incoming SIMPLE messages as well from my recipient?

Thanks again for your help.

Regards,
Calvin

User avatar
Aaron
Site Admin
Posts: 4551
Joined: Thu Jul 12, 2007 12:13 am

Re: Text Message between SS phones

Post by Aaron » Wed Sep 12, 2012 10:20 am

That's the big question :). What do you want to do with a MESSAGE request that is received by the SIPSorcery server on your account?

To print it out as a console message you could use:

Code: Select all

if req.Method.to_s == "MESSAGE"
  # Do something with MESSAGE requests.
  sys.Log("MESSAGE received: #{req.Body}")
else
  # Do normal INVITE request processing.
end


Other than that I guess you could email yourself the message or send it as a GTalk instant message. Did you have something specific in mind you wanted to do with it?

calvinng
Posts: 20
Joined: Thu Mar 01, 2012 1:08 am

Re: Text Message between SS phones

Post by calvinng » Wed Sep 12, 2012 4:22 pm

Hello Aaron,

Thanks for the quick response.

I just wanted the received SMS/IM message to show up in Bria, as Bria has a IM messaging screen similar to the popular IM platforms like MSN Live and Yahoo Messenger. Bria supports both SMS and IM. I am not sure of the difference between the two formats.

How would relay the received SMS/IM message to Bria so it will pop up within its Messaging screen and vice versa (how to process a SIMPLE message and send it out via Sipsorcery to a recepient). I can't find any Ruby code on Sipsorcery which will guide me on this process. Thanks again for your help. Extremely appreciated.

Calvin

User avatar
Aaron
Site Admin
Posts: 4551
Joined: Thu Jul 12, 2007 12:13 am

Re: Text Message between SS phones

Post by Aaron » Thu Sep 13, 2012 12:34 pm

The method you can use to send SIP MESSAGE requests is:

Code: Select all

sys.SendRequest("MESSAGE","your_username@sipsorcery.com","text/html","hello my world", 0)


So combining that with the last snippet gives:

Code: Select all

if req.Method.to_s == "MESSAGE"
  # Do something with MESSAGE requests.
  sys.Log("MESSAGE received: #{req.Body}")
  sys.SendRequest("MESSAGE","your_username@sipsorcery.com", "text/html", req.Body, 0)
else
  # Do normal INVITE request processing.
end

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests