How to get the dialed number and pass it as argument to node.js Stasis app

I have the following dial plan:

exten => _500Z,1,NoOp()
same => n,Stasis(originate-example)
same => n,Hangup()

I want to make a call from 5002 to 5001 in my Stasis app. I need to know the dialed number, (5001) so I can pass it as an argument in my app, how do I do this?

Also, I need to know how I can get the argument value in the node.js app.

${EXTEN} as shown in many examples in extensions.conf.sample.

I found a solution:

exten => _500Z,1,NoOp()
same => n,Stasis(originate-example,${EXTEN})
same => n,Hangup()

node originate-example.js
var endpoint

In your StasisStart event callback:

function (event, incomingChannel) {

            endpoint= 'PJSIP/' + event.args[0];
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.