<div dir="ltr"><div dir="ltr"><p style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;margin-top:0px;color:rgb(65,65,65);font-size:14px;background-color:rgb(246,246,246)">Hello, this question relates to issue <a href="https://issues.asterisk.org/jira/browse/ASTERISK-28197">ASTERISK-28197</a></p><p style="margin-top:0px;color:rgb(65,65,65);font-size:14px;background-color:rgb(246,246,246)"><span style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif">In case of Bridge application when bridge_exec from </span><font face="monospace, monospace">features.c</font><font face="Helvetica Neue, Helvetica, Arial, sans-serif"> is invoked it calls the </font><font face="monospace, monospace">ast_channel_unref(current_dest_chan)</font><font face="Helvetica Neue, Helvetica, Arial, sans-serif"> to remove the channel reference if channel is not in the Bridge, which gives the following function call stack.</font></p><blockquote style="border-left:5px solid rgb(236,236,236);background-color:rgb(240,240,240);clear:both;margin-left:0px;margin-right:0px;padding:12px;color:rgb(65,65,65);font-family:Helvetica,Arial,sans-serif;font-size:14px"><p style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;margin-top:0px;margin-bottom:0px"><span class="gmail-hashtag">#0</span> topic_remove_subscription (topic=0x7fbf2c008290, sub=0x36095a0) at stasis.c:711<br><span class="gmail-hashtag">#1</span> 0x00000000005c8a22 in stasis_forward_cancel (forward=0x7fbf2c009fa8) at stasis.c:925<br><span class="gmail-hashtag">#2</span> 0x00000000004cd126 in ast_channel_internal_cleanup (chan=0x7fbf2c0243d0) at channel_internal_api.c:1553<br><span class="gmail-hashtag">#3</span> 0x00000000004af818 in ast_channel_destructor (obj=0x7fbf2c0243d0) at channel.c:2363<br><span class="gmail-hashtag">#4</span> 0x000000000045b94b in internal_ao2_ref (user_data=0x7fbf2c0243d0, delta=-1, file=0x61cb0b “astobj2.c”, line=518, func=0x61cd21 <_ <em>FUNCTION</em> <em>.8693> "</em> _ao2_ref")<br>at astobj2.c:451<br><span class="gmail-hashtag">#5</span> 0x000000000045bc2e in __ao2_ref (user_data=0x7fbf2c0243d0, delta=-1) at astobj2.c:518<br><span class="gmail-hashtag">#6</span> 0x000000000050c26a in bridge_exec (chan=0x7fbf2c00a4d0, data=0x7fbfb3ffc460 “SIP/201-00000000”) at features.c:1129</p></blockquote><p style="color:rgb(65,65,65);font-size:14px;background-color:rgb(246,246,246)"><span style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif">finally the call to </span><font face="monospace, monospace">stasis_forward_cancel</font><font face="Helvetica Neue, Helvetica, Arial, sans-serif"> causes the removal of 4 subscribers from the non-pbx channel’s topic and one of those 4 subscribers carries the callback </font><font face="monospace, monospace">endpoint_cache_clear</font><font face="Helvetica Neue, Helvetica, Arial, sans-serif"> which is needed to remove channel_ids from struct ast_endpoint.<br><br><br></font><span style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif">I tried to stop the removal of subscribers from the non-pbx channel by adding a flag in ast_channel which stopped the channel_ids count from increasing forever but now the subscribers are not getting removed from the channel.<br></span><font face="Helvetica Neue, Helvetica, Arial, sans-serif"><br>can anyone suggest how to solve this so that subscribers with callback </font><span style="font-family:monospace,monospace">endpoint_cache_clear </span><font face="arial, helvetica, sans-serif">don't get removed while bridging but also get removed while channel cleanup happens.</font></p></div></div>