Hi Joshua,
thanks for the answer. Meanwhile, I've found that the debug message about
competing threads happens because I am using Fast AGI, and two threads call AGI
from the same channel. I assume this could potentially be resolved if I call
ast_app_exec_sub AFTER the attended transfer has already been completed (and,
based on your input, autoservice should be used). This is trickier to
implement, but I'll try.
Best regards,
On Tuesday, 28. February 2023. 14:44:25 (+01:00), Joshua C. Colp wrote:
On Tue, Feb 28, 2023 at 9:35 AM Nikša Baldun <i...@voxdiversa.hr> wrote:
Hello,
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:
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".
The pbx_builtin_setvar_helper function locks the channels underneath.
2. Do I have to set autoservice_chan parameter in ast_app_exec_sub? I don't
know what autoservice is.
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.
The function follows (I call it from two_bridge_attended_transfer and
ast_bridge_transfer_attended functions).
I can't comment on code through this mechanism, someone else may be able to.
--
Joshua C. Colp
Asterisk Project Lead
Sangoma Technologies
Check us out at www.sangoma.com and www.asterisk.org
--
Nikša Baldun
VoxDiversa
Sjedište:
IX Trokut 1
10020 Zagreb
Ured:
Ilica 425
10090 Zagreb
Tel.: +385 1 8000676
Web: www.voxdiversa.hr
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev