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

SOFIAPUBFUN isize_t su_guid_sprintf ( char *  buf,
size_t  len,
su_guid_t const *  guid 

Print guid.

The function guid_sprintf() formats the IP telephony call identifier according the human-readable format specified in the ITU-T recommendation H.225.0 v2. The printed identifier can be used as a SIP Call-ID if the colons in IEEE MAC address are replaced with '-', '+' or other character allowed in SIP token.

buf [out] buffer to store the formatted globally unique identifier
len [in] size of buffer buf (should be at least guid_strlen bytes)
guid [in] pointer to structure containing globally unique identifier
Return values:
The function guid_sprintf() returns length of the formatted globally unique identifier excluding the final NUL.

Definition at line 272 of file su_uniqueid.c.

References su_guid_sprintf(), and su_guid_strlen.

Referenced by nua_generate_instance_identifier(), sip_call_id_create(), and su_guid_sprintf().

  char mybuf[su_guid_strlen + 1];
  sprintf(mybuf, "%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
        (unsigned long)ntohl(v->s.time_low),
        v->s.node[0], v->s.node[1], v->s.node[2], 
        v->s.node[3], v->s.node[4], v->s.node[5]);
  memcpy(buf, mybuf, len > sizeof(mybuf) ? sizeof(mybuf) : len);
  return su_guid_strlen;

Generated by  Doxygen 1.6.0   Back to index