zmarius81 / asterisk.io

node.js asterisk pbx io
40 stars 25 forks source link

Custom ActionID #1

Open almssp opened 9 years ago

almssp commented 9 years ago

Enable the feature to provide custom ActionID instead of generating one every time an action is created.

zmarius81 commented 9 years ago

The library uses ActionID, internally, to know what callback function to call on a complete message received. Sorry but I can't merge this pull request.

almssp commented 9 years ago

Yes, I notice, this won't break the code, just allows to use a custom actionid, instead of one generated from the lib. Since it creates an array with the ActionID passed to the .action function, the value is stored in the Array and later retrieved, or deleted, since AMI will send back data with the ActionID you chose to use in the first place.

ami.action( 'Originate', { ActionID: "CUSTOM-ID-GENERATE-BY-SCRIPT-AND-NOT-LIB" }