[Home]

Summary:ASTERISK-07388: Problem calling from an IAX client to a SIP client on 2 different *'s, connected by DUNDi
Reporter:Guus Houtzager (guus)Labels:
Date Opened:2006-07-24 08:42:31Date Closed:2006-08-03 10:51:09
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) debug_info_both_asterisks.txt
( 1) iaxdebug.txt
Description:Hi,
I've got a bit of a problem with my setup. I've got 2 asterisks who are
connected using dundi over iax. Both asterisks use the realtime stuff to
fetch sip and iax client information from a mysql database. As long as all
clients are sip, everything works great. With iax clients however I've got a
problem.
Situation is as follows:
I've registered an iax softphone (I tried both idefisk and iaxComm, same
result) with number 1003 on server hub1. I've registered a sip client with
number 1001 on server hub2.
If the iax client calls 1001, something goes wrong with native bridging.
If I pick up the call of the sip phone (1001), then I can see the asterisk
where 1003 is registered (hub1) going for native bridging and thinks it
works, but the iax softphone keeps ringing and has no clue the other side has
picked up.
If the sip clients dials the iax client on 1003, everything works just fine. This way hub1 also tries to native bridge the connections, but then everything works great. Which makes me think I've stumbled upon a bug as it works one way, but not the other.

This is what I see on the cli's in the situation where it goes wrong:
hub1 (has ip 10.10.1.31, iax client has ip 10.10.180.210):
   -- Accepting AUTHENTICATED call from 10.10.180.210:
      > requested format = gsm,
      > requested prefs = (),
      > actual format = gsm,
      > host prefs = (gsm|ulaw|alaw),
      > priority = mine
   -- Executing ChanIsAvail("IAX2/1003-1", "SIP/1001|sj") in new stack
   -- Executing ChanIsAvail("IAX2/1003-1", "IAX2/1001|sj") in new stack
   -- Executing Goto("IAX2/1003-1", "lookupdundi|1001|1") in new stack
   -- Goto (lookupdundi,1001,1)
   -- Called priv:oIKeEUppyhc+NoU81ITgJQ@10.10.1.32/1001
   -- Call accepted by 10.10.1.32 (format gsm)
   -- Format for call is gsm
   -- IAX2/10.10.1.32:4569-3 is ringing
   -- IAX2/10.10.1.32:4569-3 stopped sounds
   -- IAX2/10.10.1.32:4569-3 answered IAX2/1003-1
   -- Attempting native bridge of IAX2/1003-1 and IAX2/10.10.1.32:4569-3
   -- Channel 'IAX2/10.10.1.32:4569-3' ready to transfer
   -- Channel 'IAX2/1003-1' ready to transfer
   -- Releasing IAX2/1003-1 and IAX2/10.10.1.32:4569-3
   -- Hungup 'IAX2/10.10.1.32:4569-3'
   -- Hungup 'IAX2/1003-1'

hub2 (has ip 10.10.1.32)
  -- Accepting AUTHENTICATED call from 10.10.1.31:
      > requested format = gsm,
      > requested prefs = (),
      > actual format = gsm,
      > host prefs = (),
      > priority = mine
   -- Executing Dial("IAX2/10.10.1.31:4569-1", "SIP/1001||") in new stack
   -- Called 1001
   -- SIP/1001-081980d8 is ringing
   -- SIP/1001-081980d8 answered IAX2/10.10.1.31:4569-1
   -- Hungup 'IAX2/10.10.1.31:4569-1'

All servers and clients are in the same /16, no firewalls etc.
I tried Asterisk 1.2.7 and 1.2.10, where both have the same result.

I can fix it by disabling native bridging (canreinvite=no for the sip client
and notransfer=yes for the iax client), but shouldn't Asterisk handle this
situation without these settings?

Config files and debug output are available on request.

Thanks for your time and effort!
Comments:By: Joshua C. Colp (jcolp) 2006-07-28 14:17:27

Can you provide an iax2 debug so we can see the packet exchange?

By: Guus Houtzager (guus) 2006-07-31 06:25:23

Hi,

I've uploaded a file with iax2 debug information of hub1.
Thanks!

Regards,

Guus

By: Joshua C. Colp (jcolp) 2006-07-31 10:31:25

Everything looks fine in that iax2 debug, I mean audio is even flowing. Can you try to explain your issue a bit more clearly? This sounds like a really interesting issue...

By: Guus Houtzager (guus) 2006-08-01 03:43:49

Hi,

