[asterisk-bugs] [Asterisk 0011943]: Feature to write variables to existing channels other than your own (func chanvar)

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Feb 7 04:59:31 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=11943 
====================================================================== 
Reported By:                ramonpeek
Assigned To:                russell
====================================================================== 
Project:                    Asterisk
Issue ID:                   11943
Category:                   Functions/func_logic
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             02-06-2008 15:08 CST
Last Modified:              02-07-2008 04:59 CST
====================================================================== 
Summary:                    Feature to write variables to existing channels
other than your own (func chanvar)
Description: 
Many, many times I ran into a dialplan issue where I wanted to set a
variable in the called channel whilst the dialplan was running in the
calling channel.
To my frustration an application like ImportVar() existed but something
like ExportVar() did not.

After bumping into the issue a bit too often I deciced to write it myself
:-)
It probably took me less time writing the patch than it took finding out
ways to realize this feature with the current set of applications &
functions :-(

Anyway...
I started out writing the patch for 1.4.17 and called it 'ExportVar'.
But after finding out it was deprecated in the svn-trunk and talking to
Digium (Qwell) about it,
I decided to create a new logical function in func_logic called
'CHANVAR'.
This feature includes read & write making function 'ImportVar' & 'IMPORT'
both obsolete.
Since function 'IMPORT' is only in teh svn-trunk perhaps it should be
removed or deprecated if this patch gets submitted. 

This is how the new feature works;

To read a variable from another channel;
- Set(CHANVAR(channel,variable)=value)

To write a variable to another channel;
- Set(varname=${CHANVAR(channel,variable)})


PS:
For everyone that wants to add this feature (themselves) to Asterisk
1.4.17 a path to backport to 1.4.17 is also uploaded.
====================================================================== 

---------------------------------------------------------------------- 
 ramonpeek - 02-07-08 04:59  
---------------------------------------------------------------------- 
I'm not worried about causing problems in the dialplans of incompetent
people.
If they are really that incompetent they probably wouldn't know how to use
this features ;-)
Besides, I included check and error/notice messages for those who use the
feature incorrectly.

The reason why I mentioned 'if there are no real dangers involved' is that
I could perhaps have overseen an issue where setting a variable in this
manner on a channel might cause unforseen situations.
Perhaps anybody else could try to think about a way that this might cause
problems? 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
02-07-08 04:59  ramonpeek      Note Added: 0081841                          
======================================================================




More information about the asterisk-bugs mailing list