[asterisk-users] Disabling Music On Hold

Urs Buob Urs.Buob at ascom.CH
Fri Jan 28 06:37:12 CST 2011


Hello, 

I have been trying to completely disable music on hold on my asterisk 
system. When a call is put on hold I do not want any music on hold, but I 
would like the remote user to get informed of this event (depending on the 
technology e.g. with a SIP reinvite and an SDP indicating the call is on 
hold). 

I have searched and tried out various approaches, but when putting the 
call on hold by a SIP user, I always get an indication that asterisk tries 
to play music on hold. The remote side does not get a re-invite.

What I have tried so far: 

- no musiconhold.conf in the hope that lack of the configuration file 
disables  moh 
- a musiconhold.conf where everything is commented out 
- modules.conf with 'unload => res_musiconhold.so' 

When I start asterisk, it indicates that it disables music on hold: 
[Jan 28 10:15:02] WARNING[31052]: res_musiconhold.c:1784 load_module: No 
music on hold classes configured, disabling music on hold. 
  == Registered application 'MusicOnHold' 
  == Registered application 'WaitMusicOnHold' 
  == Registered application 'SetMusicOnHold' 
  == Registered application 'StartMusicOnHold' 
  == Registered application 'StopMusicOnHold' 
 res_musiconhold.so => (Music On Hold Resource) 


However, when I set up a sip call between two sip phones and one end puts 
the call on hold, then I always get the following message and the remote 
side is not informed that the call is on hold: 

    -- Executing [s at macro-stddial:2] Dial("SIP/2222-00000000", "SIP/4444") 
in new stack
  == Using SIP RTP CoS mark 5
    -- Called 4444
    -- SIP/4444-00000001 is ringing
    -- SIP/4444-00000001 answered SIP/2222-00000000
    -- Native bridging SIP/2222-00000000 and SIP/4444-00000001
later when the call is put on hold:
    -- Music class default requested but no musiconhold loaded.


Can anybody give me any pointers or tell me how to disable moh completely 
and send re-invites for call hold? 

thanks for any help 

Urs 


My easiest configuration with Asterisk 1.6.2.7: 

modules.conf 
---------------------------------------------------------- 
[modules] 
autoload=yes 
; res_phoneprov requires func_strings.so to be loaded: 
preload => func_strings.so 
noload => pbx_gtkconsole.so 
noload => res_musiconhold.so 


extensions.conf: 
----------------------------------------------------------- 
[general] 

[default] 
;SIP extensions 
exten => _XXXX,1,Macro(stddial,SIP/${EXTEN}) 

[macro-stddial] 
;   ${ARG1} - What to dial 
exten => s,1,Answer() 
exten => s,n,Dial(${ARG1}) 
exten => s,n,Goto(s-${DIALSTATUS},1) 
exten => s-NOANSWER,1,Hangup 
exten => s-BUSY,1,Hangup 
exten => _s-.,1,NoOp 

sip.conf: 
-------------------------------------------------------- 
[general] 
        language=en                 ; configured default language 
        dtmfmode=rfc2833            ; default dtmfmode for sending DTMF 
(Dual-tone multi-frequency) 
        directrtpsetup=no           ; Disable the new experimental direct 
RTP setup 
        allowtransfer=yes           ; enable all transfers for peers and 
users 
        match_auth_username=yes     ; use 'authentication username' 
instead of 'username for authentication' (if available) 
        session-timers=originate    ; Request and run session-timers 
always 
        session-expires=3600        ; maximum session refresh interval 
        session-minse=600           ; minimum session refresh interval 
        session-refresher=uas       ; session refresher is 
user-agent-server 
        ;allowguest=no              ; Allow or reject guest calls (default 
is yes) 
        notifyhold = yes           ; Notify subscriptions on HOLD state 
(default: no) 


        udpbindaddr=0.0.0.0:5060    ; Servers IP address (all) to bind UDP 
listen socket to 
        srvlookup=yes               ; enable DNS SRV lookups on outbound 
calls 

[allusers](!) 
        context=default 
        type=friend                 ; All options are possible 
        qualify=2000                ; no, 2000=2 sec to wait for reply 
before remote party is considered unreachable 
        ;qualifyfreq=60             ; Qualification: How often to check in 
seconds 
        canreinvite=yes              ; certain devices do not like change 
of RTP source/destination during call 

[4444](allusers) 
        host=dynamic  ; the device needs to register 
        secret = 1234 
[3333](allusers) 
        host=dynamic  ; the device needs to register 
        secret = 1234 
[2222](allusers) 
        host=dynamic  ; the device needs to register 
        secret = 1234 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110128/64fbdea6/attachment.htm>


More information about the asterisk-users mailing list