[Asterisk-Users] Timing issue with call to poll() when running asterisk -rx?

Ray Van Dolson rayvd at digitalpath.net
Fri Aug 26 14:24:18 MST 2005


We have a small app that runs asterisk -rx "sip show peers" (etc) and gathers
some info and reports it back somewhere else.  This is called from a cron job
essentially and doesn't really run all that often (once a minute).  We noticed
some gaps in the results we were getting and dug in a little further.

We found that if you run asterisk -rx "sip show peers" from the command line
by hand fairly quickly, eventually it will "hang" and wait for a 30-60 seconds
or so then finally establish the connection.

During this time an strace -p on the process shows:

poll(

When everything begins working it shows that the entire call is:

poll([{fd=3, events=POLLIN, revents=POLLIN}], 1, 100) = 1

Note that this is running strace -p on the process while it's in the hung
state.

If we run strace asterisk -rx "sip show peers" we cannot reproduce the
problem.  This leads us to think this is some sort of timing issue.

There isn't any backoff code or such in the console connection code is there
that would be causing this?

I don't think this is the source of the problem in our data gap issue above,
but just was curious if anyone else had run across this.

Ray



More information about the asterisk-users mailing list