Commit 9ee6c391 authored by Martti Mela's avatar Martti Mela

initial nua_i_subscription support

darcs-hash:20051125144528-1b897-8da7f9cc629eea0e353ce39df18b5c2c9c71252c.gz
parent 40d98e67
......@@ -295,6 +295,9 @@ int nea_server_notify_one(nea_server_t *nes,
int nea_sub_auth(nea_sub_t *, nea_state_t state,
tag_type_t, tag_value_t, ...);
/** Get nta_incoming_t from sn->sn_subscriber */
nta_incoming_t *nea_subnode_get_incoming(nea_subnode_t *sn);
/** Set subscriber version sequence */
int nea_sub_version(nea_sub_t *, unsigned);
......
......@@ -1073,6 +1073,16 @@ nea_sub_t *nea_sub_create(nea_server_t *nes)
return s;
}
/* ----------------------------------------------------------------- */
nta_incoming_t *nea_subnode_get_incoming(nea_subnode_t *sn)
{
assert(sn);
if (sn->sn_subscriber) {
return sn->sn_subscriber->s_irq;
}
return NULL;
}
/* ----------------------------------------------------------------- */
void nea_sub_remove(nea_sub_t *s)
......
......@@ -1842,6 +1842,19 @@ For reference:
* @param tags
*/
/** @var nua_event_e::nua_i_subscription
*
* Incoming subscription to be authorized.
*
* This event is launched by nua_notifier to inform application of the
* current state of the subscriber and to authorize the subscriber.
*
* @param nh operation handle associated with the nua_notifier
* @param hmagic operation magic
* @param sip incoming SUBSRIBE request
* @param tags empty
*/
/** @var nua_event_e::nua_i_terminated
*
* A call has been terminated.
......
......@@ -93,6 +93,8 @@ typedef enum nua_event_e {
nua_i_notify, /**< Incoming event */
nua_i_method, /**< Incoming, unknown method */
nua_i_subscription, /**< Incoming subscription to be authorized */
nua_i_media_error, /**< Offer-answer error indication */
/* Responses */
......
......@@ -195,6 +195,8 @@ char const *nua_event_name(nua_event_t event)
case nua_i_notify: return "nua_i_notify";
case nua_i_method: return "nua_i_method";
case nua_i_subscription: return "nua_i_subscription";
case nua_i_media_error: return "nua_i_media_error";
/* Responses */
......
......@@ -6524,6 +6524,14 @@ void authenticate_watcher(nea_server_t *nes,
nea_subnode_t *sn,
sip_t const *sip)
{
nua_t *nua = nh->nh_nua;
msg_t *msg = NULL;
nta_incoming_t *irq = NULL;
irq = nea_subnode_get_incoming(sn);
msg = nta_incoming_getrequest(irq);
ua_event(nua, nh, msg, nua_i_subscription, SIP_200_OK, TAG_END());
if (sn->sn_state == nea_embryonic) {
SU_DEBUG_7(("nea: authenticate_watcher: new watcher\n"));
nea_server_auth(sn->sn_subscriber, nea_active, TAG_END());
......
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