About

The plugin provides the ability to send SMS messages over several protocols. Submitting can be done using the API for Standard Process Change Listener.

Setup

Make sure the plugin is enabled and append to the configuration:

MTS communicator

Required parameters:

sms:type=mts
sms:login=<LOGIN>
sms:password=<PASSWORD>

Optional (with default values):

sms:shortcode=bgerp.org
sms:url=http://mcommunicator.ru/M2M/m2m_api.asmx/SendMessage

TELE2 target

Required parameters:

sms:type=tele2
sms:login=<LOGIN>
sms:password=<PASSWORD>

Optional (with default values):

sms:shortcode=bgerp.org
sms:url=https://newbsms.tele2.ru/api/?operation=send

SMSC.ru

Required parameters:

sms:type=smsc
sms:login=<LOGIN>
sms:password=<PASSWORD>

Optional (with default values):

sms:url=https://smsc.ru/sys/send.php

Multiple Providers

Additionally to the default provider may be configured additional ones, using unique IDs, for example:

# default configuration
sms:type=tele2
sms:login=login
sms:password=pass
sms:shortcode=BGERP
sms:url=https://target.tele2.ru/api/v2/send_message

# additional one with ID=1
sms:1.type=smsc
sms:1.login=login
sms:1.password=pass

Standard Process Change Listener

The plugin provides for JEXL context object sms of class org.bgerp.plugin.msg.sms.ExpressionObject with methods for sending messages.

Sending notification when process status changed.

onProcessEvent.{@inc:cnt}.events=statusChanged
onProcessEvent.{@cnt}.doExpression=<<END
// phone process param with ID=86
phone = u.getFirst(pp.val(86, 'nf').getItemList());
if (phone) {
    // sending via default provider
    sms.sendSms(phone.getPhone(), "Your appeal is registered with a number " + process.getId());
    // sending via additional provider with ID=2
    // sms.sendSms(2, phone.getPhone(), "Your appeal is registered with a number " + process.getId());
}
END