Skip to content

Commit

Permalink
Link the dialog cell into internally generated requests from the dial…
Browse files Browse the repository at this point in the history
…og module

Fixes #839
  • Loading branch information
vladpaiu committed May 27, 2016
1 parent e3a57ac commit 66937a2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/dialog/dlg_req_within.c
Expand Up @@ -133,6 +133,10 @@ dlg_t * build_dlg_t(struct dlg_cell * cell, int dst_leg, int src_leg)
td->state= DLG_CONFIRMED;
td->send_sock = cell->legs[dst_leg].bind_addr;

/* link the dialog cell here - it will eventually be linked
* within the upcoming created transaction */
td->dialog_ctx = cell;

return td;

error:
Expand Down Expand Up @@ -200,6 +204,10 @@ dlg_t * build_dialog_info(struct dlg_cell * cell, int dst_leg, int src_leg,char
td->state= DLG_CONFIRMED;
td->send_sock = cell->legs[dst_leg].bind_addr;

/* link the dialog cell here - it will eventually be linked
* within the upcoming created transaction */
td->dialog_ctx = cell;

return td;

error:
Expand Down
1 change: 1 addition & 0 deletions modules/tm/dlg.h
Expand Up @@ -104,6 +104,7 @@ typedef struct dlg {
* prevent repeated analyzing of the dialog data
*/
struct socket_info* send_sock;
void *dialog_ctx; /* backpointer to dialog ctx */
struct usr_avp *avps;
} dlg_t;

Expand Down
5 changes: 5 additions & 0 deletions modules/tm/uac.c
Expand Up @@ -236,6 +236,11 @@ int t_uac(str* method, str* headers, str* body, dlg_t* dialog,
goto error2;
}

/* if we have a dialog ctx, link it to the newly created transaction
* we might need it later for accessing dialog specific info */
if (dialog->dialog_ctx)
new_cell->dialog_ctx = dialog->dialog_ctx;

/* pass the transaction flags from dialog to transaction */
new_cell->flags |= dialog->T_flags;

Expand Down

0 comments on commit 66937a2

Please sign in to comment.