| 342 | |
| 343 | |
| 344 | inline static void final_response_handler( struct timer_link *fr_tl ) |
| 345 | { |
| 346 | #define CANCEL_REASON_SIP_480 \ |
| 347 | "Reason: SIP;cause=480;text=\"NO_ANSWER\"" CRLF |
| 348 | |
| 349 | static context_p my_ctx = NULL; |
| 350 | context_p old_ctx; |
| 351 | struct retr_buf* r_buf; |
| 352 | struct cell *t; |
| 353 | branch_bm_t cancel_bitmap = BRANCH_BM_ZERO; |
| 354 | |
| 355 | if (fr_tl==0){ |
| 356 | /* or BUG?, ignoring it for now */ |
| 357 | LM_CRIT("final_response_handler(0) called\n"); |
| 358 | return; |
| 359 | } |
| 360 | r_buf = get_fr_timer_payload(fr_tl); |
| 361 | t=r_buf->my_T; |
| 362 | |
| 363 | # ifdef EXTRA_DEBUG |
| 364 | if (t->damocles) |
| 365 | { |
| 366 | LM_ERR("transaction %p scheduled for deletion and" |
| 367 | " called from FR timer\n",r_buf->my_T); |
| 368 | abort(); |
| 369 | } |
| 370 | # endif |
| 371 | |
| 372 | reset_timer( &(r_buf->retr_timer) ); |
| 373 | |
| 374 | /* the transaction is already removed from FR_LIST by the timer */ |
| 375 | |
| 376 | /* FR for local cancels.... */ |
| 377 | if (r_buf->activ_type==TYPE_LOCAL_CANCEL) |
| 378 | { |
| 379 | LM_DBG("stop retr for Local Cancel\n"); |
| 380 | return; |
| 381 | } |
| 382 | |
| 383 | /* FR for replies (negative INVITE replies) */ |
| 384 | if (r_buf->activ_type>0) { |
| 385 | # ifdef EXTRA_DEBUG |
| 386 | if (t->uas.request->REQ_METHOD!=METHOD_INVITE |
| 387 | || t->uas.status < 200 ) { |
| 388 | LM_ERR("unknown type reply buffer\n"); |
| 389 | abort(); |
| 390 | } |
| 391 | # endif |
| 392 | put_on_wait( t ); |
| 393 | return; |
| 394 | }; |
| 395 | |
| 396 | /* as this processing is outside the scope of other messages (it is |
| 397 | trigger from timer), a processing context must be attached to it */ |
| 398 | old_ctx = current_processing_ctx; |
| 399 | if (my_ctx==NULL) { |
| 400 | my_ctx = context_alloc(CONTEXT_GLOBAL); |
| 401 | if (my_ctx==NULL) { |
nothing calls this directly
no test coverage detected