This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"event": "ice", | |
"callid": "[email protected]", | |
"timestamp": "2019-03-12T03:25:16Z", | |
"version": 1, | |
"userRate": { | |
"currencyId": "USD", | |
"amount": 0 | |
}, | |
"cli": "15552600684", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "base64" | |
require "openssl" | |
require "time" | |
require "net/http" | |
require "uri" | |
require "json" | |
class SinchSms | |
def self.send(key, secret, message, to) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CallbackController : ApiController { | |
[HttpPost] | |
public async Task<SvamletModel> Post(CallbackEventModel model) { | |
var sinch = SinchFactory.CreateCallbackResponseFactory(Locale.EnUs); | |
var reader = sinch.CreateEventReader(); | |
var evt = reader.ReadModel(model); | |
var builder = sinch.CreateIceSvamletBuilder(); | |
switch (evt.Event) | |
{ | |
case Event.IncomingCall: |