Skip to content

Commit

Permalink
Solve the problem of recognizing the local SIP msg
Browse files Browse the repository at this point in the history
We need a consistent and solid way to recognize the internanlly generated SIP msg (as a result of t_uac) - these are msg structs resulted from the parsing of buffers with SIP msgs
  • Loading branch information
bogdan-iancu committed Dec 15, 2021
1 parent 4a96ef2 commit 02c6ed9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions modules/tm/t_msgbuilder.h
Expand Up @@ -124,6 +124,8 @@ static inline struct sip_msg* buf_to_sip_msg(char *buf, unsigned int len,
req->rcv.src_port = req->rcv.dst_port = dialog->send_sock->port_no;
req->rcv.bind_address = dialog->send_sock;

req->flags |= FL_IS_LOCAL;

return req;

error1:
Expand Down
2 changes: 1 addition & 1 deletion modules/topology_hiding/topo_hiding_logic.c
Expand Up @@ -1076,7 +1076,7 @@ static void topo_dlg_onroute (struct dlg_cell* dlg, int type,
/* we also may end up here via TERMINATE event triggered by internal
* dlg termination -> the requests we have here are dummy, so nothing
* to be done */
if (is_dummy_sip_msg(req)==0) {
if ((req->flags&FL_IS_LOCAL)!=0 || is_dummy_sip_msg(req)==0) {
LM_DBG("dummy request identified, skipping...\n");
return;
}
Expand Down
2 changes: 2 additions & 0 deletions parser/msg_parser.h
Expand Up @@ -124,6 +124,8 @@ enum request_method {
* route */
#define FL_TM_REPLICATED (1<<19) /* message received due to a tm replication */
#define FL_BODY_NO_SDP (1<<20) /* message does not have an SDP body */
#define FL_IS_LOCAL (1<<21) /* the message is a locally generated
* one, not received */

/* define the # of unknown URI parameters to parse */
#define URI_MAX_U_PARAMS 10
Expand Down

0 comments on commit 02c6ed9

Please sign in to comment.