[asterisk-dev] Calling System() from the "h" extension ?

Pavel Troller patrol at sinus.cz
Tue Nov 24 15:07:04 CST 2009


Hi!
  I've found a problem in my dialplan scripts, which I think was not there
before.
  I'm using the System() command in the hangup extension routine, for example
to initiate the call completion to {busy|unanswered} calls etc. This command
contained just "rasterisk -x originate <some parameters>" command.
  Now, in 1.6.1.10, executing this System() commands eats lots of a CPU cycles
momentarily (for about 5 seconds). It's enough to increase the CPU load from
0.00 to 2.55. All the calls bridged are choppy during this period, Asterisk
even cannot write to the console. After a while, all goes back to normal and
the command normally executes its function, i.e. the phone addressed by the
originate cmd starts ringing, console dumps what it has to (just a regular
processing of the dialplan including the System() command, nothing suspicious)
etc.
  I'm also executing the System() command with very similar function from
other extensions, and it behaves normally.
  Replacing rasterisk -x with a small shell wrapper, calling the rasterisk
back with a short delay asynchronously, doesn't improve anything (the wrapper
code is as follows):

#!/bin/bash
{
  sleep 0.5
  /opt/asterisk/sbin/rasterisk -x "$*"
} &
exit 0

but calling either directly rasterisk -x with appropriate params or this
shell wrapper from a separate console works perfectly, without any CPU load.

Could it be a bug ?

WIth regards, Pavel



More information about the asterisk-dev mailing list