Skip to content

sipgate/sipgate.io-meteor

Repository files navigation

#sipgate.io-meteor Build Status

Handle phone calls from meteor using sipgate.io. Check out the tutorial in our gitbook on how to create a simple project.

Installation

meteor add sipgate:io

Sample

JavaScript

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});
  }
});

CoffeeScript

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

Setup

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.

Tests

To run the tests execute meteor test-packages ./ on the command line