title: Running javascript inside rest api
body: <p>I'm working on asterisk.
  I managed to call an external api using dialplan.
  Now I want to run a javascript inside that api function, because I need to notify a browser that someone is calling. What I'm thinking is that I can do that using node.js. I don't want to use ajax polling cause it is bad.</p>
  
  <p>The following are the process when someone is calling</p>
  
  <p>Call -> Trigger dialplan -> Call external api via AGI method -> run javascript websocket event inside api -> notify browser.</p>
  
  <p>Is that possible? or there is much better way.</p>