< Previous by Date Date Index Next by Date >
  Thread Index Next in Thread >

[reSIProcate] route set when establishing dialog


Hi, 

I faced an strange behaviour when trying to establish an INVITE dialog using 
resiprocate (DUM) as a client:
    - Being my client the sender of the initial invite, it sent several 
restransmissions of the initial invite
    - It was answered with several 200OK, all of them with Record-Route 
headers, that should be used to learn the Route Set for the dialog  (as rfc 
3261, 13.2.2.4 says). Some of these 200Ok have different Recor-Route values 
(even the other parts of the msg are exactly the same). 
    - Even it is somehow a fault on the other side (they should be a all a 
retransmission of the same 200OK) it led DUM to recompute and learn a different 
Route Set for each RESPONSE received. 
    - The later can be true while the dialog has not yet received a final 
response (the route set in a final response, even empty, prevails over the 
provisional ones)
    - As far as I know, the route set (once it has been set) cannot change 
during the lifetime of a dialog (rfc 3261, 13.2.2.4). 

    - If I am right, Dialog class should be modified in order to cope with this 
condition. My solution is something like the following

void
Dialog::dispatch(const SipMessage& msg)
{
(...)
      const SipMessage& response = msg;
      int code = response.header(h_StatusLine).statusCode();
      // If this is a 200 response to the initial request, then store the 
routeset (if present)
      BaseCreator* creator = mDialogSet.getCreator();
      if (creator && (creator->getLastRequest()->header(h_CSeq) == 
response.header(h_CSeq)) && code >=200 && code < 300)
       {
         { 
//[********************************************************************changed********************************************************************]
 
         if (mType == Invitation)
            { 
            if ( (mInviteSession == NULL) || mInviteSession->isEarly())
                  {
                  mRouteSet = response.header(h_RecordRoutes).reverse();
                  }
               else
                  {
                  DebugLog ( << "Dialog::dispatch  --  Route set is not taken" 
);
                  }
            }
         else
            { //provisional responses are only meaningful on INVITE 
               if ((code / 100  == 2) && mRouteSet.empty() && 
response.exists(h_RecordRoutes))
               {      
                 mRouteSet = response.header(h_RecordRoutes).reverse();
               }
            }
         } //[end 
********************************************************************changed********************************************************************]
      }

   - Does anybody faced before this strange scenario? How do you solve it?

   - Could my changes be right

Thank you, 
    /Jesus
 




       
____________________________________________________________________________________
Sé un Mejor Amante del Cine                         
¿Quieres saber cómo? ¡Deja que otras personas te ayuden!
http://advision.webevents.yahoo.com/reto/entretenimiento.html