Skip to content

Commit

Permalink
sipsess/update: Add Contact header to UPDATE
Browse files Browse the repository at this point in the history
UPDATEs are now sent with Contact header which is mandatory according to
RFC 3311.
  • Loading branch information
maximilianfridrich authored and sreimers committed Sep 28, 2022
1 parent d18e60d commit 9acd772
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/sipsess/update.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,28 @@ static void update_resp_handler(int err, const struct sip_msg *msg, void *arg)
}


static int send_handler(enum sip_transp tp, struct sa *src,
const struct sa *dst, struct mbuf *mb,
struct mbuf **contp, void *arg)
{
struct sip_contact contact;
struct sipsess_request *req = arg;
(void)dst;
(void)contp;

sip_contact_set(&contact, req->sess->cuser, src, tp);

return mbuf_printf(mb, "%H", sip_contact_print, &contact);
}


static int update_request(struct sipsess_request *req)
{
if (!req || req->tmr.th)
return -1;

return sip_drequestf(&req->req, req->sess->sip, true, "UPDATE",
req->sess->dlg, 0, req->sess->auth, NULL,
req->sess->dlg, 0, req->sess->auth, send_handler,
update_resp_handler, req,
"%s%s%s"
"Content-Length: %zu\r\n"
Expand Down

0 comments on commit 9acd772

Please sign in to comment.