Thursday, April 17, 2014

Sip Stack - REGISTER analysis

SalOp is the main structure passed around in various classes. When linphone_proxy_config_register is called, it is creating a new SalOp using sal_op_new function and the SalOp's userdata pointer is set to the LPConfig object

The refresher, transaction is two main portions of the core. For every request, a transaction is created and a refresher is created with this transaction. For specific functionalities, there are specific c files. For example, for registration, the file is sal_op_register.c, this file is mainly for doing the register related header addition, set from, to, contact, route headers, builds the request using sal_op_build_request, and finally calls the sal_op_impl.c file to send and create the request. sal_op_impl.c calls the transaction api to create a transaction and it in turn creates a refresher as well. When it asks the sal_op_impl.c to create a transaction and register, it sends a function pointer as the listener inorder to get the call backs.

The sal_op_impl.c also sets a default retry timer of 1 minute that kicks in when the request is not able to be sent out. also, it has a manual mode refresher. This is mainly to decide whether the refresh should be done by the library or by the app when the expiration of the refresher timer happens.

Below is the websequence diagram notes for the REGISTER sending part

lpcore -> proxy.c : lp_proxy_config_register(true)
proxy.c -> sal_op_registration.c : sal_register
sal_op_registration.c -> sal_op_impl.c : sal_op_send_and_create_refresher
sal_op_impl.c -> sal_op_impl.c : sal_op_send_request_with_expires
sal_op_impl.c -> transaction.c : belle_sip_client_transaction_create_refresher
transaction.c -> refresher.c : belle_sip_refresher_new

In another Blog, the details of processing of the incoming SIP message will be analyzed


No comments:

Post a Comment