[Asterisk-Users] MusicOnHold spawns everlasting mpg123 processes

Gavin Hamill gdh at acentral.co.uk
Sun Apr 25 11:39:31 MST 2004


Hullo :)

I'm using CVS-04/23/04-23 from the stable 1.0 branch on kernel 2.6 - since I 
have no Digium h/w, I've just managed to get the zaprtc module to compile and run, 
so I thought the best way to test it would be via MoH.

The MP3Player application works great ..

exten => 6901,1,Answer
exten => 6901,2,MP3Player(http://127.0.0.1:85/ES/28)

This will play callers BBC Radio 4 from my local streaming setup, and when they
hangup, the mpg123 process dies immediately. Perfect :)

Unfortunately, the same cannot be said about:

exten => 6900,1,Answer
exten => 6900,2,MusicOnHold

    -- Accepting AUTHENTICATED call from 10.0.0.74, requested format = 2, actual 
format = 2
    -- Executing Answer("IAX2[janie at janie]/5", "") in new stack
    -- Executing MusicOnHold("IAX2[janie at janie]/5", "") in new stack
    -- Started music on hold, class 'default', on IAX2[janie at janie]/5

Then I press 'Hangup' in IaxComm:

    -- Stopped music on hold on IAX2[janie at janie]/5
  == Spawn extension (default, 6900, 2) exited non-zero on 'IAX2[janie at janie]/5'
    -- Hungup 'IAX2[janie at janie]/5'

Alas, the 'mpg123' processes live on...

 4049 pts/22   S      0:00                  \_ asterisk -vvvvvvvvvc
 4050 pts/22   S      0:00                  |   \_ mpg123 -q -s --mono -r 8000 -b 
2048 -f 8192 sample-hold.mp3
 4063 pts/22   S      0:00                  |       \_ mpg123 -q -s --mono -r 8000 
-b 2048 -f 8192 sample-hold.mp3

In fact, if I redial ext 6900, I get played the MoH sample from the point at which 
mpg123 has reached in the mp3, rather than getting it from the start.

The MusicOnHold docs say: "Returns -1 on hangup. Never returns otherwise." 

I beg to differ :) Is this a bug, or have I made some fundamental mistake?

Cheers,
Gavin.



More information about the asterisk-users mailing list