exosip2ctypes.register module

eXosip2 REGISTER and Registration Management

class exosip2ctypes.register.InitialRegister(context, from_, proxy, contact=None, expires=3600)

Bases: exosip2ctypes.message.ExosipMessage

initial REGISTER request.

To start a registration, you need to build a default REGISTER request by providing several mandatory headers.

You can start as many registration you want even in one eXosip_t context.

The created instance has a registration identifier (rid) that you can use to update your registration. In future events about this registration, you’ll see that registration identifier when applicable.

Note

You should let eXosip2 manage contact headers alone. The setup you have provided will generate various behavior, all being controlled by eXosip2. See the “NAT and Contact header” section in setup documentation.

Build initial REGISTER request.

Parameters:
  • context – eXosip_t instance.
  • from (str) – SIP url for caller.
  • proxy (str) – Proxy used for registration.
  • contact (str) – Contact address. (optional)
  • expires (int) – The expires value for registration.
contract
Returns:Contact address. (optional)
Return type:str
expires
Returns:The expires value for registration.
Return type:int
proxy

:return:Proxy used for registration. :rtype: str

remove()

Remove existing registration without sending REGISTER.

If you need to delete a context without sending a REGISTER with expires 0, you can use this method to release memory.

rid
Returns:registration identifier
Return type:int
send()

Send this REGISTER request

class exosip2ctypes.register.Register(context, rid, expires=3600)

Bases: exosip2ctypes.message.ExosipMessage

REGISTER request for an existing registration.

Use this class if you need to update a registration, You just need to reuse the registration identifier (InitialRegister.rid)

Note

An UAC should delete its registration on the SIP server when terminating. To do so, you have to send a REGISTER request with the expires header set to value “0”.

Build a new REGISTER request for an existing registration.

Parameters:
  • context (Context) – eXosip_t instance.
  • rid (int) – A unique identifier for the registration context
  • expires (int) – The expires value for registration.
expires
Returns:The expires value for registration.
Return type:int
remove()

Remove existing registration without sending REGISTER.

If you need to delete a context without sending a REGISTER with expires 0, you can use this method to release memory.

rid
Returns:A unique identifier for the registration context
Return type:int
send()

Send this REGISTER request