no such channel when HangupAction

Feb 6, 2014 at 1:47 PM
how to resolve the problem of "no such channel" when Hangup Action.Can you help me plllllz it is urgent :/
Coordinator
Feb 6, 2014 at 2:07 PM
Does the channel exist? If so, can you paste in here the code your passing, the channel name you're passing in the action and the output of "core show channels" in the asterisk CLI to show the channel in asterisk.
Feb 7, 2014 at 9:33 AM
thank you skrusty to reply me, here is the code that I call him after making a succes call with the class OriginateAction :
Dim result As String = s.Raccrocher("101")
'result return "ManagerError{DateReceived:xx:xx:xx;ActionId:xxxx;Message:No such channel; Response:Error}"
Dim manager As New ManagerConnection
Public Function Raccrocher(CallerId As String) As String
        manager= New ManagerConnection(address, port, userr, password)
        Try
            manager.Login()
        Catch ex As Exception
            MsgBox("Erreur de connection\n" + ex.Message)
            manager.Logoff()
        End Try        

        Dim hp As New HangupAction()
        hp.Channel = "SIP/" + CallerId
        Try
            Dim hangupResponse As ManagerResponse = manager.SendAction(hp)
            Deconnecter()
            Return hangupResponse.ToString
        Catch ex As Exception
            manager.Logoff()
            Return ex.Message
        End Try
    End Function
Coordinator
Feb 7, 2014 at 12:43 PM
101 isn't a valid channel name. That's an extension.
Feb 7, 2014 at 2:31 PM
the channel that I passed in the call is SIP/101.
Feb 7, 2014 at 3:05 PM
Hi,

you can get all active channels with the Status event,.

But before you have to fire a Action, otherwise the Event is not triggered

You can start with this
    private void GetChannelStatus()
    {
        StatusAction sa = new StatusAction();
        try
        {
            ManagerResponse mr = astCon.SendAction(sa, 10000);
            Console.WriteLine("Transfer Call" + "\n\tResponse:" + mr.Response + "\n\tMessage:" + mr.Message);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
    }
after fireing this command the StatusEvent is triggered and you get all active channels. If a call is active you always have two channels.