Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print log after sending SIP message successfully #3942

Merged
merged 1 commit into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pjsip/src/pjsip/sip_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,12 @@ static void transport_send_callback(pjsip_transport *transport,

PJ_UNUSED_ARG(transport);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this can be removed now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but as transport is only used for logging with level 5, if PJ_LOG_MAX_LEVEL is set to <5, the unused var warning will reappear. So I guess better leave it as is for now?


/* Print log on successful sending */
if (size > 0) {
PJ_LOG(5,(transport->obj_name,
"%s sent successfully", pjsip_tx_data_get_info(tdata)));
}

/* Mark pending off so that app can resend/reuse txdata from inside
* the callback.
*/
Expand Down Expand Up @@ -965,6 +971,13 @@ PJ_DEF(pj_status_t) pjsip_transport_send( pjsip_transport *tr,

if (status != PJ_EPENDING) {
tdata->is_pending = 0;

/* Print log on successful sending */
if (status == PJ_SUCCESS) {
PJ_LOG(5,(tr->obj_name,
"%s sent successfully", pjsip_tx_data_get_info(tdata)));
}

pjsip_tx_data_dec_ref(tdata);
}

Expand Down
Loading