Logo Search packages:      
Sourcecode: sofia-sip version File versions  Download package

sip_status_t* sip_status_create ( su_home_t home,
unsigned  status,
char const *  phrase,
char const *  version 

Create a status line object.

home memory home used to allocate sip_status_t object
status status code (in range 100 - 699)
phrase status phrase (may be NULL)
version version string (defaults to "SIP/2.0" if NULL)
If you provide an non-NULL version string, it is not copied. The string MUST remain constant.
A pointer to newly created status line structure when successful, or NULL upon an error.

Definition at line 376 of file sip_basic.c.

References sip_status_phrase(), sip_status_s::st_phrase, sip_status_s::st_status, and sip_status_s::st_version.

Referenced by nta_incoming_complete_response().

  sip_status_t *st;

  if (status < 100 || status > 699)
    return NULL;

  if (phrase == NULL && (phrase = sip_status_phrase(status)) == NULL)
    phrase = "";

  if ((st = sip_header_alloc(home, sip_status_class, 0)->sh_status)) {
    st->st_status = status;
    st->st_phrase = phrase;
    st->st_version = version ? version : SIP_VERSION_CURRENT;

  return st;

Generated by  Doxygen 1.6.0   Back to index