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

Pavel Troller patrol at sinus.cz
Wed Nov 25 02:56:24 CST 2009


> Pavel Troller wrote:
>> Hi!
>>   I've found a problem in my dialplan scripts, which I think was not there
>> before.
> <snip>
>>   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.
> <snip>
>> Could it be a bug ?
>
> This does sound like a regression, especially if you can't reproduce the 
> issue by reverting back to an earlier version (such as 1.6.1.9 or 1.6.1.4). 
> If changing nothing but the version causes this to go between working and 
> not working, then I'd suggest this to be a regression.
>
> If this is the case, then please open a new issue in the issue tracker at 
> https://issues.asterisk.org with a backtrace generated after attaching to 
> the running Asterisk process and reproducing the issue. Also, I believe the 
> output of 'core show locks' would be useful after enabling MALLOC_DEBUG and 
> DEBUG_CHANNEL_LOCKS* in the Compiler Flags section of menuselect.
>
> Don't forget to enable DONT_OPTIMIZE before getting the backtrace. More 
> information is in the doc/backtrace.txt file of your Asterisk source.
>
> Thanks!
> Leif Madsen.
>
> * I can never remember which flag it is to enable the output for 'core show 
> locks', so just enable both :)  I'm sure someone will respond here and tell 
> me which is correct.

Hi Leif,
  many thanks for your help! I'm not sure, in which version the regression
occured, what I know is, that I wrote these dialplan fragments about 1.6.1.0
or maybe with 1.6.0.something, I've tested it extensively and it worked. Now,
I was hunting a problem with Asterisk going nuts sometimes and I've finally
found the cause in this very special situation. Because this is on a production
system, I cannot debug it immediately. I've found a quick workaround - I've
replaced all System() commands with AGI(), where the agi script is exactly
the same helper which was called by System(), i.e. it doesn't communicate with
Asterisk at all, it just calls rasterisk -x "originate..." asynchronously, and
it works perfectly, all the symptoms have gone immediately. I think it's the
proof that the bug is really in the System() command, not in anything around
it (in the dialplan or the program being called). 
  As soon as I have enough time, I will try to simulate the problem on my lab
system and debug it accordingly.
  With regards, Pavel Troller

P.S. It would be nice to have a direct dialplan Originate() command, it would
simplify a lot of things.



More information about the asterisk-dev mailing list