MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / t_resume_async_request

Function t_resume_async_request

modules/tm/async.c:83–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83int t_resume_async_request(int fd, void*param, int was_timeout)
84{
85 static struct sip_msg faked_req;
86 static struct ua_client uac;
87 async_tm_ctx *ctx = (async_tm_ctx *)param;
88 struct cell *backup_t;
89 struct cell *backup_cancelled_t;
90 struct cell *backup_e2eack_t;
91 struct usr_avp **backup_list;
92 const struct socket_info* backup_si;
93 struct cell *t= ctx->t;
94 int route;
95
96 if (valid_async_fd(fd))
97 LM_DBG("resuming request on fd %d, transaction %p \n", fd, t);
98 else
99 LM_DBG("resuming request without a fd, transaction %p \n", t);
100
101
102 /* prepare for resume route, by filling in a phony UAC structure to
103 * trigger the inheritance of the branch specific values */
104 uac.br_flags = getb0flags( t->uas.request ) ;
105 uac.uri = *GET_RURI( t->uas.request );
106 uac.duri = t->uas.request->dst_uri;
107 uac.path_vec = t->uas.request->path_vec;
108 uac.adv_address = t->uas.request->set_global_address;
109 uac.adv_port = t->uas.request->set_global_port;
110 if (!fake_req( &faked_req /* the fake msg to be built*/,
111 t->uas.request, /* the template msg saved in transaction */
112 &t->uas, /*the UAS side of the transaction*/
113 &uac /* the fake UAC */)
114 ) {
115 LM_ERR("fake_req failed\n");
116 return 0;
117 }
118
119 /* enviroment setting */
120 set_global_context(ctx->msg_ctx);
121 backup_t = get_t();
122 backup_e2eack_t = get_e2eack_t();
123 backup_cancelled_t = get_cancelled_t();
124 /* fake transaction */
125 set_t( t );
126 set_cancelled_t(ctx->cancelled_t);
127 set_e2eack_t(ctx->e2eack_t);
128 reset_kr();
129 set_kr(ctx->kr);
130 /* make available the avp list from transaction */
131 backup_list = set_avp_list( &t->user_avps );
132 /* set default send address to the saved value */
133 backup_si = bind_address;
134 bind_address =
135 t->nr_of_outgoings ? TM_BRANCH( t, 0).request.dst.send_sock : NULL;
136
137 async_status = ASYNC_DONE; /* assume default status as done */
138 /* call the resume function in order to read and handle data */
139 return_code = ((async_resume_module*)
140 (was_timeout ? ctx->async.timeout_f : ctx->async.resume_f))

Callers 1

t_resume_asyncFunction · 0.85

Calls 15

fake_reqFunction · 0.85
get_tFunction · 0.85
get_e2eack_tFunction · 0.85
get_cancelled_tFunction · 0.85
set_tFunction · 0.85
set_cancelled_tFunction · 0.85
set_e2eack_tFunction · 0.85
reset_krFunction · 0.85
set_krFunction · 0.85
set_avp_listFunction · 0.85
profiling_set_ctxFunction · 0.85
run_resume_routeFunction · 0.85

Tested by

no test coverage detected