[Home]

Summary:ASTERISK-05659: [patch] Local channel variable behavior - variable inheritance
Reporter:wunderkin (wunderkin)Labels:
Date Opened:2005-11-20 18:08:30.000-0600Date Closed:2008-01-15 16:03:18.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20051128__restore_vars_in_local.diff.txt
Description:Somewhere along the lines between CVS HEAD 11/01 and now, the behavior of variable inheritance has changed.

I am originating a call via the manager, using a local channel with /n, and declaring a variable with __ in the front of it.

Previously, the variable was available on the Local/blah,1 and Local/blah,2 channel but now they only show on Local/blah,2

Can this be changed back?  It doesn't seem right.
Comments:By: Russell Bryant (russell) 2005-11-20 19:36:08.000-0600

Can you provide an example of the Manager originate action and corresponding dialplan you are using to recreate the issue you are seeing?

By: wunderkin (wunderkin) 2005-11-20 21:09:33.000-0600

Action: Originate
Channel: Local/1@test/n
Exten: 123
Context: test
Priority: 1
Variable: __test=1

[test]
exten => 1,1,Dial(SIP/1||Tt)

exten => 123,1,Answer                          
exten => 123,n,DumpChan
exten => 123,n,Wait(999999)                  

This is on CVS HEAD 11/1

   -- Executing Dial("Local/1@test-abcf,2", "SIP/1||Tt") in new stack
   -- Called 1>
   -- SIP/1-a9a9 is ringing
   -- SIP/1-a9a9 answered Local/1@test-abcf,2
      > Channel Local/1@test-abcf,1 was answered.
   -- Executing Answer("Local/1@test-abcf,1", "") in new stack
   -- Executing DumpChan("Local/1@test-abcf,1", "") in new stack
dialer-test*CLI>
Dumping Info For Channel: Local/1@test-abcf,1:
================================================================================
Info:
Name=               Local/1@test-abcf,1
Type=               Local
UniqueID=           1132542221.27
CallerID=           (N/A)
CallerIDName=       (N/A)
DNIDDigits=         (N/A)
State=              Up (6)
Rings=              0
NativeFormat=       64
WriteFormat=        64
ReadFormat=         64
1stFileDescriptor=  -1
Framesin=           3
Framesout=          0
TimetoHangup=       0
ElapsedTime=        0h0m0s
Context=            test
Extension=          123
Priority=           2
CallGroup=          
PickupGroup=        
Application=        DumpChan
Data=               (Empty)
Blocking_in=        (Not Blocking)

Variables:
test=1
================================================================================
   -- Executing Wait("Local/1@test-abcf,1", "999999") in new stack
dialer-test*CLI> show channel Local/1@test-abcf,2
-- General --I>
          Name: Local/1@test-abcf,2
          Type: Local
      UniqueID: 1132542221.28
     Caller ID: (N/A)
Caller ID Name: (N/A)
   DNID Digits: (N/A)
         State: Up (6)
         Rings: 0
  NativeFormat: 64
   WriteFormat: 64
    ReadFormat: 64
1st File Descriptor: -1
     Frames in: 0
    Frames out: 246
Time to Hangup: 0
  Elapsed Time: 0h0m9s
 Direct Bridge: SIP/1-a9a9
Indirect Bridge: SIP/1-a9a9
--   PBX   --
       Context: test
     Extension: 1
      Priority: 1
    Call Group: 0
  Pickup Group: 0
   Application: Dial
          Data: SIP/1||Tt
   Blocking in: ast_waitfor_nandfds
     Variables:
BRIDGEPEER=SIP/1-a9a9
DIALEDPEERNUMBER=1
DIALEDPEERNAME=SIP/1-a9a9
test=1

This is on CVS HEAD 11/20:
   -- Executing Dial("Local/1@test-5ca5,2", "SIP/1||Tt") in new stack
   -- Called 1>
   -- SIP/1-a0f6 is ringing
   -- SIP/1-a0f6 answered Local/1@test-5ca5,2
   -- Executing Answer("Local/1@test-5ca5,1", "") in new stack
   -- Executing DumpChan("Local/1@test-5ca5,1", "") in new stack
