Commit Graph

114 Commits

Author SHA1 Message Date
marian 5e965dd90f Use a timed lock (if answer timeout is set) when serializing message send to script. Don't send the message to script if failed to lock for configured timeout.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6325 acf43c95-373e-0410-b603-e72c3f656dc1
2018-10-01 11:31:59 +00:00
paulc 49de800994 Fixed unescaping of handler filter parameters.
This allows filter name or value to contain characters like : or %.
Patch provided by Vasily i. Redkin.


git-svn-id: http://yate.null.ro/svn/yate/trunk@6303 acf43c95-373e-0410-b603-e72c3f656dc1
2018-03-21 13:31:09 +00:00
paulc e2060c65fe Workaround for a race to watch a message result while its ExtModReceiver is being destroyed.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6263 acf43c95-373e-0410-b603-e72c3f656dc1
2017-09-13 14:55:58 +00:00
paulc c4c9e994f0 Renamed DebugGoOn to DebugCrit so it better matches its purpose.
Swapped order of DebugCall and DebugNote so DebugCall is less visible.
Changed default debug level to DebugNote.
Modified a few inadequate uses of DebugCrit.


git-svn-id: http://yate.null.ro/svn/yate/trunk@6250 acf43c95-373e-0410-b603-e72c3f656dc1
2017-08-01 13:08:23 +00:00
paulc 515d38fdbc Added possibility to stop and restart specific external instances.
Added line completion for external command arguments.


git-svn-id: http://yate.null.ro/svn/yate/trunk@6228 acf43c95-373e-0410-b603-e72c3f656dc1
2017-06-07 12:04:18 +00:00
paulc dde447c2f5 Fixed ExtModReceiver leak when destroyed from cleanup()
git-svn-id: http://yate.null.ro/svn/yate/trunk@6145 acf43c95-373e-0410-b603-e72c3f656dc1
2016-11-07 14:50:07 +00:00
paulc d3ba52e3e0 Changed the way ExtModReceivers are (de)referenced and destroyed.
Fixes destruction of external channels that have or had a watcher.


git-svn-id: http://yate.null.ro/svn/yate/trunk@6105 acf43c95-373e-0410-b603-e72c3f656dc1
2016-03-18 10:17:55 +00:00
paulc 78e486e6c0 Allow restarting external modules only if we started them.
Add address in status information for inbound connections.
Added Yate::Quit() function in PHP library.


git-svn-id: http://yate.null.ro/svn/yate/trunk@6078 acf43c95-373e-0410-b603-e72c3f656dc1
2015-12-15 11:30:07 +00:00
paulc 9a2ddd019e Added support for resizing the extmodule read buffer.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6075 acf43c95-373e-0410-b603-e72c3f656dc1
2015-12-02 16:16:52 +00:00
paulc f4be507305 Allow substitutions in extmodule [general] scripts_dir, [scripts] and [execute].
git-svn-id: http://yate.null.ro/svn/yate/trunk@5910 acf43c95-373e-0410-b603-e72c3f656dc1
2014-08-28 16:56:04 +00:00
paulc 7c7d9e2a16 Fixed cleanup for TCP connections where same stream is used for In and Out.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5858 acf43c95-373e-0410-b603-e72c3f656dc1
2014-06-30 16:07:15 +00:00
paulc c33cb114e5 Terminate I/O streams instead of deleting them when an external module exits.
This prevents a race condition causing random memory corruption.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5850 acf43c95-373e-0410-b603-e72c3f656dc1
2014-06-23 10:18:21 +00:00
marian 365e0a299b Added help for 'external' command.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5818 acf43c95-373e-0410-b603-e72c3f656dc1
2014-04-09 09:36:06 +00:00
paulc e5cfa7a2ff Apply the extmodule timeout whenever we try to grab the socket to write to the external script.
This should avoid complete locks if the external application reads too slow.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5779 acf43c95-373e-0410-b603-e72c3f656dc1
2014-02-18 14:01:57 +00:00
paulc 37a72e4bc1 Added copyright notices to sources and scripts missing them.
Updated copyright notices for 2014.
Fixed end of lines in many files.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5755 acf43c95-373e-0410-b603-e72c3f656dc1
2014-02-05 11:42:17 +00:00
paulc 22abbfc150 Added "status" command to extmodule, reports count of scripts and channels.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5748 acf43c95-373e-0410-b603-e72c3f656dc1
2014-01-29 13:31:25 +00:00
paulc cf5d0fd71a Changed license terms in each source file to reference an external file.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5609 acf43c95-373e-0410-b603-e72c3f656dc1
2013-08-06 13:38:10 +00:00
paulc 3cf42e2828 Use Alarm() in places that could prevent normal operation.
This allows sending SNMP traps when parts of the service become non-operational.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5569 acf43c95-373e-0410-b603-e72c3f656dc1
2013-07-08 12:21:26 +00:00
paulc d5a5d0f8f3 Fixed several race conditions in message post-dispatch hooks and extmodule watchers.
Engine status now reports the number of post-dispatch hooks installed.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5458 acf43c95-373e-0410-b603-e72c3f656dc1
2013-04-12 14:17:31 +00:00
paulc 210494aa15 Keep the external receiver referenced while processing a watched message.
This avoids a race condition leading to segfault.
Idle instead of yielding while waiting for a socket to absorb data.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5423 acf43c95-373e-0410-b603-e72c3f656dc1
2013-03-20 14:54:42 +00:00
marian 94b6e06060 Make sure the user data pointer carried by handled message is a CallEndpoint one.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5287 acf43c95-373e-0410-b603-e72c3f656dc1
2012-10-01 11:00:30 +00:00
paulc a1ec767e08 Allow setting the handler tracking name by individual external scripts.
This must be set before installing the handlers.


