Skip to content

Commit

Permalink
rtp_relay: add enhanced leg debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Aug 8, 2024
1 parent c689ec3 commit 28129a1
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions modules/rtp_relay/rtp_relay_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,8 @@ static inline void rtp_relay_push_sess_leg(struct rtp_relay_sess *sess,
return;
if (sess->legs[type])
rtp_relay_ctx_release_leg(sess->legs[type]);
LM_RTP_DBG("pushing sess=%p index=%d type=%d leg=%p(%d/%.*s)\n",
sess, sess->index, type, leg, leg->index, leg->tag.len, leg->tag.s);
sess->legs[type] = leg;
leg->peer = sess->legs[RTP_RELAY_PEER(type)];
if (leg->peer)
Expand Down Expand Up @@ -1192,9 +1194,10 @@ static int rtp_relay_offer(struct rtp_relay_session *info,
if (!info->from_tag && ctx->to_tag.len)
info->from_tag = &ctx->to_tag;
}
LM_DBG("callid=[%.*s] ftag=[%.*s] ttag=[%.*s] "
LM_DBG("leg=%s callid=[%.*s] ftag=[%.*s] ttag=[%.*s] "
"type=[%.*s] in-iface=[%.*s] out-iface=[%.*s] ctx-flags=[%.*s] "
"flags=[%.*s] peer-flags=[%.*s]\n",
(leg==RTP_RELAY_CALLER?"caller":"callee"),
RTP_RELAY_S(info->callid),
RTP_RELAY_S(info->from_tag),
RTP_RELAY_S(info->to_tag),
Expand Down Expand Up @@ -1263,10 +1266,10 @@ static int rtp_relay_answer(struct rtp_relay_session *info,
body = &ret_body;
}
}

LM_DBG("callid=[%.*s] ftag=[%.*s] ttag=[%.*s] "
LM_DBG("leg=%s callid=[%.*s] ftag=[%.*s] ttag=[%.*s] "
"type=[%.*s] in-iface=[%.*s] out-iface=[%.*s] ctx-flags=[%.*s] "
"flags=[%.*s] peer-flags=[%.*s]\n",
(leg==RTP_RELAY_CALLER?"caller":"callee"),
RTP_RELAY_S(info->callid),
RTP_RELAY_S(info->from_tag),
RTP_RELAY_S(info->to_tag),
Expand Down Expand Up @@ -1754,6 +1757,14 @@ static int rtp_relay_sess_success(struct rtp_relay_ctx *ctx,
}
rtp_relay_ctx_set_established(ctx);
}
LM_RTP_DBG("success %p(%d) %p(%d/%.*s)/%p(%d/%.*s)\n",
ctx->established, ctx->established->index,
sess->legs[0], sess->legs[0]?sess->legs[0]->index:-2,
sess->legs[0]?sess->legs[0]->tag.len:0,
sess->legs[0]?sess->legs[0]->tag.s:"",
sess->legs[1], sess->legs[1]?sess->legs[1]->index:-2,
sess->legs[1]?sess->legs[1]->tag.len:0,
sess->legs[1]?sess->legs[1]->tag.s:"");
return 0;
}

Expand Down

0 comments on commit 28129a1

Please sign in to comment.