int sip_rewrite_from(osip_message_t* osip_msg, char* host, char* username) { osip_from_t* from = osip_message_get_from(osip_msg); if (NULL != from) { osip_uri_t* uri = osip_from_get_url(from); if (NULL != uri) { sip_rewrite_osip_uri(uri, host, username); return RC_OK; } } return RC_ERR; }
static void add_presence_body(osip_message_t *notify, SalPresenceStatus online_status) { char buf[1000]; char *contact_info; osip_from_t *from=NULL; from=osip_message_get_from(notify); osip_uri_to_str(from->url,&contact_info); mk_presence_body (online_status, contact_info, buf, sizeof (buf), presence_style); osip_message_set_body(notify, buf, strlen(buf)); osip_message_set_content_type(notify, presence_style ? "application/xpidf+xml" : "application/pidf+xml"); osip_free(contact_info); }