Пример #1
0
int sipsess_bye(struct sipsess *sess, bool reset_ls)
{
    if (sess->req)
        return EPROTO;

    if (reset_ls)
        sip_loopstate_reset(&sess->ls);

    return sip_drequestf(&sess->req, sess->sip, true, "BYE",
                         sess->dlg, 0, sess->auth,
                         NULL, bye_resp_handler, sess,
                         "Content-Length: 0\r\n"
                         "\r\n");
}
Пример #2
0
static int request(struct sipreg *reg, bool reset_ls)
{
	if (reg->terminated)
		reg->expires = 0;

	if (reset_ls)
		sip_loopstate_reset(&reg->ls);

	return sip_drequestf(&reg->req, reg->sip, true, "REGISTER", reg->dlg,
			     0, reg->auth, send_handler, response_handler, reg,
			     "%s"
			     "%b"
			     "Content-Length: 0\r\n"
			     "\r\n",
			     reg->regid > 0
			     ? "Supported: outbound, path\r\n" : "",
			     reg->hdrs ? mbuf_buf(reg->hdrs) : NULL,
			     reg->hdrs ? mbuf_get_left(reg->hdrs) : 0);
}
Пример #3
0
static int notify_request(struct sipnot *not, bool reset_ls)
{
	DEBUG_WARNING("re.sipevent.notify.notify_request()\n");
	if (reset_ls)
		sip_loopstate_reset(&not->ls);

	if (not->terminated)
		not->termsent = true;

	not->notify_pending = false;

	return sip_drequestf(&not->req, not->sip, true, "NOTIFY",
			     not->dlg, 0, not->auth,
			     send_handler, response_handler, not,
			     "Event: %H\r\n"
			     "Subscription-State: %H\r\n"
			     "%s"
			     "%H",
			     print_event, not,
			     print_substate, not,
			     not->hdrs,
			     print_content, not);
}