Update MESSAGE dialog.

Resolve bugs.
This commit is contained in:
bossiel 2010-02-18 18:37:57 +00:00
parent efefb2782f
commit 0e81cb03f7
35 changed files with 649 additions and 333 deletions

View File

@ -32,7 +32,7 @@
#include "tsk_debug.h"
#if defined (_DEBUG) || defined (DEBUG)
# define TSK_DEBUG_OBJECTS 0
# define TSK_DEBUG_OBJECTS 1
static int tsk_objects_count = 0;
#else
# define TSK_DEBUG_OBJECTS 0

View File

@ -128,7 +128,7 @@ char* tsk_strdup(const char *s1)
{
return strdup(s1);
}
return 0;
return TSK_NULL;
}
/**

View File

@ -0,0 +1,66 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
/**@file tsip_message.h
* @brief Public registration (MESSAGE) functions.
*
* @author Mamadou Diop <diopmamadou(at)yahoo.fr>
*
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
*/
#ifndef TINYSIP_TSIP_MESSAGE_H
#define TINYSIP_TSIP_MESSAGE_H
#include "tinysip_config.h"
#include "tinysip/tsip_event.h"
TSIP_BEGIN_DECLS
#define TSIP_MESSAGE_EVENT(self) ((tsip_message_event_t*)(self))
typedef enum tsip_message_event_type_e
{
tsip_i_message,
tsip_ai_message,
tsip_o_message,
tsip_ao_message,
}
tsip_message_event_type_t;
typedef struct tsip_message_event_e
{
TSIP_DECLARE_EVENT;
tsip_message_event_type_t type;
}
tsip_message_event_t;
int tsip_message_event_signal(tsip_message_event_type_t type, struct tsip_stack_s *stack, tsip_operation_id_t opid, short status_code, const char *phrase, const struct tsip_message_s* sipmessage);
typedef int (*tsip_message_callback)(const tsip_message_event_t *sipevent);
TINYSIP_GEXTERN const void *tsip_message_event_def_t;
TSIP_END_DECLS
#endif /* TINYSIP_TSIP_MESSAGE_H */

View File

@ -40,18 +40,15 @@ TSIP_BEGIN_DECLS
typedef enum tsip_register_event_type_e
{
tsip_register_ok,
tsip_register_nok,
tsip_unregister_ok,
tsip_unregister_nok,
tsip_registering,
tsip_unregistering,
tsip_register_sent,
tsip_register_cancelled,
tsip_register_auth_nok,
tsip_register_secagree_nok,
tsip_register_transporterr,
tsip_register_terminated,
tsip_i_register,
tsip_ai_register,
tsip_o_register,
tsip_ao_register,
tsip_i_unregister,
tsip_ai_unregister,
tsip_o_unregister,
tsip_ao_unregister,
}
tsip_register_event_type_t;
@ -63,7 +60,7 @@ typedef struct tsip_register_event_e
}
tsip_register_event_t;
int tsip_register_event_signal(tsip_register_event_type_t type, struct tsip_stack_s *stack, tsip_operation_id_t opid, short status_code, const char *phrase, unsigned incoming);
int tsip_register_event_signal(tsip_register_event_type_t type, struct tsip_stack_s *stack, tsip_operation_id_t opid, short status_code, const char *phrase, const struct tsip_message_s* sipmessage);
typedef int (*tsip_register_callback)(const tsip_register_event_t *sipevent);

View File

@ -40,19 +40,20 @@ TSIP_BEGIN_DECLS
typedef enum tsip_subscribe_event_type_e
{
tsip_subscribe_ok,
tsip_subscribe_nok,
tsip_unsubscribe_ok,
tsip_unsubscribe_nok,
tsip_subscribing,
tsip_unsubscribing,
tsip_subscribe_notify,
tsip_subscribe_sent,
tsip_subscribe_cancelled,
tsip_subscribe_auth_nok,
tsip_subscribe_secagree_nok,
tsip_subscribe_transporterr,
tsip_subscribe_terminated,
tsip_i_subscribe,
tsip_ai_subscribe,
tsip_o_subscribe,
tsip_ao_subscribe,
tsip_i_unsubscribe,
tsip_ai_unsubscribe,
tsip_o_unsubscribe,
tsip_ao_unsubscribe,
tsip_i_notify,
tsip_ai_notify,
tsip_o_notify,
tsip_ao_notify
}
tsip_subscribe_event_type_t;
@ -64,7 +65,7 @@ typedef struct tsip_subscribe_event_e
}
tsip_subscribe_event_t;
int tsip_subscribe_event_signal(tsip_subscribe_event_type_t type, struct tsip_stack_s *stack, tsip_operation_id_t opid, short status_code, const char *phrase, unsigned incoming);
int tsip_subscribe_event_signal(tsip_subscribe_event_type_t type, struct tsip_stack_s *stack, tsip_operation_id_t opid, short status_code, const char *phrase, const struct tsip_message_s* sipmessage);
typedef int (*tsip_subscribe_callback)(const tsip_subscribe_event_t *sipevent);

View File

@ -83,7 +83,8 @@ tsip_dialog_type_t;
typedef enum tsip_dialog_event_type_e
{
tsip_dialog_msg,
tsip_dialog_i_msg,
tsip_dialog_o_msg,
tsip_dialog_transac_ok,
tsip_dialog_canceled,
tsip_dialog_terminated,

View File

@ -53,9 +53,7 @@ typedef struct tsip_dialog_message
}
tsip_dialog_message_t;
//int tsip_dialog_message_send(tsip_dialog_message_t *self);
//int tsip_dialog_message_recv(tsip_dialog_message_t *self, const tsip_message_t *message);
int tsip_dialog_message_start(tsip_dialog_message_t *self);
TINYSIP_GEXTERN const void *tsip_dialog_message_def_t;

View File

@ -39,9 +39,9 @@ TSIP_BEGIN_DECLS
* Creates new sip 'Content-Length' header. You must call @ref TSK_OBJECT_SAFE_FREE to free the header.
* @sa TSK_OBJECT_SAFE_FREE.
*/
#define TSIP_HEADER_CONTENT_LENGTH_VA_ARGS(length) tsip_header_Content_Length_def_t, (uint32_t)length
#define TSIP_HEADER_CONTENT_LENGTH_CREATE(length) tsk_object_new(TSIP_HEADER_CONTENT_LENGTH_VA_ARGS(length))
#define TSIP_HEADER_CONTENT_LENGTH_CREATE_NULL() TSIP_HEADER_CONTENT_LENGTH_CREATE(0)
////////////////////////////////////////////////////////////////////////////////////////////////////
/// @struct

View File

@ -39,7 +39,9 @@ TSIP_BEGIN_DECLS
* Creates new sip 'Content-Type' header. You must call @ref TSK_OBJECT_SAFE_FREE to free the header.
* @sa TSK_OBJECT_SAFE_FREE.
*/
#define TSIP_HEADER_CONTENT_TYPE_CREATE() tsk_object_new(tsip_header_Content_Type_def_t)
#define TSIP_HEADER_CONTENT_TYPE_VA_ARGS(type) tsip_header_Content_Type_def_t, (const char*)type
#define TSIP_HEADER_CONTENT_TYPE_CREATE(type) tsk_object_new(TSIP_HEADER_CONTENT_TYPE_VA_ARGS(type))
#define TSIP_HEADER_CONTENT_TYPE_CREATE_NULL() TSIP_HEADER_CONTENT_TYPE_CREATE(TSIP_NULL)
////////////////////////////////////////////////////////////////////////////////////////////////////
/// @struct

View File

@ -36,7 +36,7 @@
TSIP_BEGIN_DECLS
#define TSIP_EVENT_CREATE(stack, opid, code, phrase, incoming, type) tsk_object_new(tsip_event_def_t, stack, opid, code, phrase, incoming, type)
#define TSIP_EVENT_CREATE(stack, opid, code, phrase, sipmessage, type) tsk_object_new(tsip_event_def_t, stack, opid, code, phrase, (const tsip_message_t*)sipmessage, type)
#define TSIP_EVENT(self) ((tsip_event_t*)(self))
@ -48,7 +48,6 @@ typedef enum tsip_event_type_e
tsip_event_register,
tsip_event_subscribe,
tsip_event_transporterr,
}
@ -64,15 +63,15 @@ typedef struct tsip_event_s
short code;
char *phrase;
unsigned incoming:1;
tsip_event_type_t type;
struct tsip_message_s *sipmessage;
}
tsip_event_t;
#define TSIP_DECLARE_EVENT tsip_event_t sipevent
TINYSIP_GEXTERN const void *tsip_event_def_t;
int tsip_event_init(tsip_event_t* self, struct tsip_stack_s *stack, tsip_operation_id_t opid, short code, const char *phrase, unsigned incoming, tsip_event_type_t type);
int tsip_event_init(tsip_event_t* self, struct tsip_stack_s *stack, tsip_operation_id_t opid, short code, const char *phrase, const struct tsip_message_s* sipmessage, tsip_event_type_t type);
int tsip_event_deinit(tsip_event_t* self);
typedef int (*tsip_stack_callback)(const tsip_event_t *sipevent);

View File

