Parameters:
- Channel: Channel on which to originate the call (The same as you specify in the Dial application command)
- Context: Context to use on connect (must use Exten & Priority with it)
- Exten: Extension to use on connect (must use Context & Priority with it)
- Priority: Priority to use on connect (must use Context & Exten with it)
- Timeout: Timeout (in milliseconds) for the originating connection to happen(defaults to 30000 milliseconds)
- CallerID: CallerID to use for the call
- Variable: Channels variables to set (max 32). Variables will be set for both channels (local and connected).
- Account: Account code for the call
- Application: Application to use on connect (use Data for parameters)
- Data : Data if Application parameter is used
- Async: For the origination to be asynchronous (allows multiple calls to be generated without waiting for a response)
- ActionID: The request identifier. It allows you to identify the response to this request. You may use a number or a string. Useful when you make several simultaneous requests.
Sequence of events: first the Channel is rung. Then, when that answers, the Extension is dialled within the Context to initiate the other end of the call. Note that the Timeout only applies to the initial connection to the Channel; any timeout for the other end can be specified, for instance in a Dial command in the definition of the Context.
Example(Placing a call from a SIP channel to an extension, this will cause the outside call not to be placed until the SIP channel has picked up):
Action: Originate
Channel: SIP/101test
Context: default
Exten: 8135551212
Priority: 1
Callerid: 3125551212
Timeout: 30000
Variable: var1=23|var2=24|var3=25
ActionID: ABC45678901234567890
Where Extension 8135551212 is a local an outbound number
The above example also shows how to set channel variables in an Originate request.
Note: You might have heard that in Asterisk 1.2 variables are no longer separated by |, rather each one has its own line. Well that is not true or maybe it has been that way for a while. Asterisk 1.2 current source code suggests that variable must be separated with | (check the function astman_get_variables).
The above example will also hangup if the SIP/101test channel is not picked up in 30 seconds.
Example(Placing a call from an outgoing channel to a local extension, this will cause the local extension not to ring until the Zap channel has picked up):
Action: Originate
Channel: Zap/g2/8135551212
Context: default
Exten: 101
Priority: 1
Callerid: 3125551212
Where Extension 101 is a local SIP phone extension
Example (executing system command):
Action: OriginateChannel: Local/1@dummy
Application: System
Data: /path/to/script
Tip: if you want the Channel end to connect to an arbitrary extension and context, specify a Local channel.
Page Changes
Variable Length limitation
Account(code) available only on DESTINATION channel
I had to send ACCOUNTCODE using Variable parameter to SOURCE channel (Call Leg 1).
timeout not work.and how to detect hookoff
I'm trying to use the originate command to make a auto-dial-out.
first.
I telnet host 5038.
my command is :
action: Originate
channel: ZAP/1/xxxxxxx
context: default1
exten: s
priority: 1
callerid: ss<804>
timeout: 30000
and the extension is
default1
exten=>s,1,playback(vm-goodbye)
exten =>s,n,hangup
the problem is whatever I set the timeout .it can't work.if i don't hookoff the phone.the extension always play.
Using Asterisk API to make a callback webpage
I'm trying to use the originate command to make a web page with a "callback" field. The idea is that someone can enter is phone number to be automatically called by asterisk. Then, this call have to be placed in a queue. Every things work fine but, the only problem is that the music on hold in the queue doesn't start ... I don't know why.
The originate command sent trough the manager interface redirect the call to the context where I defined the queue.
Any ideas ?
Thanks
Benoit.
Using Asterisk API to duplicate the keyboard of a hw phone.
I do this with php script, user compose the number of second phone in your browser, the phone near PC ring and after picked up the cornet the call is make to second phone.
Exist a way to do this: User keep up the cornet before compose the number in the browser?
I don't want to make first phone ring, but I don't know how do this?
Any ideas?
Re: Matching Originate with Newchannel
A possible method to match events with the Originate command: Create a unique ID, and pass it with a name to Variable parameter of Originate. When you handle the events you can use command GetVar for getting the value of your variable on the channel. You will find your ID in it, if they matched. You can get the value of your variable also in the dialplan.
Rubification
<code>
require "socket"
number=(if ARGV.length == 1; ARGV.shift; else exit; end)
STDOUT.flush
s = TCPsocket.open('localhost', 5038)
s.write <<EOF
Action: Login
Username: admin
Secret: <your admin secret defined in /etc/asterisk/manager.conf>
Action: Originate
Channel: Zap/g0/#{number}
MaxRetries: 5
RetryTime: 300
WaitTime: 45
Context: outboundmsg1
Extension: s
Priority: 1
Action: Logoff
EOF
s.close
</code>
Matching Originate with Newchannel
Does anyone know how to match an Originate action with the corresponding Newchannel events. For example, when using asynchronous originate with ActionID set to some value OriginateFailure event does return the ActionID of the corresponding originate Action, but other evets for eg. Newchannel, Cdr etc. doesn't have ActionID so it is imposible to determine which Newchannel event was generated by which Originate action. Does anyone know how to solve this problem?
Thanks,
Tigran
Ping the server after login
Message: Authentication accepted") of the remote asterisk server shows that i have logined on successfully. Now i again run another command "sendto(clifd, bufPing, strlen(bufPing), 0, (struct sockaddr_in *)&servaddr, socklen))" and the bufPing is "Action: Ping\r\nParameters: None\r\n\r\n" , this time i get the result :Response: Error
Message: Missing action in request" ,and my /var/log/asterisk/full contains the following message:"Oct 30 03:21:43 DEBUG2627 manager.c: Manager received command '' ",the ping command is NULL ? Why? Can someone help me?
thanks in advance... xutom
Ping the server after login
Message: Authentication accepted") of the remote asterisk server shows that i have logined on successfully. Now i again run another command "sendto(clifd, bufPing, strlen(bufPing), 0, (struct sockaddr_in *)&servaddr, socklen))" and the bufPing is "Action: Ping\r\nParameters: None\r\n\r\n" , this time i get the result :Response: Error
Message: Missing action in request" ,and my /var/log/asterisk/full contains the following message:"Oct 30 03:21:43 DEBUG2627 manager.c: Manager received command '' ",the ping command is NULL ? Why? Can someone help me?
thanks in advance... xutom