git-svn-id: http://yate.null.ro/svn/yate/trunk@5123 acf43c95-373e-0410-b603-e72c3f656dc1
2012-06-15 11:19:31 +00:00
paulc bf57830c7f Added possibility to track message progress through handlers.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5107 acf43c95-373e-0410-b603-e72c3f656dc1
2012-06-12 23:47:01 +00:00
paulc 28983898f8 New "execute" command in extmodule allows executing arbitrary programs logged through Yate.
The behavior is the same as listing in the [execute] section.


git-svn-id: http://yate.null.ro/svn/yate/trunk@4796 acf43c95-373e-0410-b603-e72c3f656dc1
2012-01-05 17:52:01 +00:00
paulc c9a5bcd5dc Made exmodule setlocal return something useful for checking existence of a section in yate.conf
git-svn-id: http://yate.null.ro/svn/yate/trunk@4653 acf43c95-373e-0410-b603-e72c3f656dc1
2011-10-25 08:55:30 +00:00
paulc 4626b42e1f Addded capability to read parameters from main engine config file.
git-svn-id: http://yate.null.ro/svn/yate/trunk@4641 acf43c95-373e-0410-b603-e72c3f656dc1
2011-10-06 11:42:56 +00:00
paulc 1ae0546b45 Added class for pseudo random number generation.
Replace library ::random() and ::rand() calls with shared Random method.


git-svn-id: http://yate.null.ro/svn/yate/trunk@4470 acf43c95-373e-0410-b603-e72c3f656dc1
2011-06-29 11:19:02 +00:00
paulc e1e90f89d7 List running external modules in "external stop" and "external restart" completion.
git-svn-id: http://yate.null.ro/svn/yate/trunk@4454 acf43c95-373e-0410-b603-e72c3f656dc1
2011-06-10 15:49:42 +00:00
paulc b94f4c4239 Moved DebugEnabler and name from Module to Plugin, made name mandatory.
Added API and command to reload configuration of a single plugin.


git-svn-id: http://yate.null.ro/svn/yate/trunk@4203 acf43c95-373e-0410-b603-e72c3f656dc1
2011-03-23 16:26:25 +00:00
paulc a9400f2e7b Explicitely initialize the m_running field of ExtModChan too.
This was lost from a previous correct patch of Allan Sandfeld Jensen.


git-svn-id: http://yate.null.ro/svn/yate/trunk@3396 acf43c95-373e-0410-b603-e72c3f656dc1
2010-06-24 12:17:11 +00:00
paulc 2b6441ca9e Retain the external channel connect reason if available in call.execute message.
This is needed for some PBX operations.
Patch by Allan Sandfeld Jensen.


git-svn-id: http://yate.null.ro/svn/yate/trunk@3395 acf43c95-373e-0410-b603-e72c3f656dc1
2010-06-24 12:12:34 +00:00
paulc c4e30ab83d Initialize all fields of ExtModChan, clean up safer, use the safer version of getPeerId().
Patch by Allan Sandfeld Jensen.


git-svn-id: http://yate.null.ro/svn/yate/trunk@3394 acf43c95-373e-0410-b603-e72c3f656dc1
2010-06-24 12:09:17 +00:00
paulc 682c4c9d2a Use static const Regexps wherever possible to speed up code.
git-svn-id: http://yate.null.ro/svn/yate/trunk@3391 acf43c95-373e-0410-b603-e72c3f656dc1
2010-06-17 11:38:46 +00:00
paulc d45f8dd8c5 Changed logged output so it's obvious when global external modules are loaded and unloaded.
git-svn-id: http://yate.null.ro/svn/yate/trunk@3196 acf43c95-373e-0410-b603-e72c3f656dc1
2010-04-15 09:54:56 +00:00
paulc 9eb8e98bd5 Use a binary semaphore to wait for messages to be handled by external modules.
Reduces the CPU load when there are many scripts handling messages.