@ -79,19 +79,20 @@ TSIP_BEGIN_DECLS
#define TSIP_REQUEST_METHOD(self) ((self)->method)
#define TSIP_REQUEST_URI(self) ((self)->uri)
#define TSIP_MESSAGE_CONTENT_LENGTH(message) (uint32_t)(((message) && (message)->Content_Length) ? (message)->Content_Length->length : 0)
#define TSIP_MESSAGE_CONTENT(message) (TSIP_MESSAGE_HAS_CONTENT(message) ? (message)->Content : 0)
#define TSIP_MESSAGE_HAS_CONTENT(message) ((message) && (message)->Content)
#define TSIP_MESSAGE_CONTENT_LENGTH(message) (uint32_t)(((message) && (message)->Content_Length) ? (message)->Content_Length->length : 0)
#define TSIP_MESSAGE_CONTENT(message) (TSIP_MESSAGE_HAS_CONTENT(message) ? (message)->Content->data : 0)
#define TSIP_RESPONSE_IS(self, code) (TSIP_RESPONSE_CODE((self)) == code)
#define TSIP_RESPONSE_IS_NXX(self, N) (N##00<= TSIP_RESPONSE_CODE((self)) && TSIP_RESPONSE_CODE((self)) <= N##99)
#define TSIP_RESPONSE_IS_NXX(self, N) (TSIP_MESSAGE_IS_RESPONSE((self)) && N##00<= TSIP_RESPONSE_CODE((self)) && TSIP_RESPONSE_CODE((self)) <= N##99)
#define TSIP_RESPONSE_IS_1XX(self) TSIP_RESPONSE_IS_NXX(self, 1)
#define TSIP_RESPONSE_IS_2XX(self) TSIP_RESPONSE_IS_NXX(self, 2)
#define TSIP_RESPONSE_IS_3XX(self) TSIP_RESPONSE_IS_NXX(self, 3)
#define TSIP_RESPONSE_IS_4XX(self) TSIP_RESPONSE_IS_NXX(self, 4)
#define TSIP_RESPONSE_IS_5XX(self) TSIP_RESPONSE_IS_NXX(self, 5)
#define TSIP_RESPONSE_IS_6XX(self) TSIP_RESPONSE_IS_NXX(self, 6)
#define TSIP_RESPONSE_IS_23456(self) (200<= TSIP_RESPONSE_CODE((self)) && TSIP_RESPONSE_CODE((self)) <= 699)
#define TSIP_RESPONSE_IS_23456(self) (TSIP_MESSAGE_IS_RESPONSE((self)) && 200<= TSIP_RESPONSE_CODE((self)) && TSIP_RESPONSE_CODE((self)) <= 699)
/**
* @enum tsip_message_type_t
@ -210,6 +211,7 @@ typedef tsip_message_t tsip_response_t; /**< SIP response message. */
TINYSIP_API int tsip_message_add_header(tsip_message_t *self, const tsip_header_t *hdr);
TINYSIP_API int tsip_message_add_headers(tsip_message_t *self, const tsip_headers_L_t *headers);
TINYSIP_API int tsip_message_add_content(tsip_message_t *self, const char* content_type, const void* content, size_t size);
#if !defined(_MSC_VER) || defined(__GNUC__)
static void TSIP_MESSAGE_ADD_HEADER(tsip_message_t *self, ...)

View File

