Originate or Dial Problems


#1

For some reason I cannot dial out at all.

I installed Asterisk @ Home. I setup an extension 200 and it is linked to an SIP Softphone on my windows computer. Also I have setup an IAX link to www.exgn.net for outgoing calls.

I can use my Softphone to connect to Asterisk to make outgoing calls just fine.

But lets say I want a Wakeup Call AGI php script to make an outgoing call, then nothing happens.

I can have the Wakeup Call PHP Script to call the 200 extension for my softphone, but it won’t make outgoing calls.

I have tried:
.Net API Manager
Originate oc = new Originate();
oc.Channel = “IAX2/user11:pass23@iax.exgn.net/5173338211@from-pstn”;
oc.Context = “from-pstn”;
oc.Exten = “5173338211”;
oc.Priority = 1;
oc.CallerId = “Wakeup”;
oc.Timeout = 5000;
oc.Application = “MusicOnHold”;
Call call = dam.OriginateCall(oc);
or
Originate oc = new Originate();
oc.Channel = “IAX2/user11:pass23@iax.exgn.net/5173338211@from-internal”;
oc.Context = “from-internal”;
oc.Exten = “5173338211”;
oc.Priority = 1;
oc.CallerId = “Wakeup”;
oc.Timeout = 5000;
oc.Application = “MusicOnHold”;
Call call = dam.OriginateCall(oc);
or
with calling with: /var/spool/asterisk/outgoing

cat 1845.ext.5173338211.call

channel: Local/5173338211@from-pstn
maxretries: 3
retrytime: 60
waittime: 60
callerid: “WakeUp” <*62>
application: MusicOnHold

I just can’t figure out how to make outgoing calls with Originate or with Dial.

Please help!!!


#2

I only glanced quickly - but it seems like you are a little confused on your use of originate. Take a close look at the documentation to get a better understanding. The net summary is:

Channel: is you destination where the call is going to
Context,Extension,Priority:
OR
Application:

(and they are mutually exclusive) Is where you want that call to be connected to once it is answered.

So for example, if you want the wakeup call to go to an outside line, you reach it through the channel and then connect it to the Application AGI passing it the name of the wakeup call script (and path if need be) as its data. For your outgoing channel, you can link directly to an outgoing channel or you can do something like:

Local/${NumToCall}@from-internal/n

which will act just like if a local extension made the call (thus proper CDR records, follow you outbound routing rules, obey DND, CF, etc.)

hope that helps,

p


#3

ok so if I’m calling an outside line and I want AGI to handle it

Channel = Local/${NumToCall}@from-internal/n

Application = MusicOnHold
Priority = 1

So what should Context, and Extension equal?
I left Extension = “” and Context = “from-internal”, it makes the call but then hangs up, it won’t let MusicOnHold handle it.

so whats the problem?


#4

please help =) pretty please


#5

Is there another Asterisk Forums that I could ask? I’m pretty much stuck right now with this and I really need some help =(


#6

Hi,

I am having the same problem.

I am trying to place a call from one extension to an external number.

The code runs successfully from extension to extension with the following:
Action: Originate
Channel: SIP/54
Context = default
Exten: 51
Priority: 1
Timeout: 5000

But when I want to call an external number, it doesn’t work.

Any idea how the following should be modified?
Action: Originate
Channel: SIP/54
Context = default
Exten: 0015555551212
Priority: 1
Timeout: 5000

Thanks for your help.