[Asterisk-Dev] Multiple Asterisks on one machine

Chris Wilson chris at netservers.co.uk
Mon Feb 16 05:44:58 MST 2004

Hi all,

I need to get a jitter buffer between my SIP phones and my CAPI ISDN
lines, to fix stuttering sound on the CAPI lines.

I asked the mailing list a while about whether anyone would be interested 
in modularising the IAX jitter buffer into a generic buffer that would 
work with SIP, H.323, etc. but disappointingly nobody responded that they 
would find it useful. 

Hence I'm trying to find a way to use the existing facilities. I've tested
it using two machines running Asterisk, and it works very well, improves
the quality greatly. Now I'm trying to get it working using a single
machine, by running two Asterisk processes on the same machine. This is
proving trickier than expected, and I could use some advice.

First of all I split my single configuration in two, placing the config 
files in /etc/asterisk-sip and /etc/asterisk-capi. The CAPI configuration 
is almost untouched for now, since I'm just testing this arrangement, but 
the SIP configuration is stripped right down to remove unnecessary modules 
that might conflict with the other process.

First I wanted to simply run IAX2 on a different port between the two 
Asterisk processes, but that doesn't appear to be possible because 
chan_iax2 currently ignores the port option. The code to process it is 
disabled, but enabling it doesn't seem to help.

So instead, I allocated a new IP address to the machine, and bound each 
Asterisk process's CAPI server to its own IP address. netstat -anp shows 
the two processes bound to different IP addresses:

udp        0      0*	8617/asterisk
udp        0      0*   8418/asterisk
udp        0      0  *   8418/asterisk
udp        0      0  *   8617/asterisk
udp        0      0*   8617/asterisk
udp        0      0*   8418/asterisk

The CAPI process is fine and running normally. However, when I start the 
SIP process, they start jabbering at each other like crazy, generating 
enormous amounts of debug logs and loopback network traffic. The SIP 
server IAX2 debug shows:

Rx-Frame Retry[No] -- OSeqno: 000 ISeqno: 000 Type: IAX     Subclass: VNAK
   Timestamp: 02645ms  SCall: 00225  DCall: 00006 []
Tx-Frame Retry[002] -- OSeqno: 000 ISeqno: 001 Type: IAX    Subclass: PONG
   Timestamp: 00001ms  SCall: 00006  DCall: 00225 []

over and over again, very fast. I don't think this is looping back into 
the same process, as tcpdump shows:

12:32:53.795637 > udp 12 [tos 0x10]
12:32:53.795868 > udp 12 [tos 0x10]
12:32:53.796309 > udp 12 [tos 0x10]
12:32:53.796580 > udp 12 [tos 0x10]

Can anyone explain to me what's happening here? Why is the SIP process
using its own IAX2 port (4569) to talk to the IAX1 port (5036) of the
other process? I was expecting to see 4569 -> 4569, but I'm no expert on
the IAX protocols. What are they saying to each other? why send an
unsolicited PONG, why VNAK, and why the retry?

Cheers, Chris.
_  __ __     _
 / __/ / ,__(_)_  | Chris Wilson -- UNIX Firewall Lead Developer |
/ (_  ,\/ _/ /_ \ | NetServers.co.uk http://www.netservers.co.uk |
\__/_/_/_//_/___/ | 21 Signet Court, Cambridge, UK. 01223 576516 |

More information about the asterisk-dev mailing list