[asterisk-dev] 'IAX2 call variable passing between servers '

Andrew Kohlsmith akohlsmith-asterisk at benshaw.com
Tue Aug 8 08:22:23 MST 2006


On Tuesday 08 August 2006 11:05, Douglas Garstang wrote:
> Still can't understand how a 'Moved Temporarily' SIP message from the
> phone, which causes Asterisk to re-enter the dialplan, can be an IAX2 call.

you have an incoming call from an IAX2 peer.  It enters the dialplan and an 
attempt to Dial(SIP/ua2) is made.  The Dial() fails so the incoming call 
(from the IAX2 peer) tries another ... it's still an IAX2 call looking for a 
place to terminate to.

> I don't think it's an issue of the scripting. My script can only work with
> the variables it receives when Asterisk runs it. If vital info such as
> rdnis and dnid are not set, no amount of logic in the AGI is going to help.
> I don't know what you mean by 'looping calls'... phone sends a moved
> temporarily message back to Asterisk which causes it to re-enter the
> dialplan and try to dial the number moved to. (specified by the SIP
> 'Redirect' header I think).

I'm not talking about DNIS/RDNIS.  I'm talking about the logic in your code 
being flawed, at least from what I understand of it.  If the variables aren't 
set that's one thing, but you don't seem to understand (or we are not 
understanding your situation) that the call *IS* an IAX2 call until it 
completes to a SIP device, at which point it's a hybrid call, neither SIP nor 
IAX2.  Now if the IP501 makes a transfer back into the dialplan, that new leg 
is SIP of course, but that's because Asterisk doesn't know it's part of the 
original call (yet).

> So, in summary, what we are essentially saying here is that IAX2 cannot be
> used to trunk calls between Asterisk systems, when both end-points at SIP
> based devices unless you want to lose SIP functionality. That's really what

When you introduce a new transport protocol you are no longer SIP; of COURSE 
you will lose SIP-specific things.  Just the same as if you had

(10*phone) IAX2 (asterisk) SIP (asterisk) IAX2 (10*phone)

Would you complain that you can't trunk the calls between the 10 phones on the 
left and the 10 phones on the right?  You have SIP in the middle, and 
therefore can't trunk.  

> we are saying here. We've since gotten this to work with SIP trunking
> between the Asterisk systems, and didn't have any of the problems
> associated when using IAX2. It just seems bizarre, because this was exactly
> the type of situation IAX2 was created for... I thought.

Well as others have mentioned... You're the guy with the machete and the 
jungle brush is before you -- you're bound to sink that thing into a sleeping 
ape from time to time...  Tilghman's patch makes things a lot better for you, 
and some of the other things you mention may very well be legitimate bugs...  
If you can simplify the test cases down and present them clearly I am 
positive that they will get corrected.

-A.



More information about the asterisk-dev mailing list