Opensips SMS Implemetation and Offline SMS Implementation using MSILO module :
opensips have MESSAGE method it is uses for SMS, we can send sms using opensips and we can also send offline messages if the other user is in offline by using msilo module from opensips core.now we will look into offline messages implementation using opensips.
How to Implement Offline messages using opensips :
1) load msilo.so module
loadmodule
"msilo.so"
2) also specify module specific parameters for my configuration
modparam("msilo",
"db_url", "mysql://opensips:openspsrw@localhost/opensips")
modparam("msilo",
"from_address", "sip:$rU@registrar.com")
modparam("msilo","content_type_hdr","Content-Type:
text/plain\r\n")
modparam("msilo",
"offline_message", "*** User $rU is offline!*****")
modparam("msilo",
"use_contact", 1)
3)If the user is not online then save the message into the opensips database silo table. this is automatically done if we uses m_store() function from our configuration file.
i'm calling like this.
if
(!lookup("location","m")) {
#--- user is offline store message in opensipsdb.silo table
by calling m_store() ----
switch ($retcode) {
case -1:
case -3:
xlog("MESSAGE received ->
storing using MSILO\n");
t_newtran();
m_store();
exit;
case -2:
exit;
}
}
4) add m_dump() function in Register route, because when user come to online it will send offline messages if any message exist.
if
(is_method("REGISTER"))
{
if (m_dump())
xlog("MSILO: offline messages dumped - if they
were\n");
else
xlog("MSILO: no offline messages dumped\n");
exit;
}
Congratulations you're successfully configured opensips to support offline messages.
Now restart opensips by running /etc/init.d/opensips restart
That's it
I try to implement msilo but without success. The modul saves messages, but it does not want to send them when user is registered.
ReplyDeletesame problem me to also
ReplyDeletesame problem me to also
ReplyDelete