I want the boss’s phone to be silent, wich I can do it using alert-info, but as the header is sent to both phones the secretary’s phone also rings in silence, wich is a problem.
Is there a way to call both at the same time setting different headers?
I noticed I never update this topic, so here it is.
It’s been a few years, but better late than never!
I followed david55 advice and used local channels. The two channels are using different contexts, one with header telling the phone not to ring (the boss), the other (secretary) telling the phone to ring distinctivelly.
Here it is and thank you for all the help!
...
exten => 2848,1,Noop(Bosssecretary 2848 extension)
exten => 2848,n,Set(CALLER=${CALLERID(num)})
exten => 2848,n,Dial(local/2908@secretary&local/2848@boss)
exten => 2848,n,Goto(ext-local,2848,1)
[boss]
exten => _.,1,NoOp()
; the next line tells my yealink phone not to ring
exten => _.,n,SipAddHeader(Alert-Info: <http://nohost>\;info=alert-group\;x-line-id=0)
exten => _.,n,Dial${EXTEN})
exten => _.,n,HangUp()
[secretary]
exten => _.,1,NoOp()
; the next line tells my yealink phone to ring the tone called "bosssec" previously set
exten => _.,n,SipAddHeader(Alert-Info: <http://127.0.0.1/>\;info=bosssec)
exten => _.,n,Dial(SIP/${EXTEN})
exten => _.,n,HangUp()
While I don’t have an immediate example for doing this pre-dial handlers[1] can also be useful in this regard. They execute dialplan logic on each channel before dialing. If you examined the channel name or had a variable on the channel you could know which SIP header to set. It also doesn’t incur the cost of dialing Local channels.