SIP Session
Table of Contents
The implementation of the low level and high level SIP entities implemented so far in Pyrex and Python layers revealed weaknesses that need to be corrected before moving forward.
Inconsistencies
- Invitation gets arguments in init, although they only apply for outgoing INVITEs
- Invitation sometimes does not transition to disconnecting when local party initiated disconnect
- Invitation timeouts are notified using a 408 code, even if a SIP response would not have been received (eg when ACK is not received)
- An internal generated state change of Invitation is notified by sending a notification without headers and body; the reason is thus the error message, which is not clearly different from a reason received in a SIP response
- The state machine of the Invitation is complicated by having the reinvited and reinviting states; these can be modelled as sub-states of the connected state
- Methods for sending responses to INVITEs weren't symmetric -> 3 methods for responding to initial INVITE, 1 for responding to reINVITEs.
- end method of Invitation accepted response_code, even though it wasn't always used
- Credentials objects contains a SIPURI, although the Credentials should only contain a username and a password
- SIPURI contains a display name, to represent From and To headers; a SIP URI does not contain one and different objects need to represent the headers
- Headers are not represented as objects and are sent in notifications as tuples
- No standard way to access underlying PJSIP structures of primitive objects (Route, Credentials etc. some have to_c, some don't. Some have _obj, some have other names.
Other problems
- The primitive objects (SIPURI, Route etc.) are copied on every access; frozen counterparts to these would allow them to be readonly attributes
- Invitation attribute call_id can not be accessed if Invitation transitioned to DISCONNECTED
Naming
- Invitation: calling vs outgoing and incoming
- Invitation: confirmed vs connected state
- Invitation: callee_uri and caller_uri vs from_uri and to_uri
- Invitation: is_outgoing vs direction
Others
- Moved initialization of attributes in Invitation to cinit
Goal
The goal is a to have a consistent and generic SIP Session high level class and fix the underneath elements to behave in a better way.
