Play Sound in Caller Channel

Hi,

we have a working setup where a sip station (doorbell) is calling a phone at the reception.
The receptionist is typing the pound key to trigger a script to open the door.

Now I want to be able to play a soundfile to the caller (doorbell sip station).
Since I’m using a pre-dial handler to only allow the callee (receptionist) to open the door, only he is hearing the soundfile but not the caller (doorbell).
How can I achieve this?

Here is the code I’m using:

extensions_custom.conf:
[doorbell]
exten => s,1,Noop(doorbell context now, dynamicfeatures was set)
exten => s,n,Dial(PJSIP/11&PJSIP/12,,ob(doorbellhandler^callee_handler^1))
exten => s,n,Return()

[doorbellhandler]
exten => callee_handler,1,NoOp()
same => n,Set(__DYNAMIC_FEATURES=opendoor) ;now dynamic features can be activated by the callee's channel only. The documentation says "The feature is activated by which channel DYNAMIC_FEATURES includes the feature is on". 
same => n,Return()

[macro-incall3]
exten => s,1,Noop(incall context now)
exten => s,n,System(/home/script/opendoor.sh)
exten => s,n,Playback(custom/door-opened)
exten => s,n,Hangup()

features_applicationmap_custom.conf:
opendoor=> #,caller,Macro,incall3

Thanks for any advice :slight_smile:

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.