<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Message</TITLE>
<META content="MSHTML 5.00.2919.6307" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=441052716-06072004>Hi
all,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=441052716-06072004>I have been
experimenting with Ser and b2bua, and a Grandstream Budge Tone 100 SIP
phone, although the same problem occurs for Cisco ATAs &
softphones.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=441052716-06072004>When I try to make a
call, the call will succeed, but there are a number of issues at the
moment</SPAN></FONT></DIV>
<UL>
<LI><FONT face=Arial size=2><SPAN class=441052716-06072004>it takes a long
amount of time to connect, usually over 10 seconds. In some cases, it will
connect even when the caller has disconnected</SPAN></FONT></LI>
<LI><FONT face=Arial size=2><SPAN class=441052716-06072004>with b2bua in
between the Ser and the SIP gateway, the return code is 484 - Address
Incomplete</SPAN></FONT></LI>
<LI><FONT face=Arial size=2><SPAN class=441052716-06072004>without b2bua, the
return code is 408 - Request Timeout</SPAN></FONT></LI>
<LI><FONT face=Arial size=2><SPAN class=441052716-06072004>the Ser gets into a
loop when receiving an ACK.</SPAN></FONT></LI></UL>
<DIV><FONT face=Arial size=2><SPAN class=441052716-06072004>I have a feeling
that these are all related, and could be down to the ser.cfg
file.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=441052716-06072004>Below is the ser.cfg
file.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=441052716-06072004>Any and all help
would be appreciated.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004>Regards,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004>Derek</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=441052716-06072004>#
------------------------- request routing logic
-------------------</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=441052716-06072004># main routing
logic</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004>route{<BR></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=441052716-06072004># Standard
max_forward_header checks...</DIV></SPAN></FONT>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004> </DIV></SPAN></FONT>
<DIV><FONT face=Arial size=2><SPAN class=441052716-06072004># A REGISTER is when
a client attempts to register with a SIP
Server<BR>
if(method=="REGISTER")<BR>
{<BR>
if (!performRegistration("4ecalls.com"))
{<BR>
sl_send_reply("404", "Not
Found");<BR>
break;<BR>
};</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004>
save("location");</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004>
sl_send_reply("200", "OK");<BR>
};</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=441052716-06072004># It is an attmept
to make a call</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004>
if(method=="INVITE")<BR>
{<BR>
sl_send_reply("100",
"Trying..");<BR>
log("Attempting to re-route call ...\n");</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004><BR></SPAN></FONT><FONT face=Arial size=2><SPAN
class=441052716-06072004>
# native SIP destinations are handled using our USRLOC
DB<BR>
if
(!lookup("location"))<BR>
{</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004><BR></SPAN></FONT><FONT face=Arial size=2><SPAN
class=441052716-06072004># If we get to here, we intend to re-route throgh a
PSTN
network<BR>
log("Lookup failed
...\n");<BR>
sl_send_reply("100",
"Trying..");<BR>
if
(performInvite("4ecalls.com"))<BR>
{<BR>
log("Am checking to see if it is in our domain...\n");<BR></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004>
if(uri=~"^sip:0[0-9]*")<BR>
{<BR>
log("Am really attempting to re-route call \n");</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004>
rewritehostport("<SIP GATEWAY
IP>:5060");<BR>
forward(<SIP GATEWAY IP>, 5060);</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=441052716-06072004># This should
forward to the B2BUA
server<BR>#
rewritehostport("<b2bua
IP>:5065");<BR>#
forward(<b2bua IP>,
5065);<BR>#
log("Am done with that call ...\n");<BR># We may want to send a reply back here
to prevent the client from<BR># sending too many INVITE
requests<BR>
sl_send_reply("181", "Forwarding
call");<BR>
};<BR>
}<BR>
else<BR>
{<BR>
log("The call was not logged
...\n");<BR>
};<BR>
log("The call was redirected - hopefully
...\n");<BR>
}<BR></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=441052716-06072004># Set the accounting
flag - XXX do we actually need
this?<BR>#
setflag(1);<BR> };</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=441052716-06072004># An ACK is when a
call is acknowlowdged to have
occured<BR>
if(method=="ACK")<BR>
{<BR>
setStartTimeActiveCall("");<BR>
sl_send_reply("200", "OK");<BR>
};</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=441052716-06072004># A CANCEL is when a
call is cancelled in the middle of an
attempt<BR>
if(method=="CANCEL")<BR> {<BR># Remove
the active
details...<BR>
removeActiveCall("");<BR>
};</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=441052716-06072004># A BYE is for when
a call finishes, so what we would want to do here is to track these<BR>#
messages, as these contain the info for the
billing<BR>
if(method=="BYE")<BR>
{<BR>
log("Found BYE message ...\n");<BR># This call here should slow down the
dispatching of
messages<BR>
t_reply("100", "Trying to bill...");<BR># This will process the message and do
all necessary work on it...<BR># In this case, we just want to perform the BYE
actions...<BR>
log("Checking to see if the destination is a SIP phone or not
...\n");</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=441052716-06072004># This lookup is
here so we can determine if the call was to a SIP softphone or ATA<BR># If it
was a SIP Softphone or an ATA, then we won't need to bil, as this is over
IP<BR>
if
(!lookup("location"))<BR>
{<BR>
log("Destination is a PSTN number ...\n");<BR># This call will bill both the
provider and
customer<BR>
performBillingOperation("4ecalls.com");<BR>
}<BR> };</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004> # we
record-route all messages -- to make sure
that<BR> # subsequent messages will go
through our proxy; that's<BR> #
particularly good if upstream and downstream
entities<BR> # use different transport
protocol<BR>
if(method=="INVITE")<BR>
{<BR>
record_route();<BR>
};</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004> #
loose-route processing<BR> if
(loose_route())
{<BR>
t_relay();<BR>
break;<BR> };</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=441052716-06072004> # forward to
current uri now; use stateful forwarding;
that<BR> # works reliably even if we
forward from TCP to UDP<BR> if
(!t_relay())
{<BR>
sl_reply_error();<BR>
};<BR>}<BR></SPAN></FONT></DIV></BODY></HTML>