res_stasis_snoop: Fix snoop crash
Added NULL pointer check and channel lock to prevent resource release while the chanspy is processing. ASTERISK-29604 Change-Id: Ibdc675f98052da32333b19685b1708a3751b6d24
This commit is contained in:
parent
56051d1ac5
commit
f99849f8d5
|
@ -135,10 +135,14 @@ static void publish_chanspy_message(struct stasis_app_snoop *snoop, int start)
|
|||
}
|
||||
ast_multi_channel_blob_add_channel(payload, "spyer_channel", snoop_snapshot);
|
||||
|
||||
if (snoop->spyee_chan) {
|
||||
ast_channel_lock(snoop->spyee_chan);
|
||||
spyee_snapshot = ast_channel_snapshot_get_latest(ast_channel_uniqueid(snoop->spyee_chan));
|
||||
ast_channel_unlock(snoop->spyee_chan);
|
||||
if (spyee_snapshot) {
|
||||
ast_multi_channel_blob_add_channel(payload, "spyee_channel", spyee_snapshot);
|
||||
}
|
||||
}
|
||||
|
||||
message = stasis_message_create(type, payload);
|
||||
if (!message) {
|
||||
|
|
Loading…
Reference in New Issue