Abstract: Analyzed has opened source SIP agreement stack oSIP the operational mechanism. In the oSIP foundation, the design has realized one based on the S3C2410A microprocessor platform, uses WinCE operating system’s embedded SIP terminal.
Key word: SIP agreement; SIP user agent; oSIP; Embedded system; ARM
1st, introduction
At present, the IETF SIP agreement (Session Initiate Protocol, conversation initial agreement) has obtained field more and more attention and the support, is becoming in next generation network (NGN) gradually core agreements of [1]. The SIP agreement is relatively simple easy, to realize, the extendibility strongly, the more suitable IP network, widespread uses in the VoIP system setting up [2]. oSIP and expands the eXosip achievement to open the source the SIP agreement stack, is simple by its structure, the function rich, easy to transplant and so on merits to become on the embedded system constructs the VoIP application the first choice. This article analyzed the oSIP agreement stack’s operational mechanism, the design has realized transplanted the oSIP agreement stack to the embedded operating system and develops take this as the foundation the embedded SIP client side the plan.
2nd, oSIP agreement stack
2.1 SIP agreements
The SIP agreement is one uses in establishing, changing and terminates the multimedia conversations the application layer agreements. Present’s agreement text is IETF RFC3261 which published in July, 2002. SIP from the user localization, the user status inquiry, the user ability inquiry, the conversation establishment, the conversation manages five aspects to realize separately to the multimedia correspondence controls. As one kind of signaling controlling agreement, it needs with the IETF joint operations and so on other agreement like SDP, RTP, RTSP and SAP. In the SIP conversation’s media exchange may use any transport protocols, but in the project by RTP (Real-time Transmit Protocol, live transmission agreement) takes the transport protocols generally.
SIP uses the C/S pattern the working, contains two kind of elements: SIP user agent (User Agent, UA) and SIP server. The role which acts in the conversation different may divide into the user agent client according to the user agent (User Agent Client, UAC) and the user agent server (User Agent Server, UAS), the former initiates the call to request, the latter response call requested.
2.2 oSIP agreement stack
oSIP follows the IETF standard, uses ANSI C to compile, source code open SIP agreement stack. oSIP mainly has the following merit:
(1) structure exquisite simple, only then about 400K, suits on the embedded system applies;
(2) probability is good, already by successful application in Solaris, HP Unix, VxWorks, Windows and GNU/Linux[3] (2.2.16 and 2.4.7) and so on systems;
(3) work stable, compatible.
oSIP mainly by the analysis module, the tool module and the state machine module constitution, its core is state machine module [4] (as shown in Figure 1).

Figure 1 oSIP structure
The analysis module completes to the SIP request and the response carries on the seal and analysis processing. The analysis module may divide into the SIP analysis, the SDP analysis and the URL analysis.
The tool module mainly provides some processing tool to use in talking the management and the SDP consultation.
The state machine module is responsible for some business (for example registration process, call process and so on) the condition maintenance and processing, and triggers the response under the specific condition the event or the call-back function. According to the RFC description in about SIP agreement business level definition, oSIP
The agreement stack has 4 kind of state machines: Client side invitation business (ICT), client side non-invitation business (NICT), server end request business (IST), server end non-invitation business (NIST). The first two kind of state machines are initiate by the client side, the latter two kind of state machines are initiate by the server, these 4 kind of state machines have covered the SIP each kind of business type. And ICT (as shown in Figure 2) is in the SIP client side the most common business.

Figure 2 ICT state machine phase transition chart
In Figure 2, cb_ict_xxx_xxx expresses in oSIP the ICT state machine call-back function, when ICT from one condition to another condition the oSIP agreement stack will transfer this function.
oSIP concentrates the SIP first floor analysis, this enables it to have the very high efficiency. But on the other hand, because has not provided high-level SIP session control API, caused the upper formation application when transferred the agreement stack to be very stave, reduced the usability. Therefore the oSIP exploiters have developed eXosip in the oSIP foundation. eXosip is the oSIP expansion, its part has sealed the oSIP agreement stack, causes it to use easily. eXosip realized has taken the single SIP terminal the majority of functions.
3rd, embedded SIP terminal system architecture
3.1 embedded SIP terminal function
The embedded SIP terminal is a movement on the embedded operating system’s SIP user agent, mainly includes the SIP telephone’s registration, the call, answering, to hang up and so on functions. It is directly interactive with the user, the receive infed information, carries on the form check, according to user’s movement initialization SIP news, simultaneously obtains the local pronunciation media interface message, forms SDP to describe, completes UDP or the TCP seal.
3.2 system software and hardware platform choice
For the choice appropriate software and hardware platform, we have collected the massive correlation data, passed through compares and unifies the existing experimental condition to make the following choice repeatedly:
(1) embedded processor great variety, we have chosen Tristar’s S3C2410A microprocessor. This processor based on the ARM920T essence, the basic frequency most is high is 203MHz. Is a section of high performance-to-price ratio, the low power loss, high integration rate CPU, to grasp the equipment and the network application design specially, can satisfy the embedded system low power loss, the high performance, the small volume request. At the same time, the S3C2410 series processor obtained the widespread use, the technical data is rich, this is also uses the S3C2410 platform to carry on the development the advantage. In addition, we also selected touchscreen SHARP L35T23 which had 3.5″ the liquid-crystal display to take the system input/output unit.
(2) embedded operating system aspect, considered the GUI contact surface development the difficulty degree, we have chosen Microsoft Windows CE.NET 4.2. The WinCE 4.2 editions in aspects and so on essence, timeliness and network support have made the very big optimization and the enhancement, meanwhile for has provided powerful tool - - Platform Builder based on the WinCE embedded system’s development 4.2 (PB 4.2). These characteristics are helpful to us develop the embedded system fast.
(3) in development kit’s choice, we have selected Microsoft Embedded Visual C which 4.2 simultaneously promotes with Windows CE.NET 4.0 (eVC 4.0). This development environment and VC6.0 are very similar, easy to grasp, meanwhile contains has many WinCE special-purpose standard development kit and the remote debugging tool.
3.3 system architecture
We design embedded SIP terminal system gross structure as shown in Figure 3:

