Hi there,
I try to originate a call by CLI and send the call to an extension (my “phone audio” project at ControlPlayback: Wait for other DTMF while playback) which plays an audio file automatically.
My outbound SIP is:
register=raspbx2020:XXXXXXXX@192.168.123.1/raspbx2020
[fritzbox]
defaultuser=raspbx2020
secret=XXXXXXXX
type=peer
dtmfmode=rfc2833
insecure=port,invite
host=192.168.123.1
fromdomain=fritz.box
fromuser=raspbx2020
nat=no
context=line1
allow=g722
With “line1” as context so it autmatically executes this snippet:
[line1]
exten => raspbx2020,1,Answer()
same => n,Set(VOLUME(TX)=2,p) ; p option allows * and # to increase and decrease volume
same => n,AGI(/var/lib/asterisk/playback/pbxaudiobackend_randomfile.pl) ; modify your AGI to just set randomFile only
same => n,ControlPlayback(${randomFile},5000,9,7,0,5,1) ; no more * to restart - also the call control is out of AGI and back in your dial plan quickly
This seems to be a simple task but it didn’t manage to solve it. Do I have to use “Dial” instead of “Answer” in any way?
I initiate the call by entering:
asterisk -rx 'channel originate SIP/0175XXXXXXXX@fritzbox extension line1'
And indeed my phone rings but it terminates immediately with the following error:
[2020-07-25 16:59:41] WARNING[13250][C-00000022]: pbx.c:4453 __ast_pbx_run: Channel 'SIP/fritzbox-00000020' sent to invalid extension but no invalid handler: context,exten,priority=default,line1,1
Maybe no problem for you experts but I don’t know how to solve this
Why is the extension “invalid”? Because it’s capable of answering incoming calls …
Thanks for any suggestions,
Nico