Hi,
I set instant message store&forward in kamailio using MSILO module. It works fine in many cases. We have special message handing (encryption in "session"), i do not go into detail since it is not necessarily to solve the problem. So there are situations, when the offline receiver should get a MESSAGE and will acknowledge with 4xx status code, like 493: the original message is stored in silo table and when the receiver will be online, it will be dumped and he will send 493.
Question: how can I delete the message from silo table with MSILO (since it is not 2xx) and how can i forward this ack message to the original sender instead kamailio?
Thanks.
Dr. Péter Barabás Director of Software Development Arenim Technologies AB.
Hello,
On 08/10/15 11:58, Péter Barabás wrote:
Hi,
I set instant message store&forward in kamailio using MSILO module. It works fine in many cases.
We have special message handing (encryption in „session”), i do not go into detail since it is not necessarily to solve the problem.
So there are situations, when the offline receiver should get a MESSAGE and will acknowledge with 4xx status code, like 493: the original message is stored in silo table and when the receiver will be online, it will be dumped and he will send 493.
Question: how can I delete the message from silo table with MSILO (since it is not 2xx) and how can i forward this ack message to the original sender instead kamailio?
Do I understand right that the MESSAGE sent by msilo is replied with 493 by recipient? In SIP, 200-299 are considered the codes for which a recipient accepts the request. Any particular reason for the client to send 493?
Anyhow, the patch to msilo should not big -- change inside function m_tm_callback() from modules/msilo/msilo.c for which code to set the MS_MSG_DONE flag.
The SIP response cannot forwarded to initial sending entity, because it lacks appropriate Via headers, but more important it will not have a request generated by that entity. You can have a NOTIFY request generated by kamailio sent to the entity to inform that its message was delivered.
Cheers, Daniel
Hi Daniel,
thanks for the answer, i did that exactly.
The reason of 493 comes our special IM handling. We send encrypted message and if client sends 493 back, it means, that the message cannot be decrypted and now the message should be resend in a "new encrypted session".
Now I have another problem belonging to the delivery notification problem.
The situation is the following.
- A user send a message to B user, A includes a custom SIP header into the request with a unique identifier
- B is offline, so kamailio stores the message into silo table
- when B will B online, msilo dumps the message
- when the ACK arrives, in m_tm_callback, kamailio send a new MESSAGE with the unique identifier to user A
It works fine, it user A is online, but if user A is offline, i want to send this MESSAGE into the silo table using m_store().
The question: how can I access the request sip MESSAGE in my custom m_ack_callback which is the callback function of uac_r structure, which I use to send the delivery notification MESSAGE. What is the proper configuration of uac_r structure to achieve this goal, since neither params->req nor t->uas.request has value?
At first, i wanted to send NOTIFY back from kamailio to sender user as delivery notification, but I do not want to be missed if user is offline, and the msilo solution can be fine for it also.
Peter From: sr-users [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Daniel-Constantin Mierla Sent: Monday, October 12, 2015 2:17 PM To: Kamailio (SER) - Users Mailing List sr-users@lists.sip-router.org Subject: Re: [SR-Users] msilo dump with non 2xx answer
Hello, On 08/10/15 11:58, Péter Barabás wrote: Hi,
I set instant message store&forward in kamailio using MSILO module. It works fine in many cases. We have special message handing (encryption in "session"), i do not go into detail since it is not necessarily to solve the problem. So there are situations, when the offline receiver should get a MESSAGE and will acknowledge with 4xx status code, like 493: the original message is stored in silo table and when the receiver will be online, it will be dumped and he will send 493.
Question: how can I delete the message from silo table with MSILO (since it is not 2xx) and how can i forward this ack message to the original sender instead kamailio?
Do I understand right that the MESSAGE sent by msilo is replied with 493 by recipient? In SIP, 200-299 are considered the codes for which a recipient accepts the request. Any particular reason for the client to send 493?
Anyhow, the patch to msilo should not big -- change inside function m_tm_callback() from modules/msilo/msilo.c for which code to set the MS_MSG_DONE flag.
The SIP response cannot forwarded to initial sending entity, because it lacks appropriate Via headers, but more important it will not have a request generated by that entity. You can have a NOTIFY request generated by kamailio sent to the entity to inform that its message was delivered.
Cheers, Daniel
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
Hello,
On 16/10/15 12:20, Péter Barabás wrote:
Hi Daniel,
thanks for the answer, i did that exactly.
The reason of 493 comes our special IM handling. We send encrypted message and if client sends 493 back, it means, that the message cannot be decrypted and now the message should be resend in a „new encrypted session”.
Now I have another problem belonging to the delivery notification problem.
The situation is the following.
A user send a message to B user, A includes a custom SIP
header into the request with a unique identifier
B is offline, so kamailio stores the message into silo table
when B will B online, msilo dumps the message
when the ACK arrives, in m_tm_callback, kamailio send a new
MESSAGE with the unique identifier to user A
It works fine, it user A is online, but if user A is offline, i want to send this MESSAGE into the silo table using m_store().
The question: how can I access the request sip MESSAGE in my custom m_ack_callback which is the callback function of uac_r structure, which I use to send the delivery notification MESSAGE. What is the proper configuration of uac_r structure to achieve this goal, since neither params->req nor t->uas.request has value?
At first, i wanted to send NOTIFY back from kamailio to sender user as delivery notification, but I do not want to be missed if user is offline, and the msilo solution can be fine for it also.
t->uas.request would be the request received by Kamailio, but here is not the case, because the request is generated by kamailio. You have to look at t->uac -- this is an array with branches sent out, in this case it should be the first branch (index 0).
Alternative is to pass the unique identifier to the new tm callback (used for sending the delivery message to A) and based on it store something in msilo that will be sent when A is coming online.
Cheers, Daniel
Thanks Daniek,
it works now when i use the t->uac structure. I replaced the cbp messageId with custom structure and if the ack delivery fails, i put the message converted from request buffer into the silo table.
Dr. Barabás Péter Minerva-Soft Kft. Fejlesztésvezető
Mob: +36 70 314 56 57 Tel: +36 1 8 555 602 Fax: +36 1 3 539 393 E-mail: peter.barabas@minerva-soft.commailto:peter.barabas@minerva-soft.com Cím: 1117 Budapest, Infopark sétány 1, “I” Épület
[cid:image001.png@01D10CE9.5A05FC30]
From: Daniel-Constantin Mierla [mailto:miconda@gmail.com] Sent: Wednesday, October 21, 2015 2:16 PM To: Péter Barabás Peter.Barabas@minerva-soft.com; Kamailio (SER) - Users Mailing List sr-users@lists.sip-router.org Subject: Re: [SR-Users] msilo dump with non 2xx answer
Hello, On 16/10/15 12:20, Péter Barabás wrote: Hi Daniel,
thanks for the answer, i did that exactly.
The reason of 493 comes our special IM handling. We send encrypted message and if client sends 493 back, it means, that the message cannot be decrypted and now the message should be resend in a „new encrypted session”.
Now I have another problem belonging to the delivery notification problem.
The situation is the following.
- A user send a message to B user, A includes a custom SIP header into the request with a unique identifier
- B is offline, so kamailio stores the message into silo table
- when B will B online, msilo dumps the message
- when the ACK arrives, in m_tm_callback, kamailio send a new MESSAGE with the unique identifier to user A
It works fine, it user A is online, but if user A is offline, i want to send this MESSAGE into the silo table using m_store().
The question: how can I access the request sip MESSAGE in my custom m_ack_callback which is the callback function of uac_r structure, which I use to send the delivery notification MESSAGE. What is the proper configuration of uac_r structure to achieve this goal, since neither params->req nor t->uas.request has value?
At first, i wanted to send NOTIFY back from kamailio to sender user as delivery notification, but I do not want to be missed if user is offline, and the msilo solution can be fine for it also.
t->uas.request would be the request received by Kamailio, but here is not the case, because the request is generated by kamailio. You have to look at t->uac -- this is an array with branches sent out, in this case it should be the first branch (index 0).
Alternative is to pass the unique identifier to the new tm callback (used for sending the delivery message to A) and based on it store something in msilo that will be sent when A is coming online.
Cheers, Daniel
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com