Module ecimd2

CIMD2 Client.

Copyright © 2017 Voyager Innovations Inc.

Description

CIMD2 Client

Exposes a start_link/1 function that accepts login parameters and makes connection to the Nokia SMSC. This starts an internal gen_server and returns a reference for that particular process

This is also the main module interface for this library. This will also expose the functions for sending sms, retrieving delivery receipts and registering callbacks

Function Index

is_connected/1Check if connected to server.
logout/1Logout the session.
send_sms/6Sends a message to the specified MSISDN.
start_link/1Starts connection to the SMSC and logs in with the given credentials.

Function Details

is_connected/1

is_connected(C::pid()) -> {status, boolean()}

Check if connected to server

logout/1

logout(C::pid()) -> ok

Logout the session

send_sms/6

send_sms(C::pid(), AccessCode::iodata(), Sender::iodata(), Destination::iodata(), Message::iodata(), Options) -> [{message_id, iodata()}] | {error, atom()}

Sends a message to the specified MSISDN

Options is an optional map that may contain the following keys:

cancellable
Determines if the message can be cancelled or not
tariff_class
Tariff code to be used for the message. This is usually MC specific
service_desc
Service description to be used for the message. This is usually MC specific
status_report
Flag of the cases when the status report should be returned. See status report flags
priority
Priorty of the message (0-9). Lower value means higher priority

Status Report Flag values:

1 - Temporary error

2 - Validity period expired

4 - Delivery failed

8 - Delivery successful

16 - Message cancelled

32 - Message deleted by operator

64 - First temporary result

128 - Reserved

start_link/1

start_link(Options) -> {ok, pid()} | ignore | {error, term()}

Starts connection to the SMSC and logs in with the given credentials

Options is a map that should contain the following keys:

name
If provided, the internal gen_server will be registered with this name. see gen_server:start_link/4
callback_mo
Tuple of module and function atoms to be executed when a mobile originating message has been received
callback_dr
Tuple of module and function atoms to be executed when a delivery receipt has been received
reconnect
Reconnect time for lazy initialization. This indicates the number of milliseconds to sleep before attempting to connect to the SMSC. This accepts a module and function atom tuple for external sources.
host
Hostname or IP address of the Nokia MC
port
Port of the Nokia MC
username
Username of the account to login
password
Password used to authenticate with the username


Generated by EDoc, May 8 2017, 19:45:17.