I've uploaded an early version of OpenVPMS 1.5-beta-3 with SMS support to:
http://repository.openvpms.org/snapshots/org/openvpms/openvpms-release/1...

Two email-to-SMS gateways are supported out of the box:

To sign up, go to: http://www.smsglobal.com/en-au/solutions/signup_page.php
SMSGlobal allows you to send a small number if test messages for free after you register.  

Clickatell allows you to send a small number of test messages for free after you register but sends a preformatted SMS until you pay $.
To sign up:

After signing up, go to: https://www.clickatell.com/central/manage_products.php and select "SMTP" from the "Add Connection" drop down. Click "Submit and Get API ID". The API ID is needed when configuring OpenVPMS.
 

Other gateways can be added, with some knowledge of the gateway message format requirements and xpath expressions.
 

Configuring SMS

1. reload archetypes to pick up the new SMS configuration archetypes.
2. create an SMS configuration for the SMS provider

To create a configuration for SMSGlobal:

  • go to Administration -> Organisation and select New -> SMS Configuration: SMSGlobal Email2SMS.
  • Populate the Country Prefix and Area Prefix as required (e.g, 61 and 0 for Australia).
  • Enter the From address. This must be the same as that entered in the Email to SMS settings in the Preferences page at https://www.smsglobal.com/mobileworks/preferences.php

To create a configuration for Clickatell:

  • go to Administration -> Organisation and select New -> SMS Configuration: Clickatell SMTP Connection
  • Populate the Country Prefix and Area Prefix as required (e.g, 61 and 0 for Australia).
  • Enter the User and Password. These are the same as those used to sign in to the Clickatell website
  • Enter the API ID. Set this to be that of the API ID obtained as described above.
  • Enter a valid From email address.
  • Optionally enter a Reply To email address. If specified, responses from the gateway will be sent here.

3. link the SMS configuration to the practice:

  • edit the Practice in Administration -> Organisation
  • select the SMS tab
  • select the followed by the SMS configuration created above

4. optionally configure the mail server:

  • edit the Practice Location(s) in Administration -> Organisation
  • enter the Mail Host, Mail Port, Mail Username and Mail Password as required

 

Sending SMS messages

SMS messages can be sent to any customer that has a Phone Number Contact with "Allow SMS" ticked.
SMS messages can be sent by clicking the Send SMS button in the Customer Summary. If a customer has multiple phones, the preferred one will be pre-selected in a dropdown. Alternatively, the Send SMS button in the customer's Phone Number contact can be used to send a message.
For this release, only messages up to 160 characters may be sent.

A description of the implementation can be found in the JIRA:
https://openvpms.atlassian.net/browse/OVPMS-902?focusedCommentId=12531&p...
This includes instructions for adding support for other SMS gateways.

A description of the Clickatell SMTP API can be found at http://www.clickatell.com/downloads/smtp/Clickatell_SMTP.pdf

A description of the SMSGlobal SMTP API can be found at http://www.smsglobal.com/docs/Email-2-SMS.pdf

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: SMS support

Hi Tim,

It works really quickly with SMSglobal and was quite easy to setup. It would be really handy to have a script to look for mobile numbers and set the "Allow SMS" to true for all of them. There are alot of retrospective entries that do not have that option selected. 

Matt Y. 

Re: SMS support

Thanks for trying it out. I'll look at providing a script in the next few days.

One aspect of SMSGlobal email gateway is that its not particularly secure. If you know the From email address configured in the SMSGlobal account preferences, you can send SMS messages to anyone. It may be a good idea to use a From email address created solely for the purposes of sending SMS messages.

-Tim

Re: SMS support

The following should do it. Note that it will set the sms flag for any phone number beginning with "04" which is the mobile area prefix in Australia.

-Tim

 insert into contact_details (contact_id, name, type, value)
select c.contact_id, "sms", "boolean", "false"
from contacts c
join contact_details d
    on c.contact_id = d.contact_id and c.arch_short_name = "contact.phoneNumber" and d.name = "telephoneNumber"
left join contact_details s
    on c.contact_id = s.contact_id and s.name = "sms"
where s.value is null;

update contacts c, contact_details d, contact_details s
set s.value = "true"
where c.contact_id = d.contact_id and d.name = "telephoneNumber" and d.value like "04%"
    and c.contact_id = s.contact_id and s.name = "sms" and s.value = "false"
    and c.arch_short_name = "contact.phoneNumber"; 

Re: SMS support

Thanks Tim,

It worked perfectly.

Matt.

Re: SMS support

Hi,

I have followed the steps for setup per the newest post from Tony.

I am getting the attached error message so I guess I am missing something? Maybe an implementor??

SMS-0202: Mail server connection failed: Could not connect to SMTP host: localhost, port: 25;
nested exception is:
java.net.ConnectException: Connection refused: connect
 
 

Would it be correct that I would need to add the settings below and where would I find these?

4. optionally configure the mail server:

  • edit the Practice Location(s) in Administration -> Organisation
  • enter the Mail Host, Mail Port, Mail Username and Mail Password as required

Thanks Bernie

Re: SMS support

My ISP has had an EmailtoSMS facility for quite some time which we've used to text clients through an API they developed.  There's no commitment and it's 7c an SMS so is good value, IMHO. I don't know if every Australian ISP offers the same facility, but non-users of that ISP can sign up for SMS-only accounts.

I've thrown together a few screenshots into a book page and popped the page up under User Documentation / Various Other Pages, showing the steps I had to take.

Now if mobile numbers can be correctly harvested from "Area Code + Number" fields, we'll be able to use this facility in our practice on a daily basis (I know my staff have been bugging me ever since v1.5 came out).

Re: SMS support

Thanks for another great tutorial Yuri.

As a workaround to sending to formatted mobile numbers try editing your generic SMS configuration so that the To Expression looks like the following:

 concat(translate($phone, "() ", ""), '@insert.email.provider.here.com') 

This will strip brackets and spaces from the phone number.

If you have any other text in the phone field, you can strip that out as well, although you have to list each character to remove:

concat(translate($phone, "() ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxy'", ""), '@insert.email.provider.here.com')

Regards,

Tim

Re: SMS support

Thanks, they work very well, but unfortunately still don't pick up the "04nn" in the area code field.

EDIT: I'll update the tutorial with the longer phrase above.  It certainly addresses the concerns you had in http://www.openvpms.org/forum/sms-numbers-fax-phone-numbers-and-little-pedantry#comment-4536 - I've been playing around with different phone numbers and field contents such as (0411) 123-456 (ask for Jane) resolve nicely to 0411123456.

Once OVPMS-1112 is implemented to take care of area codes, SMS phone numbers should be pretty much bullet-proof.

Thanks.

Cheers

Yuri.

Re: SMS support

OVPMS-1112 is now implemented in 1.6. It will also strip out comments after the number, making the above translate() redundant.

-Tim

Re: SMS support

Thanks, Tim - awesome.

Yuri.

Syndicate content