zmarius81 / asterisk.io Goto Github PK
View Code? Open in Web Editor NEWnode.js asterisk pbx io
node.js asterisk pbx io
Hi I am trying to execute the following code which should transfer the call to the target extension.
agiHandler.command('Set Extension 1000', function (code, result, data) {
});
The java equivelant of this code works fine so I'm not sure if I have a syntax error. Here is what I have in the onsole:
Console verbose was 12 and is now 25.
== Using SIP RTP CoS mark 5
-- Executing [1300@default:1] AGI("SIP/2000-0000004b", "agi://10.0.1.106/hello.agi") in new stack
> 0x7f7ad001c280 -- Probation passed - setting RTP source address to 10.0.1.103:4022
-- <SIP/2000-0000004b> Playing 'digits/8.gsm' (language 'en')
> 0x7f7ad001c280 -- Probation passed - setting RTP source address to 10.0.1.103:4022
-- <SIP/2000-0000004b> Playing 'digits/20.gsm' (language 'en')
-- <SIP/2000-0000004b> Playing 'digits/7.gsm' (language 'en')
-- <SIP/2000-0000004b> Playing 'digits/a-m.gsm' (language 'en')
-- <SIP/2000-0000004b>AGI Script agi://10.0.1.106/hello.agi completed, returning 4
== Spawn extension (default, 1000, 1) exited non-zero on 'SIP/2000-0000004b'
Am I just missing something?
Hello All,
My astmanproxy server is linked to two asterisk servers.
Now i want to execute an action Queuepause from node js code , I want to execute this action on the secod server linked to astmanproxy server. But how can i pass the ip address of asterisk server through node js code ?
Below is code i am using:
ami.action(
'QueuePause',
{
Interface: 'SIP/301@Kam-SBC',
Paused: true,
Queue: '1003_italk-support',
Reason: 'home'
},
function (data) {
if (data.Response == 'Error') {
logger.log('info', 'server.js: Park Error: ' + JSON.stringify(data))
return;
}
logger.log('info', 'server.js: Park Response: ' + JSON.stringify(data));
}
);
I code the asterisk.io to listening events and/or send actions. But always after a time (random time) the node server crash with the follow error. Why? Thanks
This code throw error
ami.on('error', function(err){
throw err;
});
throw err;
^
E_AMI_SOCKED_CLOSE: Lost connection to server.
at Socket. (/home/.../asterisk.io/lib/ami.js:272:30)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at TCP._onclose (net.js:486:12)
I am trying to send the info of a queue as a response to a GET request to my server. When the request hits, I issue an action to asterisk using:
ami.action('Command',{ Command: 'queue show' },function(data){ console.log(data); res.write(JSON.stringify(data)); res.end(' \n \n 200 OK'); })
.
I get a response from asterisk, with info like number of calls, queue strategy etc, however the Members list is empty. When I do the same command directly in asterisk, the Members list successfully shows all the queue's members.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.