dialer-test*CLI>
Dumping Info For Channel: Local/1@test-5ca5,1:
================================================================================
Info:
Name=               Local/1@test-5ca5,1
Type=               Local
UniqueID=           1132542479.0
CallerID=           (N/A)
CallerIDName=       (N/A)
DNIDDigits=         (N/A)
State=              Up (6)
Rings=              0
NativeFormat=       64
WriteFormat=        64
ReadFormat=         64
1stFileDescriptor=  -1
Framesin=           3
Framesout=          0
TimetoHangup=       0
ElapsedTime=        0h0m0s
Context=            test
Extension=          123
Priority=           2
CallGroup=          
PickupGroup=        
Application=        DumpChan
Data=               (Empty)
Blocking_in=        (Not Blocking)

Variables:
================================================================================
   -- Executing Wait("Local/1@test-5ca5,1", "999999") in new stack
Local/1@test-5ca5,1  Local/1@test-5ca5,2  
dialer-test*CLI> show channel Local/1@test-5ca5,2
-- General --I>
          Name: Local/1@test-5ca5,2
          Type: Local
      UniqueID: 1132542479.1
     Caller ID: (N/A)
Caller ID Name: (N/A)
   DNID Digits: (N/A)
         State: Up (6)
         Rings: 0
  NativeFormat: 64
   WriteFormat: 64
    ReadFormat: 64
1st File Descriptor: -1
     Frames in: 0
    Frames out: 443
Time to Hangup: 0
  Elapsed Time: 0h0m12s
 Direct Bridge: SIP/1-a0f6
Indirect Bridge: SIP/1-a0f6
--   PBX   --
       Context: test
     Extension: 1
      Priority: 1
    Call Group: 0
  Pickup Group: 0
   Application: Dial
          Data: SIP/1||Tt
   Blocking in: ast_waitfor_nandfds
     Variables:
BRIDGEPEER=SIP/1-a0f6
DIALEDPEERNUMBER=1
DIALEDPEERNAME=SIP/1-a0f6
test=1

Notice on 11/01 the variable shows on ,1 and ,2 but on 11/20 it only shows on ,2

By: Tilghman Lesher (tilghman) 2005-11-20 23:12:47.000-0600

We changed it for another reason:  variable inheritance.  Currently, because the Local channel is just a proxy, we set up the new channel (the channel which Local becomes) to have a single inheritance from the old channel, which means that the new channel inherits variables with a single underscore.

For what purpose do you need the variables to be preserved in the proxy channel?  Also, if you remove the nonoptimization flag from your Local channel (/n), does that fix your issue?

By: wunderkin (wunderkin) 2005-11-20 23:21:27.000-0600

I'm pretty sure that it didn't work without the /n.  It is just due to the way I have my dialplan setup.  It was probably changed due to one of my other bugs :D

