[Home]

Summary:ASTERISK-15474: Possible problem with IAXVAR
Reporter:Morten Tryfoss (mtryfoss)Labels:
Date Opened:2010-01-20 03:16:32.000-0600Date Closed:2011-06-07 14:08:03
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_iax2
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) testiaxvar.agi
Description:A call comes in one a server. IAXVAR(call_id) is set on the IAX-channel.
Then a dial(Local/..) is done.

When trying to read out IAXVAR(call_id) on the local channel I only get this:
<Local/115@transcontext_220-4c7b;2>AGI Rx << GET VARIABLE IAXVAR(call_id)
<Local/115@transcontext_220-4c7b;2>AGI Tx >> 200 result=1 (ÿÿÿÿ0010|343.6)

It was initially set this way (on the same server):
<IAX2/pbx7-5666>AGI Rx << SET VARIABLE "IAXVAR(call_id)" "pbx3_1263978343.6"
<IAX2/pbx7-5666>AGI Tx >> 200 result=1

The value I get when I read the variable seems to be a mix of the last 5 on the iaxvar ("343.6") and the last 4 of the previously read variable (0010):
<Local/115@transcontext_220-4c7b;2>AGI Rx << GET VARIABLE origcallerid
<Local/115@transcontext_220-4c7b;2>AGI Tx >> 200 result=1 (38600010)

I don't know if this should be possible, but it would be nice if it was. Anyway, the IAXVAR function should return empty or so if not.
Comments:By: Leif Madsen (lmadsen) 2010-01-21 10:39:06.000-0600

And you are for sure running on 1.6.1.13? The crazy 'y' character stuff was supposed to already be fixed.

By: Morten Tryfoss (mtryfoss) 2010-01-21 10:59:10.000-0600

I'm absolutely sure I'm running 1.6.1.13.

Not sure if it has something to say, but the IAXVAR is set on the channel incoming iax channel, then a blind transfer was initiated and the IAX variable was read on a local channel "after" the transfer.

By: Leif Madsen (lmadsen) 2010-01-21 11:06:47.000-0600

OK, sometimes people don't select the right version :)

Can you provide some configuration files and a test plan for how to reproduce this issue? That would be useful for a developer once they are able to work on this issue. Thanks!

By: Morten Tryfoss (mtryfoss) 2010-01-21 13:09:00.000-0600

I've tried a lot now, but I can't reproduce the issue with crazy y's with other code than some internal that I can't publish. Sorry for this.


However, this config will show that the IAX-variables is not kept through an assisted transfer (I wrote blind transfer earlier, but that was wrong). It's a stripped down version of my other code, not requiring any databases and several AGI scripts.

[iaxvar_test]

exten => s,1,answer
exten => s,n,set(TRANSFER_CONTEXT=iaxvar_transfer)
exten => s,n,set(IAXVAR(test)=test123)
exten => s,n,dial(Local/my_number@outgoing/n,,t)

[iaxvar_transfer]

exten => 111,1,noop(${IAXVAR(test)})
exten => 111,n,wait(10)

I you call in to iaxvar_test and then do a blind transfer to '111' the variable will containt the correct information.
But if you do an assisted transfer the variable will be blank.

All IAX and local channels should inherit the IAXVAR's ?

By: Morten Tryfoss (mtryfoss) 2010-01-21 13:50:26.000-0600

I managed to reproduce it now.

Updated asterisk code:
[iaxvar_test]

exten => s,1,answer
exten => s,n,set(TRANSFER_CONTEXT=iaxvar_transfer)
exten => s,n,Set(__origcallerid=38600010)
exten => s,n,set(IAXVAR(call_id)=test123)
exten => s,n,Dial(Local/my_number@outgoing/n,,t)

[iaxvar_transfer]

exten => 111,1,agi(testiaxvar.agi)
exten => 111,n,Wait(10)

You'll also need the testiaxvar.agi to see it (using agi set debug on)
The thing that caused the y's is setting another iax variable to empty just before reading the variable(see the agi script..). Still using assisted transfer like the previous note.

By: Leif Madsen (lmadsen) 2010-01-21 14:53:59.000-0600

Can you try this?

Set(__IAXVAR(call_id)=test123)

By: Morten Tryfoss (mtryfoss) 2010-01-21 15:15:49.000-0600

-- Executing [s@iaxvar_test:4] Set("IAX2/pstn6-13934", "__IAXVAR(call_id)=test123") in new stack
[Jan 21 22:13:22] ERROR[7088]: pbx.c:2899 ast_func_write: Function __IAXVAR not registered

By: Morten Tryfoss (mtryfoss) 2010-01-21 15:20:28.000-0600

One more thing. Even when the set variable fails, the same result after the transfer:
<Local/111@iaxvar_transfer-690d;2>AGI Rx << SET VARIABLE "IAXVAR(queuecall)" ""
<Local/111@iaxvar_transfer-690d;2>AGI Tx >> 200 result=1
<Local/111@iaxvar_transfer-690d;2>AGI Rx << GET VARIABLE origcallerid
<Local/111@iaxvar_transfer-690d;2>AGI Tx >> 200 result=1 (38600010)
<Local/111@iaxvar_transfer-690d;2>AGI Rx << GET VARIABLE IAXVAR(call_id)
<Local/111@iaxvar_transfer-690d;2>AGI Tx >> 200 result=1 (ÿÿÿÿ0010|)


Must have something to do with the empty variable then, since IAXVAR(call_id) doesn't even exist?

By: Leif Madsen (lmadsen) 2010-01-22 10:36:48.000-0600

Ya I thought you could force inheritance to a function, but I guess I'm wrong :)

Well, I'm going to mark this Acknowledged because it seems you don't have an issue when doing a blind transfer, but do when doing an assisted transfer. You're putting the 't' option in the Dial(), so it seems you're using the built-in transfers using the star code set in features.conf?

I'm not 100% sure this is a bug, but I'm going to acknowledge this for now until someone can verify in either direction.

By: Morten Tryfoss (mtryfoss) 2010-01-22 10:54:43.000-0600

Yes, I'm using the integrated transfers defined in features.conf. :)

I'm thinking that it shall inherit the same way on both transfer methods (same as using __ on a regular variable). This is clearly not working.

Thanks a lot.

By: Tilghman Lesher (tilghman) 2010-02-15 14:17:03.000-0600

Okay, are you stating that IAXVARs don't work on a plain jane channel, or after a transfer only?  Because we have never supported them after a transfer.

By: Morten Tryfoss (mtryfoss) 2010-02-19 01:08:42.000-0600

I got those crazy characters after a Dial(Local/xx) too. Anyway, if it's not supported it should return a blank value instead?

By: Tilghman Lesher (tilghman) 2010-02-19 13:38:24.000-0600

Could you come up with a test case please?  I am completely unable to replicate those results:

   -- Executing [8165@digium:1] Set("SIP/103-00000000", "IAXVAR(foo)=bar") in new stack
   -- Executing [8165@digium:2] Set("SIP/103-00000000", "IAXVAR(bar)=foo") in new stack
   -- Executing [8165@digium:3] Dial("SIP/103-00000000", "Local/8166@digium") in new stack
   -- Executing [8166@digium:1] NoOp("Local/8166@digium-c86d;2", "foo=bar, bar=foo") in new stack
   -- Called 8166@digium
   -- Auto fallthrough, channel 'Local/8166@digium-c86d;2' status is 'UNKNOWN'

By: Tilghman Lesher (tilghman) 2010-02-25 15:37:28.000-0600

No response from reporter.

If you're able to work up a test case, please feel free to reopen this issue.