Originating VoIP call using AsterNET in C#

5.6k Views Asked by At

I try doing

mConnection.SendAction(new OriginateAction()
                {
                    Channel = "SIP/201test",
                    Exten = "401",
                    Context = "201", 
                    Priority = "1",
                    CallerId = "201",
                    Timeout = 30000
                });

Where 201 and 401 extensions are connected to my local network. I am trying to call from 201 to 401. What am I doing wrong?

Edit:

  1. I have a test application with a button "Call"
  2. I have 2 extensions connected to my server - 201, 401
  3. I want to call from 201 to 401 on "Call" button click

Channel name I selected randomly I am even not sure if I am right.

UPDATE:

```

mConnection.SendAction(new OriginateAction()
                {
                    Channel = "SIP/401",
                    Exten = "401",
                    Context = "default",
                    Priority = "1",
                    CallerId = "201"
                    Timeout = 3000000
                });

```

This way 401 receives a call from 201, when answering the phone, a voice tells that 201 is on the phone, and it is followed by a beep. BUT 201 actually is not calling, as when taking the phone tube of 201, it is not connected to 401.

1

There are 1 best solutions below

1
On
mConnection.SendAction(new OriginateAction()
                {
                    Channel = "SIP/401",
                    Exten = "201",
                    Context = "default",
                    Priority = "1",
                    CallerId = "401"
                    Timeout = 3000000
                });

See the solution here: https://asternet.codeplex.com/discussions/542916 I post the link, to help people having the same issue to be able to read all the discussion to clarify all mismatches they have.