<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I have question about the two different buffers that are
accessed in this function:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>/*****************************************************************************<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'> Function: Q931Rx23<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'> Description: Receive message from layer
2 (LAPD). Receiving a message <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
is always done in 2 steps. First the message must be <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
interpreted and translated to a static struct. Secondly<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
the message is processed and responded to.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
The Q.931 message contains a static header that is <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
interpreted in this function. The rest is interpreted<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
in a sub function according to mestype.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'> Parameters: pTrunk
[IN] Ptr to trunk info.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
buf [IN] Ptr to buffer containing
message.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
Size [IN] Size of message.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'> Return Value: Error Code. 0 = No Error, <
0 :error, > 0 : Warning<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>
see q931errors.h for details.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>*****************************************************************************/<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>L3INT Q931Rx23(Q931_TrunkInfo_t *pTrunk, L3UCHAR *
buf, L3INT Size)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=ES
style='font-size:10.0pt;font-family:"Courier New"'>{<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=ES
style='font-size:10.0pt;font-family:"Courier New"'> L3UCHAR
*Mes = &buf[Q931L2HeaderSpace];<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=ES
style='font-size:10.0pt;font-family:"Courier New"'> L3INT
RetCode = Q931E_NO_ERROR;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=ES
style='font-size:10.0pt;font-family:"Courier New"'> </span></font><font
size=2 face="Courier New"><span lang=DE style='font-size:10.0pt;font-family:
"Courier New"'>Q931mes_Generic *m = (Q931mes_Generic *) pTrunk->L3Buf;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=DE
style='font-size:10.0pt;font-family:"Courier New"'> L3INT
ISize;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=DE
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=DE
style='font-size:10.0pt;font-family:"Courier New"'> L3INT
IOff = 0;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=DE
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=DE
style='font-size:10.0pt;font-family:"Courier New"'> /*
Protocol Discriminator */<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=DE
style='font-size:10.0pt;font-family:"Courier New"'>
m->ProtDisc = Mes[IOff++];<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=DE
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=DE
style='font-size:10.0pt;font-family:"Courier New"'> /* CRV */<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=DE
style='font-size:10.0pt;font-family:"Courier New"'>
m->CRVFlag = Mes[IOff + 1] & 0x80;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=DE
style='font-size:10.0pt;font-family:"Courier New"'> m->CRV
= Q931Uie_CRV(pTrunk, Mes, m->buf, &IOff, &ISize);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=DE
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=DE
style='font-size:10.0pt;font-family:"Courier New"'> </span></font><font
size=2 face="Courier New"><span lang=FR style='font-size:10.0pt;font-family:
"Courier New"'>/* Message Type */<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=FR
style='font-size:10.0pt;font-family:"Courier New"'>
m->MesType = Mes[IOff++];<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=FR
style='font-size:10.0pt;font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=FR
style='font-size:10.0pt;font-family:"Courier New"'> </span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>/*
Call table proc to unpack codec message */<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'> /*debug */<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'> printf("\n\nQ931Rx23-
Dialect: %d, MsgType: %d\nCause:
[%x]\n",pTrunk->Dialect,m->MesType,m->Cause); <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'> printf("Message:
%s\n",Mes);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'> RetCode =
Q931Umes[pTrunk->Dialect][m->MesType](pTrunk, Mes, (Q931mes_Generic
*)pTrunk->L3Buf, Q931L4HeaderSpace + IOff , Size - Q931L4HeaderSpace - IOff
+ 1);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'> </span></font><font size=2
face="Courier New"><span lang=ES style='font-size:10.0pt;font-family:"Courier New"'>if(RetCode
>= Q931E_NO_ERROR)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=ES
style='font-size:10.0pt;font-family:"Courier New"'> {<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=ES
style='font-size:10.0pt;font-family:"Courier New"'>
RetCode = Q931Proc[pTrunk->Dialect][m->MesType](pTrunk, pTrunk->L3Buf,
2);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span lang=ES
style='font-size:10.0pt;font-family:"Courier New"'> </span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>}<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'> return RetCode;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>}<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>What’s the difference between pTrunk->L3Buf and
*buf in this function? I’m trying to understand where the q931
message is coming from as it is passed up the stack from layer 2 to layer 3. I
may have found a clue about the phantom cause IE issue but I won’t know
for sure until I know what exactly I’m looking at.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Also, can you tell me what is accomplished by creating *Mes
as opposed to *m? I am familiar with the Q931mes_Generic data struct but
the line:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'> </span></font><font size=2
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>L3UCHAR
*Mes = &buf[Q931L2HeaderSpace];<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>… is confusing me. What does that do?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Thanks for your time!!<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>-MC<o:p></o:p></span></font></p>
</div>
</body>
</html>