<div dir="ltr"><div dir="ltr">On Tue, Feb 28, 2023 at 9:35 AM Nikša Baldun <<a href="mailto:it@voxdiversa.hr">it@voxdiversa.hr</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
information available on channels involved in attended transfer is inadequate for my purposes, so I have created a function which sets some variables on these channels, and also runs transferee and transfer target through dialplan. It works, but I am unsure that I did it correctly. Two specific questions of note:<br>
<br>
1. Do I have to lock channels before setting variables? I've seen it done in many places, but if I do, I get debug messages like: "Thread LWP 822 is blocking 'PJSIP/444-0000004b', already blocked by thread LWP 6204 in procedure ast_waitfor_nandfds".<br></blockquote><div><br></div><div>The pbx_builtin_setvar_helper function locks the channels underneath.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
2. Do I have to set autoservice_chan parameter in ast_app_exec_sub? I don't know what autoservice is.<br></blockquote><div><br></div><div>You don't HAVE to. Autoservice is used when you want to run a potentially long running operation and still properly service (handle received audio, discarding it, amongst things) the channel. Not servicing the channel means stuff would just back up. The parameter exists for cases where 2 channels are being handled by the thread - one should execute the Gosub, one should go to autoservice to be handled.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
The function follows (I call it from two_bridge_attended_transfer and ast_bridge_transfer_attended functions).<br></blockquote><div><br></div><div>I can't comment on code through this mechanism, someone else may be able to. </div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-family:tahoma,sans-serif"><font color="#073763">Joshua C. Colp</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Asterisk Project Lead</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Sangoma Technologies</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Check us out at <a href="http://www.sangoma.com" target="_blank">www.sangoma.com</a> and <a href="http://www.asterisk.org" target="_blank">www.asterisk.org</a></font><br></div></div></div></div></div></div></div></div></div></div></div>