I need the variables on both sides :(

Is there a way to compromise and still keep whatever behavior intact that you were hoping for?

Or can you show me what to change so I can keep the behavior on my local copy? :D



By: Tilghman Lesher (tilghman) 2005-11-23 14:02:00.000-0600

You're welcome to test this patch.

By: wunderkin (wunderkin) 2005-11-25 15:31:05.000-0600

Thanks.  I should be able to try it Monday.

By: Bruno Voigt (bvoigt) 2005-11-28 15:03:03.000-0600

Hi,
I tried the patch for my problem 5876.
It basically works and fixed the problem in the derived contexts, but in the initial /Local context initiating the call a variable now returns garbage.

I get now:

  -- Attempting call on Local/04109555907553@test-ic3s-dial for s@test-ic3s:1 (Retry 1)
   -- Executing NoOp("Local/04109555907553@test-ic3s-dial-bd6a,2", "SMIDA=sà") in new stack

Without the patch the last line showed the correct content of __SMID1 __SMID2 __SMID3

  -- Executing NoOp("Local/04109555907553@test-ic3s-dial-a954,2", "SMIDA=TEST05101413332568405") in new stack

By: Tilghman Lesher (tilghman) 2005-11-28 15:27:16.000-0600

Okay, modified a little bit, try this patch, now.

By: Bruno Voigt (bvoigt) 2005-11-29 03:52:55.000-0600

20051128__restore_vars_in_local.diff.txt fixed the problem for me (bug 5876) !

What are the plan for integrating the final patch into asterisk?
Will it be the default behaviour or will a new Dial() command option be added?

bye, Bruno

By: Tilghman Lesher (tilghman) 2005-11-29 08:44:14.000-0600

Default behavior

By: Kevin P. Fleming (kpfleming) 2005-12-01 18:26:20.000-0600

Committed to branch 1.2, will auto-merge to trunk. Thanks!

By: Digium Subversion (svnbot) 2008-01-15 16:03:05.000-0600

Repository: asterisk
Revision: 7270

U   branches/1.2/channels/chan_local.c

------------------------------------------------------------------------
r7270 | kpfleming | 2008-01-15 16:03:05 -0600 (Tue, 15 Jan 2008) | 2 lines

allow variables to exist on both 'halves' of the Local channel (issue ASTERISK-5659)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=7270

By: Digium Subversion (svnbot) 2008-01-15 16:03:11.000-0600

Repository: asterisk
Revision: 7276

_U  trunk/
U   trunk/Makefile
U   trunk/UPGRADE.txt
U   trunk/apps/app_festival.c
U   trunk/apps/app_page.c
U   trunk/apps/app_voicemail.c
U   trunk/channel.c
U   trunk/channels/chan_agent.c
U   trunk/channels/chan_local.c
U   trunk/channels/chan_sip.c
U   trunk/configs/voicemail.conf.sample
U   trunk/doc/README.misdn
D   trunk/patches/
U   trunk/pbx.c

------------------------------------------------------------------------
r7276 | kpfleming | 2008-01-15 16:03:10 -0600 (Tue, 15 Jan 2008) | 57 lines

Merged revisions 7265-7266,7268-7275 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r7265 | oej | 2005-12-01 17:18:14 -0600 (Thu, 01 Dec 2005) | 2 lines

Changing bug report address to the Asterisk issue tracker

........
r7266 | kpfleming | 2005-12-01 17:18:29 -0600 (Thu, 01 Dec 2005) | 3 lines

Makefile 'update' target now supports updating from Subversion repositories (issue ASTERISK-5722)
remove support for 'patches' subdirectory, it's no longer useful

........
r7268 | kpfleming | 2005-12-01 17:34:58 -0600 (Thu, 01 Dec 2005) | 2 lines

ensure channel's scheduling context is freed (issue ASTERISK-5638)

........
r7269 | kpfleming | 2005-12-01 17:49:44 -0600 (Thu, 01 Dec 2005) | 2 lines

don't block waiting for the Festival server forever when it goes away (issue ASTERISK-5729)

........
r7270 | kpfleming | 2005-12-01 18:26:12 -0600 (Thu, 01 Dec 2005) | 2 lines

allow variables to exist on both 'halves' of the Local channel (issue ASTERISK-5659)

........
r7271 | kpfleming | 2005-12-01 18:28:48 -0600 (Thu, 01 Dec 2005) | 2 lines

protect agent_bridgedchannel() from segfaulting when there is no bridged channel (issue ASTERISK-5726)

........
r7272 | kpfleming | 2005-12-01 18:39:00 -0600 (Thu, 01 Dec 2005) | 3 lines

properly handle password changes when mailbox is last line of config file and not followed by a newline (issue ASTERISK-5717)
reformat password changing code to conform to coding guidelines (issue ASTERISK-5717)

........
r7273 | kpfleming | 2005-12-01 18:42:40 -0600 (Thu, 01 Dec 2005) | 2 lines

allow previous context-searching behavior to be used if desired (issue ASTERISK-5745)

........
r7274 | kpfleming | 2005-12-01 18:51:15 -0600 (Thu, 01 Dec 2005) | 2 lines

inherit channel variables into channels created by Page() application (issue ASTERISK-5736)

........
r7275 | oej | 2005-12-01 18:52:13 -0600 (Thu, 01 Dec 2005) | 2 lines

Bug ASTERISK-5753. Improve SIP INFO DTMF debugging output. (1.2 & Trunk)

........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=7276

By: Digium Subversion (svnbot) 2008-01-15 16:03:18.000-0600

Repository: asterisk
Revision: 7284

_U  team/kpfleming/test-for-merging/
U   team/kpfleming/test-for-merging/Makefile
U   team/kpfleming/test-for-merging/UPGRADE.txt
U   team/kpfleming/test-for-merging/apps/app_festival.c
U   team/kpfleming/test-for-merging/apps/app_page.c
U   team/kpfleming/test-for-merging/apps/app_voicemail.c
U   team/kpfleming/test-for-merging/build_tools/make_svn_branch_name
U   team/kpfleming/test-for-merging/channel.c
U   team/kpfleming/test-for-merging/channels/chan_agent.c
U   team/kpfleming/test-for-merging/channels/chan_local.c
U   team/kpfleming/test-for-merging/channels/chan_sip.c
U   team/kpfleming/test-for-merging/configs/voicemail.conf.sample
U   team/kpfleming/test-for-merging/doc/README.jitterbuffer
U   team/kpfleming/test-for-merging/doc/README.misdn
U   team/kpfleming/test-for-merging/doc/README.realtime
D   team/kpfleming/test-for-merging/patches/
U   team/kpfleming/test-for-merging/pbx.c

------------------------------------------------------------------------
r7284 | kpfleming | 2008-01-15 16:03:17 -0600 (Tue, 15 Jan 2008) | 72 lines

Merged revisions 7257,7261,7263,7265-7266,7268-7275 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r7257 | kpfleming | 2005-12-01 13:25:06 -0600 (Thu, 01 Dec 2005) | 2 lines

ensure that 'svn info' output is in the expected language for the script to parse (issue ASTERISK-5727)

........
r7261 | oej | 2005-12-01 15:38:38 -0600 (Thu, 01 Dec 2005) | 2 lines

Fixing some spelling errors, as well as changing "cvs" to "subversion" in misdn documentation.

........
r7263 | oej | 2005-12-01 16:21:13 -0600 (Thu, 01 Dec 2005) | 2 lines

Removing references to 1.1dev, replacing with 1.2, in documentation files.

........
r7265 | oej | 2005-12-01 17:18:14 -0600 (Thu, 01 Dec 2005) | 2 lines

Changing bug report address to the Asterisk issue tracker

........
r7266 | kpfleming | 2005-12-01 17:18:29 -0600 (Thu, 01 Dec 2005) | 3 lines

Makefile 'update' target now supports updating from Subversion repositories (issue ASTERISK-5722)
remove support for 'patches' subdirectory, it's no longer useful

........
r7268 | kpfleming | 2005-12-01 17:34:58 -0600 (Thu, 01 Dec 2005) | 2 lines

ensure channel's scheduling context is freed (issue ASTERISK-5638)

........
r7269 | kpfleming | 2005-12-01 17:49:44 -0600 (Thu, 01 Dec 2005) | 2 lines

don't block waiting for the Festival server forever when it goes away (issue ASTERISK-5729)

........
r7270 | kpfleming | 2005-12-01 18:26:12 -0600 (Thu, 01 Dec 2005) | 2 lines

allow variables to exist on both 'halves' of the Local channel (issue ASTERISK-5659)

........
r7271 | kpfleming | 2005-12-01 18:28:48 -0600 (Thu, 01 Dec 2005) | 2 lines

protect agent_bridgedchannel() from segfaulting when there is no bridged channel (issue ASTERISK-5726)

........
r7272 | kpfleming | 2005-12-01 18:39:00 -0600 (Thu, 01 Dec 2005) | 3 lines

properly handle password changes when mailbox is last line of config file and not followed by a newline (issue ASTERISK-5717)
reformat password changing code to conform to coding guidelines (issue ASTERISK-5717)

........
r7273 | kpfleming | 2005-12-01 18:42:40 -0600 (Thu, 01 Dec 2005) | 2 lines

allow previous context-searching behavior to be used if desired (issue ASTERISK-5745)

........
r7274 | kpfleming | 2005-12-01 18:51:15 -0600 (Thu, 01 Dec 2005) | 2 lines

inherit channel variables into channels created by Page() application (issue ASTERISK-5736)

........
r7275 | oej | 2005-12-01 18:52:13 -0600 (Thu, 01 Dec 2005) | 2 lines

Bug ASTERISK-5753. Improve SIP INFO DTMF debugging output. (1.2 & Trunk)

........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=7284