I would like to initiate an external call using the CLI.
A search has shown that the best way for me to do this is via a ‘call file’ as described here: https://www.voip-info.org/asterisk-auto-dial-out
However, I am not really getting anywhere here.
The call should be triggered from extension 15 and go through the PJSIP trunk.
It does ring on the external number, but I can’t pick up or anything like that.
My call file so far (SIP server from my provider is 'tel.t-online.de'):
I don’t know how to place the extension and how exactly to dial correctly like in a ‘normal’ SIP client.
The call also looks completely different in the CDR reports when I let it ring (ANSWER instead of NO ANSWER / s[from-pstn] instead of phone number / CallerIDs empty).
See picture (First call: SIP-client / Second call: caller-file):
What am I doing wrong, or what is missing here to make it work like a ‘real’ call from extension 15?
I’m not really familiar with Asterisk, unfortunately.
thanks for the help.
It almost works … I originally wanted that I do not have to answer the call again on extension 15, but that is automatically called out (to: 4917XXXXXX3).
Is that also possible?
For debug purposes I want to initiate a call to an external number (4917XXXXXXXX3) via CLI in the simplest way.
Command > Call to external number > Ringing 2 times > Terminate Call.
I also want to set something like ‘userfield’ so that I can search call in the CDR reports.
It is only about ringing so that no call costs are incurred by the provider.
I don’t believe that the CLI originate supports that, and other versions would be dependent on the called system initiating early media, or a short timeout. Normal originates don’t complete until the call times out or is answered.
The CLI version of originate doesn’t seem to support early media, or timeout, parameters.
You could reverse the originate and use a local channels to a virtual extension that just waits, on the A side, and specify a timeout for the Dial application on the B side.
I’d also note that excessive use of this might be considered a fair usage breach, or trigger special tariffs for customers who make excessive numbers of short or unanswered calls.
This will call 4917XXXXXX3 with the CID set on the outbound route, it will ring for 10 seconds (about two rings in the US) and then hang up. If the callee answered prior to 10 seconds they will hear a recording that says “goodbye” and then get disconnected.
This will also set ‘foo’ in the CDR accountcode field.
You can probably try to play with the Setvar: <var=value> field to set a the userfield for CDR.