[RESOLVED]: Different SIP Headers in the same Dial command

Hi,

I have a boss-secretary functionality that dials both phones at once and works something like this:

XXXX,1,SIPAddHader(Alert-info: yadayadayada: silent-ring ) XXXX,n,Dial(SIP/BOSS&SIP/SECRETARY)

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 also very much apreciate other ideas!

You might be able to do this using local channels.

Hi david55

Apreciate the help, but could you be more specific? maybe an example.

Use & with two local channels. Do not answer in the local channel dialplan. Set the header and do a simple dial.

Got it, thank you!

Will test and post anything helpful for others!

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()

Thank you all for the support.

1 Like

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.

[1] wiki.asterisk.org/wiki/display/ … l+Handlers