[Serusers] Cancelling an INVITE

Benito Caracuel becasi at hotmail.com
Wed Nov 8 17:49:54 CET 2006


Hello all,
 
 
I have a problem when I try to cancel an invite, because I have modified the invite method. 
 
I'm going to explain the idea behind the problem, which is related to what we call "OffLine Invitation". An "Offline Invitation" consists of the SER set up as to DON'T send a "404 Not Found" when the Invitated party isn't registered. What is done is to keep the SER sending "100 Trying" for a while, and to send meanwhile 
a SMS to the Invitated -but not registered- party. That SMS is understood by the Application that's running at the Invited party as a "Register Request", so the Invitated party goes for a Register.
That works OK, but the problem comes up when you try to CANCEL the Invitation request. In that case, as the Invitated party isn't still registered, it cannot take care of the CANCEL's lifecicle, so SER has to deal with it, "emulating" that it is the Invitated party. 
As to do this, we assume that no race condition is produced, and neither a Final response has been sent by the Invitated party. So what is needed is, according to SIP protocol, to answer to the CANCEL with "200 OK" and to the original INVITE with a "487 Request Terminated".
 
The problem is obviously doing the INVITE - CANCEL match at the time the CANCEL gets to SER. We know there are scripts/procedures and tables in the SER architecture that can be used to do other tasks (as it is the "saving" of REGISTER packet onto a DB table), but, to be honest, we are a bit confused about if it can be done, or if it should need SER ad-hoc programming, or if there is a way to use an specific  SER DB Table to do it...
 
I post along my SER.CFG file, and an idea about how we were thinking that it could be solved (that is, a big picture; what we need indeed is to know if it is a good idea (having in mind SER architecture and scripting capabilities) or it cannot be done. Please, if it can be done, we'd like to hear a little more about what tables can be used, or if it's needed to create another new one, or at least, a clue to solve it.
 
 
In my ser.cfg:
 
 
if ((method=="INVITE")&&(!lookup("location"))) {
   exec_msg("printenv SRCIP; /bin/bash /usr/local/ser_snapshot/sbin/sms");
   sl_send_reply("100", "Trying");
   exec_msg("sleep 10");
 
   if (!lookup("location")){
     sl_send_reply("100", "Trying");
     exec_msg("sleep 10");
   } else {
     t_relay();
     break;
   }
   
   if (!lookup("location")){
     sl_send_reply("100", "Trying");
     exec_msg("sleep 10");
   } else {
     t_relay();
     break;
   }
   
      
   if (!lookup("location")){
     sl_send_reply("404", "Not on-line");
     break;
   } else {
     t_relay();
     break;
   }
  };
 
 
 
If I send an INVITE to user2, who is off-line (not registered), SER sends a SMS to this user2 and meanwhile, sends TRYINGS to me, until user2 becomes REGISTERED (the sent SMS makes the Invited party Register, so it can receive the Invite, as It was told before).
 
I have a problem, because If I send a CANCEL, SER still sends TRYINGS to me and SER doesn`t send "487 Request Terminated" and SER doesn´t associate CANCEL and INVITE.
 
How can I solve this? any idea?
 
I think that maybe, If I use a mysql table to save CSEQ of CANCEL, and before SER sends TRYINGS (I mean the next TRYINGs following the first), SER checks if CSEQ is into table, but I don´t know if SER can save CANCEL information in a mysql table.
I know that there is a command "save" to save REGISTER packet into location table. Is there any similar command to save CSEQ of CANCEL (and/or other, as Call-Id, Branch, Request-Uri and To) in one table?
 
Could someone help me, please? We are in a hurry with our customer, so fast key to a solution will be really appreciated.
 
Thank you very much.
_________________________________________________________________
Llama a tus amigos de PC a PC: ¡Es GRATIS!
http://get.live.com/messenger/overview
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20061108/f165eaf1/attachment.htm>


More information about the sr-users mailing list