Asterisk MOH Issue With Asterisk 1.6 Version

Hi to all

I am using asterisk 1.6 version with centos 5.3.I am trying to configure MOH for individual sip users/peers ,i configure that music class in sip.conf its working fine.But when i am trying to configure this for individual context in the dialplan it will going to default MOH. For this i am removing musicclass in sip.conf and only mentioning in the extensions.conf but i am not getting that.That conf files are below

sip.conf
[1001]
name=1001
secret=1001
context=mohmp3
host=dynamic
type=friend
disallow=all
allow=ulaw,alaw,gsm

[1002]
name=1002
secret=1002
context=mohmp3
host=dynamic
type=friend
disallow=all
allow=ulaw,alaw,gsm

extensions.conf

[mohmp3]
exten =>1001,1,Dial(SIP/1001,5)
exten =>1001,n,Set(CHANNEL(musicclass)=bpmf)
exten =>1001,n,Set(foo=${CHANNEL(musicclass)})
exten =>1001,n,StartMusicOnHold(bpmf)
exten =>1001,n,Playback(vm-youhave)
exten =>1001,n,StopMusicOnhold()

exten =>1002,1,Dial(SIP/1002,5)
exten =>1002,n,Set(CHANNEL(musicclass)=bpmf)
exten =>1002,n,Set(foo=${CHANNEL(musicclass)})
exten =>1002,n,StartMusicOnHold(bpmf)
exten =>1002,n,Playback(vm-youhave)
exten =>1002,n,StopMusicOnHold()

musiconhold.conf

[bpmf]
mode=files
directory=/var/lib/asterisk/mohmp3

Can any one pls guide me what is the error here.I strucked here from long time.

Best Regards,
Vishnu

Please provide a log at sufficient verbosity to show when music on hold is started and stopped.

As far as I know, Playback will cancel music on hold.

Hi,

Thanks For response i disable playback option then also its going to default only, please find log below

Executing [1002@mohmp3:1] Dial(“SIP/1001-000000a0”, “SIP/1002,5”) in new stack
== Using SIP RTP CoS mark 5
– Called 1002
– SIP/1002-000000a1 is ringing
– SIP/1002-000000a1 answered SIP/1001-000000a0
– Native bridging SIP/1001-000000a0 and SIP/1002-000000a1
– Started music on hold, class ‘default’, on SIP/1001-000000a0
– Stopped music on hold on SIP/1001-000000a0
== Spawn extension (mohmp3, 1002, 1) exited non-zero on ‘SIP/1001-000000a0’

Best Regards,
Vishnu

mp3 in the directory names suggests an unsupported format. What format are you actually using?

Having MoH in mp3 is just a waste of processor power.

Also, I wanted to see the output from this line:

exten =>1001,n,Set(foo=${CHANNEL(musicclass)})

Hi,
Thanks for quick response i am using wav files .I disable mohmp3 now also same situation happening.
And the result when running exten =>1001,n,Set(foo=${CHANNEL(musicclass)}) is below

Executing [1002@mohmp3:1] Dial(“SIP/1001-000000a6”, “SIP/1002,5”) in new stack
== Using SIP RTP CoS mark 5
– Called 1002
– SIP/1002-000000a7 is ringing
– SIP/1002-000000a7 answered SIP/1001-000000a6
– Native bridging SIP/1001-000000a6 and SIP/1002-000000a7
– Started music on hold, class ‘default’, on SIP/1001-000000a6
[Oct 10 17:51:46] NOTICE[9949]: rtp.c:1790 ast_rtp_read: Unknown RTP codec 126 received from ‘192.168.86.1’
– Stopped music on hold on SIP/1001-000000a6
== Spawn extension (mohmp3, 1002, 1) exited non-zero on ‘SIP/1001-000000a6’

Best Regards,
Vishnu

Hi,

Is there any AGI script for MOH to individual contexts for reference.

Best Regards,
Vishnu