Skip to content

How To: Originate Call From Asterisk CLI

by Jon on June 16th, 2010

This is a useful command when building your dial plan, it allows testing of the dial plan remotely. There are a couple of commands to explain. The first is the originate command a highly useful tool for checking any IVR context’s, this is how to use it.

originate SIP/14075551234@sip-outbound extension s@auto-att

Let me explain this.:

originate = command

SIP/14075551234 = what technology to use so this could be IAX.,SIP,ZAP,DHADI following a slash and phone number

@sip-outbound = this is what context to send it to in sip.conf or other associated technology file

extension = is required for the command

s = this is what exten to send to within the context specified below

@auto-att = which context to send to in extensions.conf

Now the other way to dial out from the system is with the dial command which is show below.

dial 14075551234@internal

dial = the command

14075551234 = the digits to send, so this could be anything you want it just has to match something in the context you specify

@internal = the context you would like to match the digits in extensions.conf

From → VOIP

13 Comments
  1. physician assistant permalink

    Great site. A lot of useful information here. I’m sending it to some friends!

    • i have tried the command but it is not working. i see you have already tryed. please give any advice.

      originate SIP/12012680793@sip-outbound extension s@auto-att
      == Using SIP RTP CoS mark 5
      [Jul 21 08:21:31] ERROR[15639][C-00000001]: netsock2.c:271 ast_sockaddr_resolve: getaddrinfo(“sip-outbound”, “(null)”, …): Name or service not known
      [Jul 21 08:21:31] WARNING[15639][C-00000001]: chan_sip.c:6058 create_addr: No such host: sip-outbound
      [Jul 21 08:21:31] NOTICE[15639][C-00000001]: channel.c:5689 __ast_request_and_dial: Unable to request channel SIP/12012680793@sip-outbound

      can you please help.

  2. Asterisk is amazingly confusing!!!!

  3. Leonel Jimenez permalink

    You really helped me with this detailed description on each section of the originate command.

  4. Isaías permalink

    Thanks man, very helpful!

  5. Instead of “SIP/14075551234” can be whatever??
    Thx

  6. wow, thanks for this. the voip-info website doesnt provide enough information. this was just what i was looking for!

  7. I am trying to do the following:

    Through the CLI: Call Outbound Number1 and Connect it to Outbound Number2.

    I have tried the originate command:

    Originate SIP/NUMBER1@sip-outbound extension SIP/NUMBER2@sip-Outbound
    no luck

    any help?
    Any way to make sure that Number1 picks up before calling number2?

  8. Mahbub permalink

    I used originate SIP/8801934443444@GW-2 extension 8801@8820
    BUT asterisk no audio format found to offer. cancelling call to 880193444344.

  9. Bhuvnesh permalink

    Hi

    I looking for AMI command to originate call to a specific number and once called party pickup the call and play ivr and then further according to ivr.

    Details concept as below:

    Lets say :
    callling party = 201 (extension or some channel)
    Called Party = 9999999999
    When called party pickup the called ivr plays (Press 1 to speak with our representative). When called party press 1 then it connect to some queue or particular extension).

    Help me in this please.

    • Hello,

      If you use the following example it will send the call to a context that has an auto attendant setup to ask the caller what they want to do. They could press 1 or 0 or whatever you have setup in the [context].

      originate SIP/14075551234@voip-ms extension s@autoatt-context

      That will place a call to the phone number 14075551234 and connect it to whatever is at s,1 of autoatt-context which would be in extensions.conf. If you would like to better understand this I would have to show you.

      Regards,

      Jon

  10. hi i have tryed to user this command it is showing an error message
    originate SIP/12012680793@sip-outbound extension s@auto-att
    == Using SIP RTP CoS mark 5
    [Jul 21 08:21:31] ERROR[15639][C-00000001]: netsock2.c:271 ast_sockaddr_resolve: getaddrinfo(“sip-outbound”, “(null)”, …): Name or service not known
    [Jul 21 08:21:31] WARNING[15639][C-00000001]: chan_sip.c:6058 create_addr: No such host: sip-outbound
    [Jul 21 08:21:31] NOTICE[15639][C-00000001]: channel.c:5689 __ast_request_and_dial: Unable to request channel SIP/12012680793@sip-outbound

    can you please help.

    • So looks like your problem is you didn’t replace “sip-outbound” with the ip address of your server. See this following error: “create_addr: No such host: sip-outbound”

      You need to fix the ip address problem.

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS

%d bloggers like this: