# Structure

msg_start

The structure represents the first line of a SIP request or response.

The structure is defined in file `parse_fline.h` under `parser` subdirectory.

Structure Declaration

    struct msg_start {
        int type;                        /* Type of the Message - Request/Response */
        union {
            struct {
                str method;              /* Method string */
                str uri;                 /* Request URI */
                str version;             /* SIP version */
                int method_value;        /* Parsed method */
            } request;

            struct {
                str version;             /* SIP version */
                str status;              /* Reply status */
                str reason;              /* Reply reason phrase */
                unsigned int statuscode; /* Status code */
            } reply;
        }u;
    };

Description of Request Related Fields:

- type - Type of the message - REQUEST or RESPONSE.

- method - Name of method (same as in the message).

- uri - Request URI.

- version - Version string.

- method_value - Parsed method. Field method which is of type `str` will be converted to integer and stored here. This is good for comparison, integer comparison is much faster than string comparison.

Description of Response Related Fields:

- version - Version string.

- status - Response status code as string.

- reason - Response reason string as in the message.

- statuscode - Response status code converted to integer.