Function Description: saves the basic information of the SIP server to the linked list of the client.
Other descriptions: initialize a registration ID and generate a registration package (for generating a registration ID, there is no opinion, but there is a registration package, there are doubts, whether the source code indicates identity, to be verified)
The return value of this function is the registered ID, which can be used to upgrade registration (not only to upgrade registration, but also to regularly send registration information. The server must use the returned ID and modify the registration period (expires) to be called.
Exosip_register_build_register ();
Exosip_register_send_register (RID, Reg,
Be cautious when calling this function !!
The result of viewing the source code is analyzed as follows:
Step 1: Save the server information (IP address, port, and domain name) in the registration list. Osip saves a global registration list with the same server information, once only
Added to this linked list. If the program calls this function multiple times to the same registration server, the registration server will return an incorrect RID, which is very important.
Detailed descriptions are as follows:
Rid = exosip_register_build_initial_register (... & reg );
Exosip_register_send_register (RID, Reg );
Through the RID, the registration request will be sent to the specified server, so the storage and use of this RID is very important.
/**
* Build initial register request.
*
* @ Param from sip url for caller.
* @ Param proxy used for registration.
* @ Param contact address. (optional)
* @ Param expires the expires value for regires.
* @ Param Reg the SIP request to build.
*/
Int exosip_register_build_initial_register (const char * From, const char * proxy,
Const char * contact, int expires,
Osip_message_t ** REG );
The format of the from field is as follows: SIP: User Name @ local IP address. Explanation: During the authentication process, the user name must have been registered on the server, and the local IP address can be selected, because Osip will automatically fill in
The format of the proxy field is as follows: SIP: User Name @ server address: Port, explanation: