Doorbel / command line start call

I am very new to freepbx…
Finally got it running with 2 phones. :wink:
Now i want to start a call to a phone from command line
Like a doorbel does for example.

On google i found this:

I created the [fromdoor] in extensions_custom.conf

when i trigger the script i get the following message
No such command ‘originate SIP/5555 application Playback beep’ (type ‘core show help originate SIP/5555’ for other possible commands)

Any help on solving this would be phantastic :wink:
my freepbx version is FreePBX

While logged into the Asterisk CLI try:

 channel originate local/[email protected] application Playback beep

Thanks for your quick reply! :slight_smile:
when i do this my phones rings :wink: But i get the errors below

is it possible to run this command outside the CLI?

[2020-01-31 21:01:31] WARNING[7183][C-00000001]: app_macro.c:274 _macro_exec: Macro() is deprecated and will be removed from a future version of Asterisk.

[2020-01-31 21:01:31] WARNING[7183][C-00000001]: app_macro.c:275 _macro_exec: Dialplan should be updated to use Gosub instead.
[2020-01-31 21:01:31] WARNING[7183][C-00000001]: chan_sip.c:23163 func_header_read: This function can only be used on SIP channels.
[2020-01-31 21:01:31] ERROR[7183][C-00000001]: res_pjsip_header_funcs.c:454 func_read_header: This function requires a PJSIP channel.

Ignore those warnings.

asterisk -x "channel originate local/[email protected] application Playback beep"

Cool it works :wink:
Thank you!

Can i edit the behavior of this call some were?
for example that i need to hangup instead of auto hangup
and the caller id is the ip now, would like to give this a name
or isnt this possible to change?

I’m not sure what you are trying to accomplish.

Loom up Asterisk AMI and Callfiles.

I tried a lot with changing things and restarting but no succes.

What i wish to get and do is start a call from command line
Phone rings
Then pick it up and wait few seconds
Press a button to trigger a script (got that running )
Hang up the phone
It is for a movie setup

You’ll want something like:

asterisk -x "channel originate local/[email protected] extension [email protected]

Then in extensions_custom.conf have something like this

exten => s,1,Noop(entering user defined context in extensions_custom.conf)
exten => s,n,Read(myvar,custom/greeting,1,1,,4)
exten => s,n,ExecIf($["${myvar}" = "1" ]?System(/path/to/script))
exten => s,n,Hangup
1 Like

wow how nice you are helping me out to get this done!
i think this is exactly what i need…
but it is not working… well jet

when i run this in cli it calls but hangs up after i pickup
channel originate local/[email protected] extension [email protected]

when i run this from command line it also hangs up before pressing a button
asterisk -x “channel originate local/[email protected] extension [email protected]

i did not change the /path/to/script but i gues that shoul only give an error


I did not test it, and I’m on mobile, so could be there’s an error.

First question, did you add these in extensions_custom.conf and reloaded the dialplan?

Can you post a picture how it looks in the config edit module? As mentioned, could be there’s an error.

When running from CLI, do you see anything once you answer the call on ext 5555? Perhaps you can post it?

1 Like

So fine you are helping me!
yes i did add it, and did a reboot or a “core restart now”

ehh what is the config edit module?
you mean this:
exten => s,1,Noop(entering user defined context in extensions_custom.conf)
exten => s,n,Read(myvar,custom/greeting,1,1,4)
exten => s,n,ExecIf($["${myvar}" = “1” ]?System(/home/asterisk/
exten => s,n,Hangup

what i get when i run from cli is:
[2020-02-01 22:45:39] WARNING[2863][C-00000003]: chan_sip.c:23163 func_header_read: This function can only be used on SIP channels.
[2020-02-01 22:45:39] ERROR[2863][C-00000003]: res_pjsip_header_funcs.c:454 func_read_header: This function requires a PJSIP channel.
[2020-02-01 22:45:43] WARNING[2862][C-00000004]: file.c:782 ast_openstream_full: File custom/greeting does not exist in any format
[2020-02-01 22:45:43] WARNING[2862][C-00000004]: file.c:1255 ast_streamfile: Unable to open custom/greeting (format (slin)): No such file or directory

So it successfully calls that context, but it can’t find the audio.

exten => s,n,Read(myvar,custom/greeting,1,1,4)

This line is supposed to play an audio that is uploaded to the PBX.

And since there’s no audio with the name ‘greering’ uploaded, it will just hang up.

Do you want it to play anything?

start off by replacing ’ custom/greeting’ with ‘zombies’

1 Like

no need to play something, but if it makes it no problem for me
what extension does greeting nee to have? mp3? and were do i put it?
i can put an empty audio file i gues


whahahahahahahahaha funny :wink:

replace ‘zombies’ with a comfortable ‘beep’

1 Like

Thanks! But i prefer the zombies! Really cool whaha

But i think i have now what i need :slight_smile:
Only last question is how can i change the dialer id?
Now it is the ip, is it possible to give this a nice name?

That’s set wherever you define your 5555 extension

Agree. But i receive the call from the “cli” or “command line” this show the id on my incoming call with the ip. Is it possible to give that a name?