with an (attended) transfer i see the following happening:
1) A calls B1
2) B2 calls C
3) B2 transfers call to A
4) A talks to C
At step 3, the channel A is connected to channel C and B1 and B2 are hung up. In the h extension for channel B2, the channel is renamed to B2 and i see that the channel variables of A have been merged into B2. If there were duplicate names for variables, the channel now has those variables doubled. The DumpChan() application called from the h extension confirms this.
In my case the channels are all SIP channels and in the h extension I want to access the SIPCALLID variable of the A channel. Every access to it gives me the wrong value namely that of channel B1. How do i access the second variable named SIPCALLID in the channel?
Ugly solution:
A solution I have found is to go from:
same => n,Set(myVariable=10)
same => n,NoOp(The value of myVariable is ${myVariable})
to:
same => n,Set(${CHANNEL:6:8}myVariable=10)
same => n,NoOp(The value of myVariable is ${${CHANNEL:6:8}myVariable})
With this trick I am appending the id of the channel to all the variables. I have to use the 6:8 because once I transfer the call the channel id now contains <ZOMBIE>. I do not want to append ${CHANNEL:6:8} to all my variables. What do you guys recommend?
_or__do they? This kind of sounds like variable inheritance: wiki.asterisk.org/wiki/display/AST/Variable+Inheritance - QuickDanger