diff --git a/include/re_sipevent.h b/include/re_sipevent.h index 8f60470..fdd7503 100644 --- a/include/re_sipevent.h +++ b/include/re_sipevent.h @@ -77,8 +77,7 @@ struct sipsub; typedef int (sipevent_fork_h)(struct sipsub **subp, struct sipsub *osub, const struct sip_msg *msg, void *arg); -typedef void (sipevent_notify_h)(struct sip *sip, const struct sip_msg *msg, - void *arg); +typedef void (sipevent_notify_h)(const struct sip_msg *msg, void *arg); int sipevent_subscribe(struct sipsub **subp, struct sipevent_sock *sock, const char *uri, const char *from_name, diff --git a/src/sipevent/listen.c b/src/sipevent/listen.c index 2224728..c18a835 100644 --- a/src/sipevent/listen.c +++ b/src/sipevent/listen.c @@ -192,13 +192,11 @@ static void notify_handler(struct sipevent_sock *sock, (void)sip_dialog_update(sub->dlg, msg); } + (void)sip_treply(NULL, sip, msg, 200, "OK"); + if (sub->refer_cseq >= 0 && !sub->id && pl_isset(&event.id)) { - err = pl_strdup(&sub->id, &event.id); - if (err) { - (void)sip_treply(NULL, sip, msg, 500, strerror(err)); - return; - } + (void)pl_strdup(&sub->id, &event.id); } re_printf("notify: %s (%r)\n", sipevent_substate_name(state.state), @@ -220,7 +218,7 @@ static void notify_handler(struct sipevent_sock *sock, } mem_ref(sub); - sub->notifyh(sip, msg, sub->arg); + sub->notifyh(msg, sub->arg); nrefs = mem_nrefs(sub); mem_deref(sub); diff --git a/src/sipevent/subscribe.c b/src/sipevent/subscribe.c index a871739..e650da9 100644 --- a/src/sipevent/subscribe.c +++ b/src/sipevent/subscribe.c @@ -29,12 +29,10 @@ enum { static int request(struct sipsub *sub, bool reset_ls); -static void internal_notify_handler(struct sip *sip, const struct sip_msg *msg, - void *arg) +static void internal_notify_handler(const struct sip_msg *msg, void *arg) { + (void)msg; (void)arg; - - (void)sip_treply(NULL, sip, msg, 200, "OK"); }