| With the outbreak of the mobile Internet,Internet telephony applications have been more and more popular.SIP stack is the core of application,there are a lot of options available for developers.In the Android platform,SIP stack written by Java is easy to customize,has high flexibility,but the performance of the stack is not good;the performance of the SIP stack written by C is good,but it’s difficult to customize,it’s flexibility is poor.This paper proposes an optimized design scheme for PJSIP stack based on Android platform,which can solve the problem that the flexibility and performance of SIP stack in Android platform.This paper makes a comparative analysis of the open source SIP stacks,the PJSIP stack is selected as the optimization object.According to the characteristics of the PJISP stack and the application characteristics of the Android platform,optimization needs is determined.By studying the RFC3261 protocol and the SIP stack implemented by C,the SIP base service layer is designed and implemented.SIP base service layer is written by Java.through the JNI technology the layer is mapped to the SIP stack written by C.SIP base service layer is mainly completed three major functions:one is the SIP message management,provide on-demand custom function of SIP message;The second is the transport layer and provides on-demand select function of transport;Three is the SIP process control,providing on-demand custom functions of the SIP protocol stack operation process.Through the SIP base service layer,Android developers can customize the SIP stack with Java language.This improve the development efficiency,while in the support of JNI technology,the performance of the SIP protocol stack is guaranteed.This paper designs and implements an optimized design scheme for PJSIP protocol stack based on Android platform.This optimized PJSIP stack not only meets the demands both in functional way and non-functional way,but also works well in a certain project. |