Handle phone calls from meteor using sipgate.io. Check out the tutorial in our gitbook on how to create a simple project.
meteor add sipgate:io
sipgate = new Sipgate();
sipgate.events({
newCall: function(call) {
Calls.insert(call)
},
// optional to get notified about answer events
answer: function (call) {
Calls.update(call._id, {$set: call});
},
// optional to get notified about hangup events
hangup: function (call) {
Calls.update(call._id, {$set:call});
},
// optional to get notified about dtmf events
dtmf: function (call) {
Calls.update(call._id, {$set:call});
}
});
sipgate = new Sipgate()
sipgate.events
newCall: (call) ->
Calls.insert call
# optional to get notified about answer events
answer: (call) ->
Calls.update call._id, $set:call
# optional to get notified about hangup events
hangup: (call) ->
Calls.update call._id, $set:call
# optional to get notified about dtmf events
dtmf: (call) ->
Calls.update call._id, $set:call
Set up http://yourdomain.com***/io/call/***userid for incoming and outgoing calls in the sipgate.io settings of your sipgate team, sipgate basic or simquadrat account. If you are not using the Meteor accounts package, you can set a placeholder like 1 as userid.
To run the tests execute meteor test-packages ./
on the command line