@ -42,6 +42,7 @@ TSIP_BEGIN_DECLS
typedef uint64_t tsip_operation_id_t;
#define TSIP_OPERATION_INVALID_ID 0
#define TSIP_OPERATION_INVALID_HANDLE TSIP_NULL
typedef enum tsip_operation_param_type_e
{
@ -56,7 +57,7 @@ tsip_operation_param_type_t;
typedef void tsip_operation_handle_t;
tsip_operation_handle_t *tsip_operation_clone(const tsip_operation_handle_t *self);
tsip_operation_handle_t *tsip_operation_createex(const struct tsip_message_s* message);
TINYSIP_API tsip_operation_id_t tsip_operation_get_id(const tsip_operation_handle_t *self);
const tsk_param_t* tsip_operation_get_param(const tsip_operation_handle_t *self, const char* pname);

View File

@ -91,9 +91,9 @@ tsip_uri_t;
typedef tsk_list_t tsip_uris_L_t;
TINYSIP_API int tsip_uri_serialize(const tsip_uri_t *uri, int with_params, int quote, tsk_buffer_t *output);
TINYSIP_API char* tsip_uri_tostring(const tsip_uri_t *uri, int with_params, int quote);
TINYSIP_API tsip_uri_t *tsip_uri_clone(const tsip_uri_t *uri, int with_params, int quote);
TINYSIP_API int tsip_uri_serialize(const tsip_uri_t *uri, TSIP_BOOLEAN with_params, TSIP_BOOLEAN quote, tsk_buffer_t *output);
TINYSIP_API char* tsip_uri_tostring(const tsip_uri_t *uri, TSIP_BOOLEAN with_params, TSIP_BOOLEAN quote);
TINYSIP_API tsip_uri_t *tsip_uri_clone(const tsip_uri_t *uri, TSIP_BOOLEAN with_params, TSIP_BOOLEAN quote);
TINYSIP_GEXTERN const void *tsip_uri_def_t;

View File

@ -80,5 +80,6 @@
#define TSIP_TRUE 1
#define TSIP_FALSE 0
typedef int TSIP_BOOLEAN;
#define TSIP_NULL 0
#endif // TINYSIP_CONFIG_H

View File

@ -38,6 +38,7 @@
#include "tinysip/api/tsip_register.h"
#include "tinysip/api/tsip_subscribe.h"
#include "tinysip/api/tsip_message.h"
#include "tinysip/tsip_uri.h"
@ -129,6 +130,7 @@ typedef struct tsip_stack_s
tsip_stack_callback callback;
tsip_register_callback callback_register;
tsip_subscribe_callback callback_subscribe;
tsip_message_callback callback_message;
/* Identity */
char* display_name;
@ -203,6 +205,7 @@ TINYSIP_API int tsip_stack_start(tsip_stack_handle_t *self);
TINYSIP_API int tsip_stack_set(tsip_stack_handle_t *self, ...);
TINYSIP_API int tsip_stack_set_callback_register(tsip_stack_handle_t *self, tsip_register_callback callback);
TINYSIP_API int tsip_stack_set_callback_subscribe(tsip_stack_handle_t *self, tsip_subscribe_callback callback);
TINYSIP_API int tsip_stack_set_callback_message(tsip_stack_handle_t *self, tsip_message_callback callback);
//int tsip_stack_alert(const tsip_stack_handle_t *self, tsip_operation_id_t opid, short status_code, char *reason_phrase, int incoming, tsip_event_type_t type);
TINYSIP_API int tsip_stack_stop(tsip_stack_handle_t *self);
TINYSIP_API int tsip_stack_destroy(tsip_stack_handle_t *self);
@ -220,6 +223,8 @@ int tsip_unregister(tsip_stack_handle_t *stack, const tsip_operation_handle_t *o
TINYSIP_API int tsip_subscribe(tsip_stack_handle_t *stack, const tsip_operation_handle_t *operation);
int tsip_unsubscribe(tsip_stack_handle_t *stack, const tsip_operation_handle_t *operation);
TINYSIP_API int tsip_message(tsip_stack_handle_t *stack, const tsip_operation_handle_t *operation);
#define TSIP_STACK_EVENT_RAISE(stack, status_code, reason_phrase, incoming, type) \
TSK_RUNNABLE_ENQUEUE(TSK_RUNNABLE(stack), (const tsip_stack_handle_t*)stack, (short)status_code, (const char*)reason_phrase, (unsigned)incoming, (tsip_event_type_t)type);

View File

@ -89,8 +89,13 @@ int tsip_header_Content_Type_tostring(const void* header, tsk_buffer_t* output)
{
if(header)
{
const tsip_header_Content_Type_t *Content_Type = header;
return tsk_buffer_append(output, Content_Type->type, strlen(Content_Type->type));
const tsip_header_Content_Type_t *Content_Type = header;
if(Content_Type->type){
return tsk_buffer_append(output, Content_Type->type, strlen(Content_Type->type));
}
else{
return -2;
}
}
return -1;
@ -102,7 +107,7 @@ tsip_header_Content_Type_t *tsip_header_Content_Type_parse(const char *data, siz
const char *p = data;
const char *pe = p + size;
const char *eof = pe;
tsip_header_Content_Type_t *hdr_ctype = TSIP_HEADER_CONTENT_TYPE_CREATE();
tsip_header_Content_Type_t *hdr_ctype = TSIP_HEADER_CONTENT_TYPE_CREATE_NULL();
const char *tag_start;
@ -137,6 +142,8 @@ static void* tsip_header_Content_Type_create(void *self, va_list * app)
{
TSIP_HEADER(Content_Type)->type = tsip_htype_Content_Type;
TSIP_HEADER(Content_Type)->tostring = tsip_header_Content_Type_tostring;
Content_Type->type = tsk_strdup( va_arg(*app, const char*) );
}
else
{

View File

@ -0,0 +1,139 @@
/*
* Copyright (C) 2009 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/
/**@file tsip_message.c
* @brief Public short messaging (MESSAGE) functions.
*
* @author Mamadou Diop <diopmamadou(at)yahoo.fr>
*
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
*/
#include "tinysip/api/tsip_message.h"
#include "tinysip/dialogs/tsip_dialog_layer.h"
#include "tinysip/dialogs/tsip_dialog_message.h"
#include "tsip.h"
#include "tsk_runnable.h"
#include "tsk_debug.h"
#define TSIP_MESSAGE_EVENT_CREATE( type) tsk_object_new(tsip_message_event_def_t, type)
int tsip_message_event_signal(tsip_message_event_type_t type, struct tsip_stack_s *stack, tsip_operation_id_t opid, short status_code, const char *phrase, const tsip_message_t* sipmessage)
{
tsip_message_event_t* sipevent = TSIP_MESSAGE_EVENT_CREATE(type);
tsip_event_init(TSIP_EVENT(sipevent), stack, opid, status_code, phrase, sipmessage, tsip_event_message);
TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(stack), sipevent);
return 0;
}
int tsip_message(tsip_stack_handle_t *_stack, const tsip_operation_handle_t *operation)
{
int ret = -1;
if(_stack && operation)
{
tsip_stack_t *stack = _stack;
tsip_dialog_message_t *dialog;
dialog = (tsip_dialog_message_t*)tsip_dialog_layer_find_by_op(stack->layer_dialog, tsip_dialog_message, operation);
if(dialog)
{
TSK_DEBUG_WARN("Dialog with same opid already exist.");
ret = -2;
goto bail;
}
else
{
dialog = TSIP_DIALOG_MESSAGE_CREATE(stack, operation);
ret = tsip_dialog_message_start(dialog);
tsk_list_push_back_data(stack->layer_dialog->dialogs, (void**)&dialog);
}
}
bail:
return ret;
}
int tsip_unmessage(tsip_stack_handle_t *_stack, const tsip_operation_handle_t *operation)
{
if(_stack && operation)
{
//const tsip_stack_t *stack = self;
//tsip_operation_handle_t *op = tsip_operation_clone(operation);
//tsk_list_push_back_data(stack->operations, (void**)&op);
}
return -1;
}
//========================================================
// SIP MESSAGE event object definition
//
static void* tsip_message_event_create(void * self, va_list * app)
{
tsip_message_event_t *sipevent = self;
if(sipevent)
{
sipevent->type = va_arg(*app, tsip_message_event_type_t);
}
return self;
}
static void* tsip_message_event_destroy(void * self)
{
tsip_message_event_t *sipevent = self;
if(sipevent)
{
tsip_event_deinit(TSIP_EVENT(sipevent));
}
return self;
}
static int tsip_message_event_cmp(const void *obj1, const void *obj2)
{
return -1;
}
static const tsk_object_def_t tsip_message_event_def_s =
{
sizeof(tsip_message_event_t),
tsip_message_event_create,
tsip_message_event_destroy,
tsip_message_event_cmp,
};
const void *tsip_message_event_def_t = &tsip_message_event_def_s;

View File

@ -39,10 +39,10 @@
#define TSIP_REGISTER_EVENT_CREATE( type) tsk_object_new(tsip_register_event_def_t, type)
int tsip_register_event_signal(tsip_register_event_type_t type, struct tsip_stack_s *stack, tsip_operation_id_t opid, short status_code, const char *phrase, unsigned incoming)
int tsip_register_event_signal(tsip_register_event_type_t type, struct tsip_stack_s *stack, tsip_operation_id_t opid, short status_code, const char *phrase, const tsip_message_t* sipmessage)
{
tsip_register_event_t* sipevent = TSIP_REGISTER_EVENT_CREATE(type);
tsip_event_init(TSIP_EVENT(sipevent), stack, opid, status_code, phrase, incoming, tsip_event_register);
tsip_event_init(TSIP_EVENT(sipevent), stack, opid, status_code, phrase, sipmessage, tsip_event_register);
TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(stack), sipevent);

View File

@ -39,10 +39,10 @@
#define TSIP_SUBSCRIBE_EVENT_CREATE( type) tsk_object_new(tsip_subscribe_event_def_t, type)
int tsip_subscribe_event_signal(tsip_subscribe_event_type_t type, struct tsip_stack_s *stack, tsip_operation_id_t opid, short status_code, const char *phrase, unsigned incoming)
int tsip_subscribe_event_signal(tsip_subscribe_event_type_t type, struct tsip_stack_s *stack, tsip_operation_id_t opid, short status_code, const char *phrase, const tsip_message_t* sipmessage)
{
tsip_subscribe_event_t* sipevent = TSIP_SUBSCRIBE_EVENT_CREATE(type);
tsip_event_init(TSIP_EVENT(sipevent), stack, opid, status_code, phrase, incoming, tsip_event_subscribe);
tsip_event_init(TSIP_EVENT(sipevent), stack, opid, status_code, phrase, sipmessage, tsip_event_subscribe);
TSK_RUNNABLE_ENQUEUE_OBJECT(TSK_RUNNABLE(stack), sipevent);

View File

@ -34,6 +34,8 @@
#include "tinysip/transactions/tsip_transac_nict.h"
#include "tinysip/parsers/tsip_parser_uri.h"
#include "tinysip/headers/tsip_header_Authorization.h"
#include "tinysip/headers/tsip_header_Contact.h"
#include "tinysip/headers/tsip_header_Expires.h"
@ -680,8 +682,6 @@ int tsip_dialog_init(tsip_dialog_t *self, tsip_dialog_type_t type, tsip_stack_ha
{
if(self)
{
const tsk_param_t* param;
if(self->initialized)
{
TSK_DEBUG_WARN("Dialog already initialized.");
@ -720,12 +720,42 @@ int tsip_dialog_init(tsip_dialog_t *self, tsip_dialog_type_t type, tsip_stack_ha
/* CSeq */
self->cseq_value = rand();
/* Expires */
if((param = tsip_operation_get_param(TSIP_DIALOG(self)->operation, "expires"))){
self->expires = atoi(param->value);
/*== Operation */
if(self->operation != TSIP_OPERATION_INVALID_HANDLE)
{
const tsk_param_t* param;
tsip_uri_t* uri;
/* Expires */
if((param = tsip_operation_get_param(self->operation, "expires"))){
self->expires = atoi(param->value);
}
else{
self->expires = TSIP_DIALOG_EXPIRES_DEFAULT;
}
/* from */
if((param = tsip_operation_get_param(TSIP_DIALOG(self)->operation, "from")) && (uri = tsip_uri_parse(param->value, strlen(param->value)))){
self->uri_local = uri;
}
else{
self->uri_local = tsk_object_ref((void*)TSIP_DIALOG_GET_STACK(self)->public_identity);
}
/* to */
if((param = tsip_operation_get_param(TSIP_DIALOG(self)->operation, "to")) && (uri = tsip_uri_parse(param->value, strlen(param->value)))){
self->uri_remote_target = tsk_object_ref(uri); /* the to uri will be used as request uri. */
self->uri_remote = tsk_object_ref(uri);
tsk_object_unref(uri);
}
else{
self->uri_remote = tsk_object_ref((void*)TSIP_DIALOG_GET_STACK(self)->public_identity);
self->uri_remote_target = tsk_object_ref((void*)TSIP_DIALOG_GET_STACK(self)->realm);
}
}
else{
self->expires = TSIP_DIALOG_EXPIRES_DEFAULT;
else
{
TSK_DEBUG_ERROR("Invalid operation id.");
}
self->initialized = 1;

View File

@ -173,23 +173,20 @@ int tsip_dialog_layer_handle_incoming_msg(const tsip_dialog_layer_t *self, const
//tsk_safeobj_unlock(self);
if(dialog){
dialog->callback(dialog, tsip_dialog_msg, message);
dialog->callback(dialog, tsip_dialog_i_msg, message);
if((transac = tsip_transac_layer_new(layer_transac, TSIP_FALSE, message))){
TSIP_TRANSAC(transac)->dialog = dialog;
}
}
else{
/*const*/ tsip_transac_t* transac = 0;
else{
if(TSIP_MESSAGE_IS_REQUEST(message))
{
tsip_operation_handle_t* op = tsip_operation_createex(message);
if(tsk_strequals("MESSAGE", TSIP_REQUEST_METHOD(message)))
{
tsip_dialog_message_t *dlg_msg = TSIP_DIALOG_MESSAGE_CREATE(self->stack, 0);
transac = tsip_transac_layer_new(layer_transac, TSIP_FALSE, message);
if(transac)
tsip_dialog_message_t *dlg_msg = TSIP_DIALOG_MESSAGE_CREATE(self->stack, op);
if((transac = tsip_transac_layer_new(layer_transac, TSIP_FALSE, message)))
{
TSIP_TRANSAC(transac)->dialog = TSIP_DIALOG(dlg_msg);
}
@ -200,7 +197,9 @@ int tsip_dialog_layer_handle_incoming_msg(const tsip_dialog_layer_t *self, const
{
}
// ....
// ....
TSK_OBJECT_SAFE_FREE(op);
}
}

View File

@ -37,13 +37,11 @@
#include "tsk_time.h"
#define DEBUG_STATE_MACHINE 1
#define TSIP_DIALOG_MESSAGE_SIGNAL_ERROR(self) \
TSIP_DIALOG_SYNC_BEGIN(self); \
tsip_dialog_messageContext_sm_error(&TSIP_DIALOG_MESSAGE(self)->_fsm); \
TSIP_DIALOG_SYNC_END(self);
#define TSIP_DIALOG_MESSAGE_SIGNAL(self, type, code, phrase, message) \
tsip_message_event_signal(type, TSIP_DIALOG_GET_STACK(self), tsip_operation_get_id(TSIP_DIALOG(self)->operation), code, phrase, message)
/* ======================== internal functions ======================== */
int send_message(tsip_dialog_message_t *self);
int send_MESSAGE(tsip_dialog_message_t *self, tsip_request_t *request);
int send_response(tsip_dialog_message_t *self, short status, const char* phrase, const tsip_request_t *request);
int tsip_dialog_message_OnTerminated(tsip_dialog_message_t *self);
@ -96,7 +94,7 @@ int tsip_dialog_message_event_callback(const tsip_dialog_message_t *self, tsip_d
switch(type)
{
case tsip_dialog_msg:
case tsip_dialog_i_msg:
{
if(msg)
{
@ -122,7 +120,7 @@ int tsip_dialog_message_event_callback(const tsip_dialog_message_t *self, tsip_d
TSK_DEBUG_WARN("Not supported status code: %d", status_code);
}
}
else
else // REQUEST ==> Incoming MESSAGE
{
ret = tsk_fsm_act(self->fsm, _fsm_action_receiveMESSAGE, self, msg, self, msg);
}
@ -130,6 +128,18 @@ int tsip_dialog_message_event_callback(const tsip_dialog_message_t *self, tsip_d
break;
}
//case tsip_dialog_o_msg:
// {
// if(msg)
// {
// if(TSIP_MESSAGE_IS_REQUEST(msg)) /* outgoing MESSAGE. */
// {
// ret = tsk_fsm_act(self->fsm, _fsm_action_sendMESSAGE, self, msg, self, msg);
// }
// }
// break;
// }
case tsip_dialog_canceled:
{
ret = tsk_fsm_act(self->fsm, _fsm_action_cancel, self, msg, self, msg);
@ -151,6 +161,8 @@ int tsip_dialog_message_event_callback(const tsip_dialog_message_t *self, tsip_d
int tsip_dialog_message_init(tsip_dialog_message_t *self)
{
//const tsk_param_t* param;
/* Initialize the state machine. */
tsk_fsm_set(self->fsm,
@ -206,29 +218,46 @@ int tsip_dialog_message_init(tsip_dialog_message_t *self)
return 0;
}
/*int tsip_dialog_message_send(tsip_dialog_message_t *self)
int tsip_dialog_message_start(tsip_dialog_message_t *self)
{
int ret = -1;
if(self && !TSIP_DIALOG(self)->running)
{
const tsk_param_t* param;
const void* content = TSIP_NULL;
size_t content_length = 0;
const char* content_type = "text/plain";
self->sender = 1;
//tsip_dialog_messageContext_sm_send(&self->_fsm, message);
tsip_request_t* request = tsip_dialog_request_new(TSIP_DIALOG(self), "MESSAGE");
/* content-type */
if((param = tsip_operation_get_param(TSIP_DIALOG(self)->operation, "content-type"))){
content_type = param->value;
}
/* content-length */
if((param = tsip_operation_get_param(TSIP_DIALOG(self)->operation, "content-length"))){
content_length = atoi(param->value);
}
/* content */
if((param = tsip_operation_get_param(TSIP_DIALOG(self)->operation, "content"))){
content = param->value;
if(!content_length && content){
content_length = strlen(content);
}
}
if(content){
tsip_message_add_content(request, content_type, content, content_length);
}
/* Send request */
ret = tsk_fsm_act(self->fsm, _fsm_action_sendMESSAGE, self, request, self, request);
TSK_OBJECT_SAFE_FREE(request);
}
return ret;
}
int tsip_dialog_message_recv(tsip_dialog_message_t *self, const tsip_message_t *message)
{
int ret = -1;
self->sender = 0;
tsip_dialog_messageContext_sm_receive(&self->_fsm, message);
return ret;
}*/
@ -242,9 +271,9 @@ int tsip_dialog_message_recv(tsip_dialog_message_t *self, const tsip_message_t *
int tsip_dialog_message_Started_2_Sending_X_sendMESSAGE(va_list *app)
{
tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
tsip_request_t *request = va_arg(*app, tsip_request_t *);
return 0;
return send_MESSAGE(self, request);
}
/* Started -> (recvMESSAGE) -> Receiving
@ -254,7 +283,11 @@ int tsip_dialog_message_Started_2_Receiving_X_recvMESSAGE(va_list *app)
tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
return send_response(self, 200, "OK", request);
/* Alert the user. */
TSIP_DIALOG_MESSAGE_SIGNAL(self, tsip_i_message,
299, "Incoming Request.", request);
return send_response(self, 200, "OK", request); // Wait for accept
}
/* Sending -> (1xx) -> Sending
@ -274,6 +307,10 @@ int tsip_dialog_message_Sending_2_Terminated_X_2xx(va_list *app)
tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
/* Alert the user. */
TSIP_DIALOG_MESSAGE_SIGNAL(self, tsip_ao_message,
TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
return 0;
}
@ -294,6 +331,10 @@ int tsip_dialog_message_Sending_2_Terminated_X_300_to_699(va_list *app)
tsip_dialog_message_t *self = va_arg(*app, tsip_dialog_message_t *);
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
/* Alert the user. */
TSIP_DIALOG_MESSAGE_SIGNAL(self, tsip_ao_message,
TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
return 0;
}
@ -351,6 +392,11 @@ int tsip_dialog_message_Any_2_Terminated_X_Error(va_list *app)
// == STATE MACHINE END ==
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++
int send_MESSAGE(tsip_dialog_message_t *self, tsip_request_t *request)
{
return tsip_dialog_request_send(TSIP_DIALOG(self), request);
}
int send_response(tsip_dialog_message_t *self, short status, const char* phrase, const tsip_request_t *request)
{
tsip_response_t *response;

View File

@ -43,14 +43,8 @@
#define DEBUG_STATE_MACHINE 1
#define TSIP_DIALOG_REGISTER_TIMER_SCHEDULE(TX) TSIP_DIALOG_TIMER_SCHEDULE(register, TX)
#define TSIP_DIALOG_REGISTER_SIGNAL_ERROR(self) \
TSIP_DIALOG_SYNC_BEGIN(self); \
tsip_dialog_registerContext_sm_error(&TSIP_DIALOG_REGISTER(self)->_fsm); \
TSIP_DIALOG_SYNC_END(self);
#define TSIP_DIALOG_REGISTER_SIGNAL(self, type, code, phrase, incoming) \
tsip_register_event_signal(type, TSIP_DIALOG_GET_STACK(self),/*tsip_operation_get_id(TSIP_DIALOG(self)->operation)*/0, code, phrase, incoming)
#define TSIP_DIALOG_REGISTER_SIGNAL_INCOMING(self, type, code, phrase) TSIP_DIALOG_REGISTER_SIGNAL(self, type, code, phrase, 1)
#define TSIP_DIALOG_REGISTER_SIGNAL_OUTGOING(self, type, code, phrase) TSIP_DIALOG_REGISTER_SIGNAL(self, type, code, phrase, 0)
#define TSIP_DIALOG_REGISTER_SIGNAL(self, type, code, phrase, message) \
tsip_register_event_signal(type, TSIP_DIALOG_GET_STACK(self),tsip_operation_get_id(TSIP_DIALOG(self)->operation), code, phrase, message)
/* ======================== internal functions ======================== */
@ -135,7 +129,7 @@ int tsip_dialog_register_event_callback(const tsip_dialog_register_t *self, tsip
switch(type)
{
case tsip_dialog_msg:
case tsip_dialog_i_msg:
{
if(msg && TSIP_MESSAGE_IS_RESPONSE(msg))
{
@ -298,9 +292,9 @@ int tsip_dialog_register_init(tsip_dialog_register_t *self)
TSIP_DIALOG(self)->callback = TSIP_DIALOG_EVENT_CALLBACK(tsip_dialog_register_event_callback);
TSIP_DIALOG(self)->uri_local = tsk_object_ref((void*)TSIP_DIALOG_GET_STACK(self)->public_identity);
TSIP_DIALOG(self)->uri_remote = tsk_object_ref((void*)TSIP_DIALOG_GET_STACK(self)->public_identity);
TSIP_DIALOG(self)->uri_remote_target = tsk_object_ref((void*)TSIP_DIALOG_GET_STACK(self)->realm);
//TSIP_DIALOG(self)->uri_local = tsk_object_ref((void*)TSIP_DIALOG_GET_STACK(self)->public_identity);
//TSIP_DIALOG(self)->uri_remote = tsk_object_ref((void*)TSIP_DIALOG_GET_STACK(self)->public_identity);
//TSIP_DIALOG(self)->uri_remote_target = tsk_object_ref((void*)TSIP_DIALOG_GET_STACK(self)->realm);
self->timerrefresh.id = TSK_INVALID_TIMER_ID;
self->timerrefresh.timeout = TSIP_DIALOG(self)->expires;
@ -365,8 +359,8 @@ int tsip_dialog_register_Trying_2_Connected_X_2xx(va_list *app)
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
/* Alert the user. */
TSIP_DIALOG_REGISTER_SIGNAL_INCOMING(self, tsip_register_ok,
TSIP_RESPONSE_CODE(message), TSIP_RESPONSE_PHRASE(message));
TSIP_DIALOG_REGISTER_SIGNAL(self, tsip_ao_register,
TSIP_RESPONSE_CODE(message), TSIP_RESPONSE_PHRASE(message), message);
/* - Set P-associated-uriS
* - Update service-routes
@ -430,7 +424,8 @@ int tsip_dialog_register_Trying_2_Terminated_X_2xx(va_list *app)
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
/* Alert the user. */
TSIP_DIALOG_REGISTER_SIGNAL_INCOMING(self, tsip_unregister_ok, TSIP_RESPONSE_CODE(message), TSIP_RESPONSE_PHRASE(message));
TSIP_DIALOG_REGISTER_SIGNAL(self, tsip_ao_unregister,
TSIP_RESPONSE_CODE(message), TSIP_RESPONSE_PHRASE(message), message);
return 0;
}
@ -446,8 +441,8 @@ int tsip_dialog_register_Trying_2_Trying_X_401_407_421_494(va_list *app)
if((ret = tsip_dialog_update(TSIP_DIALOG(self), message)))
{
/* Alert the user. */
TSIP_DIALOG_REGISTER_SIGNAL_INCOMING(self, self->unregistering ? tsip_unregistering : tsip_registering,
TSIP_RESPONSE_CODE(message), TSIP_RESPONSE_PHRASE(message));
TSIP_DIALOG_REGISTER_SIGNAL(self, self->unregistering ? tsip_ao_unregister : tsip_ao_register,
TSIP_RESPONSE_CODE(message), TSIP_RESPONSE_PHRASE(message), message);
return ret;
}
@ -497,8 +492,9 @@ int tsip_dialog_register_Trying_2_Terminated_X_300_to_699(va_list *app)
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
/* Alert the user. */
TSIP_DIALOG_REGISTER_SIGNAL_INCOMING(self, tsip_register_nok, TSIP_RESPONSE_CODE(message), TSIP_RESPONSE_PHRASE(message));
TSIP_DIALOG_REGISTER_SIGNAL(self, self->unregistering ? tsip_ao_unregister : tsip_ao_register,
TSIP_RESPONSE_CODE(message), TSIP_RESPONSE_PHRASE(message), message);
return 0;
}
@ -510,7 +506,8 @@ int tsip_dialog_register_Trying_2_Terminated_X_cancel(va_list *app)
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
/* Alert the user. */
TSIP_DIALOG_REGISTER_SIGNAL_INCOMING(self, tsip_register_cancelled, 701, "Registration cancelled");
TSIP_DIALOG_REGISTER_SIGNAL(self, self->unregistering ? tsip_ao_unregister : tsip_ao_register,
701, "Registration cancelled", TSIP_NULL);
return 0;
}
@ -553,7 +550,9 @@ int tsip_dialog_register_Any_2_Terminated_X_transportError(va_list *app)
tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
TSIP_DIALOG_REGISTER_SIGNAL_INCOMING(self, tsip_register_transporterr, 702, "Transport error.");
/* Alert the user. */
TSIP_DIALOG_REGISTER_SIGNAL(self, self->unregistering ? tsip_ao_unregister : tsip_ao_register,
702, "Transport error.", TSIP_NULL);
return 0;
}
@ -565,6 +564,10 @@ int tsip_dialog_register_Any_2_Terminated_X_Error(va_list *app)
tsip_dialog_register_t *self = va_arg(*app, tsip_dialog_register_t *);
const tsip_message_t *message = va_arg(*app, const tsip_message_t *);
/* Alert the user. */
TSIP_DIALOG_REGISTER_SIGNAL(self, self->unregistering ? tsip_ao_unregister : tsip_ao_register,
703, "Global error.", TSIP_NULL);
return 0;
}
@ -659,9 +662,6 @@ int tsip_dialog_register_OnTerminated(tsip_dialog_register_t *self)
/* Cancel all timers */
DIALOG_TIMER_CANCEL(refresh);
/* Alert user */
TSIP_DIALOG_REGISTER_SIGNAL_INCOMING(self, tsip_register_terminated, 700, "Dialog terminated.");
/* Remove from the dialog layer. */
return tsip_dialog_remove(TSIP_DIALOG(self));
}

View File

@ -29,8 +29,6 @@
*/
#include "tinysip/dialogs/tsip_dialog_subscribe.h"
#include "tinysip/parsers/tsip_parser_uri.h"
#include "tinysip/headers/tsip_header_Event.h"
#include "tinysip/headers/tsip_header_Min_Expires.h"
#include "tinysip/headers/tsip_header_Subscription_State.h"
@ -40,11 +38,8 @@
#define DEBUG_STATE_MACHINE 1
#define TSIP_DIALOG_SUBSCRIBE_TIMER_SCHEDULE(TX) TSIP_DIALOG_TIMER_SCHEDULE(subscribe, TX)
#define TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, type, code, phrase, incoming) \
tsip_subscribe_event_signal(type, TSIP_DIALOG_GET_STACK(self),/*tsip_operation_get_id(TSIP_DIALOG(self)->operation)*/0, code, phrase, incoming)
#define TSIP_DIALOG_SUBSCRIBE_SIGNAL_INCOMING(self, type, code, phrase) TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, type, code, phrase, 1)
#define TSIP_DIALOG_SUBSCRIBE_SIGNAL_OUTGOING(self, type, code, phrase) TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, type, code, phrase, 0)
#define TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, type, code, phrase, message) \
tsip_subscribe_event_signal(type, TSIP_DIALOG_GET_STACK(self), tsip_operation_get_id(TSIP_DIALOG(self)->operation), code, phrase, message)
/* ======================== internal functions ======================== */
int send_subscribe(tsip_dialog_subscribe_t *self);
@ -146,7 +141,7 @@ int tsip_dialog_subscribe_event_callback(const tsip_dialog_subscribe_t *self, ts
switch(type)
{
case tsip_dialog_msg:
case tsip_dialog_i_msg:
{
if(msg && TSIP_MESSAGE_IS_RESPONSE(msg))
{
@ -256,8 +251,7 @@ int tsip_dialog_subscribe_timer_callback(const tsip_dialog_subscribe_t* self, ts
int tsip_dialog_subscribe_init(tsip_dialog_subscribe_t *self)
{
const tsk_param_t* param;
tsip_uri_t* uri = 0;
/* Initialize the State Machine. */
tsk_fsm_set(self->fsm,
@ -325,25 +319,10 @@ int tsip_dialog_subscribe_init(tsip_dialog_subscribe_t *self)
}
TSIP_DIALOG(self)->callback = TSIP_DIALOG_EVENT_CALLBACK(tsip_dialog_subscribe_event_callback);
/* from */
TSIP_DIALOG(self)->uri_local = tsk_object_ref((void*)TSIP_DIALOG_GET_STACK(self)->public_identity);
/* to */
if((param = tsip_operation_get_param(TSIP_DIALOG(self)->operation, "to")) && (uri = tsip_uri_parse(param->value, strlen(param->value)))){
TSIP_DIALOG(self)->uri_remote_target = tsk_object_ref(uri); /* the to uri will be used as request uri. */
TSIP_DIALOG(self)->uri_remote = tsk_object_ref(uri);
}
else{
TSIP_DIALOG(self)->uri_remote = tsk_object_ref((void*)TSIP_DIALOG_GET_STACK(self)->public_identity);
TSIP_DIALOG(self)->uri_remote_target = tsk_object_ref((void*)TSIP_DIALOG_GET_STACK(self)->realm);
}
self->timerrefresh.id = TSK_INVALID_TIMER_ID;
self->timerrefresh.timeout = TSIP_DIALOG(self)->expires;
tsk_object_unref(uri);
return 0;
}
@ -391,7 +370,8 @@ int tsip_dialog_subscribe_Trying_2_Terminated_X_2xx(va_list *app)
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
/* Alert the user. */
TSIP_DIALOG_SUBSCRIBE_SIGNAL_INCOMING(self, tsip_unsubscribe_ok, TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response));
TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, self->unsubscribing ? tsip_ao_unsubscribe : tsip_ao_subscribe,
TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
return 0;
}
@ -404,8 +384,8 @@ int tsip_dialog_subscribe_Trying_2_Connected_X_2xx(va_list *app)
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
/* Alert the user. */
TSIP_DIALOG_SUBSCRIBE_SIGNAL_INCOMING(self, tsip_subscribe_ok,
TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response));
TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, self->unsubscribing ? tsip_ao_unsubscribe : tsip_ao_subscribe,
TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
/* Update the dialog state. */
tsip_dialog_update(TSIP_DIALOG(self), response);
@ -427,8 +407,8 @@ int tsip_dialog_subscribe_Trying_2_Trying_X_401_407_421_494(va_list *app)
if(tsip_dialog_update(TSIP_DIALOG(self), response))
{
/* Alert the user. */
TSIP_DIALOG_SUBSCRIBE_SIGNAL_INCOMING(self, self->unsubscribing ? tsip_unsubscribing : tsip_subscribing,
TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response));
TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, self->unsubscribing ? tsip_ao_unsubscribe : tsip_ao_subscribe,
TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
return -1;
}
@ -462,8 +442,8 @@ int tsip_dialog_subscribe_Trying_2_Trying_X_423(va_list *app)
}
else
{
TSIP_DIALOG_SUBSCRIBE_SIGNAL_INCOMING(self, self->unsubscribing ? tsip_unsubscribing : tsip_subscribing,
TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response));
TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, self->unsubscribing ? tsip_ao_unsubscribe : tsip_ao_subscribe,
715, "Invalid SIP response.", response);
return -1;
}
@ -479,7 +459,8 @@ int tsip_dialog_subscribe_Trying_2_Terminated_X_300_to_699(va_list *app)
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
/* Alert the user. */
TSIP_DIALOG_SUBSCRIBE_SIGNAL_INCOMING(self, tsip_subscribe_nok, TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response));
TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, self->unsubscribing ? tsip_ao_unsubscribe : tsip_ao_subscribe,
TSIP_RESPONSE_CODE(response), TSIP_RESPONSE_PHRASE(response), response);
return 0;
}
@ -492,7 +473,8 @@ int tsip_dialog_subscribe_Trying_2_Terminated_X_cancel(va_list *app)
const tsip_response_t *response = va_arg(*app, const tsip_response_t *);
/* Alert the user. */
TSIP_DIALOG_SUBSCRIBE_SIGNAL_INCOMING(self, tsip_subscribe_cancelled, 801, "Subscribtion cancelled");
TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, self->unsubscribing ? tsip_ao_unsubscribe : tsip_ao_subscribe,
701, "Subscription cancelled", TSIP_NULL);
return 0;
}
@ -504,9 +486,7 @@ int tsip_dialog_subscribe_Trying_2_Trying_X_NOTIFY(va_list *app)
tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
send_notify_200ok(self, request);
return 0;
return send_notify_200ok(self, request);
}
/* Connected -> (unsubscribe) -> Trying
@ -539,8 +519,8 @@ int tsip_dialog_subscribe_Connected_2_Connected_X_NOTIFY(va_list *app)
send_notify_200ok(self, request);
/* Alert the user */
TSIP_DIALOG_SUBSCRIBE_SIGNAL_INCOMING(self, tsip_subscribe_notify,
TSIP_RESPONSE_CODE(request), TSIP_RESPONSE_PHRASE(request));
TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, tsip_i_notify,
299, "Incoming Request.", request);
/* Request timeout for dialog refresh (re-registration). */
self->timerrefresh.timeout = tsip_dialog_get_newdelay(TSIP_DIALOG(self), request);
@ -556,6 +536,10 @@ int tsip_dialog_subscribe_Connected_2_Terminated_X_NOTIFY(va_list *app)
tsip_dialog_subscribe_t *self = va_arg(*app, tsip_dialog_subscribe_t *);
const tsip_request_t *request = va_arg(*app, const tsip_request_t *);
/* Alert the user */
TSIP_DIALOG_SUBSCRIBE_SIGNAL(self, tsip_i_notify,
720, "Dialog terminated", request);
return send_notify_200ok(self, request);
}
@ -657,9 +641,6 @@ int tsip_dialog_subscribe_OnTerminated(tsip_dialog_subscribe_t *self)
/* Cancel all timers */
DIALOG_TIMER_CANCEL(refresh);
/* Alert user */
TSIP_DIALOG_SUBSCRIBE_SIGNAL_INCOMING(self, tsip_subscribe_terminated, 700, "Dialog terminated.");
/* Remove from the dialog layer. */
return tsip_dialog_remove(TSIP_DIALOG(self));
}

View File

@ -50,8 +50,13 @@ int tsip_header_Content_Type_tostring(const void* header, tsk_buffer_t* output)
{
if(header)
{
const tsip_header_Content_Type_t *Content_Type = header;
return tsk_buffer_append(output, Content_Type->type, strlen(Content_Type->type));
const tsip_header_Content_Type_t *Content_Type = header;
if(Content_Type->type){
return tsk_buffer_append(output, Content_Type->type, strlen(Content_Type->type));
}
else{
return -2;
}
}
return -1;
@ -63,12 +68,12 @@ tsip_header_Content_Type_t *tsip_header_Content_Type_parse(const char *data, siz
const char *p = data;
const char *pe = p + size;
const char *eof = pe;
tsip_header_Content_Type_t *hdr_ctype = TSIP_HEADER_CONTENT_TYPE_CREATE();
tsip_header_Content_Type_t *hdr_ctype = TSIP_HEADER_CONTENT_TYPE_CREATE_NULL();
const char *tag_start;
/* #line 72 "../src/headers/tsip_header_Content_Type.c" */
/* #line 77 "../src/headers/tsip_header_Content_Type.c" */
static const char _tsip_machine_parser_header_Content_Type_actions[] = {
0, 1, 0, 1, 1, 1, 2, 1,
3
@ -235,16 +240,16 @@ static const int tsip_machine_parser_header_Content_Type_error = 0;
static const int tsip_machine_parser_header_Content_Type_en_main = 1;
/* #line 110 "tsip_parser_header_Content_Type.rl" */
/* #line 115 "tsip_parser_header_Content_Type.rl" */
/* #line 241 "../src/headers/tsip_header_Content_Type.c" */
/* #line 246 "../src/headers/tsip_header_Content_Type.c" */
{
cs = tsip_machine_parser_header_Content_Type_start;
}
/* #line 111 "tsip_parser_header_Content_Type.rl" */
/* #line 116 "tsip_parser_header_Content_Type.rl" */
/* #line 248 "../src/headers/tsip_header_Content_Type.c" */
/* #line 253 "../src/headers/tsip_header_Content_Type.c" */
{
int _klen;
unsigned int _trans;
@ -341,7 +346,7 @@ _match:
{
}
break;
/* #line 345 "../src/headers/tsip_header_Content_Type.c" */
/* #line 350 "../src/headers/tsip_header_Content_Type.c" */
}
}
@ -354,12 +359,12 @@ _again:
_out: {}
}
/* #line 112 "tsip_parser_header_Content_Type.rl" */
/* #line 117 "tsip_parser_header_Content_Type.rl" */
if( cs <
/* #line 361 "../src/headers/tsip_header_Content_Type.c" */
/* #line 366 "../src/headers/tsip_header_Content_Type.c" */
60
/* #line 113 "tsip_parser_header_Content_Type.rl" */
/* #line 118 "tsip_parser_header_Content_Type.rl" */
)
{
TSK_OBJECT_SAFE_FREE(hdr_ctype);
@ -387,6 +392,8 @@ static void* tsip_header_Content_Type_create(void *self, va_list * app)
{
TSIP_HEADER(Content_Type)->type = tsip_htype_Content_Type;
TSIP_HEADER(Content_Type)->tostring = tsip_header_Content_Type_tostring;
Content_Type->type = tsk_strdup( va_arg(*app, const char*) );
}
else
{

View File

@ -454,7 +454,7 @@ int tsip_transac_nict_Trying_2_Proceedding_X_1xx(va_list *app)
}
TRANSAC_TIMER_CANCEL(F);
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_msg, message);
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_i_msg, message);
return 0;
}
@ -480,7 +480,7 @@ int tsip_transac_nict_Trying_2_Completed_X_200_to_699(va_list *app)
}
TRANSAC_TIMER_CANCEL(F);
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_msg, message);
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_i_msg, message);
/* SCHEDULE timer K */
TRANSAC_NICT_TIMER_SCHEDULE(K);
@ -552,7 +552,7 @@ int tsip_transac_nict_Proceeding_2_Proceeding_X_1xx(va_list *app)
{
TRANSAC_TIMER_CANCEL(E);
}
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_msg, message);
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_i_msg, message);
return 0;
}
@ -587,7 +587,7 @@ int tsip_transac_nict_Proceeding_2_Completed_X_200_to_699(va_list *app)
TRANSAC_TIMER_CANCEL(E);
}
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_msg, message);
TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_i_msg, message);
/* SCHEDULE timer K */
TRANSAC_NICT_TIMER_SCHEDULE(K);

