mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-03 14:56:17 +00:00
fixing rtp termination id issue
This commit is contained in:
parent
94297df2ac
commit
d5ea03d693
@ -374,9 +374,14 @@ void megaco_termination_destroy(mg_termination_t *term)
|
|||||||
term->uuid = NULL;
|
term->uuid = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (term->type == MG_TERM_RTP && term->u.rtp.local_port != 0) {
|
if (term->type == MG_TERM_RTP ){
|
||||||
|
if(term->u.rtp.local_port != 0) {
|
||||||
switch_rtp_release_port(term->u.rtp.local_addr, term->u.rtp.local_port);
|
switch_rtp_release_port(term->u.rtp.local_addr, term->u.rtp.local_port);
|
||||||
}
|
}
|
||||||
|
if(term->u.rtp.term_id != 0) {
|
||||||
|
mg_rtp_release_id(term->profile,term->u.rtp.term_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(term->active_events){
|
if(term->active_events){
|
||||||
mgUtlDelMgMgcoReqEvtDesc(term->active_events);
|
mgUtlDelMgMgcoReqEvtDesc(term->active_events);
|
||||||
@ -603,6 +608,8 @@ void megaco_release_context(mg_context_t *ctx)
|
|||||||
|
|
||||||
uint32_t mg_rtp_request_id(megaco_profile_t *profile)
|
uint32_t mg_rtp_request_id(megaco_profile_t *profile)
|
||||||
{
|
{
|
||||||
|
uint32_t rtp_id = 0x00;
|
||||||
|
|
||||||
if (profile->rtpid_next >= MG_MAX_RTPID || profile->rtpid_next == 0) {
|
if (profile->rtpid_next >= MG_MAX_RTPID || profile->rtpid_next == 0) {
|
||||||
profile->rtpid_next = 1;
|
profile->rtpid_next = 1;
|
||||||
}
|
}
|
||||||
@ -610,8 +617,9 @@ uint32_t mg_rtp_request_id(megaco_profile_t *profile)
|
|||||||
for (; profile->rtpid_next < MG_MAX_RTPID; profile->rtpid_next++) {
|
for (; profile->rtpid_next < MG_MAX_RTPID; profile->rtpid_next++) {
|
||||||
if ((profile->rtpid_bitmap[profile->rtpid_next / 8] & (1 << (profile->rtpid_next % 8))) == 0) {
|
if ((profile->rtpid_bitmap[profile->rtpid_next / 8] & (1 << (profile->rtpid_next % 8))) == 0) {
|
||||||
profile->rtpid_bitmap[profile->rtpid_next / 8] |= 1 << (profile->rtpid_next % 8);
|
profile->rtpid_bitmap[profile->rtpid_next / 8] |= 1 << (profile->rtpid_next % 8);
|
||||||
|
rtp_id = profile->rtpid_next;
|
||||||
profile->rtpid_next++;
|
profile->rtpid_next++;
|
||||||
return profile->rtpid_next;
|
return rtp_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user