Commit 3ce69c1b authored by Michael Jerris's avatar Michael Jerris

more register nua handling

darcs-hash:20060926184617-16063-3e6311ae309d268d7b05d666d1bf247c2d727794.gz
parent 565acce1
......@@ -2245,8 +2245,9 @@ int nua_stack_process_register(nua_t *nua,
if (!(nh = nua_stack_incoming_handle(nua, irq, sip, nh_has_nothing, 0)))
return 500; /* Respond with 500 Internal Server Error */
nh->nh_registrar = irq;
nua_stack_event(nh->nh_nua, nh, nta_incoming_getrequest(irq),
nua_i_register, SIP_200_OK, TAG_END());
nua_i_register, SIP_100_TRYING, TAG_END());
return 0;
}
......
......@@ -1706,6 +1706,12 @@ nua_stack_respond(nua_t *nua, nua_handle_t *nh,
nua_stack_event(nua, nh, NULL, nua_i_error,
500, "Already Sent Final Response", TAG_END());
}
else if (nh->nh_registrar) {
nta_incoming_treply(nh->nh_registrar, status, phrase,
TAG_NEXT(tags));
if (status >= 200)
nta_incoming_destroy(nh->nh_registrar), nh->nh_registrar = NULL;
}
else {
nua_stack_event(nua, nh, NULL, nua_i_error,
500, "Responding to a Non-Existing Request", TAG_END());
......
......@@ -247,6 +247,7 @@ struct nua_handle_s
} nh_referral[1];
nea_server_t *nh_notifier; /**< SIP notifier */
nta_incoming_t * nh_registrar;
};
#define NH_IS_VALID(nh) ((nh) && (nh)->nh_valid)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment