Skip to main content

MOH not working when calling from external

Posted by ryan.tuttle on Tue, 05/12/2009

I'm having an issue were calls coming in a SIP trunk do not have MOH. Internal calls seem to work fine, just calls from outside. Judging from the error below it looks like its trying to use 'default' as the music on hold class, instead of 'default-tenant'. I've pasted a sample of the inbound_actions.include file, it looks like it should set the MOH to 'default-tenant' but it apparently isn't working. Any thoughts?

res_musiconhold.c:665 get_mohbyname: Music on Hold class 'default' not found

[from-outside-5414926000-tl-allhours-thirdlane]
exten => 5414926000,1,Set(__tenant=thirdlane)
exten => 5414926000,2,Set(CDR(userfield)=thirdlane)
exten => 5414926000,3,Set(MOH=${DB(TL/MOH/default${TL_DASH}${tenant})})
exten => 5414926000,n,GotoIf($["${MOH}" = ""]?nomoh)
exten => 5414926000,n,SetMusicOnHold(${MOH})
exten => 5414926000,n(nomoh),Macro(tl-goto-userextension,6000)


Submitted by eeman on Tue, 05/12/2009 Permalink

what does your /etc/asterisk/musiconhold.conf look like?

Submitted by ryan.tuttle on Tue, 05/12/2009 Permalink

;

; Music on Hold -- Sample Configuration

;

[default-thirdlane]

mode=files

directory=/var/lib/asterisk/moh/thirdlane/default

Submitted by ryan.tuttle on Tue, 05/12/2009 Permalink

The directory does exist, and if I call from another phone in the tenant group the MOH works, just not if the call comes in on the from-outside context. I haven't created any tenants, just working off the thirdlane tenant group to start with. Once I have everything working the way I want then I'll use it as my clone source. It's acting like the moh variable doesn't get set properly when the call comes in, just not sure why. Is there a debug option that would help me find the cause?

Submitted by ryan.tuttle on Tue, 05/12/2009 Permalink

Figured it out, the database key TL/MOH/default-thirdlane was not in the database. Probably do the wierd install issue were I had to copy the configuration files in from the webmin directory. Works now, thanks for the help.