git-svn-id: http://yate.null.ro/svn/yate/trunk@3169 acf43c95-373e-0410-b603-e72c3f656dc1
2010-04-06 11:13:47 +00:00
paulc 66e1945048 Reference the ExtReceiver just before trying to start it.
Prevents crashes and memory corruption caused by race conditions, especially when the script des not start or terminates early.


git-svn-id: http://yate.null.ro/svn/yate/trunk@3027 acf43c95-373e-0410-b603-e72c3f656dc1
2010-01-17 17:47:01 +00:00
paulc 2186793f38 The worker thread of ThreadedSource now keeps it referenced.
New methods of DataEndpoint, CallEndpoint and ThreadedSource allow easier handling of concurrent operations.
Modules using ThreadedSource were modified to use the new API.


git-svn-id: http://yate.null.ro/svn/yate/trunk@2827 acf43c95-373e-0410-b603-e72c3f656dc1
2009-09-07 23:49:12 +00:00
paulc a2881258bc Once a thread was started for an external module let it do the destruction in its cleanup, only unuse() if thread failed to start.
Bug report and solution by Allan.


git-svn-id: http://yate.null.ro/svn/yate/trunk@2797 acf43c95-373e-0410-b603-e72c3f656dc1
2009-08-19 13:55:22 +00:00
paulc 8520218d2d Added flags to data forwarded through DataNodes.
The amount of consumed data is returned to the source.


git-svn-id: http://yate.null.ro/svn/yate/trunk@2745 acf43c95-373e-0410-b603-e72c3f656dc1
2009-07-02 09:24:33 +00:00
paulc f4b1496a46 Added an unified Thread::idle method, use it instead of arbitrary
sleeps.


git-svn-id: http://yate.null.ro/svn/yate/trunk@2737 acf43c95-373e-0410-b603-e72c3f656dc1
2009-06-24 16:47:29 +00:00
paulc 5499650213 Changed thread names to be uniform and easily readable.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2733 acf43c95-373e-0410-b603-e72c3f656dc1
2009-06-22 14:48:26 +00:00
paulc 00105b6b53 Warn if we never received a valid line from an external script.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2691 acf43c95-373e-0410-b603-e72c3f656dc1
2009-06-08 10:56:01 +00:00
paulc c669a24f90 Added mutex names to most Yate modules.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2613 acf43c95-373e-0410-b603-e72c3f656dc1
2009-05-05 14:06:39 +00:00
paulc b745abe0f5 Stdio pipe or socket operation are executed with the mutex locked.
Wait a configurable time after flushing relays and pending messages.


git-svn-id: http://yate.null.ro/svn/yate/trunk@2593 acf43c95-373e-0410-b603-e72c3f656dc1
2009-04-24 11:18:35 +00:00
paulc ec4e0f9369 Stop processing early if the external message receiver is dying.
Yield if any message relay is removed to allow it to detect the receiver is dying and return false.


git-svn-id: http://yate.null.ro/svn/yate/trunk@2587 acf43c95-373e-0410-b603-e72c3f656dc1
2009-04-17 13:27:27 +00:00
paulc f2b2e01529 Complain less loud about unmatched messages while the module is disconnecting.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2531 acf43c95-373e-0410-b603-e72c3f656dc1
2009-03-22 21:36:49 +00:00
paulc f51989fc1b Added local setting that controls if channel pointer is set in emitted messages.
A channel creating call.execute message no longer looks up for user data in the waiting messages as it could result in immediate destruction.


git-svn-id: http://yate.null.ro/svn/yate/trunk@2410 acf43c95-373e-0410-b603-e72c3f656dc1
2008-12-23 15:50:13 +00:00
paulc a54cd57e23 Lock waiting message list while cleaning it up.
Increased level of debugging message when needing to clean up waiting list.


git-svn-id: http://yate.null.ro/svn/yate/trunk@2385 acf43c95-373e-0410-b603-e72c3f656dc1
2008-12-02 21:42:10 +00:00
paulc 72f453e88a Cleanup an ExtMessage only if it successfully started up.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2288 acf43c95-373e-0410-b603-e72c3f656dc1
2008-10-24 14:26:51 +00:00
paulc dc67319d01 Made Module::itemComplete public, use it in several more places.
git-svn-id: http://yate.null.ro/svn/yate/trunk@2204 acf43c95-373e-0410-b603-e72c3f656dc1
2008-09-16 15:30:54 +00:00