summaryrefslogtreecommitdiff
path: root/pjnath
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2016-05-09 03:29:28 +0000
committerLiong Sauw Ming <ming@teluu.com>2016-05-09 03:29:28 +0000
commitbd669b9c601fa8c18e7fbfb6789d6135f1b4224b (patch)
treed584344e087a5fb95dc3804b0bedd3602808d1da /pjnath
parentd3a32eaf6bc179dc910a2c79c4802ccb6f30ebbe (diff)
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
Diffstat (limited to 'pjnath')
-rw-r--r--pjnath/include/pjnath/ice_strans.h8
-rw-r--r--pjnath/src/pjnath/ice_strans.c8
2 files changed, 14 insertions, 2 deletions
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);
+ }
}
}