Producer handled by producermanager
Type: interval
Functionality: Reads and returns isdn_calls and inbound_calls
Data exchange Format: JSON
Send request object to omg-producermanager via zeroMQ.
Subscription:
{
rMethod: "pubsub",
pAction: "subscribe",
producer: "callinfo"
}
Request/reply:
{
rMethod: "reqrep",
pAction: "getStatus",
producer: "callinfo"
}
Watches for changes on /tmp/isdn-call*
Watches for changes on /tmp/inbound_call*
Returns:
{
isdn: {}
inbound: {}
lastCalls: {}
}
host = aggConfig.protocol + "://" + aggConfig.address + ":"
pushSubscriptionSocket = zmq.socket('push')
pushSubscriptionSocket.connect(host + aggConfig.subscriberPoolPort)
subscriptionSocket = zmq.socket('sub')
subscriptionSocket.connect(host + aggConfig.pubSub)
blub = {
rMethod: "pubsub",
pAction: "subscribe",
producer: "callinfo"
}
pushSubscriptionSocket.send(JSON.stringify(blub))
subscriptionSocket.subscribe("callinfo")
subscriptionSocket.on("message", function(response) {
response = JSON.parse(response)
//Do something with it
})
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
(Nothing yet)
Copyright (c) 2014 Johannes Noe
Licensed under the MIT license.