Browse code

branch param is parsed in t_reply_matching

Bogdan-Andrei Iancu authored on 28/11/2001 15:25:33
Showing 1 changed files
... ...
@@ -321,7 +321,7 @@ int t_on_reply_received( struct sip_msg  *p_msg )
321 321
       if ( p_msg->first_line.u.reply.statusclass==1 && T->inbound_request->first_line.u.request.method_value!=METHOD_INVITE )
322 322
       {
323 323
          T->outbound_request[branch]->timeout = RETR_T2;
324
-         insert_into_timer_list( hash_table , &(T->outbound_request[branch]->tl[RETRASMISSIONS_LIST]) , RETRASMISSIONS_LIST , 10/* TO DO !!! */ );
324
+         insert_into_timer_list( hash_table , &(T->outbound_request[branch]->tl[RETRASMISSIONS_LIST]) , RETRASMISSIONS_LIST , RETR_T2 );
325 325
       }
326 326
 
327 327
 
... ...
@@ -489,20 +489,25 @@ int t_reply_matching( struct s_table *hash_table , struct sip_msg *p_msg , struc
489 489
    unsigned int hash_index = 0;
490 490
    unsigned int entry_label  = 0;
491 491
    unsigned int branch_id    = 0;
492
+   char  *begin, *end;
492 493
 
493
-   /* getting the hash_index from the brach param , via header*/
494
-   // hash_index = get_hash_index( p_msg );   TO DO !!!!
495 494
 
495
+   /* getting the hash_index from the brach param , via header*/
496
+   begin = p_msg->via1->branch->value.s;
497
+   for(  ; *begin!='.' ; begin++ );
498
+   hash_index = strtol( ++begin , &end , 10 );
496 499
    /*if the hash index is corect */
497
-   if  ( hash_index>=0 && hash_index<TABLE_ENTRIES-1 )
500
+   if  ( *end=='.' && hash_index>=0 && hash_index<TABLE_ENTRIES-1 )
498 501
    {
499 502
       /* getting the entry label value */
500
-      // entry_label =  get_entry_label( p_msg );   TO DO !!!!
503
+      begin=end++ ;
504
+      entry_label = strtol( ++begin , &end , 10 );
501 505
       /* if the entry label also is corect */
502
-      if  ( entry_label>=0 )
506
+      if  ( *end=='.' && entry_label>=0 )
503 507
       {
504 508
          /* getting the branch_id value */
505
-         // entry_label =  get_branch_id( p_msg );   TO DO !!!!
509
+         begin=end++ ;
510
+         branch_id = strtol( ++begin , &end , 10 );
506 511
          /* if the entry label also is corect */
507 512
           if  ( branch_id>=0 )
508 513
           {