<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>This interface is introduced to allow other
applications than bsc_hack to be used with libbsc.<SPAN
class=699370612-21052009> The </SPAN>built-in application for call forwarding
from mobile to mobile calls has been moved <SPAN
class=699370612-21052009>out of gsm_04_08.c </SPAN>to mncc.c and stays part
of libbsc.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The most messages on this interface begin with
MNCC_ and end with _REQ (layer 4 requests) _CNF (layer 3 reply) _IND (layer 3
requests) _RSP (layer 4 replies). Other messages are used to control TRAU
traffic or channel modification. More commands may be added in the
future.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT><FONT face=Arial size=2>The handling of messages from the mobile side
(MMC<SPAN class=699370612-21052009>C</SPAN>) and from the application (MNCC) is
done by a state machine. (See Fig. 5.1b TS 04.08) The<SPAN
class=699370612-21052009> </SPAN>"datastate" list handles messages from the
mobile side. The "downstate" list handles messages from the application. The
timers are handled by a special timeout function. When a message is
received, the downstate list or datastate list is checked for the current state
and the message. <SPAN class=699370612-21052009>I</SPAN>f there is a
match, for <SPAN class=699370612-21052009>a current state and a
message, it's handler</SPAN> called. Inside this handler, timers can be started
and stopped, states can be changed, messages can be forwarded and replied,
and so on.</FONT></FONT></DIV>
<DIV><FONT><FONT face=Arial size=2></FONT></FONT> </DIV>
<DIV><FONT><FONT face=Arial size=2>All information elements are parsed or
created in gsm_04_08.c.<BR></FONT></FONT></DIV>
<DIV><FONT><FONT><FONT face=Arial><FONT size=2>A special "upqueue" is used
to <SPAN class=699370612-21052009>forward</SPAN> messages from
gsm_04_08.c<SPAN class=699370612-21052009> to</SPAN> the application. The
dequeue function is called by the application in the main loop (before
select function). If the application sends a message to BSC, it calls the
"mncc_send" function of gsm_04_08.c. The process<SPAN class=699370612-21052009>
</SPAN>of this maessage in gsm_04_08.c may result in messages back to the
application. The queue prevents <SPAN class=699370612-21052009>libbsc
</SPAN>from calling the application's "mncc_recv"<SPAN class=699370612-21052009>
</SPAN>function, while the <SPAN
class=699370612-21052009>a</SPAN>pplication calls the "mncc_send" function. The
upqueue makes sure that messages created by gsm_04_08.c during
"mncc_send" is processed AFTER the application has finished it's
processing.</FONT></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The call instance of the application is called
"gsm_call". This has moved out of gsm_04_08.c into mncc.c. The gsm_04_08.c uses
a "llist" of transactions: "<SPAN class=699370612-21052009>struct
</SPAN>gsm_trans". The transaction <SPAN class=699370612-21052009>can
be</SPAN> associated <SPAN class=699370612-21052009>with</SPAN> a
logical channel: "lchan". <SPAN
class=699370612-21052009>The</SPAN> use-counter of lchan is increased for
every transaction<SPAN class=699370612-21052009> assoicated to</SPAN>. After
freeing of transaction, the use-counter is decremented. If lchan breaks down,
all transactions are released. The application receives a "released indication"
message. <SPAN class=699370612-21052009>Multiple</SPAN> transactions for an
lchan provide the ability to hold a call and receive/make another call. This has
been successfully tested on LCR application<SPAN class=699370612-21052009> and
is not yet implemented in mncc.c, but very easy todo</SPAN>.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT><FONT face=Arial><FONT size=2>A message between libbsc and
application consists of a message type (mgs_type), a call reference (callref),
and information elements within the same structure. Each information element has
an additional flag, to indicati if it exists in the message. The message is
defined in<SPAN class=699370612-21052009>
mncc.h</SPAN></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN class=699370612-21052009>The </SPAN>A
transaction can have a logical channel (lchan) or not. At least it has a
subscriber (subscr). If a transaction is created, the subscriber is checked. If
no transaction with this subscriber exists, paging is started. If another
transaction exists with an lchan, this lchan is also used for the transaction
(already established). If another transaction of this subscriber exists, but no
lchan, the paging is already stated, nothing is done until paging response.
After a paging response, the transactions with the same subscribers are
associated to the lchan. If paging failed, all transactions
associated <SPAN class=699370612-21052009>with</SPAN> the subscriber are
released. (no user responding).</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT><FONT face=Arial size=2></FONT></FONT> </DIV>
<DIV><FONT><FONT><FONT face=Arial size=2></FONT> </DIV>
<DIV><BR></DIV></FONT></FONT></BODY></HTML>