Create, redirect... calls using AsterNET.ARI

2.4k views Asked by At

I have installed AsteriskNOW distribution with freePBX. I'm trying to implement autodialer to our existing software. I am monitoring calls wihtout any problems. Only thing that works is to hang up call. When i try to originate, redirect, hold or make similar action i get response from asterisk: Channel not in Stasis application.

var x = client.Channels.Originate("SIP/447", extension: "SIP/446", timeout: 30);
client.Channels.Ring(x.Id);
1

There are 1 answers

0
Shankar Dutt Chamoli On

First you have to originate call using Channel.Originate method as

var newChannel = ActionClient.Channels.Originate(endpoint, extension, context, priority, null, AppName, null, callerId, timeout, variables, channelId, otherChannelId, originator);

newChannel.Id is the Channel_id which is created due to the above method. Now you have to Redirect the call using public void Redirect(string channelId, string endpoint) where channelId is your current channel and endpoint is like "endpoint:SIP/703"

Try this.. Good luck!!