How can I test dial command of the dialplan

Hi,

I have in my extensions.conf the following lines. I want to make a call from the command line.

exten => _X.,1,Dial(SIP/sip/+1${EXTEN:4})
exten => _X.,n,hangup()

How can I make this to dial out from a command line to call a destination?

Suppose I want to call a number +12634779641. Can I run a dial command from asterisk command line? How?

Please start again with chan_pjsip, as chan_sip is not in the latest version of Asterisk and is, effectively, unsupported.

This is a strange requirement. Most people would use a soft phone. However see:

It is possible some names have changed, e.g. it might be console dial. It is also possible that some of this has been deprecated or removed.

Personally, I’d consider the console channel drivers proof of concept ones, and most people who use them in production, only use them to receive calls.

This is more likely to turn into testing how to dial from the console.

You can test outbound calls by using originate, e.g. with the Playback application. You can use a local channel ot access you dialplan. This is something that rather more people do, although originating from the dialplan is not normally the best way to originate.

This is an existing system running old version of asterisk and we aren’t ready to upgrade as it is live.

I’ve pasted the dialplan from the extensions.conf above. I want to manually try to simulate for my test purpose to learn how.

From the asterisk cli prompt >

I’m not specific about cli dial options… is there any way to dial out a destination number +12634779641 and make the called party answer the call

I’ve already given you two ways. I’m not clear on the underlying reason for this, but I’d currently say originate was your best option, if you don’t want human to human communication.

On Saturday 02 March 2024 at 13:47:52, muslimak via Asterisk Community wrote:

From the asterisk cli prompt

I’m not specific about cli dial options… is there any way to dial out a
destination number +12634779641 and make the called party answer the call

  1. No matter how you end up placing a call, I know of no way to make the
    called party answer :slight_smile:

  2. Suppose you do manage to initiate a call from the command line instead of
    from a phone, and the called party does answer - what do you expect them to
    find themselves talking (or listening) to?

Antony.


“Measuring average network latency is about as useful as measuring the mean
temperature of patients in a hospital.”

  • Stéphane Bortzmeyer

                                                Please reply to the list;
                                                      please *don't* CC me.
    

I agree the called party won’t be speaking to anybody. But, will he/she receive the call from the command line ? I want to see the signaling happening.

On Saturday 02 March 2024 at 15:12:04, muslimak via Asterisk Community wrote:

I agree the called party won’t be speaking to anybody. But, will he/she
receive the call from the command line ? I want to see the signaling
happening.

I would use a call file for this purpose - create something which dials to
something you can answer, and then goes to the context and extension you
quoted in your original post. That will then test whether those commands
succeed in dialling out to wherever you want them to.

https://docs.asterisk.org/Configuration/Interfaces/Asterisk-Call-Files/

https://support.digium.com/s/article/How-to-use-an-Asterisk-callfile

Antony.


3 logicians walk into a bar. The bartender asks “Do you all want a drink?”
The first logician says “I don’t know.”
The second logician says “I don’t know.”
The third logician says “Yes!”

                                               Please reply to the list;
                                                     please *don't* CC me.

Would you entrust mission-critical business operations to obsolete, unsupported software?

Yes, you can use the Asterisk CLI (Command Line Interface) to originate a call from the command line. Here’s how you can do it:

  1. Connect to the Asterisk CLI using your preferred method (e.g., SSH, console).
  2. Once connected, you can use the originate command to place a call. The syntax for the originate command is as follows:
originate {tech}/{resource} application arguments

In your case, you can use the SIP technology and specify the SIP endpoint you want to call. Here’s how you can originate a call to the number +12634779641:

originate SIP/sip/12634779641 application playback tt-monkeys

This command will originate a call to the specified number and play the built-in sound file tt-monkeys. You can replace tt-monkeys with any other application or dialplan context you want to execute upon the call being answered.

Alternatively, if you want to directly dial the number without executing any additional applications, you can use the Dial application directly:

originate SIP/sip/12634779641 application Dial SIP/sip/12634779641

This command will dial the number directly without any additional processing.

Best Regard
Danish Hafeez | QA Assistant
ICTInnovations

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.