[asterisk-users] some kind of timeout problem in pbx_spool.c

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Tue Feb 3 16:52:31 CST 2009


On Tuesday 03 February 2009 16:26:51 Jerry Geis wrote:
> I am using outgoing call files. I typically see the "ooh something
> changed / timeout" on a regular bases every second to be exact.
> Then it stops until some other call event happens.
>
> So I "mv" my call file to the outgoing spool directory, I am listening
> to that message, another call file is "mv"'ed into the directory
> and something happens to the timeout that its not resamplling the call
> directory. Then if I do another call file it now comes out of it
> and will place both calls.
>
> Why does the time outs stop happening???

It's a race condition, and it's difficult to solve because filesystem
timestamps are only resolute to the second, not to any fraction of a second.

> ACTUALLY -------------- I thought the timespec timeout time SHOULD
> ALWAYS BE set in pbx_spool.c: scan_thread() ??? I thought the
> timeout &ts can be modified at times by the nanosleep(). So I needs to
> be reset inside the for() loop???? I am I off base here?

You're misreading the manual page for nanosleep(2).  The first parameter to
nanosleep is never modified, but the second parameter may receive the
remaining time, if interrupted, and if the second parameter is not NULL
(which it is, in this case).

-- 
Tilghman



More information about the asterisk-users mailing list