Re: daemon without pcntl_fork

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Lars Torben Wilson wrote:
2009/8/20 Jim Lucas <lists@xxxxxxxxx>:
Lars Torben Wilson wrote:
2009/8/19 Per Jessen <per@xxxxxxxxxxxx>:
Jim Lucas wrote:
[snip]

I probably wouldn't have chosen PHP for the first one, but there's no
reason it shouldn't work.  For the second one, did you mean to
write "serial port"?  That's a bit of a different animal, I'm not sure
how far you'll get with php.

Here is what I have come up with so far.  Looks to satisfying my
needs:

tms_daemon
[snip]
# END OF SCRIPT
Looks good to me. It'll certainly do the job.


/Per
I agree with Per on all points--I probably wouldn't choose PHP as a
first choice for the first task, but the startup script you have shown
looks like a bog-standard startup script and should serve you well. I
haven't really gone over it with a fine-toothed comb though. Typos
etc. are still up to to you. :) Of course, the whole thing depends on
how tms_daemon behaves, but the startup script looks OK.

Can you explain in a bit more detail exactly what the second part (the
serial-network data logger) needs to do? I've written similar daemons
in C but not PHP--when I've needed to get something like that going
with a PHP script, I've used ser2net (which I linked to in an earlier
post) and been quite happy. Maybe you don't even have to do the hard
work yourself (or buy extra hardware to do it for you).


Cheers,

Torben

As for the second project, I asked about it in the previous thread about
the SMDR/CDR processor.

http://www.nabble.com/SMDR-CDR-daemon-processor-td25014822.html

Sorry, missed that thread.

Basically, I need to have a process that collects data via serial
(USB|RS323), connects to a remote port, or listens and receives data
from the PBX pushing it.

The most common is the RS232 serial connection.  Thats why I need to be
able to listen on the local RS232 port for data coming from the PBX system.

What I have built so far can connect to a remote machine, via a TCP/IP
connection, and wait for data to be push out the specified TCP port.

I haven't done it yet, but I know that I can easily build, using a
different project as a base, the version that would connect to a local
TCP/IP IP:PORT and wait for a PBX to send the data to that IP:PORT.

After the data has been received, the process flow will be the same with
all three methods.  Parse it, sanitize it, store it.

Hopefully that explains a little more.

Jim

In short, are you looking for a program which listens on a serial port
and a network port at the same time, and places any data received from
either into a database?


No, I am looking to build and application that will have the option doing either of the three methods. All at separate times.

It will be configured to work one phone system at a time. It will either listen locally, connect remotely via TCP/IP, or open a COM port. But, at this point, I don't see a need to have the ability to have it doing more then one method at a time.

Thanks


Regards,

Torben


--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux