[Home]

Summary:ASTERISK-27443: Add a dynamic feature on callee channel
Reporter:Thomas Sevestre (to)Labels:
Date Opened:2017-11-22 11:34:56.000-0600Date Closed:2017-11-23 13:20:40.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I want to activate a dynamic feature on callee channel only.

According to the documentation, "ActivatedBy is no longer honored. The feature is activated by which channel DYNAMIC_FEATURES includes the feature is on. Use predial to set different values of DYNAMIC_FEATURES on the channels"

https://wiki.asterisk.org/wiki/display/AST/Custom+Dynamic+Features

With the variable inheritance system, it is not possible to set a variable on the callee channel only. With DYNAMIC_FEATURES, _DYNAMIC_FEATURES, __DYNAMIC_FEATURES caller channel will always have the feature enabled

I've tried to add a the DYNAMIC_FEATURES variable on the callee channel after bridge, it doesn't work.

We could add the ability to add a variable on the callee channel. for instance :
{quote}
   Set(*DYNAMIC_FEATURES=test)
{quote}
This can be implementeded in channel.c / ast_channel_inherit_variables

by replacing this line :
{quote}
if (varname[0] == '_') {
{quote}
with this one :
{quote}
if (varname[0] == '_' || varname[0] == '*') {
{quote}
If interested I'll provide the patch in gerrit
Comments:By: Asterisk Team (asteriskteam) 2017-11-22 11:34:56.292-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Richard Mudgett (rmudgett) 2017-11-22 12:48:05.332-0600

{quote}
According to the documentation, "ActivatedBy is no longer honored. The feature is activated by which channel DYNAMIC_FEATURES includes the feature is on. Use predial to set different values of DYNAMIC_FEATURES on the channels"
{quote}

You can *already* do what you want.  To have a difference between caller and callee you cannot use channel variable inheritance.  You need to use *predial handlers* \[1] to set DYNAMIC_FEATURES on the called side like the below dialplan example:
{noformat}
exten 100,1,NoOp()
same = n,Set(DYNAMIC_FEATURES=caller side settings)
same = n,Dial(PJSIP/100,,b(predial))
same = n,Hangup()
; This pre-dial routine is executed by the called channel.  PJSIP/100-xxxxxxxx in this case.
same = n(predial),NoOp()
same = n,Set(DYNAMIC_FEATURES=called/callee side settings)
same = n,Return()
{noformat}

The reason ActivatedBy is no longer honored is because the bridging system since Asterisk 12 cannot support it.  The bridge can have more than two channels and channels can be moved from bridge to bridge so a caller and callee designation does not make much sense.

More information on dialplan handler routines can be found at \[2].

\[1] https://wiki.asterisk.org/wiki/display/AST/Pre-Dial+Handlers
\[2] http://blogs.asterisk.org/2017/03/29/dialplan-handler-routines-allow-customization/

By: Thomas Sevestre (to) 2017-11-23 07:24:20.731-0600

Thanks it works
I was not aware of predial handlers