Figure 3 embedded SIP terminal system architecture
The overall system divides into 3 levels:
(1) system platform level: Including hardware platform and movement in above embedded operating system, this is overall system’s foundation.
(2) agreement stack level: Moves the SIP agreement stack, provides the transfer for the user program. The RTP module we used have opened the source jrtplib. jrtplib uses the C compilation, may facilitate transplant to the WinCE system on. Transplants jrtplib to the embedded operating system is not this article key point, the concrete procedure no longer gives unnecessary detail in this.
(3) user program level: Is responsible to receive the user the input, according to the user request type transfer agreement stack level function, simultaneously realizes the oSIP call-back function, and gives the result feedback the user.
4th, embedded SIP terminal realization
4.1 system platform level realizes
This system development use’s hardware equipment directly purchases to the equipment supplier, but because the embedded system is the system which the software and hardware unifies highly, but also needs to have custom-made a WinCE platform according to the hardware condition. May have custom-made in PB meets each kind of different need the CE system. We use BSP which the equipment supplier provides, founded a guide newly built WinCE reflection document using the PB platform and downloads it to the development board in solidifies.
4.2 agreement stack level realization
the oSIP agreement stack considered at the beginning of the design has satisfied the embedded operating system the specific request, this causes only to make the very few revisions (is mainly needs to join some in view of the WinCE head document) to be able to transplant oSIP to the WinCE system.
Moreover, in WinCE API does not have time() function realization, we need to realize this function, the code are as follows:
#ifdef _WIN32_WCE
SYSTEMTIME t;
#endif
……
#ifdef _WIN32_WCE
GetSystemTime(&t);
now = (int) ((t.wYear-1970) *365*24*3600 t.wMonth*30*24*3600 t.wDay*24*3600 t.wHour*3600 t.wMinute *60 t.wSecond);
#else
now = time(NULL);
#endif
After completing the essential revision, translates may obtain can use the dynamic link storehouse on the WinCE system.
4.3 user program level realization
In the system initiation process, the user program first carries on the evaluation operation according to the user disposition to the system global variable, then to oSIP agreement stack registration call-back function, and log-on data package of monitor thread. Once accepts the data packet, then the transfer agreement stack function production corresponding event and judges this event’s manage affairs whether to exist, if exists puts in the event in this business, otherwise produces the new business, start business carries out the thread. Meanwhile hands over according to the user movement production corresponding event by the agreement stack processes.
oSIP through state machine call-back function and user program correspondence, to user program circular event’s occurrence and business condition. The user program transfers oSIP agreement stack API to initiate the oSIP movement (increase event, event processing and so on).
5th, concluding remark
This article proposed based on the ARM9 core’s processor platform, take the oSIP agreement stack as the foundation embedded SIP terminal design proposal, and on the embedded system platform build, the agreement stack transplanted, the SIP user agent to realize and so on questions to carry on the discussion. The test result indicated that realizes the embedded SIP terminal system according to this plan to be able to realize the expectation function and the performance. Some reasons believed that along with the SIP agreement’s widespread application and the embedded technology’s unceasing development, the embedded SIP terminal will have the magnificent prospect.
This article author innovates the spot: This article discussed and has realized the oSIP agreement stack’s on WinCE system transplant and the application, proposed an embedded SIP terminal’s system stratification structure had simultaneously pointed out in above stratification structure various levels when realization must pay attention subject matter.
Reference
[1] Si Duanfeng, Han Xinhui, .SIP standard and so on Long Qin core technologies and research development [J]. Journal of Software .2005 16(2).
[2] Liu Zhijun, Wang Feng, Zhang Meng Hui and so on. Soft exchange technology agreement SIP and applies the [J]. micro computer information in VoIP .2006,09-3:169-172
the [3] Lu China, Wang Baobao the .oSIP agreement stack’s research and applies the [J]. electronic technology .2006.2.
[4] libosip Documentation 2.2.0. http://www.gnu.org/software/osip/doc/html/