1

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);
jww
  • 97,681
  • 90
  • 411
  • 885
palkhin
  • 13
  • 4
  • "Implement autodialler" without skill is fast path to loose money. Use vicidial or other opensource already EXISTING core. For use ARI you first have move channel to Statis app. – arheops Jul 11 '17 at 00:56
  • @arheops yes i'm looking into these solutions, but i am trying to implement very simple dallier, it would be better to have my solution... How do i move channel to Stasis app? Thanks for reply – palkhin Jul 11 '17 at 08:12
  • There are no "simpler dialler". You have go Statis using dialplan. – arheops Jul 11 '17 at 08:14
  • @arheops okay thanks for reply... I will use other solutions – palkhin Jul 11 '17 at 11:22
  • @arheops I'll still need one operation to do by my service, that is redirecting calls. When i try to redirect i get again **Channel not in Stasis application**. Can you tell how to fix this? or some link to documentation. I can't find solution to this. Thank you `if (channel.State == "Up") client.Channels.Redirect(channel.Id, "SIP/447");` – palkhin Jul 19 '17 at 08:05
  • You need put channel in Statis by dialplan first. – arheops Jul 19 '17 at 13:29

1 Answers1

0

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!!