View File

@ -272,7 +272,7 @@ int tsip_transac_nist_handle_request(const tsip_transac_nist_t *self, const tsip
int ret = -1;
if(!(ret = tsk_fsm_act(self->fsm, _fsm_action_request, self, TSK_NULL, self, TSK_NULL))){
/* Alert the dialog */
ret = TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_msg, request);
ret = TSIP_TRANSAC(self)->dialog->callback(TSIP_TRANSAC(self)->dialog, tsip_dialog_i_msg, request);
}
return ret;
}

View File

@ -452,6 +452,19 @@ int tsip_stack_set_callback_subscribe(tsip_stack_handle_t *self, tsip_subscribe_
return -1;
}
int tsip_stack_set_callback_message(tsip_stack_handle_t *self, tsip_message_callback callback)
{
if(self)
{
tsip_stack_t *stack = self;
stack->callback_message = callback;
return 0;
}
return -1;
}
//int tsip_stack_alert(const tsip_stack_handle_t *self, tsip_operation_id_t opid, short status_code, char *reason_phrase, int incoming, tsip_event_type_t type)
//{
// if(self)
@ -502,6 +515,7 @@ int tsip_stack_destroy(tsip_stack_handle_t *self)
{
tsip_stack_t *stack = self;
/* Identity */
TSK_FREE(stack->display_name);
TSK_OBJECT_SAFE_FREE(stack->public_identity);
TSK_OBJECT_SAFE_FREE(stack->preferred_identity);
@ -509,21 +523,37 @@ int tsip_stack_destroy(tsip_stack_handle_t *self)
TSK_FREE(stack->private_identity);
TSK_FREE(stack->password);
/* Network */
TSK_FREE(stack->local_ip);
TSK_FREE(stack->privacy);
TSK_FREE(stack->netinfo);
TSK_OBJECT_SAFE_FREE(stack->realm);
TSK_FREE(stack->proxy_cscf);
TSK_FREE(stack->device_id);
TSK_FREE(stack->mobility);
TSK_FREE(stack->sec_agree_mech);
TSK_OBJECT_SAFE_FREE(stack->paths);
TSK_OBJECT_SAFE_FREE(stack->service_routes);
TSK_OBJECT_SAFE_FREE(stack->associated_uris);
/* DNS */
TSK_OBJECT_SAFE_FREE(stack->dns_ctx);
/* DHCP */
/* features */
/* QoS */
/* Internals. */
TSK_OBJECT_SAFE_FREE(stack->timer_mgr);
TSK_OBJECT_SAFE_FREE(stack->operations);
TSK_OBJECT_SAFE_FREE(stack->service_routes);
TSK_OBJECT_SAFE_FREE(stack->paths);
TSK_OBJECT_SAFE_FREE(stack->associated_uris);
/* Layers */
TSK_OBJECT_SAFE_FREE(stack->layer_dialog);
TSK_OBJECT_SAFE_FREE(stack->layer_transac);
TSK_OBJECT_SAFE_FREE(stack->layer_transport);
// FIXME: free strings, uris, ...
TSK_OBJECT_SAFE_FREE(stack->dns_ctx);
return 0;
}
@ -670,6 +700,14 @@ void *run(void* self)
break;
}
}
case tsip_event_message:
{
if(stack->callback_message){
stack->callback_message(TSIP_MESSAGE_EVENT(sipevent));
break;
}
}
default:
{
if(stack->callback){

View File

@ -31,13 +31,15 @@
#include "tsip.h"
#include "tinysip/tsip_message.h"
#include "tsk_string.h"
#include "tsk_memory.h"
int tsip_event_init(tsip_event_t* self, tsip_stack_t *stack, tsip_operation_id_t opid, short code, const char *phrase, unsigned incoming, tsip_event_type_t type)
int tsip_event_init(tsip_event_t* self, struct tsip_stack_s *stack, tsip_operation_id_t opid, short code, const char *phrase, const tsip_message_t* sipmessage, tsip_event_type_t type)
{
if(self && stack)
{
@ -45,8 +47,10 @@ int tsip_event_init(tsip_event_t* self, tsip_stack_t *stack, tsip_operation_id_t
self->opid = opid;
self->code = code;
tsk_strupdate(&(self->phrase), phrase);
self->incoming = incoming;
self->type = type;
if(sipmessage){
self->sipmessage = tsk_object_ref((void*)sipmessage);
}
return 0;
}
return -1;
@ -59,6 +63,7 @@ int tsip_event_deinit(tsip_event_t* self)
TSK_OBJECT_SAFE_FREE(self->stack);
TSK_FREE(self->phrase);
TSK_OBJECT_SAFE_FREE(self->sipmessage);
return 0;
}
return -1;
@ -85,18 +90,27 @@ static void* tsip_event_create(void * self, va_list * app)
tsip_event_t *sipevent = self;
if(sipevent)
{
sipevent->stack = va_arg(*app, tsip_stack_handle_t *);
sipevent->opid = va_arg(*app, tsip_operation_id_t);
const tsip_message_t* sipmessage;
tsip_stack_t *stack;
tsip_operation_id_t opid;
short code;
const char *phrase;
tsip_event_type_t type;
stack = va_arg(*app, tsip_stack_handle_t *);
opid = va_arg(*app, tsip_operation_id_t);
#if defined(__GNUC__)
sipevent->code = (short)va_arg(*app, int);
code = (short)va_arg(*app, int);
#else
sipevent->code = va_arg(*app, short);
code = va_arg(*app, short);
#endif
sipevent->phrase = tsk_strdup(va_arg(*app, const char *));
sipevent->incoming = va_arg(*app, unsigned);
sipevent->type = va_arg(*app, tsip_event_type_t);
phrase = va_arg(*app, const char *);
sipmessage = va_arg(*app, const tsip_message_t*);
type = va_arg(*app, tsip_event_type_t);
tsip_event_init(self, stack, opid, code, phrase, sipmessage, type);
}
return self;
}
@ -106,7 +120,7 @@ static void* tsip_event_destroy(void * self)
tsip_event_t *sipevent = self;
if(sipevent)
{
TSK_FREE(sipevent->phrase);
tsip_event_deinit(sipevent);
}
return self;
}

View File

@ -122,6 +122,23 @@ int tsip_message_add_headers(tsip_message_t *self, const tsip_headers_L_t *heade
return -1;
}
int tsip_message_add_content(tsip_message_t *self, const char* content_type, const void* content, size_t size)
{
if(self)
{
TSK_OBJECT_SAFE_FREE(self->Content_Type);
TSK_OBJECT_SAFE_FREE(self->Content_Length);
TSK_OBJECT_SAFE_FREE(self->Content);
TSIP_MESSAGE_ADD_HEADER(self, TSIP_HEADER_CONTENT_TYPE_VA_ARGS(content_type));
TSIP_MESSAGE_ADD_HEADER(self, TSIP_HEADER_CONTENT_LENGTH_VA_ARGS(size));
self->Content = TSK_BUFFER_CREATE(content, size);
return 0;
}
return -1;
}
const tsip_header_t *tsip_message_get_headerAt(const tsip_message_t *self, tsip_header_type_t type, size_t index)
{
size_t pos = 0;
@ -449,7 +466,7 @@ static void* tsip_message_create(void *self, va_list * app)
message->type = va_arg(*app, tsip_message_type_t);
message->headers = TSK_LIST_CREATE();
message->sockfd = TNET_INVALID_FD;
message->Content_Length = TSIP_HEADER_CONTENT_LENGTH_CREATE(0);
//message->Content_Length = TSIP_HEADER_CONTENT_LENGTH_CREATE(0);
switch(message->type)

View File

@ -30,6 +30,8 @@
#include "tinysip/tsip_operation.h"
#include "tsip.h"
#include "tinysip/tsip_message.h"
#include "tsk_debug.h"
@ -44,13 +46,30 @@ typedef struct tsip_operation_s
tsip_operation_t;
tsip_operation_handle_t *tsip_operation_clone(const tsip_operation_handle_t *self)
tsip_operation_handle_t *tsip_operation_createex(const struct tsip_message_s* message)
{
if(self)
tsip_operation_handle_t* operation = TSIP_NULL;
if(message)
{
return tsk_object_ref((void*)self);
char* from = TSIP_NULL, *to = TSIP_NULL;
if(message->From && message->From->uri){ /* MUST be not null */
from = tsip_uri_tostring(message->From->uri, TSIP_FALSE, TSIP_FALSE);
}
if(message->To && message->To->uri){ /* MUST be not null */
to = tsip_uri_tostring(message->To->uri, TSIP_FALSE, TSIP_FALSE);
}
operation = TSIP_OPERATION_CREATE(TSIP_NULL,
TSIP_OPERATION_SET_PARAM("to", to),
TSIP_OPERATION_SET_PARAM("from", from),
TSIP_OPERATION_SET_NULL());
TSK_FREE(from);
TSK_FREE(to);
}
return 0;
return operation;
}
tsip_operation_id_t tsip_operation_get_id(const tsip_operation_handle_t *self)
@ -70,7 +89,7 @@ const tsk_param_t* tsip_operation_get_param(const tsip_operation_handle_t *self,
const tsip_operation_t *operation = self;
return tsk_params_get_param_by_name(operation->params, pname);
}
return 0;
return TSIP_NULL;
}

View File

@ -40,7 +40,7 @@
/**@defgroup tsip_uri_group
*/
int __tsip_uri_serialize(const tsip_uri_t *uri, int with_params, tsk_buffer_t *output)
int __tsip_uri_serialize(const tsip_uri_t *uri, TSIP_BOOLEAN with_params, tsk_buffer_t *output)
{
tsk_istr_t port;
@ -76,7 +76,7 @@ int __tsip_uri_serialize(const tsip_uri_t *uri, int with_params, tsk_buffer_t *o
return 0;
}
int tsip_uri_serialize(const tsip_uri_t *uri, int with_params, int quote, tsk_buffer_t *output)
int tsip_uri_serialize(const tsip_uri_t *uri, TSIP_BOOLEAN with_params, TSIP_BOOLEAN quote, tsk_buffer_t *output)
{
if(uri)
{
@ -108,7 +108,7 @@ int tsip_uri_serialize(const tsip_uri_t *uri, int with_params, int quote, tsk_bu
return -1;
}
char* tsip_uri_tostring(const tsip_uri_t *uri, int with_params, int quote)
char* tsip_uri_tostring(const tsip_uri_t *uri, TSIP_BOOLEAN with_params, TSIP_BOOLEAN quote)
{
tsk_buffer_t *output = TSK_BUFFER_CREATE_NULL();
char* ret = 0;
@ -126,7 +126,7 @@ char* tsip_uri_tostring(const tsip_uri_t *uri, int with_params, int quote)
return ret;
}
tsip_uri_t *tsip_uri_clone(const tsip_uri_t *uri, int with_params, int quote)
tsip_uri_t *tsip_uri_clone(const tsip_uri_t *uri, TSIP_BOOLEAN with_params, TSIP_BOOLEAN quote)
{
tsip_uri_t *newuri;
tsk_buffer_t *output = TSK_BUFFER_CREATE_NULL();

View File

@ -112,7 +112,7 @@
"How are you"
#define SIP_MSG_2_TEST SIP_RESPONSE
#define SIP_MSG_2_TEST SIP_MESSAGE
void test_parser()
{

View File

@ -44,15 +44,42 @@ int test_stack_callback(const tsip_event_t *sipevent)
return 0;
}
int tsip_subscribtion_callback(const tsip_subscribe_event_t *sipevent)
int tsip_subscription_callback(const tsip_subscribe_event_t *sipevent)
{
/* common part */
TSK_DEBUG_INFO("\n====\nSUBSCRIBTION event: %d [%s]\n=====", TSIP_EVENT(sipevent)->code, TSIP_EVENT(sipevent)->phrase);
/* subscribtion part */
switch(sipevent->type)
{
case tsip_subscribe_notify:
case tsip_i_notify:
{
if(TSIP_MESSAGE_HAS_CONTENT(TSIP_EVENT(sipevent)->sipmessage))
{
TSK_DEBUG_INFO("NOTIFY Content: %s", TSIP_MESSAGE_CONTENT(TSIP_EVENT(sipevent)->sipmessage));
}
break;
}
default:
break;
}
return 0;
}
int tsip_messaging_callback(const tsip_message_event_t *sipevent)
{
/* common part */
TSK_DEBUG_INFO("\n====\nMESSAGE event: %d [%s]\n=====", TSIP_EVENT(sipevent)->code, TSIP_EVENT(sipevent)->phrase);
/* message part */
switch(sipevent->type)
{
case tsip_i_message:
{
if(TSIP_MESSAGE_HAS_CONTENT(TSIP_EVENT(sipevent)->sipmessage))
{
TSK_DEBUG_INFO("MESSAGE Content: %s", TSIP_MESSAGE_CONTENT(TSIP_EVENT(sipevent)->sipmessage));
}
break;
}
default:
break;
}
@ -66,27 +93,31 @@ int tsip_registration_callback(const tsip_register_event_t *sipevent)
/* registration part */
switch(sipevent->type)
{
case tsip_register_ok:
case tsip_ao_register:
{
TSK_DEBUG_INFO("Registration succeed.");
if(TSIP_RESPONSE_IS_2XX(TSIP_EVENT(sipevent)->sipmessage)){
TSK_DEBUG_INFO("Registration succeed.");
}
else{
TSK_DEBUG_INFO("Registration failed.");
}
break;
}
case tsip_register_nok:
case tsip_register_cancelled:
case tsip_register_auth_nok:
case tsip_register_secagree_nok:
case tsip_register_transporterr:
case tsip_ao_unregister:
{
TSK_DEBUG_INFO("Registration failed.");
if(TSIP_RESPONSE_IS_2XX(TSIP_EVENT(sipevent)->sipmessage)){
TSK_DEBUG_INFO("Unregistration succeed.");
}
else{
TSK_DEBUG_INFO("Unregistration failed.");
}
break;
}
case tsip_register_terminated:
{
TSK_DEBUG_INFO("Registration terminated.");
break;
}
default:
break;
}
return 0;
}
@ -153,7 +184,8 @@ void test_stack()
/* Callbacks */
tsip_stack_set_callback_register(stack, tsip_registration_callback);
tsip_stack_set_callback_subscribe(stack, tsip_subscribtion_callback);
tsip_stack_set_callback_subscribe(stack, tsip_subscription_callback);
tsip_stack_set_callback_message(stack, tsip_messaging_callback);
tsip_stack_start(stack);
@ -161,16 +193,26 @@ void test_stack()
tsk_thread_sleep(1000);
{
tsip_operation_handle_t *op2 = TSIP_OPERATION_CREATE(stack,
TSIP_OPERATION_SET_PARAM("expires", "30"),
TSIP_OPERATION_SET_PARAM("package", "reg"),
TSIP_OPERATION_SET_PARAM("accept", "application/reginfo+xml"),
TSIP_OPERATION_SET_PARAM("to", "sip:mamadou@ims.inexbee.com"),
TSIP_OPERATION_SET_NULL());
tsip_subscribe(stack, op2);
}
//{
// tsip_operation_handle_t *op2 = TSIP_OPERATION_CREATE(stack,
// TSIP_OPERATION_SET_PARAM("expires", "30"),
// TSIP_OPERATION_SET_PARAM("package", "reg"),
// TSIP_OPERATION_SET_PARAM("accept", "application/reginfo+xml"),
// TSIP_OPERATION_SET_PARAM("to", "sip:mamadou@ims.inexbee.com"),
//
// TSIP_OPERATION_SET_NULL());
// tsip_subscribe(stack, op2);
//}
//{
// tsip_operation_handle_t *op3 = TSIP_OPERATION_CREATE(stack,
// TSIP_OPERATION_SET_PARAM("to", "sip:laurent@ims.inexbee.com"),
// TSIP_OPERATION_SET_PARAM("content", "test"),
// TSIP_OPERATION_SET_PARAM("content-type", "text/plain"),
//
// TSIP_OPERATION_SET_NULL());
// tsip_message(stack, op3);
//}
//while(1);//tsk_thread_sleep(500);
//while(1)

View File

@ -792,38 +792,6 @@
>
</File>
</Filter>
<Filter
Name="smc"
>
<File
RelativePath="..\..\tinySIP\src\smc\tsip_dialog_message_sm.c"
>
</File>
<File
RelativePath="..\..\tinySIP\src\smc\tsip_dialog_register_sm.c"
>
</File>
<File
RelativePath="..\..\tinySIP\src\smc\tsip_dialog_subscribe_sm.c"
>
</File>
<File
RelativePath="..\..\tinySIP\src\smc\tsip_transac_ict_sm.c"
>
</File>
<File
RelativePath="..\..\tinySIP\src\smc\tsip_transac_ist_sm.c"
>
</File>
<File
RelativePath="..\..\tinySIP\src\smc\tsip_transac_nict_sm.c"
>
</File>
<File
RelativePath="..\..\tinySIP\src\smc\tsip_transac_nist_sm.c"
>
</File>
</Filter>
<Filter
Name="transports"
>
@ -1408,38 +1376,6 @@
>
</File>
</Filter>
<Filter
Name="smc"
>
<File
RelativePath="..\..\tinySIP\include\tinysip\smc\tsip_dialog_message_sm.h"
>
</File>
<File
RelativePath="..\..\tinySIP\include\tinysip\smc\tsip_dialog_register_sm.h"
>
</File>
<File
RelativePath="..\..\tinySIP\include\tinysip\smc\tsip_dialog_subscribe_sm.h"
>
</File>
<File
RelativePath="..\..\tinySIP\include\tinysip\smc\tsip_transac_ict_sm.h"
>
</File>
<File
RelativePath="..\..\tinySIP\include\tinysip\smc\tsip_transac_ist_sm.h"
>
</File>
<File
RelativePath="..\..\tinySIP\include\tinysip\smc\tsip_transac_nict_sm.h"
>
</File>
<File
RelativePath="..\..\tinySIP\include\tinysip\smc\tsip_transac_nist_sm.h"
>
</File>
</Filter>
<Filter
Name="transports"
>
@ -1921,38 +1857,6 @@
>
</File>
</Filter>
<Filter
Name="smc"
>
<File
RelativePath="..\..\tinySIP\smc\tsip_dialog_message.sm"
>
</File>
<File
RelativePath="..\..\tinySIP\smc\tsip_dialog_register.sm"
>
</File>
<File
RelativePath="..\..\tinySIP\smc\tsip_dialog_subscribe.sm"
>
</File>
<File
RelativePath="..\..\tinySIP\smc\tsip_transac_ict.sm"
>
</File>
<File
RelativePath="..\..\tinySIP\smc\tsip_transac_ist.sm"
>
</File>
<File
RelativePath="..\..\tinySIP\smc\tsip_transac_nict.sm"
>
</File>
<File
RelativePath="..\..\tinySIP\smc\tsip_transac_nist.sm"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>