Yate server > Yate bugs

[fix] Wrong killing of extmodule

(1/2) > >>

andr04:
Some time ago I said about the bug of terminating external module. I've fixed it and changed the logic of quiting from external module as follows.

If exit is initiated from external module it just close their stdout and finish running. Yate as soon as get EOF trying to check is pid terminated or not and waiting up to m_timeout. If EOF was get from socket nothing to wait.

If exit initiated from Yate the engine send to external module %%<quit message and waiting EOF/pid termination as described above.

%%>quit from external module to Yate I've make redundant. But it's possible to interpret it as a "kill me" signal without waiting and without %%<quit as a reply. Let me know how it must be.

The approach let external modules to handle quit messages. It is useful for example if external module registers external lines through user.login message: it's may be important to unregister lines on module quiting (operation=logout).

I'm new in Yate and would like how can I share described improvements? How can I commit it and to know is it a needed feature?

marian:
Hi,
What is the purpose of this improvement?

If an external script wants to know when yate is going to stop it may install a handler for engine.stop message.

andr04:
It's 2 improvements: waiting of termination and notification about starting termination. External scripts can be large and complicated. Not only about Yate going to stop but about the external module going to stop it's important to know to close their resources and unregister their lines and accounts (notify SIP clients about loging out). Another case -- channel/playrec external modules started and terminated by Yate for every call and it is also important not only to get notification about quiting but to close their resources properly as well.

Killing by SIGTERM is present on exceptions and wrong behavior.

andr04:
Any suggestions?

marian:
For more info on external module protocol see:
http://docs.yate.ro/wiki/External_Module
http://docs.yate.ro/wiki/External_module_command_flow

For channel scripts you may install message handlers to check termination (see chan.disconnected): when peer channel is hung up your channel script will send a chan.disconnected message: you may catch it

Navigation

[0] Message Index

[#] Next page

Go to full version