| 11 | |
| 12 | === Monitoring RTCP-FB event in application === |
| 13 | Application can monitor RTCP Feedback events by implementing PJSUA callback {{{on_call_media_event}}} or PJSUA2 callback {{{Call::onCallMediaEvent()}}}. Sample code for PJSUA: |
| 14 | {{{ |
| 15 | static void on_call_media_event(pjsua_call_id call_id, |
| 16 | unsigned med_idx, |
| 17 | pjmedia_event *event) |
| 18 | { |
| 19 | if (event->type == PJMEDIA_EVENT_RX_RTCP_FB) { |
| 20 | /* Incoming RTCP-FB event */ |
| 21 | pjmedia_event_rx_rtcp_fb_data *fb_data = (pjmedia_event_rx_rtcp_fb_data*) |
| 22 | event.data.ptr; |
| 23 | if (fb_data->cap.type == PJMEDIA_RTCP_FB_NACK && fb_data->cap.param.slen == 0) |
| 24 | { |
| 25 | /* Generic NACK */ |
| 26 | /* NACK message can be accessed via 'fb_data->msg.nack' */ |
| 27 | ... |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | }}} |