Announcement play in call

when i call a number in asterisk, I want the music to begin. but I need to do this with node.js and ami. what should i do for this?

ar Ami = require(‘asterisk-manager’);
var ami = Ami(“5038”, “192.168.10.126”, “amiuser”, “b8d402ef6ff7c2678a2348585c53fdg4”, true);

ami.action({
‘action’:‘originate’,
‘channel’:‘SIP/2011’,
//‘ConnectedLineNum’:‘xxxx’,
//‘CallerIDNum’:‘xxxxx’,
‘context’:‘default’,
‘CallerID’: ‘xxxx’,
‘exten’:‘s’,
‘priority’:1,
‘async’: true,
‘Codecs’: ‘g729’
}, function(err, res) {
console.log(err);
console.log(res);
});

Not sure about AMI, but you can sure set the MOH class and start it in ARI

AMI makes 2 calls so I assume you want the first party called listen music while calling to the second leg , if this is the case you can use the m option of the dial command

Generally you do this sort of thing in your extensions, and the means by which the Originate is invoked is irrelevant.