I have been playing around with the idea of making a hot desk solution as simple as possible and I ended up with 10 lines of Asterisk script and it is working
You can add global variables that start with PHONE to represent every registered sip phone and then the number, as much as needed without the need of adding code. You just dial 1111 and enter the number of the line that you want to receive on that particular phone. You can link as many phone numbers to a phone as you like/need.
You have to record a voice prompt that sounds something like:" Please enter the number that you want to receive the calls from on this phone". I hope it will be useful to someone.
Happy coding
/EdW
You can use this Asterisk lines to actually make the recording after you add a “hot desk” directory to /var/lib/asterisk/sounds/
exten => 773,1, PlayBack(hotdesk/instructie)
exten => 773,n, Wait(5)
exten => 773,n, Record(hotdesk/instructie.gsm)
; Voer het telefoonnummer in van de lijn die je op deze telefoon wilt binnen krijgen.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; auteur: Erik de Wild
; mail erik@wildsound.nl
; date: 07-11-2016
; the Netherlands
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; license:
; GPL3. You are free to use it as long as you grand the credits to the auteur. If you copy
; the script please copy this heather (from auteur to [globals]) with it and don’t
; charge money for the script as it is (it is also free for others). If you need adjustments or extras
; or something completely new feel free to contact me.
;
; Happy coding
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[globals]
PHONE5556 => 5556
PHONE5557 => 5557
PHONE5558 => 5558
PHONE5559 => 5559
PHONE1111 => 1111
; etc. etc.
[test]
exten => _XXXX,1,Answer()
exten => _XXXX,n, Set(NUMBER_TO_CALL=${EXTEN}) ; the underscore between NUMBER and To
; doesn’t show on the screen while it is
; really there.
exten => _XXXX,n,Goto(hotdesking,s,1)
[hotdesking]
exten => s,1(begin), NoOp(start hotdesking routine)
exten => s,n, GotoIf($[ “${NUMBER_TO_CALL}” : “1111”]?1111,1)
exten => s,n, Dial(SIP/${PHONE${NUMBER_TO_CALL}})
exten => s,n, Hangup()
exten => 1111,1, Read(HOTDESK_LOGIN,hotdesk/instructie,4)
exten => 1111,n, Set(HOTDESK_LOGIN=PHONE${HOTDESK_LOGIN})
exten => 1111,n, Set(GLOBAL(${HOTDESK_LOGIN})=${CALLERID(num)})
exten => 1111,n, HangUp()