[asterisk-dev] Running channels through dialplan on attended transfer

Joshua C. Colp jcolp at sangoma.com
Tue Feb 28 07:44:25 CST 2023


On Tue, Feb 28, 2023 at 9:35 AM Nikša Baldun <it at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20230228/25e42210/attachment.html>


More information about the asterisk-dev mailing list