[asterisk-dev] when will be the reason for not having a channel in monitor_dial of dial.c

Mohit Dhiman mohitdhiman736 at gmail.com
Mon May 10 07:09:01 CDT 2021


Hi,
I am having trouble understanding a piece of code in the function
monitor_dial of the file main/dial.c

who = ast_waitfor_n(cs, pos, &timeout);

/* If the timeout no longer exists OR *if we got no channel* it basically
means the timeout was tripped, so handle it */
if (!timeout || !who) {
    timeout = handle_timeout_trip(dial, start);
    continue;
}

my question is what will be the reason for not having the channel "who" as
mentioned in the comment above the condition?
The reason I am asking this is that "who" is returned from the channel list
"cs" which cannot be of size 0 as the "count" variable is being checked and
also the "pos" value can't be less than 1.

can please anybody explain what could be the conditions for "who" to be
returned NULL.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20210510/cdbd5836/attachment.html>


More information about the asterisk-dev mailing list