"fork and exit" needed?

Vincent Delporte bla at bla.com
Thu Nov 30 09:38:11 EST 2006


On Tue, 28 Nov 2006 04:30:09 -0600, Nick Craig-Wood
<nick at craig-wood.com> wrote:
>I'm not sure how you do open stdout to /dev/null in python though!
>
>I suspect something like this...
>
>  import posix
>  posix.close(1)
>  posix.open("/dev/null", posix.O_WRONLY)

Thanks everyone, but no go :-/ Neither the above nor "sys.stdout =
open(os.devnull, 'w') " trigger the application.

This is a script that is launched by the Asterisk open-source PBX
server when a call comes in. Its goal is to broadcast some messages to
a Windows caller ID application that is installed on all client hosts
so that they know who's calling.

Before I go ask in an Asterisk forum, is there some Python-related
issue that experienced Python developers can spot in this rewrite of a
Perl script that works?

Here's the original Perl script:
http://www.voip-info.org/wiki/view/Asterisk+NetCID

Here's my Python rewrite:
http://codecomplete.free.fr/asterisk/python_cid.txt

Yes, I changed the UDP port from 42685 to 42687 so that my development
client host is the only one getting the broadcast :-)

Thank you!



More information about the Python-list mailing list