<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Steve Murphy wrote:
<blockquote cite="mid1103657280.3542.12.camel@lurch.wyoming.e-tools.com"
type="cite">
<blockquote type="cite">
<pre wrap="">
--On Tuesday, December 21, 2004 9:37 AM -0700 Steve Murphy
<a class="moz-txt-link-rfc2396E" href="mailto:murf@e-tools.com"><murf@e-tools.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Howdy--
I'm playing with different IAX softphones. I've got DIAX and
</pre>
</blockquote>
<pre wrap="">IAXPHONE on
</pre>
<blockquote type="cite">
<pre wrap="">a windows (XP) machine on my network, and I'm running asterisk on a
newly loaded Fedora Core 3 machine.
I set up a separate IAX account for each phone. I was EXPECTING them
to each register seperately with asterisk....
But I am swiftly finding out, that ONLY one registers. The first one
to start running, gets to register with Asterisk, and the other is
</pre>
</blockquote>
<pre wrap="">left
</pre>
<blockquote type="cite">
<pre wrap="">out in the cold. Am I seeing things right? Is this the way it
</pre>
</blockquote>
<pre wrap="">should
</pre>
<blockquote type="cite">
<pre wrap="">be, or is something wrong?
Many thanks!
</pre>
</blockquote>
<pre wrap="">Hmmm... two IAX clients on one IP address, both trying to bind to
port
4569?
I haven't tried it to see, but I'm not surprised it doesn't work.
</pre>
</blockquote>
<pre wrap=""><!---->
You are saying the clients bind to 4569? You mean, an IAX client is
also a server? I always pictured clients accessing 4569 on the remote
machine they want to register with, and then they have a connection,
like email servers, web servers, ftp servers, etc. Once the connection
is made, the server can send signalling to it.
Am I picturing this wrong?
</pre>
</blockquote>
iaxclient tries to bind to port 4569, but should use a transient port
if binding to port 4569 fails. This makes it possible for iaxclient
to receive calls without requiring registration. I've never tested
this on windows, but it works fine under Linux. <br>
<br>
Here's the code:<br>
if (preferredportno > 0) {<br>
sin.sin_family = AF_INET;<br>
sin.sin_addr.s_addr = 0;<br>
sin.sin_port = htons((short)preferredportno);<br>
if (bind(netfd, (struct sockaddr *) &sin,
sizeof(sin)) < 0) {<br>
DEBU(G "Unable to bind to preferred port.
Using random one instead.");<br>
}<br>
}<br>
sinlen = sizeof(sin);<br>
if (getsockname(netfd, (struct sockaddr *) &sin,
&sinlen) < 0) {<br>
close(netfd);<br>
netfd = -1;<br>
DEBU(G "Unable to figure out what I'm bound to.");<br>
IAXERROR "Unable to determine bound port number.");<br>
}<br>
<br>
The situation you describe should work; you will have failures,
though, if both clients try to access the same audio devices, and your
drivers/os don't permit that.<br>
<br>
-SteveK<br>
<br>
<br>
<br>
<br>
</body>
</html>