<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=239095105-06122006>hi
all</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=239095105-06122006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=239095105-06122006>i have some doubt in
the SIP call flow.Please help me....</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=239095105-06122006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=239095105-06122006>STEPS:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=239095105-06122006>1.sender receives
the 180 ringing, so onrecivedRinging() is to be called.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=239095105-06122006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=239095105-06122006>void
SIPConnection::OnReceivedRinging(SIP_PDU & /*response*/)<BR>{<BR>
PTRACE(2, "SIP\tReceived Ringing response");</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=239095105-06122006> if (phase
< AlertingPhase)<BR> {<BR> phase =
AlertingPhase;<BR> OnAlerting();<BR>
}</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=239095105-06122006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=239095105-06122006>2.In
OnReceivedRinging() function,OnAlerting is also called.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=239095105-06122006>BOOL
OpalCall::OnAlerting(OpalConnection & connection)<BR>{<BR> PTRACE(3,
"Call\tOnAlerting " << connection);</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=239095105-06122006> BOOL ok =
FALSE;</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=239095105-06122006> if
(!LockReadWrite())<BR> return FALSE;</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=239095105-06122006> partyB =
connection.GetRemotePartyName();</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=239095105-06122006>
UnlockReadWrite();</SPAN></FONT></DIV>
<DIV> </DIV><FONT><SPAN class=239095105-06122006>
<DIV><BR><FONT face=Arial size=2> BOOL hasMedia =
connection.GetMediaStream(OpalMediaFormat::DefaultAudioSessionID, TRUE) !=
NULL;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> for (PSafePtr<OpalConnection>
conn(connectionsActive, PSafeReadOnly); conn != NULL; ++conn)
{<BR> if (conn != &connection)
{<BR> if
(conn->SetAlerting(connection.GetRemotePartyName(),
hasMedia))<BR> ok =
TRUE;<BR> }<BR> }</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2> return ok;<BR>}<BR><SPAN
class=239095105-06122006></SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN class=239095105-06122006>3. See this
line in OnAlerting() function:
conn->SetAlerting(connection.GetRemotePartyName(),
hasMedia))</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=239095105-06122006></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=239095105-06122006></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN class=239095105-06122006>here we are
calling setAlerting()</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=239095105-06122006></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=239095105-06122006></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=239095105-06122006></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN class=239095105-06122006>4.the
setalerting() definition is given below:</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=239095105-06122006></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN class=239095105-06122006>BOOL
SIPConnection::SetAlerting(const PString & /*calleeName*/, BOOL
/*withMedia*/)<BR>{<BR> if (IsOriginating()) {<BR>
PTRACE(2, "SIP\tSetAlerting ignored on call we
originated.");<BR> return TRUE;<BR>
}</SPAN></FONT></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN class=239095105-06122006>
PTRACE(2, "SIP\tSetAlerting");</SPAN></FONT></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN class=239095105-06122006> if
(phase != SetUpPhase) <BR> return
FALSE;</SPAN></FONT></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN class=239095105-06122006> SIP_PDU
response(*originalInvite, SIP_PDU::Information_Ringing);<BR>
SendPDU(response, originalInvite->GetViaAddress(endpoint));<BR> phase =
AlertingPhase;</SPAN></FONT></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN class=239095105-06122006> return
TRUE;<BR>}</DIV>
<DIV><BR></DIV></SPAN></FONT></FONT></SPAN></FONT>
<DIV><FONT face=Arial size=2><SPAN
class=239095105-06122006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=239095105-06122006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=239095105-06122006>Here we are sending
SIP_PDU::Information_Ringing to the "PartyB",why it is so?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=239095105-06122006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=239095105-06122006>But actual flow i
studied in SIP TUTORIAL is </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=239095105-06122006>partyA has to send
the invite,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=239095105-06122006>the partyB has to
send the 180::Ringing,200::OK</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=239095105-06122006>then PartyA has to
send the ACK</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=239095105-06122006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=239095105-06122006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=239095105-06122006>Can you clarify
me?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=239095105-06122006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=239095105-06122006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=239095105-06122006>thanks</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=239095105-06122006></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=239095105-06122006> </SPAN></FONT><FONT
face=Arial size=2><SPAN
class=239095105-06122006>
</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=239095105-06122006></SPAN></FONT> </DIV></BODY></HTML>