Commit 8d2fe4f7 authored by Pekka Pessi's avatar Pekka Pessi

nua_stack_process_register(): moved to nua_registrar.c.

darcs-hash:20061003082902-65a35-f06d2baaa2a247414fee4d879f7232b6d7838579.gz
parent 2651c06e
......@@ -47,7 +47,8 @@ libnua_la_SOURCES = nua.c nua_stack.h nua_common.c nua_stack.c \
nua_dialog.c nua_dialog.h \
outbound.c outbound.h \
nua_params.c nua_params.h \
nua_register.c nua_session.c nua_options.c \
nua_register.c nua_registrar.c \
nua_session.c nua_options.c \
nua_message.c nua_publish.c nua_subnotref.c \
nua_notifier.c \
nua_event_server.c \
......
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2006 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE nua_registrar.c
* @brief REGISTER UAS
*
* @author Michael Jerris
*
* @date Created: Tue Oct 3 10:14:54 EEST 2006 ppessi
*/
#include "config.h"
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <assert.h>
#include <sofia-sip/string0.h>
#include <sofia-sip/sip_protos.h>
#include <sofia-sip/sip_status.h>
#include <sofia-sip/sip_util.h>
#define NTA_LEG_MAGIC_T struct nua_handle_s
#define NTA_OUTGOING_MAGIC_T struct nua_handle_s
#define NTA_INCOMING_MAGIC_T struct nua_handle_s
#define NTA_RELIABLE_MAGIC_T struct nua_handle_s
#include "nua_stack.h"
/* ======================================================================== */
/* REGISTER */
int nua_stack_process_register(nua_t *nua,
nua_handle_t *nh,
nta_incoming_t *irq,
sip_t const *sip)
{
if (nh == NULL)
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_100_TRYING, TAG_END());
return 0;
}
......@@ -43,6 +43,7 @@
#include <sofia-sip/sip_protos.h>
#include <sofia-sip/sip_status.h>
#include <sofia-sip/sip_util.h>
#include <sofia-sip/su_uniqueid.h>
#define NTA_LEG_MAGIC_T struct nua_handle_s
#define NTA_OUTGOING_MAGIC_T struct nua_handle_s
......@@ -52,16 +53,12 @@
#include "nua_stack.h"
#include <sofia-sip/soa.h>
#if !defined(random) && defined(_WIN32)
#define random rand
#endif
#ifndef SDP_H
typedef struct sdp_session_s sdp_session_t;
#endif
/* ---------------------------------------------------------------------- */
/* */
/** @enum nua_callstate
The states for SIP session established with INVITE.
......@@ -75,6 +72,8 @@ If a re-INVITE transaction fails, the result depends on the status code in
failure. The call can return to the ready state, be terminated immediately,
or be terminated gracefully. The proper action to take is determined with
sip_response_terminates_dialog().
@sa @ref nua_call_model, #nua_i_state, nua_invite(), #nua_i_invite
@par Session State Diagram
......@@ -1311,7 +1310,7 @@ int process_invite1(nua_t *nua,
sip_retry_after_t af[1];
/* Random delay of 0..10 seconds */
sip_retry_after_init(af)->af_delta = (unsigned)random() % 11U;
sip_retry_after_init(af)->af_delta = (unsigned)su_randint(0, 10);
af->af_comment = "Overlapping INVITE Request";
nta_incoming_treply(irq, 500, af->af_comment,
......@@ -2233,28 +2232,6 @@ int nua_stack_process_info(nua_t *nua,
}
/* ======================================================================== */
/* REGISTER */
int nua_stack_process_register(nua_t *nua,
nua_handle_t *nh,
nta_incoming_t *irq,
sip_t const *sip)
{
if (nh == NULL)
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_100_TRYING, TAG_END());
return 0;
}
/* ======================================================================== */
/* UPDATE */
......
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