Sure, I'll give it a go.
Situation:
2 asterisk 1.2.10 servers, hub1 and hub2, which both use realtime info (sip.conf and iax.conf) from a shared mysql database. They are connected with a dundi link over iax2. The idea is to create a cluster where it doesn't matter where a client connects, but it can always connect to other clients on all of the asterisk servers. This works fine with sip clients. If I register a sip client 1001 on hub2 and 1002 on hub1, they can call each other just fine. However, if I mix sip and iax clients, I've got a problem. If I register a sip client on one hub and an iax client (1003) on the other, the sip client can call the iax client succesfully, but not the other way around. If the iax client calls the sip client (so calling 1001), the sip phone ring and the iax client ring. Then I pick up the sip phone (which ofcourse stops ringing), but the iax client keeps on ringing and apperently has no clue the other side picked up. The asterisk which does the native bridging (in this case that's the asterisk where the iax client has registered) thinks it can bridge these calls (which is what you saw), but something is going wrong.
The sip client is a grandstream budgetone 101, the iax client is a softphone (I tried idefisk and iaxcomm).

Summary:
sip client (1001) <-> hub2 <- dundi/iax2 -> hub1 <-> iax client (1003)
1001 calls 1003: works fine, hub1 native bridges the bridges the dundi/iax2 channel for 1001 with the iax channel for 1003
1003 calls 1001: hub1 native bridges the dundi/iax2 channel for 1001 with the iax channel for 1003, but 1003 has no clue that 1001 has picked up the call.
If both 1001 and 1003 are sip clients, all works just fine.
All clients and servers are in the same subnet, so no routers or nat or anything which can muddle things.

I hope this makes it more clear!

Regards,

Guus

By: Guus Houtzager (guus) 2006-08-01 09:48:16

Hi again,

This is getting weirder and weirder. I made some changes to both asterisk machines (not asterisk related, config is as it was) and decided to reboot them. After they both came back up, I couldn't for the life of me recreate the situation as I've been describing. But now I've got a new problem: there is no sound going from the sip client to the iax client, no matter who started the call. A side effect of this is that if the sip client hangs up the phone, the iax client doesn't notice this; after about 35 seconds the iax client detects an idle timeout and disconnects. If I do not disconnect the sip client, the connection just stays open. If I press the disconnect button on the iax client the connection drops just like it should.
However if both the sip client and the iax client are connected to the same asterisk everything is still peachy. So I keep suspecting that there's something fishy going on with the bridging of an iax channel with an dundi/iax channel.
Would tcpdump info help in this matter? What would you like to see?

Quick situation sketch:
sip client (1001) <-> hub1 <- dundi/iax2 -> hub2 <-> iax client (1003)
after 1001 calls 1003 (arrows show audio direction that works):
sip client (1001) <- hub1 <- iax2 dundi channel bridged with iax client (1003)

Regards,

Guus

By: Guus Houtzager (guus) 2006-08-01 10:14:43

And hi again again :)

Well, looks like I'm a step closer. I downloaded another soft phone, this time explicitly an IAX2 softphone: ephone from http://www.diamondcard.us and to my astonishment this one works just fine! So far, no problems.
So should I have read documentation better and have known that you can't mix&match dundi/iax2 with iax clients only with (explicit) iax2 clients??
If that's the case then I'm sorry for bothering you!

Thanks!

Guus

By: Joshua C. Colp (jcolp) 2006-08-01 11:08:31

Can you get me an iax2 debug from both sides? That would rock...

By: Guus Houtzager (guus) 2006-08-02 04:07:02

Hi,

I uploaded a file with debug information. It wasn't entirely clear to me what you wanted to see, so I put in debug information for both asterisks and for both situations (a working iax client and a non-working client).
Hth!

Regards,

Guus

By: Joshua C. Colp (jcolp) 2006-08-02 11:36:10

Here's my interpretation of what is happening for a failed call:

1. 1003 calls hub1 (IAX2)
2. hub1 calls hub2 (IAX2)
3. hub2 calls 1001 (SIP)
4. 1001 answers
5. 1003 native transfers to hub2 (IAX2)
6. hub1 drops out of the entire call
7. 1001 hangs up
8. hub2 tells 1003 directly that 1001 hung up
9. 1003 acknowledges this
10. 1003 seems to ignore this and behave as though the call is still up.
11. 1003 sends PING requests for the call to hub2, while hub2 has no idea about the call since it is gone.
12. 1003 eventually gives up on the call and hub2 continues to have no idea since the call is already gone.

On a working call both IAX2 phones must talk to eachother so Asterisk isn't involved at all.

I would see if you can get any debug information from 1003.

By: Guus Houtzager (guus) 2006-08-03 07:25:09

Hi,

Unfortunately both iax clients which failed can't provide debug info :(
I found an IAX hardphone (noname Chinese thing) somewhere in the building which also works just fine. In addition to this I found this on the idefisk forum:
http://www.asteriskguru.com/board/idefisk-answer-problem-vt1092.html
There a user has a similar problem and is told to use a notransfer=yes setting (without saying why). Which also fixes it in my setup.
So I think we can chalk this whole thing up to implementation issues with several clients. Unless you want to debug further, with which I'll happily help ofcourse?

In any case: thanks for your time and effort!

Regards,

Guus

By: Joshua C. Colp (jcolp) 2006-08-03 10:51:08

Determined to be a client implementation problem.