UCT IMS Client Source Code Analysis 转载:http://blog.csdn.net/heyunqi/archive/2007/11/19/1892560.aspx
来源:互联网 发布:淘宝专业术语 编辑:程序博客网 时间:2024/05/21 16:22
转载:http://blog.csdn.net/heyunqi/archive/2007/11/19/1892560.aspx
目的:学习方便
UCT IMS Client Source Code Analysis
Overview
It is an IMS user agent based on osip/eXsip library. The source code the document analyzes is uctimsclient1.0.6
• Feature list:
– AKAv1 and AKAv2 registration
– Subscribe to reg event and watcher info event
– instant messaging
– DTMF tones via SIP INFO messages
– Presence support
– XCAP Presence Rules Support
• Depends on following open source lib:
– libosip2
– libeXosip2
– Gstreamer libraries
– libgtk2
• File List
– Entry
• imsUA.c: application entry, create GUI, init eXosip2 library and fetch events from eXosip2 library
– GUI
• Interface.c: used to create GUI and set GUI signal handler
• Callback.c: GUI signal handlers
• Ims_interface_event_handler.c: functions called by signal handlers in callback.c
• Common_interface_event_handler.c: functions called by event handlers in callback.c
• Preferences.c: used to set preference parameters
• Presence.c: edit and show presence info
• Watchers.c: list who are interested in your presence info
• Xcap.c: handler XDMS manager
– eXosip event
• Ims_exosip_event_handler.c: callback called by eXosip2 library
• Common_exosip_event_handler.c: common functions called by callbacks in Ims_exosip_event_handler.c
• Media.c: common functions called by callbacks in Ims_exosip_event_handler.c
– authentication
• DigestAKAv1MD5.c
• Base64.c
• Md5.c
• Rfc2617.c
– media:
• Gstreamer.c: used to set GStreamer pipeline for audio and video call
– Utilities:
• Support.c: utilities for GUI fuctions
• Useful_method.c: utilities for processing SIP message
• Sdp_method.c: used to build SDP parameters for SIP message
– SIP-to-IMS Gateway(not used)
• Milenage.c
• Rijndael.c
• Sound_conv.c
startup process
create_imsUA: create GUI, and set signal handler for each GUI component
initialise_eXosip
set eXosip event process function get_exosip_events: all events from eXosip is fetched by this function, and then handle in Ims_exosip_event_handler.c
Registration Process
User click “Registration”:
on_register2_activate --->ims_send_register:
Build and send a register request(eXosip_register_send_register)
Wait for event EXOSIP_REGISTRATION_FAILURE:
If error code is 401, it does not mean registration failed, it means we need to do authentication:
ims_process_401: build an another register request with authentication info, and send it.
wait for event EXOSIP_REGISTRATION_SUCCESS:
ims_process_registration_200ok:
subscribe presence info and watchers info
Presence and watcher
When any buddy is online or update its presence info, or anyone subscribes your presence info, the event EXOSIP_SUBSCRIPTION_NOTIFY will be received:
ims_process_notify:
presence_process_notify to handle presence info, or watchers_process_notify to handle watch info
Calling Process
User click “Call or answer”button:
on_call_button_clicked---ims_call_initiate--ims_call_initiate
build and send a invite request(eXosip_call_send_initial_invite)
wait for event EXOSIP_CALL_RINGING:
ims_process_18x:
(the status code is 183 on the first round)
if require 180rel: build and send a prack(eXosip_call_send_prack)
wait fro event EXOSIP_CALL_MESSAGE_ANSWERED:
ims_process_2xx:
build and send update message: eXosip_call_build_update and eXosip_call_send_request
wait for message EXOSIP_CALL_RINGING:
ims_process_18x:
(the status code is 180 on the second round)
initialiseRingingPipeline: initialize GStreamer ringing pipeline.
wait until remote accept or reject the call:
EXOSIP_CALL_ANSWERED means accept call:
ims_process_200ok:
build and send an ack message.
start_rtp_session: destroy GStreamer ringing pipeline, and start GStreamer voice and video pipeline
Incoming Call:
event EXOSIP_CALL_INVITE:
ims_process_incoming_invite
if busy at this moment, send reject(eXosip_call_send_answer(je->tid, 486, NULL))
build and send answer: (eXosip_call_send_answer(je->tid, 183, session_progress))
wait EXOSIP_CALL_MESSAGE_NEW:
ims_process_prack: (why there is no place to send an ack for prack?)
build and send answer(eXosip_call_send_answer)
initialiseRingingPipeline: initialize GStreamer ringing pipeline.
if user click “call or answer” button:
on_call_button_clicked---- ims_call_answer
build and send answer(eXosip_call_send_answer)
wait for event EXOSIP_CALL_ACK:
ims_process_ack:
start_rtp_session: destroy GStreamer ringing pipeline, and start GStreamer voice and video pipeline
If user click “hangup or refuse” button:
on_hangup_button_clicked--- terminate_call
DTMF:
click “DTMF digits” buttons during call:
common_send_dtmf:
create and send request: eXosip_call_build_info and eXosip_call_send_request
IM
user click “start chat” button:
on_start_chat_clicked--ims_open_im_window:
if no IM window, create_im_window: connect signal
g_signal_connect ((gpointer) send_im_button, "clicked",
G_CALLBACK (on_send_im_button_clicked),
NULL);
the peer who receives IM message:
receives event EXOSIP_MESSAGE_NEW:
ims_start_im_session:
if no IM window, create_im_window: connect signal
g_signal_connect ((gpointer) send_im_button, "clicked",
G_CALLBACK (on_send_im_button_clicked),
NULL);
on_send_im_button_clicked:
ims_send_instant_message: build and send message(eXosip_message_send_request)
- UCT IMS Client Source Code Analysis 转载:http://blog.csdn.net/heyunqi/archive/2007/11/19/1892560.aspx
- 转:http://blog.csdn.net/heyunqi/archive/2007/11/19/1892520.aspx
- setprecision()与setiosflags() (转载http://blog.csdn.net/yunhaiC/archive/2008/03/11/2167462.aspx)
- [转]我的Modbus Slave/Client开发历程(Rtu/AscII/Tcp) [http://blog.csdn.net/yefanqiu/archive/2007/07/19/1698480.aspx]
- GRIDVIEW导航http://blog.csdn.net/mengyao/archive/2007/02/19/1511765.aspx
- http://blog.csdn.net/21aspnet/archive/2007/04/11/1559848.aspx
- 完整的CSS工具列表 http://blog.csdn.net/jaketseng/archive/2007/11/12/1880344.aspx
- 正则表达式(http://blog.csdn.net/cping1982/archive/2007/11/24/1900808.aspx)
- http://blog.csdn.net/pongba/archive/2007/12/11/1930150.aspx
- 创建一个filter实例(transform filter)【转载http://blog.csdn.net/captain_x/archive/2007/08/10/1737619.aspx】
- 预防SQL注入攻击之我见[转载http://blog.csdn.net/jyk/archive/2009/11/26/4882097.aspx]
- 转载http://blog.csdn.net/jojoaric/archive/2006/10/17/1338763.aspx
- form数据传递 转载http://blog.csdn.net/lxxlql/archive/2009/08/04/4408158.aspx
- http://blog.csdn.net/CYRTSOFT/archive/2004/12.aspx
- http://blog.csdn.net/hbuzhang/archive/2006/01.aspx
- http://blog.csdn.net/zhuky/archive/2009/12.aspx
- http://blog.csdn.net/mrunix/archive/2004/08.aspx
- ASP.NET 常用技巧学习 (http://blog.csdn.net/JavaProgramers/archive/2007/04/13/1563441.aspx)
- Visual Studio 2005 SP1 的几个Bug
- vss和Eclipse结合实现代码版本控制
- j2me SyncML
- _stdcall 与 _cdecl 的区别
- 使用StringBuilder操作字符串
- UCT IMS Client Source Code Analysis 转载:http://blog.csdn.net/heyunqi/archive/2007/11/19/1892560.aspx
- Google扩展自定义搜索引擎
- Visual Studio 2008系列教程(一):VS 2008安装详解!
- Net2005中的警告处理
- IronRuby初探——在C#中调用Ruby代码
- 用Asp隐藏文件路径,实现防盗链
- 改进的SQL防注入(加强抑错
- UNIX网络编程中的一些参数-POSIX
- C++/MFC——获得MFC窗口其它类指针的方法