Replies: 2 comments
-
|
hi there are a couple of options:
static void sip_trace_handler(bool tx, enum sip_transp tp,
const struct sa *src, const struct sa *dst,
const uint8_t *pkt, size_t len, void *arg)
{
(void)tx;
(void)arg;
re_printf("\x1b[36;1m"
"%H#\n"
"%s %J -> %J\n"
"%b"
"\x1b[;m\n"
,
fmt_timestamp, NULL,
sip_transp_name(tp), src, dst, pkt, len);
}
sip_set_trace_handler(uag.sip, enable ? sip_trace_handler : NULL); |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Ah, I totally missed this notification! Sorry for the late reply. This is exactly what I was looking for (sip_set_trace_handler). Thanks a lot for pointing it out!" |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am embedding
baresipinto a custom host application (using it as a library). I have a requirement to capture and process the raw SIP traffic programmatically—for example, to store it in a custom database or display it in a UI.I know
uag_enable_sip_trace(true)works well for debugging, but it outputs directly tostdout/stderror the system log.My Question:
Is there a recommended way or an existing API in
baresip(orre) to register a sink/callback for SIP tracing?Ideally, I am looking for a way to intercept the
sip_msgor the rawmbufbefore (or while) it is being printed.For example:
Or should I look into overriding the global
dbgprint handlers inlibre?Any pointers on the best practice to achieve this would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions