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”, “”, “amiuser”, “b8d402ef6ff7c2678a2348585c53fdg4”, true);

‘CallerID’: ‘xxxx’,
‘async’: true,
‘Codecs’: ‘g729’
}, function(err, 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.