мои внутренние номера. конф
Код: Выделить всё
exten => 1000,1, NoOp()
same => n,Stasis(originate-example)
same => n,Hangup()
Код: Выделить всё
using AsterNET.ARI;
using AsterNET.ARI.Helpers;
using AsterNET.ARI.Models;
var AppName = "originate-example";
var actionClient = new AriClient(new StasisEndpoint("127.0.0.1", 8088, "asterisk", "asterisk"), AppName);
actionClient.Connect();
//I subscribe to the application start event
actionClient.OnStasisStartEvent += ActionClientOnOnStasisStartEvent;
void ActionClientOnOnStasisStartEvent(IAriClient sender, StasisStartEvent e)
{
//answer the call
actionClient.Channels.Answer(e.Channel.Id);
//sound file is playing
SyncHelper.Wait(actionClient.Channels.Play(e.Channel.Id, "sound:vm-dialout", "en", 0, 0, Guid.NewGuid().ToString()), actionClient);
//I'm trying to call from 401 number to 402 but the call doesn't happen
actionClient.Channels.Originate(
endpoint:"PJSIP/401", //the number from which I called 1000 to start stasis
extension:"402", //the number I'm calling
callerId:"401",
timeout:100000 ,
app:AppName,
priority: 1
);
}
Console.ReadLine();
Подробнее здесь: https://stackoverflow.com/questions/781 ... al-numbers