[asterisk-bugs] [Asterisk 0013404]: [patch] Commands issued to asterisk using a remote console on OSX have no effect

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Mar 18 09:39:07 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13404 
====================================================================== 
Reported By:                agalbraith
Assigned To:                russell
====================================================================== 
Project:                    Asterisk
Issue ID:                   13404
Category:                   Core/Portability
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Asterisk Version:           SVN 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): 1.6.0 
SVN Revision (number only!): 140547 
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2008-08-30 12:30 CDT
Last Modified:              2009-03-18 09:39 CDT
====================================================================== 
Summary:                    [patch] Commands issued to asterisk using a remote
console on OSX have no effect
Description: 
When starting Asterisk using either 'launchctl' or from a prommpt, it
becomes impossible to issue commands using a remote (asterisk -r)
connection.

Commands entered simply return to the CLI prompt.

The remote console *is* connected, because if the command "stop now" is
issued to the local console, the console disconnects.

This appears to be a recurrance of bug 0011928, however I've tried both
with and without the patch - and this behavior is consistent.
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
has duplicate       0013844 CLI non-responsive
====================================================================== 

---------------------------------------------------------------------- 
 (0101934) svnbot (reporter) - 2009-03-18 09:39
 http://bugs.digium.com/view.php?id=13404#c101934 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 182947

_U  branches/1.6.2/
U   branches/1.6.2/apps/app_mp3.c
U   branches/1.6.2/apps/app_nbscat.c
U   branches/1.6.2/channels/chan_alsa.c
U   branches/1.6.2/channels/chan_skinny.c
U   branches/1.6.2/configure
U   branches/1.6.2/configure.ac
U   branches/1.6.2/include/asterisk/autoconfig.h.in
U   branches/1.6.2/include/asterisk/channel.h
U   branches/1.6.2/include/asterisk/io.h
U   branches/1.6.2/include/asterisk/poll-compat.h
U   branches/1.6.2/main/Makefile
U   branches/1.6.2/main/asterisk.c
U   branches/1.6.2/main/channel.c
U   branches/1.6.2/main/io.c
U   branches/1.6.2/main/poll.c
U   branches/1.6.2/main/utils.c
U   branches/1.6.2/res/res_agi.c

------------------------------------------------------------------------
r182947 | russell | 2009-03-18 09:39:05 -0500 (Wed, 18 Mar 2009) | 60
lines

Merged revisions 182847 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r182847 | russell | 2009-03-17 21:28:55 -0500 (Tue, 17 Mar 2009) | 52
lines

Merged revisions 182810 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r182810 | russell | 2009-03-17 21:09:13 -0500 (Tue, 17 Mar 2009) | 44
lines

Fix cases where the internal poll() was not being used when it needed to
be.

We have seen a number of problems caused by poll() not working properly on

Mac OSX.  If you search around, you'll find a number of references to
using 
select() instead of poll() to work around these issues.  In Asterisk,
we've 
had poll.c which implements poll() using select() internally.  However, we

were still getting reports of problems.

vadim investigated a bit and realized that at least on his system, even 
though we were compiling in poll.o, the system poll() was still being
used.  
So, the primary purpose of this patch is to ensure that we're using the 
internal poll() when we want it to be used.

The changes are:

1) Remove logic for when internal poll should be used from the Makefile.  
   Instead, put it in the configure script.  The logic in the configure 
   script is the same as it was in the Makefile.  Ideally, we would have 
   a functionality test for the problem, but that's not actually possible,

   since we would have to be able to run an application on the _target_ 
   system to test poll() behavior.

2) Always include poll.o in the build, but it will be empty if
AST_POLL_COMPAT
   is not defined.

3) Change uses of poll() throughout the source tree to ast_poll().  I feel

   that it is good practice to give the API call a new name when we are 
   changing its behavior and not using the system version directly in all
cases.
   So, normally, ast_poll() is just redefined to poll().  On systems where

   AST_POLL_COMPAT is defined, ast_poll() is redefined to
ast_internal_poll().

4) Change poll() in main/poll.c to be ast_internal_poll().

It's worth noting that any code that still uses poll() directly will work
fine 
(if they worked fine before).  So, for example, out of tree modules that
are 
using poll() will not stop working or anything.  However, for modules to
work 
properly on Mac OSX, ast_poll() needs to be used.

(closes issue http://bugs.digium.com/view.php?id=13404)
Reported by: agalbraith
Tested by: russell, vadim

http://reviewboard.digium.com/r/198/

........

................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=182947 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-03-18 09:39 svnbot         Checkin                                      
2009-03-18 09:39 svnbot         Note Added: 0101934                          
======================================================================




More information about the asterisk-bugs mailing list