Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sipsess/update: Add Contact header to UPDATE #545

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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