Skip to content

Commit

Permalink
oceProcessStateChange remove medias
Browse files Browse the repository at this point in the history
  • Loading branch information
xhit committed Apr 17, 2024
1 parent 6da0b06 commit 3ae665d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pjsip/src/pjsua2/call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1037,11 +1037,21 @@ void Call::processStateChange(OnCallStateParam &prm)
void Call::oceProcessStateChange(OnCallStateParam &prm)
{
pjsua_call_info pj_ci;
unsigned mi;

// OCE: originally called pjsua_call_get_info instead pjsua_call_get_inv_status
if (pjsua_call_get_inv_status(id, &pj_ci) == PJ_SUCCESS &&
pj_ci.state == PJSIP_INV_STATE_DISCONNECTED)
{
/* Clear medias. */
for (mi = 0; mi < medias.size(); mi++) {
if (medias[mi]) {
Endpoint::instance().mediaRemove((AudioMedia &)*medias[mi]);
delete medias[mi];
}
}
medias.clear();

/* Remove this Call object association */
pjsua_call_set_user_data(id, NULL);
}
Expand Down

0 comments on commit 3ae665d

Please sign in to comment.