From bd669b9c601fa8c18e7fbfb6789d6135f1b4224b Mon Sep 17 00:00:00 2001 From: Liong Sauw Ming Date: Mon, 9 May 2016 03:29:28 +0000 Subject: Fixed #1913: Add callback for address change notification from STUN keep alive git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5282 74dad513-b988-da41-8d7b-12977e46ad98 --- pjnath/include/pjnath/ice_strans.h | 8 ++++++-- pjnath/src/pjnath/ice_strans.c | 8 ++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'pjnath') diff --git a/pjnath/include/pjnath/ice_strans.h b/pjnath/include/pjnath/ice_strans.h index 340bf605..d711d951 100644 --- a/pjnath/include/pjnath/ice_strans.h +++ b/pjnath/include/pjnath/ice_strans.h @@ -125,10 +125,14 @@ typedef enum pj_ice_strans_op /** Negotiation */ PJ_ICE_STRANS_OP_NEGOTIATION, - /** This operatino is used to report failure in keep-alive operation. + /** This operation is used to report failure in keep-alive operation. * Currently it is only used to report TURN Refresh failure. */ - PJ_ICE_STRANS_OP_KEEP_ALIVE + PJ_ICE_STRANS_OP_KEEP_ALIVE, + + /** IP address change notification from STUN keep-alive operation. + */ + PJ_ICE_STRANS_OP_ADDR_CHANGE } pj_ice_strans_op; diff --git a/pjnath/src/pjnath/ice_strans.c b/pjnath/src/pjnath/ice_strans.c index aee0c39d..66dce88e 100644 --- a/pjnath/src/pjnath/ice_strans.c +++ b/pjnath/src/pjnath/ice_strans.c @@ -1640,6 +1640,14 @@ static pj_bool_t stun_on_status(pj_stun_sock *stun_sock, sizeof(ipaddr), 3))); sess_init_update(ice_st); + + if (op == PJ_STUN_SOCK_MAPPED_ADDR_CHANGE && + ice_st->cb.on_ice_complete) + { + (*ice_st->cb.on_ice_complete)(ice_st, + PJ_ICE_STRANS_OP_ADDR_CHANGE, + status); + } } } -- cgit v1.2.3