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)
 

 

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 停机错过的短信怎么办 手机卡丢了信息怎么办 手机qq消息延迟怎么办 手机无法注册qq怎么办 邮箱发ppt打不开怎么办 263邮箱网页打不开怎么办 电脑网页打不开邮箱怎么办 OPPO邮件卸载了怎么办 刘海扎起来了怎么办 车子过户行驶证怎么办 车辆过户登记证怎么办 当泥石流时应该怎么办 无法接通激活服务器怎么办 金蝶提示服务器怎么办 怎么办word发到qq邮箱 iphone邮箱账户错误怎么办 mac邮箱账户错误怎么办 速腾邮箱打不开怎么办 附近功能已屏蔽怎么办 网易支付被冻结怎么办 华为账号服务器繁忙怎么办? 电脑服务器删了怎么办 感觉自己没排卵怎么办 淘宝卖家骂人怎么办 淘宝遇到恶意买家怎么办 起诉不知道地址怎么办 不知道被告地址怎么办 被报复收到冥币怎么办 划伤伤口肿了怎么办 小孩跳舞不肯跳怎么办 买的豆沙馅太干怎么办 买的豆沙馅太甜怎么办 卷筒发型不会做怎么办 变频器stop灯亮怎么办 增压泵频繁启停怎么办 大理石地面没铺平怎么办 瓷砖拼花压平机跳匝怎么办 五笔不会拆字怎么办 厚铁板弯了怎么办 海关查到仿牌怎么办 mk包包坏了怎么办