diff options
Diffstat (limited to 'pjsip')
-rw-r--r-- | pjsip/include/pjsua-lib/pjsua.h | 13 | ||||
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_media.c | 10 |
2 files changed, 23 insertions, 0 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h index eb1beb8c..01d1f801 100644 --- a/pjsip/include/pjsua-lib/pjsua.h +++ b/pjsip/include/pjsua-lib/pjsua.h @@ -849,6 +849,19 @@ typedef struct pjsua_callback */ pjsip_tp_state_callback on_transport_state; + /** + * This callback is called to report error in ICE media transport. + * Currently it is used to report TURN Refresh error. + * + * @param index Transport index. + * @param op Operation which trigger the failure. + * @param status Error status. + * @param param Additional info about the event. Currently this will + * always be set to NULL. + */ + void (*on_ice_transport_error)(int index, pj_ice_strans_op op, + pj_status_t status, void *param); + } pjsua_callback; diff --git a/pjsip/src/pjsua-lib/pjsua_media.c b/pjsip/src/pjsua-lib/pjsua_media.c index 311c015c..84012080 100644 --- a/pjsip/src/pjsua-lib/pjsua_media.c +++ b/pjsip/src/pjsua-lib/pjsua_media.c @@ -862,6 +862,16 @@ static void on_ice_complete(pjmedia_transport *tp, } } break; + case PJ_ICE_STRANS_OP_KEEP_ALIVE: + if (result != PJ_SUCCESS) { + PJ_PERROR(4,(THIS_FILE, result, + "ICE keep alive failure for transport %d", id)); + } + if (pjsua_var.ua_cfg.cb.on_ice_transport_error) { + (*pjsua_var.ua_cfg.cb.on_ice_transport_error)(id, op, result, + NULL); + } + break; } } |