For my hotdesking solution, using “standard” hints and device state is a bit tricky.
I think about using custom device state.
However to initialize properly those custom device state, I would need to execute a specific extension in my dialplan when asterisk reload or when the dialplan reload.
Thanks for your feedback. If I understand correcly #exec allows to call a script that will generate a portion of the extensions.conf. It’s an interesting feature but I don’t think it will fit my need.
Here is what I have put in place until now :
Defined context [startup] in extensions.conf with :
[startup]
exten => 1,1,NoOp(startup)
same => n,Set(DEVICE_STATE(Custom:201)=BUSY)
same => n,Set(DEVICE_STATE(Custom:202)=INUSE)
same => n,Hangup()
in cli.conf, add line : console dial 1@startup = yes
At least it works for asterisk restart.
For dialplan reload, I still need to think about it
For dialplan reload, I still need to think about it ;-)"
I would ask: “when does a dialplan reload occur?”
If it’s a manual process, or something scripted as part of a cron job etc,
then why not just append a command to place a call to your startup context
after the reload?
Are there any circumstances under which a dialplan reload occurs
“spontaneously” in the background, and a dial command couldn’t easily be added
to it?
I think they are suggesting running it for side effects, only. However, its seems to me that it is run before the dialplan is fully loaded, so the call file will fail, if it runs too soon, and you could probably get the same effect by doing it from the system startup script for Asteirk.
Just an idea, but you can open your own programmatic connection to the Asterisk console socket. You might be able to use this to recognize the message displayed when a reload command is executed. Alternatively, you can send your own reload command, followed by submission of an Originate request or whatever else you want to do.
I sadly have nothing to add, but I though I should say thanks for showing me how to do something I’ve wanted to do for many years. How to run a dialplan context at startup. When I forget to do it manually, I break the system and it annoys my wife, so thank you so much.