Skip to content

Commit

Permalink
Merge branch 'OpenSIPS:master' into b2b_logic_addons
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenbock committed Mar 17, 2022
2 parents eeb331e + 6907901 commit b97f228
Show file tree
Hide file tree
Showing 6 changed files with 260 additions and 70 deletions.
3 changes: 1 addition & 2 deletions modules/b2b_entities/b2b_entities.c
Expand Up @@ -555,8 +555,7 @@ int b2b_update_b2bl_param(enum b2b_entity_type type, str* key,
lock_release(&table[hash_index].lock);
return -1;
}
memcpy(dlg->logic_key.s, logic_key->s, logic_key->len);
dlg->logic_key.len = logic_key->len;
shm_str_sync(&dlg->logic_key, logic_key);
if (unlock)
lock_release(&table[hash_index].lock);

Expand Down
44 changes: 22 additions & 22 deletions modules/b2b_entities/dlg.c
Expand Up @@ -807,26 +807,6 @@ int b2b_prescript_f(struct sip_msg *msg, void *uparam)
}
}

if(method_value == METHOD_PRACK)
{
LM_DBG("Received a PRACK - send 200 reply\n");
str reason={"OK", 2};
/* send 200 OK and exit */
tmb.t_newtran( msg );
tm_tran = tmb.t_gett();
// FIXME run here the transactional tracing, but we do not have
// the matching dlg, in order to grab the tracing function
tmb.t_reply(msg, 200, &reason);
if(tm_tran && tm_tran!=T_UNDEFINED)
tmb.unref_cell(tm_tran);

/* No need to apply lumps */
if(req_routeid > 0)
run_top_route(sroutes->request[req_routeid], msg);

goto done;
}

search_dialog:
if( msg->callid==NULL || msg->callid->body.s==NULL)
{
Expand Down Expand Up @@ -966,7 +946,7 @@ int b2b_prescript_f(struct sip_msg *msg, void *uparam)
}
else /* if also not a client request - not for us */
{
if(method_value != METHOD_UPDATE)
if(method_value != METHOD_UPDATE && method_value != METHOD_PRACK)
{
LM_DBG("Not a b2b request\n");
return SCB_RUN_ALL;
Expand All @@ -981,7 +961,7 @@ int b2b_prescript_f(struct sip_msg *msg, void *uparam)
if(dlg == NULL)
{
lock_release(&server_htable[hash_index].lock);
LM_DBG("No dialog found for cancel\n");
LM_DBG("No dialog found for UPDATE/PRACK\n");
return SCB_RUN_ALL;
}
}
Expand Down Expand Up @@ -1016,6 +996,26 @@ int b2b_prescript_f(struct sip_msg *msg, void *uparam)
return SCB_RUN_ALL;
}
}
if (method_value == METHOD_PRACK)
{
lock_release(&table[hash_index].lock);
LM_DBG("Received a PRACK - send 200 reply\n");
str reason={"OK", 2};
/* send 200 OK and exit */
tmb.t_newtran( msg );
tm_tran = tmb.t_gett();
if (dlg)
b2b_run_tracer(dlg, msg, tm_tran);
tmb.t_reply(msg, 200, &reason);
if(tm_tran && tm_tran!=T_UNDEFINED)
tmb.unref_cell(tm_tran);

/* No need to apply lumps */
if(req_routeid > 0)
run_top_route(sroutes->request[req_routeid], msg);

goto done;
}

ctx = b2b_get_context();
if (!ctx) {
Expand Down
1 change: 1 addition & 0 deletions modules/proto_msrp/msrp_api.c
Expand Up @@ -29,6 +29,7 @@ void load_msrp( struct msrp_binds *binds)
binds->register_msrp_handler = register_msrp_handler;
binds->send_reply = msrp_send_reply;
binds->send_reply_on_cell = msrp_send_reply_on_cell;
binds->send_report = msrp_send_report;
binds->forward_request = msrp_fwd_request;
binds->forward_reply = msrp_fwd_reply;
}
4 changes: 4 additions & 0 deletions modules/proto_msrp/msrp_api.h
Expand Up @@ -40,6 +40,9 @@ typedef int (*send_reply_on_cell_f)( void *hdl, struct msrp_cell *cell,
int code, str* reason,
str *hdrs, int hdrs_no);

typedef int (*send_report_f)( void *hdl, str *status,
struct msrp_msg *req, struct msrp_cell *cell );

typedef int (*fwd_request_f)( void *hdl, struct msrp_msg *req,
str *hdrs, int hdrs_no);

Expand All @@ -51,6 +54,7 @@ struct msrp_binds {
register_msrp_handler_f register_msrp_handler;
send_reply_f send_reply;
send_reply_on_cell_f send_reply_on_cell;
send_report_f send_report;
fwd_request_f forward_request;
fwd_reply_f forward_reply;
};
Expand Down

0 comments on commit b97f228

Please sign in to comment.