Freeswitch-trunk
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
December 2008
- 10 participants
- 371 discussions
Author: anthm
Date: Tue Dec 16 20:55:06 2008
New Revision: 10842
Log:
add mod_celt
Modified:
freeswitch/trunk/build/modules.conf.in
Modified: freeswitch/trunk/build/modules.conf.in
==============================================================================
--- freeswitch/trunk/build/modules.conf.in (original)
+++ freeswitch/trunk/build/modules.conf.in Tue Dec 16 20:55:06 2008
@@ -28,6 +28,7 @@
codecs/mod_ilbc
codecs/mod_speex
#codecs/mod_siren
+#codecs/mod_celt
#dialplans/mod_dialplan_directory
dialplans/mod_dialplan_xml
dialplans/mod_dialplan_asterisk
1
0
[commit] r10841 - in freeswitch/trunk: conf/autoload_configs src src/include src/mod/applications/mod_conference src/mod/codecs/mod_celt src/mod/codecs/mod_voipcodecs src/mod/formats/mod_local_stream
by FreeSWITCH SVN 17 Dec '08
by FreeSWITCH SVN 17 Dec '08
17 Dec '08
Author: anthm
Date: Tue Dec 16 20:53:46 2008
New Revision: 10841
Log:
add mod_celt
Added:
freeswitch/trunk/src/mod/codecs/mod_celt/
freeswitch/trunk/src/mod/codecs/mod_celt/Makefile
freeswitch/trunk/src/mod/codecs/mod_celt/mod_celt.c
Modified:
freeswitch/trunk/conf/autoload_configs/conference.conf.xml
freeswitch/trunk/conf/autoload_configs/local_stream.conf.xml
freeswitch/trunk/src/include/switch_loadable_module.h
freeswitch/trunk/src/include/switch_types.h
freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
freeswitch/trunk/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.c
freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c
freeswitch/trunk/src/switch_pcm.c
freeswitch/trunk/src/switch_time.c
Modified: freeswitch/trunk/conf/autoload_configs/conference.conf.xml
==============================================================================
--- freeswitch/trunk/conf/autoload_configs/conference.conf.xml (original)
+++ freeswitch/trunk/conf/autoload_configs/conference.conf.xml Tue Dec 16 20:53:46 2008
@@ -150,5 +150,31 @@
<!--<param name="tts-engine" value="flite"/>-->
<!--<param name="tts-voice" value="kal16"/>-->
</profile>
+ <!--
+ <profile name="cdquality">
+ <param name="domain" value="$${domain}"/>
+ <param name="rate" value="48000"/>
+ <param name="interval" value="10"/>
+ <param name="energy-level" value="300"/>
+ <param name="sound-prefix" value="$${base_dir}/sounds/en/us/callie"/>
+ <param name="muted-sound" value="conference/conf-muted.wav"/>
+ <param name="unmuted-sound" value="conference/conf-unmuted.wav"/>
+ <param name="alone-sound" value="conference/conf-alone.wav"/>
+ <param name="moh-sound" value="$${hold_music}"/>
+ <param name="enter-sound" value="tone_stream://%(200,0,500,600,700)"/>
+ <param name="exit-sound" value="tone_stream://%(500,0,300,200,100,50,25)"/>
+ <param name="kicked-sound" value="conference/conf-kicked.wav"/>
+ <param name="locked-sound" value="conference/conf-locked.wav"/>
+ <param name="is-locked-sound" value="conference/conf-is-locked.wav"/>
+ <param name="is-unlocked-sound" value="conference/conf-is-unlocked.wav"/>
+ <param name="pin-sound" value="conference/conf-pin.wav"/>
+ <param name="bad-pin-sound" value="conference/conf-bad-pin.wav"/>
+ <param name="caller-id-name" value="$${outbound_caller_name}"/>
+ <param name="caller-id-number" value="$${outbound_caller_id}"/>
+ <param name="comfort-noise" value="true"/>
+ <!--<param name="tts-engine" value="flite"/>-->
+ <!--<param name="tts-voice" value="kal16"/>-->
+ </profile>
+ -->
</profiles>
</configuration>
Modified: freeswitch/trunk/conf/autoload_configs/local_stream.conf.xml
==============================================================================
--- freeswitch/trunk/conf/autoload_configs/local_stream.conf.xml (original)
+++ freeswitch/trunk/conf/autoload_configs/local_stream.conf.xml Tue Dec 16 20:53:46 2008
@@ -22,5 +22,13 @@
<param name="interval" value="20"/>
<param name="timer-name" value="soft"/>
</directory>
-
+ <!--
+ <directory name="moh/48000" path="$${base_dir}/sounds/music/48000">
+ <param name="rate" value="48000"/>
+ <param name="shuffle" value="true"/>
+ <param name="channels" value="1"/>
+ <param name="interval" value="10"/>
+ <param name="timer-name" value="soft"/>
+ </directory>
+ -->
</configuration>
Modified: freeswitch/trunk/src/include/switch_loadable_module.h
==============================================================================
--- freeswitch/trunk/src/include/switch_loadable_module.h (original)
+++ freeswitch/trunk/src/include/switch_loadable_module.h Tue Dec 16 20:53:46 2008
@@ -41,6 +41,7 @@
#ifndef SWITCH_LOADABLE_MODULE_H
#define SWITCH_LOADABLE_MODULE_H
+#include <switch_log.h>
#include <switch.h>
#include <switch_module_interfaces.h>
@@ -324,44 +325,74 @@
break; \
}
+static inline int switch_check_interval(uint32_t rate, uint32_t ptime)
+{
+ uint32_t max_ms = 0, ptime_div = 0;
+
+ switch (rate) {
+ case 22050:
+ case 11025:
+ if (ptime < 120) return 1;
+ break;
+ case 48000:
+ max_ms = 20;
+ ptime_div = 2;
+ break;
+ case 32000:
+ case 16000:
+ max_ms = 60;
+ ptime_div = 2;
+ break;
+ case 8000:
+ max_ms = 120;
+ ptime_div = 2;
+ break;
+ }
+
+ if (max_ms && ptime_div && (ptime <= max_ms && (ptime % ptime_div) == 0) && ((rate / 1000) * ptime) < SWITCH_RECOMMENDED_BUFFER_SIZE) {
+ return 1;
+ }
+
+ return 0;
+}
- static inline void switch_core_codec_add_implementation(switch_memory_pool_t *pool, switch_codec_interface_t *codec_interface,
- /*! enumeration defining the type of the codec */
- const switch_codec_type_t codec_type,
- /*! the IANA code number */
- switch_payload_t ianacode,
- /*! the IANA code name */
- const char *iananame,
- /*! default fmtp to send (can be overridden by the init function) */
- char *fmtp,
- /*! samples transferred per second */
- uint32_t samples_per_second,
- /*! actual samples transferred per second for those who are not moron g722 RFC writers */
- uint32_t actual_samples_per_second,
- /*! bits transferred per second */
- int bits_per_second,
- /*! number of microseconds that denote one frame */
- int microseconds_per_packet,
- /*! number of samples that denote one frame */
- uint32_t samples_per_packet,
- /*! number of bytes that denote one frame decompressed */
- uint32_t decoded_bytes_per_packet,
- /*! number of bytes that denote one frame compressed */
- uint32_t encoded_bytes_per_packet,
- /*! number of channels represented */
- uint8_t number_of_channels,
- /*! number of frames to send in one network packet */
- int codec_frames_per_packet,
- /*! function to initialize a codec handle using this implementation */
- switch_core_codec_init_func_t init,
- /*! function to encode raw data into encoded data */
- switch_core_codec_encode_func_t encode,
- /*! function to decode encoded data into raw data */
- switch_core_codec_decode_func_t decode,
- /*! deinitalize a codec handle using this implementation */
- switch_core_codec_destroy_func_t destroy)
+static inline void switch_core_codec_add_implementation(switch_memory_pool_t *pool, switch_codec_interface_t *codec_interface,
+ /*! enumeration defining the type of the codec */
+ const switch_codec_type_t codec_type,
+ /*! the IANA code number */
+ switch_payload_t ianacode,
+ /*! the IANA code name */
+ const char *iananame,
+ /*! default fmtp to send (can be overridden by the init function) */
+ char *fmtp,
+ /*! samples transferred per second */
+ uint32_t samples_per_second,
+ /*! actual samples transferred per second for those who are not moron g722 RFC writers */
+ uint32_t actual_samples_per_second,
+ /*! bits transferred per second */
+ int bits_per_second,
+ /*! number of microseconds that denote one frame */
+ int microseconds_per_packet,
+ /*! number of samples that denote one frame */
+ uint32_t samples_per_packet,
+ /*! number of bytes that denote one frame decompressed */
+ uint32_t decoded_bytes_per_packet,
+ /*! number of bytes that denote one frame compressed */
+ uint32_t encoded_bytes_per_packet,
+ /*! number of channels represented */
+ uint8_t number_of_channels,
+ /*! number of frames to send in one network packet */
+ int codec_frames_per_packet,
+ /*! function to initialize a codec handle using this implementation */
+ switch_core_codec_init_func_t init,
+ /*! function to encode raw data into encoded data */
+ switch_core_codec_encode_func_t encode,
+ /*! function to decode encoded data into raw data */
+ switch_core_codec_decode_func_t decode,
+ /*! deinitalize a codec handle using this implementation */
+ switch_core_codec_destroy_func_t destroy)
{
- if (codec_type == SWITCH_CODEC_TYPE_VIDEO || SWITCH_ACCEPTABLE_INTERVAL(microseconds_per_packet / 1000)) {
+ if (codec_type == SWITCH_CODEC_TYPE_VIDEO || switch_check_interval(actual_samples_per_second, microseconds_per_packet / 1000)) {
switch_codec_implementation_t *impl = (switch_codec_implementation_t *) switch_core_alloc(pool, sizeof(*impl));
impl->codec_type = codec_type;
impl->ianacode = ianacode;
@@ -383,6 +414,9 @@
impl->codec_id = codec_interface->codec_id;
impl->next = codec_interface->implementations;
codec_interface->implementations = impl;
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Rejected codec name: %s rate: %u ptime: %u\n",
+ iananame, actual_samples_per_second, microseconds_per_packet / 1000);
}
}
Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h (original)
+++ freeswitch/trunk/src/include/switch_types.h Tue Dec 16 20:53:46 2008
@@ -359,9 +359,9 @@
#define SWITCH_SYSTEM_THREAD_STACKSIZE 8192 * 1024
#define SWITCH_MAX_INTERVAL 120 /* we only do up to 120ms */
#define SWITCH_INTERVAL_PAD 10 /* A little extra buffer space to be safe */
-#define SWITCH_MAX_SAMPLE_LEN 32
+#define SWITCH_MAX_SAMPLE_LEN 48
#define SWITCH_BYTES_PER_SAMPLE 2 /* slin is 2 bytes per sample */
-#define SWITCH_RECOMMENDED_BUFFER_SIZE (SWITCH_BYTES_PER_SAMPLE * SWITCH_MAX_SAMPLE_LEN * (SWITCH_MAX_INTERVAL + SWITCH_INTERVAL_PAD))
+#define SWITCH_RECOMMENDED_BUFFER_SIZE 4096 /* worst case of 32khz @60ms we only do 48khz @10ms which is 960 */
#define SWITCH_MAX_CODECS 50
#define SWITCH_MAX_STATE_HANDLERS 30
#define SWITCH_CORE_QUEUE_LEN 100000
Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c Tue Dec 16 20:53:46 2008
@@ -4893,7 +4893,7 @@
if (!strcasecmp(var, "rate") && !switch_strlen_zero(val)) {
uint32_t tmp = atoi(val);
- if (tmp == 8000 || tmp == 16000 || tmp == 32000) {
+ if (tmp == 8000 || tmp == 16000 || tmp == 32000 || tmp == 48000) {
rate = tmp;
}
} else if (!strcasecmp(var, "domain") && !switch_strlen_zero(val)) {
Added: freeswitch/trunk/src/mod/codecs/mod_celt/Makefile
==============================================================================
--- (empty file)
+++ freeswitch/trunk/src/mod/codecs/mod_celt/Makefile Tue Dec 16 20:53:46 2008
@@ -0,0 +1,20 @@
+BASE=../../../..
+
+CELT=celt-0.5.0
+
+CELT_DIR=$(BASE)/libs/$(CELT)
+LOCAL_CFLAGS=-I$(CELT_DIR)/libcelt
+CELT_LA=$(CELT_DIR)/libcelt/.libs/libcelt.la
+LOCAL_LIBADD=$(CELT_LA)
+include $(BASE)/build/modmake.rules
+
+$(CELT_DIR):
+ $(GETLIB) $(CELT).tar.gz
+
+$(CELT_DIR)/Makefile: $(CELT_DIR)
+ cd $(CELT_DIR) && CFLAGS=$(AM_CFLAGS) ./configure --disable-shared --with-pic
+
+$(CELT_LA): $(CELT_DIR)/Makefile
+ cd $(CELT_DIR) && $(MAKE)
+ $(TOUCH_TARGET)
+
Added: freeswitch/trunk/src/mod/codecs/mod_celt/mod_celt.c
==============================================================================
--- (empty file)
+++ freeswitch/trunk/src/mod/codecs/mod_celt/mod_celt.c Tue Dec 16 20:53:46 2008
@@ -0,0 +1,217 @@
+/*
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005/2006, Anthony Minessale II <anthmct(a)yahoo.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Anthony Minessale II <anthmct(a)yahoo.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Brian K. West <brian(a)freeswitch.org>
+ *
+ * mod_celt.c -- The CELT ultra-low delay audio codec (http://www.celt-codec.org/)
+ *
+ */
+
+#include "switch.h"
+#include "celt.h"
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_celt_load);
+SWITCH_MODULE_DEFINITION(mod_celt, mod_celt_load, NULL, NULL);
+
+struct celt_context {
+ CELTEncoder *encoder_object;
+ CELTDecoder *decoder_object;
+ CELTMode *mode_object;
+ int frame_size;
+ int bytes_per_packet;
+};
+
+static switch_status_t switch_celt_init(switch_codec_t *codec, switch_codec_flag_t flags, const switch_codec_settings_t *codec_settings)
+{
+ struct celt_context *context = NULL;
+ int encoding = (flags & SWITCH_CODEC_FLAG_ENCODE);
+ int decoding = (flags & SWITCH_CODEC_FLAG_DECODE);
+
+ if (!(encoding || decoding) || (!(context = switch_core_alloc(codec->memory_pool, sizeof(*context))))) {
+ return SWITCH_STATUS_FALSE;
+ }
+
+ context->mode_object = celt_mode_create(codec->implementation->actual_samples_per_second, 1, codec->implementation->samples_per_packet, NULL);
+ celt_mode_info(context->mode_object, CELT_GET_FRAME_SIZE, &context->frame_size);
+ context->bytes_per_packet = (codec->implementation->bits_per_second * context->frame_size/codec->implementation->actual_samples_per_second + 4) / 8;
+
+ /*
+ if (codec->fmtp_in) {
+ int x, argc;
+ char *argv[10];
+ argc = switch_separate_string(codec->fmtp_in, ';', argv, (sizeof(argv) / sizeof(argv[0])));
+ for (x = 0; x < argc; x++) {
+ char *data = argv[x];
+ char *arg;
+ switch_assert(data);
+ while (*data == ' ') {
+ data++;
+ }
+ if ((arg = strchr(data, '='))) {
+ *arg++ = '\0';
+ if (!strcasecmp(data, "bitrate")) {
+ bit_rate = atoi(arg);
+ }
+ }
+ }
+ }
+
+ codec->fmtp_out = switch_core_sprintf(codec->memory_pool, "bitrate=%d", bit_rate);
+ */
+ if (encoding) {
+ context->encoder_object = celt_encoder_create(context->mode_object);
+ }
+
+ if (decoding) {
+ context->decoder_object = celt_decoder_create(context->mode_object);
+ }
+
+ codec->private_info = context;
+ return SWITCH_STATUS_SUCCESS;
+}
+
+static switch_status_t switch_celt_destroy(switch_codec_t *codec)
+{
+ codec->private_info = NULL;
+ return SWITCH_STATUS_SUCCESS;
+}
+
+static switch_status_t switch_celt_encode(switch_codec_t *codec,
+ switch_codec_t *other_codec,
+ void *decoded_data,
+ uint32_t decoded_data_len,
+ uint32_t decoded_rate, void *encoded_data, uint32_t *encoded_data_len, uint32_t *encoded_rate,
+ unsigned int *flag)
+{
+ struct celt_context *context = codec->private_info;
+
+ if (!context) {
+ return SWITCH_STATUS_FALSE;
+ }
+
+ *encoded_data_len = (uint32_t) celt_encode(context->encoder_object, (celt_int16_t *)decoded_data, NULL,
+ (unsigned char *)encoded_data, context->bytes_per_packet);
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+static switch_status_t switch_celt_decode(switch_codec_t *codec,
+ switch_codec_t *other_codec,
+ void *encoded_data,
+ uint32_t encoded_data_len,
+ uint32_t encoded_rate, void *decoded_data, uint32_t *decoded_data_len, uint32_t *decoded_rate,
+ unsigned int *flag)
+{
+ struct celt_context *context = codec->private_info;
+
+ if (!context) {
+ return SWITCH_STATUS_FALSE;
+ }
+
+ if (celt_decode(context->decoder_object, encoded_data, encoded_data_len, decoded_data)) {
+ return SWITCH_STATUS_GENERR;
+ }
+
+ *decoded_data_len = codec->implementation->decoded_bytes_per_packet;
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+SWITCH_MODULE_LOAD_FUNCTION(mod_celt_load)
+{
+ switch_codec_interface_t *codec_interface;
+ int bytes_per_frame;
+ int samples_per_frame;
+ int ms_per_frame;
+ int x;
+
+ /* connect my internal structure to the blank pointer passed to me */
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+
+ SWITCH_ADD_CODEC(codec_interface, "CELT ultra-low delay");
+
+ switch_core_codec_add_implementation(pool,
+ codec_interface,
+ SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
+ 114, /* the IANA code number */
+ "CELT", /* the IANA code name */
+ NULL, /* default fmtp to send (can be overridden by the init function) */
+ 32000, /* samples transferred per second */
+ 32000, /* actual samples transferred per second */
+ 32000, /* bits transferred per second */
+ 10000, /* number of microseconds per frame */
+ 320, /* number of samples per frame */
+ 640, /* number of bytes per frame decompressed */
+ 0, /* number of bytes per frame compressed */
+ 1, /* number of channels represented */
+ 1, /* number of frames per network packet */
+ switch_celt_init, /* function to initialize a codec handle using this implementation */
+ switch_celt_encode, /* function to encode raw data into encoded data */
+ switch_celt_decode, /* function to decode encoded data into raw data */
+ switch_celt_destroy); /* deinitalize a codec handle using this implementation */
+ ms_per_frame = 2000;
+ samples_per_frame = 96;
+ bytes_per_frame = 192;
+
+ for (x = 0; x < 5; x++) {
+ switch_core_codec_add_implementation(pool,
+ codec_interface,
+ SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
+ 114, /* the IANA code number */
+ "CELT", /* the IANA code name */
+ NULL, /* default fmtp to send (can be overridden by the init function) */
+ 48000, /* samples transferred per second */
+ 48000, /* actual samples transferred per second */
+ 48000, /* bits transferred per second */
+ ms_per_frame, /* number of microseconds per frame */
+ samples_per_frame, /* number of samples per frame */
+ bytes_per_frame, /* number of bytes per frame decompressed */
+ 0, /* number of bytes per frame compressed */
+ 1, /* number of channels represented */
+ 1, /* number of frames per network packet */
+ switch_celt_init, /* function to initialize a codec handle using this implementation */
+ switch_celt_encode, /* function to encode raw data into encoded data */
+ switch_celt_decode, /* function to decode encoded data into raw data */
+ switch_celt_destroy); /* deinitalize a codec handle using this implementation */
+ ms_per_frame += 2000;
+ samples_per_frame += 96;
+ bytes_per_frame += 192;
+ }
+
+
+ /* indicate that the module should continue to be loaded */
+ return SWITCH_STATUS_SUCCESS;
+}
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
+ */
Modified: freeswitch/trunk/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.c (original)
+++ freeswitch/trunk/src/mod/codecs/mod_voipcodecs/mod_voipcodecs.c Tue Dec 16 20:53:46 2008
@@ -588,7 +588,7 @@
switch_adpcm_destroy); /* deinitalize a codec handle using this implementation */
}
mpf = 10000, spf = 160, bpf = 320, ebpf = 160;
- for (count = 12; count > 0; count--) {
+ for (count = 6; count > 0; count--) {
switch_core_codec_add_implementation(pool,
codec_interface,
SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
@@ -781,7 +781,7 @@
/* G722 */
mpf = 10000, spf = 80, bpf = 320, ebpf = 80;
SWITCH_ADD_CODEC(codec_interface, "G.722");
- for (count = 12; count > 0; count--) {
+ for (count = 6; count > 0; count--) {
switch_core_codec_add_implementation(pool,
codec_interface,
SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
Modified: freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c (original)
+++ freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c Tue Dec 16 20:53:46 2008
@@ -450,7 +450,7 @@
if (!strcasecmp(var, "rate")) {
int tmp = atoi(val);
- if (tmp == 8000 || tmp == 16000 || tmp == 32000) {
+ if (tmp == 8000 || tmp == 16000 || tmp == 32000 || tmp == 48000) {
source->rate = tmp;
}
} else if (!strcasecmp(var, "shuffle")) {
Modified: freeswitch/trunk/src/switch_pcm.c
==============================================================================
--- freeswitch/trunk/src/switch_pcm.c (original)
+++ freeswitch/trunk/src/switch_pcm.c Tue Dec 16 20:53:46 2008
@@ -323,6 +323,7 @@
switch_codec_interface_t *codec_interface;
int mpf = 10000, spf = 80, bpf = 160, ebpf = 160, bps = 128000, rate = 8000, counta = 1, countb = 12;
switch_payload_t ianacode[4] = { 0, 10, 117, 119 };
+ int samples_per_frame, bytes_per_frame, ms_per_frame, x;
/* connect my internal structure to the blank pointer passed to me */
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
@@ -342,7 +343,12 @@
SWITCH_ADD_CODEC(codec_interface, "RAW Signed Linear (16 bit)");
for (counta = 1; counta <= 3; counta++) {
- for (countb = 12; countb > 0; countb--) {
+ if (rate == 8000) {
+ countb = 12;
+ } else {
+ countb = 6;
+ }
+ for (; countb > 0; countb--) {
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, ianacode[counta], "L16", NULL, rate, rate, bps,
mpf * countb, spf * countb, bpf * countb, ebpf * countb, 1, spf * countb,
@@ -356,13 +362,186 @@
}
/* these formats below are for file playing. */
+ samples_per_frame = 96;
+ bytes_per_frame = 192;
+ ms_per_frame = 2000;
+
+ for (x = 0; x < 5; x++) {
+ switch_core_codec_add_implementation(pool, codec_interface,
+ SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
+ 118, /* the IANA code number */
+ "L16", /* the IANA code name */
+ NULL, /* default fmtp to send (can be overridden by the init function) */
+ 48000, /* samples transferred per second */
+ 48000, /* actual samples transferred per second */
+ 768000, /* bits transferred per second */
+ ms_per_frame, /* number of microseconds per frame */
+ samples_per_frame, /* number of samples per frame */
+ bytes_per_frame, /* number of bytes per frame decompressed */
+ bytes_per_frame, /* number of bytes per frame compressed */
+ 1, /* number of channels represented */
+ 1, /* number of frames per network packet */
+ switch_raw_init, /* function to initialize a codec handle using this implementation */
+ switch_raw_encode, /* function to encode raw data into encoded data */
+ switch_raw_decode, /* function to decode encoded data into raw data */
+ switch_raw_destroy); /* deinitalize a codec handle using this implementation */
+
+ samples_per_frame += 96;
+ bytes_per_frame += 192;
+ ms_per_frame += 2000;
+
+ }
+
+
+ samples_per_frame = 8;
+ bytes_per_frame = 16;
+ ms_per_frame = 2000;
+
+ for (x = 0; x < 5; x++) {
+ switch_core_codec_add_implementation(pool, codec_interface,
+ SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
+ 10, /* the IANA code number */
+ "L16", /* the IANA code name */
+ NULL, /* default fmtp to send (can be overridden by the init function) */
+ 8000, /* samples transferred per second */
+ 8000, /* actual samples transferred per second */
+ 128000, /* bits transferred per second */
+ ms_per_frame, /* number of microseconds per frame */
+ samples_per_frame, /* number of samples per frame */
+ bytes_per_frame, /* number of bytes per frame decompressed */
+ bytes_per_frame, /* number of bytes per frame compressed */
+ 1, /* number of channels represented */
+ 1, /* number of frames per network packet */
+ switch_raw_init, /* function to initialize a codec handle using this implementation */
+ switch_raw_encode, /* function to encode raw data into encoded data */
+ switch_raw_decode, /* function to decode encoded data into raw data */
+ switch_raw_destroy); /* deinitalize a codec handle using this implementation */
+
+ samples_per_frame += 8;
+ bytes_per_frame += 16;
+ ms_per_frame += 2000;
+
+ }
+
+
+
+ samples_per_frame = 16;
+ bytes_per_frame = 32;
+ ms_per_frame = 2000;
+
+ for (x = 0; x < 5; x++) {
+ switch_core_codec_add_implementation(pool, codec_interface,
+ SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
+ 10, /* the IANA code number */
+ "L16", /* the IANA code name */
+ NULL, /* default fmtp to send (can be overridden by the init function) */
+ 16000, /* samples transferred per second */
+ 16000, /* actual samples transferred per second */
+ 256000, /* bits transferred per second */
+ ms_per_frame, /* number of microseconds per frame */
+ samples_per_frame, /* number of samples per frame */
+ bytes_per_frame, /* number of bytes per frame decompressed */
+ bytes_per_frame, /* number of bytes per frame compressed */
+ 1, /* number of channels represented */
+ 1, /* number of frames per network packet */
+ switch_raw_init, /* function to initialize a codec handle using this implementation */
+ switch_raw_encode, /* function to encode raw data into encoded data */
+ switch_raw_decode, /* function to decode encoded data into raw data */
+ switch_raw_destroy); /* deinitalize a codec handle using this implementation */
+
+ samples_per_frame += 16;
+ bytes_per_frame += 32;
+ ms_per_frame += 2000;
+
+ }
+
+
+ samples_per_frame = 32;
+ bytes_per_frame = 64;
+ ms_per_frame = 2000;
+
+ for (x = 0; x < 5; x++) {
+ switch_core_codec_add_implementation(pool, codec_interface,
+ SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
+ 10, /* the IANA code number */
+ "L16", /* the IANA code name */
+ NULL, /* default fmtp to send (can be overridden by the init function) */
+ 32000, /* samples transferred per second */
+ 32000, /* actual samples transferred per second */
+ 512000, /* bits transferred per second */
+ ms_per_frame, /* number of microseconds per frame */
+ samples_per_frame, /* number of samples per frame */
+ bytes_per_frame, /* number of bytes per frame decompressed */
+ bytes_per_frame, /* number of bytes per frame compressed */
+ 1, /* number of channels represented */
+ 1, /* number of frames per network packet */
+ switch_raw_init, /* function to initialize a codec handle using this implementation */
+ switch_raw_encode, /* function to encode raw data into encoded data */
+ switch_raw_decode, /* function to decode encoded data into raw data */
+ switch_raw_destroy); /* deinitalize a codec handle using this implementation */
+
+ samples_per_frame += 32;
+ bytes_per_frame += 64;
+ ms_per_frame += 2000;
+
+ }
+
+ switch_core_codec_add_implementation(pool, codec_interface,
+ SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
+ 118, /* the IANA code number */
+ "L16", /* the IANA code name */
+ NULL, /* default fmtp to send (can be overridden by the init function) */
+ 48000, /* samples transferred per second */
+ 48000, /* actual samples transferred per second */
+ 768000, /* bits transferred per second */
+ 20000, /* number of microseconds per frame */
+ 960, /* number of samples per frame */
+ 1920, /* number of bytes per frame decompressed */
+ 1920, /* number of bytes per frame compressed */
+ 1, /* number of channels represented */
+ 1, /* number of frames per network packet */
+ switch_raw_init, /* function to initialize a codec handle using this implementation */
+ switch_raw_encode, /* function to encode raw data into encoded data */
+ switch_raw_decode, /* function to decode encoded data into raw data */
+ switch_raw_destroy); /* deinitalize a codec handle using this implementation */
+
switch_core_codec_add_implementation(pool, codec_interface,
- SWITCH_CODEC_TYPE_AUDIO, 118, "L16", NULL, 22050, 22050, 352800,
- 20000, 441, 882, 882, 1, 1, switch_raw_init, switch_raw_encode, switch_raw_decode, switch_raw_destroy);
+ SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
+ 118, /* the IANA code number */
+ "L16", /* the IANA code name */
+ NULL, /* default fmtp to send (can be overridden by the init function) */
+ 22050, /* samples transferred per second */
+ 22050, /* actual samples transferred per second */
+ 352800, /* bits transferred per second */
+ 20000, /* number of microseconds per frame */
+ 441, /* number of samples per frame */
+ 882, /* number of bytes per frame decompressed */
+ 882, /* number of bytes per frame compressed */
+ 1, /* number of channels represented */
+ 1, /* number of frames per network packet */
+ switch_raw_init, /* function to initialize a codec handle using this implementation */
+ switch_raw_encode, /* function to encode raw data into encoded data */
+ switch_raw_decode, /* function to decode encoded data into raw data */
+ switch_raw_destroy); /* deinitalize a codec handle using this implementation */
switch_core_codec_add_implementation(pool, codec_interface,
- SWITCH_CODEC_TYPE_AUDIO, 118, "L16", NULL, 11025, 11025, 176400,
- 40000, 441, 882, 882, 1, 1, switch_raw_init, switch_raw_encode, switch_raw_decode, switch_raw_destroy);
+ SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
+ 118, /* the IANA code number */
+ "L16", /* the IANA code name */
+ NULL, /* default fmtp to send (can be overridden by the init function) */
+ 11025, /* samples transferred per second */
+ 11025, /* actual samples transferred per second */
+ 176400, /* bits transferred per second */
+ 40000, /* number of microseconds per frame */
+ 441, /* number of samples per frame */
+ 882, /* number of bytes per frame decompressed */
+ 882, /* number of bytes per frame compressed */
+ 1, /* number of channels represented */
+ 1, /* number of frames per network packet */
+ switch_raw_init, /* function to initialize a codec handle using this implementation */
+ switch_raw_encode, /* function to encode raw data into encoded data */
+ switch_raw_decode, /* function to decode encoded data into raw data */
+ switch_raw_destroy); /* deinitalize a codec handle using this implementation */
Modified: freeswitch/trunk/src/switch_time.c
==============================================================================
--- freeswitch/trunk/src/switch_time.c (original)
+++ freeswitch/trunk/src/switch_time.c Tue Dec 16 20:53:46 2008
@@ -44,7 +44,9 @@
#endif
#define MAX_TICK UINT32_MAX - 1024
-#define MS_PER_TICK 10
+
+static int MS_PER_TICK = 10;
+
static switch_memory_pool_t *module_pool = NULL;
static struct {
@@ -252,6 +254,11 @@
private_info->start = private_info->reference = TIMER_MATRIX[timer->interval].tick;
private_info->roll = TIMER_MATRIX[timer->interval].roll;
private_info->ready = 1;
+
+ if (timer->interval < MS_PER_TICK) {
+ MS_PER_TICK = timer->interval;
+ }
+
return SWITCH_STATUS_SUCCESS;
}
@@ -319,7 +326,7 @@
#endif
timer_step(timer);
-
+
while (globals.RUNNING == 1 && private_info->ready && TIMER_MATRIX[timer->interval].tick < private_info->reference) {
check_roll();
if (globals.use_cond_yield == 1) {
@@ -506,6 +513,7 @@
}
#endif
+
if ((current_ms % MS_PER_TICK) == 0) {
for (x = MS_PER_TICK; x <= MAX_ELEMENTS; x += MS_PER_TICK) {
if ((current_ms % x) == 0) {
@@ -525,6 +533,7 @@
}
}
}
+
if (current_ms == MAX_ELEMENTS) {
current_ms = 0;
}
1
0
Author: brian
Date: Tue Dec 16 18:46:49 2008
New Revision: 10840
Log:
60ms max
Modified:
freeswitch/trunk/src/mod/codecs/mod_siren/mod_siren.c
Modified: freeswitch/trunk/src/mod/codecs/mod_siren/mod_siren.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_siren/mod_siren.c (original)
+++ freeswitch/trunk/src/mod/codecs/mod_siren/mod_siren.c Tue Dec 16 18:46:49 2008
@@ -147,7 +147,7 @@
SWITCH_ADD_CODEC(codec_interface, "Polycom(R) G722.1/G722.1C");
spf = 320, bpf = 640;
- for (count = 4; count > 0; count--) {
+ for (count = 3; count > 0; count--) {
switch_core_codec_add_implementation(pool,
codec_interface,
SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
@@ -169,7 +169,7 @@
switch_siren_destroy); /* deinitalize a codec handle using this implementation */
}
spf = 640, bpf = 1280;
- for (count = 4; count > 0; count--) {
+ for (count = 3; count > 0; count--) {
switch_core_codec_add_implementation(pool,
codec_interface,
SWITCH_CODEC_TYPE_AUDIO, /* enumeration defining the type of the codec */
1
0
Author: mikej
Date: Tue Dec 16 16:42:38 2008
New Revision: 10838
Log:
.update
Modified:
freeswitch/trunk/libs/sofia-sip/.update
Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update (original)
+++ freeswitch/trunk/libs/sofia-sip/.update Tue Dec 16 16:42:38 2008
@@ -1 +1 @@
-Tue Dec 16 15:22:24 CST 2008
+Tue Dec 16 15:42:18 CST 2008
1
0
16 Dec '08
Author: mikej
Date: Tue Dec 16 16:29:07 2008
New Revision: 10837
Log:
SFSIP-107 don't destroy locked mutex
Modified:
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c Tue Dec 16 16:29:07 2008
@@ -1020,17 +1020,15 @@
home->suh_blocks = NULL;
if (home->suh_lock) {
-#ifdef WIN32
- UNLOCK(home); /* we must unlock here or windows leaks handles on the next call because the mutex is locked */
-#endif
-/* "In the LinuxThreads implementation, no resources are associated with mutex objects,
- thus pthread_mutex_destroy actually does nothing except checking that the mutex is unlocked. "
- In the Windows pthread implementation we must free the handles that are allocated */
- _su_home_destroy_mutexes(home->suh_lock);
+ void *suh_lock = home->suh_lock;
+
+ home->suh_lock = NULL;
+
+ /* Unlock, or risk assert() or leak handles on Windows */
+ _su_home_unlocker(suh_lock);
+ _su_home_destroy_mutexes(suh_lock);
}
}
-
- home->suh_lock = NULL;
}
/** Free memory blocks allocated through home.
1
0
Author: mikej
Date: Tue Dec 16 16:25:54 2008
New Revision: 10836
Log:
Tue Dec 9 11:11:08 CST 2008 Pekka Pessi <first.last(a)nokia.com>
* RELEASE, configure.ac: opening development head
Modified:
freeswitch/trunk/libs/sofia-sip/RELEASE
freeswitch/trunk/libs/sofia-sip/configure.ac
Modified: freeswitch/trunk/libs/sofia-sip/RELEASE
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/RELEASE (original)
+++ freeswitch/trunk/libs/sofia-sip/RELEASE Tue Dec 16 16:25:54 2008
@@ -1,24 +1,30 @@
-===================================
-Release notes for Sofia-SIP 1.12.10
-===================================
+==============================================
+Release notes for current version of Sofia-SIP
+==============================================
-Changes since release 1.12.9
-----------------------------
+Changes since last release
+--------------------------
+
+<changes since last written in freshmeat.net "Changes:" style;
+ and in less than 10 lines, written in 3rd person English, with
+ complete sentences />
-Numerous bugs has been fixed. The SDP parser has been updated to accept
-syntax according to RFC 4566. The TLS certificate verfication can now be
-controlled through offical API.
+Bugs in blaa and foo have been fixed. The stack now supports
+use of foobar...
API/ABI changes and versioning
------------------------------
-libsofia-sip-ua:
- New tags added:
- - TPTAG_TLS_VERIFY_PEER()
- - NUTAG_REFRESH_WITHOUT_SDP()
- Tag behavour updated:
- - NTATAG_SERVER_RPORT(2) now includes and uses rport even if client does not
+<see previous release notes at
+ http://sofia-sip.sourceforge.net/relnotes/ for examples ;
+ - should include all changes to public headers, and
+ other important information to developers;
+ - and should be updated _continuously_! />
+
+**template**: New features in API are marked with Doxytag macro @VERSION_1_XX_X.
+libsofia-sip-ua:
+- **template**: Added foobar() function (sofia-sip/foobar.h).
- This release is ABI/API compatible with applications linked against
any 1.12.x release. However, applications built against this release won't
work against an older library. The ABI has been tested with the nua module
@@ -32,40 +38,36 @@
Contributors to this release
----------------------------
-Tiago Katcipis <katcipis AT inf DOT ufcs DOT br>
-Mikhail Zabaluev
-Paulo Pizarro <paulo -dot pizarro -at gmail -dot com>
-Filippo Della Betta
-Jarod Neuner <janeuner(a)networkharbor.com>
-Fabio Ferrari <fabioferrari AT gmail DOT com>
-Jeff Lenk <jlenk at frontiernet dot net>
-Brian Czapiga <rys at evool dot com>
-Stefano Sabatini
-Fabio Margarido <fabiomargarido AT gmail DOT com>
+<list of people who contributed to _this_ release
+ - update as people's patches are added, or when you commit stuff
+ - current development team members (see AUTHORS) may be omitted,
+ or listed at the end of the contribur list (depending on the scope
+ of the work done since the last release)
+ - name of the contributor should be enough (email addresses in AUTHORS),
+ plus a _brief_ description of what was contributed
+ - roughly sorted by number of patches accepted
+/>
+
+- **template**: First Surname (patch to nua/soa/msg)
See the AUTHORS file in the distribution package.
+Notes on new features
+---------------------
+
+<information about major new features
+ - new/changed/removed functionality
+ - links to further documentation
+ - section may be omitted for minor releases
+/>
Bugs fixed in this release
--------------------------
-- Configure script options --enable-ndebug and enable-expensive-checks fixed.
- Patch by Fabio Margarido
-- When using session-timers, expire session only at the end of negotiated
- expiration time.
-- Fixed #1930055: Unregister when a new public binding is detected.
- Patch by Mikhail Zabaluev.
-- Use SIPS scheme in Contact URI if registering with SIPS. Patch by Jarod
- Neuner.
-- Using lower-case "udptl" transport name in SDP. Be bug-compatible.
- Report by Timo Bruhn.
-- Fixed mutex handle leak on Windows. Patch by Jeff Lenk.
-- Accept requests with invalid Supported header. Patch by Brian Czapiga.
-- When doing event fetch (SUBSCRIBE with Expires: 0) Wait until NOTIFY is
- received.
-- Fixed memory leak when destroying incomplete INVITE transactions in nua.
-- Not using OPTIONS keepalive on TCP.
-- Fixed bug with To-tags in response to CANCEL.
-- Fixed #2041747: crash when using SIPTAG_ORGANIZATION_TAG_STR
-- Fixed #1904805: build with Vista PlatformSDK
-- Fixed #2037585: crash when call terminated
+< notable bugs fixed in this release
+ - check the sf.net bug tracker; see closed bugs,
+ sorted by closing date
+ - other bugs as fixed in CVS/darcs
+/>
+
+- **template**: #9499652 sf.net bug item title
Modified: freeswitch/trunk/libs/sofia-sip/configure.ac
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/configure.ac (original)
+++ freeswitch/trunk/libs/sofia-sip/configure.ac Tue Dec 16 16:25:54 2008
@@ -11,7 +11,7 @@
dnl ---------------------------
dnl update both the version for AC_INIT and the LIBSOFIA_SIP_UA_MAJOR_MINOR
-AC_INIT([sofia-sip], [1.12.10])
+AC_INIT([sofia-sip], [1.12.10devel])
AC_CONFIG_SRCDIR([libsofia-sip-ua/sip/sofia-sip/sip.h])
AC_SUBST(VER_LIBSOFIA_SIP_UA_MAJOR_MINOR, [1.12])
dnl Includedir specific to this sofia version
1
0
Author: mikej
Date: Tue Dec 16 16:25:01 2008
New Revision: 10835
Log:
Mon Dec 8 09:40:33 CST 2008 Pekka Pessi <first.last(a)nokia.com>
* configure.ac, RELEASE: bumped version
Modified:
freeswitch/trunk/libs/sofia-sip/RELEASE
freeswitch/trunk/libs/sofia-sip/configure.ac
Modified: freeswitch/trunk/libs/sofia-sip/RELEASE
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/RELEASE (original)
+++ freeswitch/trunk/libs/sofia-sip/RELEASE Tue Dec 16 16:25:01 2008
@@ -1,6 +1,6 @@
-======================================
-Release notes for Sofia-SIP 1.12.10rc2
-======================================
+===================================
+Release notes for Sofia-SIP 1.12.10
+===================================
Changes since release 1.12.9
----------------------------
Modified: freeswitch/trunk/libs/sofia-sip/configure.ac
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/configure.ac (original)
+++ freeswitch/trunk/libs/sofia-sip/configure.ac Tue Dec 16 16:25:01 2008
@@ -11,7 +11,7 @@
dnl ---------------------------
dnl update both the version for AC_INIT and the LIBSOFIA_SIP_UA_MAJOR_MINOR
-AC_INIT([sofia-sip], [1.12.9pre10rc2])
+AC_INIT([sofia-sip], [1.12.10])
AC_CONFIG_SRCDIR([libsofia-sip-ua/sip/sofia-sip/sip.h])
AC_SUBST(VER_LIBSOFIA_SIP_UA_MAJOR_MINOR, [1.12])
dnl Includedir specific to this sofia version
1
0
Author: mikej
Date: Tue Dec 16 16:24:18 2008
New Revision: 10834
Log:
Wed Dec 3 06:00:07 CST 2008 Pekka Pessi <first.last(a)nokia.com>
* Updated AUTHORS, RELEASE.
Modified:
freeswitch/trunk/libs/sofia-sip/AUTHORS
freeswitch/trunk/libs/sofia-sip/RELEASE
freeswitch/trunk/libs/sofia-sip/configure.ac
Modified: freeswitch/trunk/libs/sofia-sip/AUTHORS
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/AUTHORS (original)
+++ freeswitch/trunk/libs/sofia-sip/AUTHORS Tue Dec 16 16:24:18 2008
@@ -19,6 +19,7 @@
Jacobs, Remeres <first.surname(a)nokia.com>
Jalava, Teemu <first.surname(a)nokia.com>
Jerris, Michael <mike -at jerris -dot com>
+Katcipis, Tiago <katcipis AT inf DOT ufcs DOT br>
Knoblich, Stefan
Legostayev, Denis <legostayev -at neic -dot nsk -dot su>
Lenk, Jeff <jlenk -at frontiernet -dot net>
Modified: freeswitch/trunk/libs/sofia-sip/RELEASE
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/RELEASE (original)
+++ freeswitch/trunk/libs/sofia-sip/RELEASE Tue Dec 16 16:24:18 2008
@@ -1,30 +1,24 @@
-==============================================
-Release notes for current version of Sofia-SIP
-==============================================
+======================================
+Release notes for Sofia-SIP 1.12.10rc2
+======================================
-Changes since last release
---------------------------
-
-<changes since last written in freshmeat.net "Changes:" style;
- and in less than 10 lines, written in 3rd person English, with
- complete sentences />
+Changes since release 1.12.9
+----------------------------
-Bugs in blaa and foo have been fixed. The stack now supports
-use of foobar...
+Numerous bugs has been fixed. The SDP parser has been updated to accept
+syntax according to RFC 4566. The TLS certificate verfication can now be
+controlled through offical API.
API/ABI changes and versioning
------------------------------
-<see previous release notes at
- http://sofia-sip.sourceforge.net/relnotes/ for examples ;
- - should include all changes to public headers, and
- other important information to developers;
- - and should be updated _continuously_! />
-
-**template**: New features in API are marked with Doxytag macro @VERSION_1_XX_X.
-
libsofia-sip-ua:
-- **template**: Added foobar() function (sofia-sip/foobar.h).
+ New tags added:
+ - TPTAG_TLS_VERIFY_PEER()
+ - NUTAG_REFRESH_WITHOUT_SDP()
+ Tag behavour updated:
+ - NTATAG_SERVER_RPORT(2) now includes and uses rport even if client does not
+
- This release is ABI/API compatible with applications linked against
any 1.12.x release. However, applications built against this release won't
work against an older library. The ABI has been tested with the nua module
@@ -38,36 +32,40 @@
Contributors to this release
----------------------------
-<list of people who contributed to _this_ release
- - update as people's patches are added, or when you commit stuff
- - current development team members (see AUTHORS) may be omitted,
- or listed at the end of the contribur list (depending on the scope
- of the work done since the last release)
- - name of the contributor should be enough (email addresses in AUTHORS),
- plus a _brief_ description of what was contributed
- - roughly sorted by number of patches accepted
-/>
-
-- **template**: First Surname (patch to nua/soa/msg)
+Tiago Katcipis <katcipis AT inf DOT ufcs DOT br>
+Mikhail Zabaluev
+Paulo Pizarro <paulo -dot pizarro -at gmail -dot com>
+Filippo Della Betta
+Jarod Neuner <janeuner(a)networkharbor.com>
+Fabio Ferrari <fabioferrari AT gmail DOT com>
+Jeff Lenk <jlenk at frontiernet dot net>
+Brian Czapiga <rys at evool dot com>
+Stefano Sabatini
+Fabio Margarido <fabiomargarido AT gmail DOT com>
See the AUTHORS file in the distribution package.
-Notes on new features
----------------------
-
-<information about major new features
- - new/changed/removed functionality
- - links to further documentation
- - section may be omitted for minor releases
-/>
Bugs fixed in this release
--------------------------
-< notable bugs fixed in this release
- - check the sf.net bug tracker; see closed bugs,
- sorted by closing date
- - other bugs as fixed in CVS/darcs
-/>
-
-- **template**: #9499652 sf.net bug item title
+- Configure script options --enable-ndebug and enable-expensive-checks fixed.
+ Patch by Fabio Margarido
+- When using session-timers, expire session only at the end of negotiated
+ expiration time.
+- Fixed #1930055: Unregister when a new public binding is detected.
+ Patch by Mikhail Zabaluev.
+- Use SIPS scheme in Contact URI if registering with SIPS. Patch by Jarod
+ Neuner.
+- Using lower-case "udptl" transport name in SDP. Be bug-compatible.
+ Report by Timo Bruhn.
+- Fixed mutex handle leak on Windows. Patch by Jeff Lenk.
+- Accept requests with invalid Supported header. Patch by Brian Czapiga.
+- When doing event fetch (SUBSCRIBE with Expires: 0) Wait until NOTIFY is
+ received.
+- Fixed memory leak when destroying incomplete INVITE transactions in nua.
+- Not using OPTIONS keepalive on TCP.
+- Fixed bug with To-tags in response to CANCEL.
+- Fixed #2041747: crash when using SIPTAG_ORGANIZATION_TAG_STR
+- Fixed #1904805: build with Vista PlatformSDK
+- Fixed #2037585: crash when call terminated
Modified: freeswitch/trunk/libs/sofia-sip/configure.ac
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/configure.ac (original)
+++ freeswitch/trunk/libs/sofia-sip/configure.ac Tue Dec 16 16:24:18 2008
@@ -11,7 +11,7 @@
dnl ---------------------------
dnl update both the version for AC_INIT and the LIBSOFIA_SIP_UA_MAJOR_MINOR
-AC_INIT([sofia-sip], [1.12.9pre10rc1])
+AC_INIT([sofia-sip], [1.12.9pre10rc2])
AC_CONFIG_SRCDIR([libsofia-sip-ua/sip/sofia-sip/sip.h])
AC_SUBST(VER_LIBSOFIA_SIP_UA_MAJOR_MINOR, [1.12])
dnl Includedir specific to this sofia version
1
0
16 Dec '08
Author: mikej
Date: Tue Dec 16 16:23:37 2008
New Revision: 10833
Log:
fixed whitespace
Modified:
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/check_session.c Tue Dec 16 16:23:37 2008
@@ -326,7 +326,7 @@
fail_unless(s2_check_callstate(nua_callstate_terminated));
}
-static void
+static void
bye_by_nua_challenged(nua_handle_t *nh,
tag_type_t tag, tag_value_t value, ...)
{
@@ -358,7 +358,7 @@
}
-static void
+static void
cancel_by_nua(nua_handle_t *nh,
struct message *invite,
struct dialog *dialog,
@@ -383,7 +383,7 @@
fail_unless(s2_check_event(nua_r_invite, 487));
}
-static void
+static void
bye_to_nua(nua_handle_t *nh,
tag_type_t tag, tag_value_t value, ...)
{
@@ -1094,7 +1094,7 @@
s2_request_to(dialog, SIP_METHOD_INVITE, NULL,
SIPTAG_USER_AGENT_STR("evil (evil) evil"),
TAG_END());
-
+
nua_respond(nh, SIP_200_OK, TAG_END());
fail_unless(s2_check_callstate(nua_callstate_completed));
@@ -1119,7 +1119,7 @@
s2_request_to(dialog, SIP_METHOD_INVITE, NULL,
SIPTAG_USER_AGENT_STR("evil (evil) evil"),
TAG_END());
-
+
nua_respond(nh, SIP_200_OK, TAG_END());
fail_unless(s2_check_callstate(nua_callstate_completed));
@@ -1564,7 +1564,7 @@
invite = s2_wait_for_request(SIP_METHOD_INVITE);
fail_if(!invite);
- respond_with_sdp(invite, dialog, SIP_500_INTERNAL_SERVER_ERROR,
+ respond_with_sdp(invite, dialog, SIP_500_INTERNAL_SERVER_ERROR,
SIPTAG_RETRY_AFTER_STR("8"),
TAG_END());
s2_free_message(invite);
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h Tue Dec 16 16:23:37 2008
@@ -26,7 +26,7 @@
/** Defined when <nua_params.h> has been included. */
#define NUA_PARAMS_H
-/**@internal @file nua_params.h
+/**@internal @file nua_params.h
* @brief Parameters and their handling
*
* @author Pekka Pessi <Pekka.Pessi(a)nokia.com>
@@ -37,7 +37,7 @@
#include <nua_types.h>
-/**@internal @brief NUA preferences.
+/**@internal @brief NUA preferences.
*
* This structure contains values for various preferences and a separate
* bitmap (nhp_set) for each preference. Preferences are set using
@@ -69,7 +69,7 @@
unsigned nhp_auto_ack:1; /**< Automatically ACK a final response */
unsigned :0;
- /** INVITE timeout.
+ /** INVITE timeout.
*
* If no response is received in nhp_invite_timeout seconds,
* INVITE client transaction times out
@@ -80,12 +80,12 @@
/** Default Min-SE Delta value */
unsigned nhp_min_se;
/** no (preference), local or remote */
- enum nua_session_refresher nhp_refresher;
+ enum nua_session_refresher nhp_refresher;
unsigned nhp_update_refresh:1; /**< Use UPDATE to refresh */
/**< Accept refreshes without SDP */
unsigned nhp_refresh_without_sdp:1;
-
+
/* Messaging preferences */
unsigned nhp_message_enable : 1;
/** Be bug-compatible with Windows Messenger */
@@ -131,8 +131,8 @@
char const *nhp_instance;
/** Outbound OPTIONS */
- char const *nhp_outbound;
-
+ char const *nhp_outbound;
+
sip_allow_t *nhp_appl_method;
/** Initial route set */
@@ -143,11 +143,11 @@
union { struct {
/* A bit for each feature set by application */
- /* NOTE:
+ /* NOTE:
Some compilers behave weird if there are bitfields
- together with width > 32
- So there should be a padding field (unsigned:0;)
- every 32 bits.
+ together with width > 32
+ So there should be a padding field (unsigned:0;)
+ every 32 bits.
*/
unsigned nhb_retry_count:1;
unsigned nhb_max_subscriptions:1;
@@ -165,7 +165,7 @@
unsigned nhb_session_timer:1;
unsigned nhb_min_se:1;
- unsigned nhb_refresher:1;
+ unsigned nhb_refresher:1;
unsigned nhb_update_refresh:1;
unsigned nhb_refresh_without_sdp:1;
unsigned nhb_message_enable:1;
@@ -202,7 +202,7 @@
unsigned nhb_initial_route:1;
unsigned nhb_proxy:1;
unsigned :0;
- } set_bits;
+ } set_bits;
unsigned set_unsigned[2];
} nhp_set_;
};
@@ -222,7 +222,7 @@
unsigned ngp_detect_network_updates:1;
unsigned ngp_shutdown_events:1;
unsigned :0;
- } set_bits;
+ } set_bits;
unsigned set_unsigned[2];
} ngp_set_;
};
@@ -250,7 +250,7 @@
#define NH_PGET(nh, pref) \
NHP_GET((nh)->nh_prefs, (nh)->nh_dprefs, pref)
-/* Get preference from handle, if exists and set,
+/* Get preference from handle, if exists and set,
otherwise from default handle */
#define NUA_PGET(nua, nh, pref) \
NHP_GET((nh) ? (nh)->nh_prefs : (nua)->nua_dhandle->nh_prefs, \
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Tue Dec 16 16:23:37 2008
@@ -70,14 +70,14 @@
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().
+sip_response_terminates_dialog().
@sa @ref nua_call_model, #nua_i_state, nua_invite(), #nua_i_invite
-
-@par Session State Diagram
-
-@code
- +----------+
+
+@par Session State Diagram
+
+@code
+ +----------+
| |---------------------+
| Init | |
| |----------+ |
@@ -124,16 +124,16 @@
+->|Terminated|<--------------+
| |
+----------+
- |
+ |
V
+----------+
| |
| Init |
| |
+----------+
-@endcode
-*/
-
+@endcode
+*/
+
/* ---------------------------------------------------------------------- */
/* Session event usage */
@@ -141,10 +141,10 @@
typedef struct nua_session_usage
{
enum nua_callstate ss_state; /**< Session status (enum nua_callstate) */
-
+
unsigned ss_100rel:1; /**< Use 100rel, send 183 */
unsigned ss_alerting:1; /**< 180 is sent/received */
-
+
unsigned ss_update_needed:2; /**< Send an UPDATE (do O/A if > 1) */
unsigned ss_precondition:1; /**< Precondition required */
@@ -273,7 +273,7 @@
continue;
if (cr->cr_status < 200) {
- nua_stack_event(nh->nh_nua, nh,
+ nua_stack_event(nh->nh_nua, nh,
NULL,
cr->cr_event,
SIP_481_NO_TRANSACTION,
@@ -291,8 +291,8 @@
ss->ss_state != nua_callstate_init &&
!ss->ss_reporting) {
int status = 0; char const *phrase = "Terminated";
-
- if (cr0)
+
+ if (cr0)
status = cr0->cr_status, phrase = cr0->cr_phrase ? cr0->cr_phrase : phrase;
else if (sr0)
status = sr0->sr_status, phrase = sr0->sr_phrase;
@@ -409,11 +409,11 @@
/**@fn void nua_invite(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
*
- * Place a call using SIP @b INVITE method.
+ * Place a call using SIP @b INVITE method.
*
* The INVITE method is used to initiate a call between two parties. The
* call is also known as <i>SIP session</i>.
- *
+ *
* At SIP level the session is represented as @e Dialog, which is a
* peer-to-peer association between two SIP User-Agents. The dialog is
* established by a successful 2XX response to the INVITE. The dialog is
@@ -433,7 +433,7 @@
* @param nh Pointer to operation handle
* @param tag, value, ... List of tagged parameters
*
- * @return
+ * @return
* nothing
*
* @par Events:
@@ -469,11 +469,11 @@
* @par
* When multiple tags for the same header are specified, the behaviour
* depends on the header type. If only a single header field can be included
- * in a SIP message, the latest non-NULL value is used, e.g., @Subject.
+ * in a SIP message, the latest non-NULL value is used, e.g., @Subject.
* However, if the SIP header can consist of multiple lines or header fields
* separated by comma, e.g., @Accept, all the tagged
* values are concatenated.
- *
+ *
* @par
* However, if a tag value is #SIP_NONE (-1 casted as a void pointer), the
* values from previous tags are ignored.
@@ -490,10 +490,10 @@
* For initial INVITE requests, values from tags are used. If NUTAG_URL() is
* given, it is used as target URI. Otherwise, if SIPTAG_TO() is given, it
* is used as target URI. If neither is given, the complete request line
- * already specified using SIPTAG_REQUEST() or SIPTAG_REQUEST_STR() is used.
+ * already specified using SIPTAG_REQUEST() or SIPTAG_REQUEST_STR() is used.
* If none of the tags above are given, an internal error is returned to the
* application. At this point, the target URI is stored in the request line,
- * together with method name ("INVITE") and protocol version ("SIP/2.0").
+ * together with method name ("INVITE") and protocol version ("SIP/2.0").
* The initial dialog information is also created: @CallID, @CSeq headers
* are generated, if they do not exist, and an unique tag is added to @From
* header.
@@ -521,14 +521,14 @@
* For in-dialog INVITE (re-INVITE), the request URI is taken from the
* @Contact header received from the remote party during the dialog
* establishment. Also, the @CallID and @CSeq headers and @From and @To tags
- * are generated based on the dialog information and added to the request.
+ * are generated based on the dialog information and added to the request.
* If the dialog has a route (set by @RecordRoute headers), it is added to
* the request, too.
*
* @par
* @MaxForwards header (with default value set by NTATAG_MAX_FORWARDS()) is
* also added now, if it does not exist.
- *
+ *
* @par
* The INVITE request message created by nua_invite() operation is saved as
* a template for automatic re-INVITE requests sent by the session timer
@@ -540,8 +540,8 @@
*
* @par Tags Related to SIP Headers and Request-URI
* NUTAG_URL(), SIPTAG_REQUEST(), SIPTAG_REQUEST_STR() \n
- * NUTAG_INITIAL_ROUTE(), NUTAG_INITIAL_ROUTE_STR(),
- * SIPTAG_ROUTE(), SIPTAG_ROUTE_STR(),
+ * NUTAG_INITIAL_ROUTE(), NUTAG_INITIAL_ROUTE_STR(),
+ * SIPTAG_ROUTE(), SIPTAG_ROUTE_STR(),
* NUTAG_SERVICE_ROUTE_ENABLE() \n
* SIPTAG_MAX_FORWARDS(), SIPTAG_MAX_FORWARDS_STR() \n
* SIPTAG_PROXY_REQUIRE(), SIPTAG_PROXY_REQUIRE_STR() \n
@@ -574,7 +574,7 @@
* SIPTAG_AUTHORIZATION(), SIPTAG_AUTHORIZATION_STR() \n
* SIPTAG_REFERRED_BY(), SIPTAG_REFERRED_BY_STR() \n
* SIPTAG_REPLACES(), SIPTAG_REPLACES_STR() \n
- * NUTAG_SESSION_TIMER(), NUTAG_SESSION_REFRESHER(),
+ * NUTAG_SESSION_TIMER(), NUTAG_SESSION_REFRESHER(),
* SIPTAG_SESSION_EXPIRES(), SIPTAG_SESSION_EXPIRES_STR() \n
* NUTAG_MIN_SE(), SIPTAG_MIN_SE(), SIPTAG_MIN_SE_STR() \n
* SIPTAG_SECURITY_CLIENT(), SIPTAG_SECURITY_CLIENT_STR() \n
@@ -596,7 +596,7 @@
* @par
* The SDP description of the
* @ref soa_session_t "soa media session" is included in the INVITE request
- * as a message body.
+ * as a message body.
* The SDP in the message body of the 1XX or 2XX response message is
* interpreted as an answer, given to the @ref soa_session_t "soa media
* session" object for processing.
@@ -608,8 +608,8 @@
* NUTAG_MEDIA_ENABLE(), \n
* NUTAG_INCLUDE_EXTRA_SDP(), \n
* SOATAG_HOLD(), SOATAG_AF(), SOATAG_ADDRESS(),
- * SOATAG_ORDERED_USER(), SOATAG_REUSE_REJECTED(),
- * SOATAG_RTP_SELECT(), SOATAG_RTP_SORT(), SOATAG_RTP_MISMATCH(),
+ * SOATAG_ORDERED_USER(), SOATAG_REUSE_REJECTED(),
+ * SOATAG_RTP_SELECT(), SOATAG_RTP_SORT(), SOATAG_RTP_MISMATCH(),
* SOATAG_AUDIO_AUX(), \n
* SOATAG_USER_SDP() or SOATAG_USER_SDP_STR() \n
*
@@ -623,10 +623,10 @@
* SIP level, that is, the SIP PRACK and UPDATE requests are sent if
* "precondition" is added to the @Require header in the INVITE request.
*
- * Optionally
+ * Optionally
* - uses early media if NUTAG_EARLY_MEDIA() tag is used with non zero-value
* - media parameters can be set by SOA tags
- * - nua_invite() can be used to change status of an existing call:
+ * - nua_invite() can be used to change status of an existing call:
* - #SOATAG_HOLD tag can be used to list the media that will be put on hold,
* the value "*" sets all the media beloginging to the session on hold
*
@@ -645,7 +645,7 @@
* nua_authenticate() \n
* nua_prack() \n
* nua_update() \n
- * nua_info() \n
+ * nua_info() \n
* nua_cancel() \n
* nua_bye() \n
* #nua_i_invite, nua_respond()
@@ -655,7 +655,7 @@
* NUTAG_REFER_PAUSE() \n
*/
-static int nua_invite_client_init(nua_client_request_t *cr,
+static int nua_invite_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags);
static int nua_invite_client_request(nua_client_request_t *cr,
@@ -706,7 +706,7 @@
return nua_client_create(nh, e, &nua_invite_client_methods, tags);
}
-static int nua_invite_client_init(nua_client_request_t *cr,
+static int nua_invite_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags)
{
@@ -715,11 +715,11 @@
nua_session_usage_t *ss;
cr->cr_usage = du = nua_dialog_usage_for_session(nh->nh_ds);
- /* Errors returned by nua_invite_client_init()
+ /* Errors returned by nua_invite_client_init()
do not change the session state */
- cr->cr_neutral = 1;
-
- if (nh_is_special(nh) ||
+ cr->cr_neutral = 1;
+
+ if (nh_is_special(nh) ||
nua_stack_set_handle_special(nh, nh_has_invite, nua_i_error))
return nua_client_return(cr, 900, "Invalid handle for INVITE", msg);
else if (nh_referral_check(nh, tags) < 0)
@@ -751,7 +751,7 @@
session_timer_preferences(ss->ss_timer,
sip,
- NH_PGET(nh, supported),
+ NH_PGET(nh, supported),
NH_PGET(nh, session_timer),
NUA_PISSET(nh->nh_nua, nh, session_timer),
NH_PGET(nh, refresher),
@@ -770,7 +770,7 @@
int offer_sent = 0, retval;
sip_time_t invite_timeout;
- if (du == NULL) /* Call terminated */
+ if (du == NULL) /* Call terminated */
return nua_client_return(cr, SIP_481_NO_TRANSACTION, msg);
ss = NUA_DIALOG_USAGE_PRIVATE(du);
@@ -836,7 +836,7 @@
ss->ss_oa_sent = Offer;
if (!cr->cr_restarting) /* Restart logic calls nua_invite_client_report */
- signal_call_state_change(nh, ss, 0, "INVITE sent",
+ signal_call_state_change(nh, ss, 0, "INVITE sent",
nua_callstate_calling);
}
@@ -861,7 +861,7 @@
session_timer_set(ss);
}
-
+
return nua_session_client_response(cr, status, phrase, sip);
}
@@ -885,7 +885,7 @@
nua_dialog_uac_route(nh, nh->nh_ds, sip, 1);
nua_dialog_store_peer_info(nh, nh->nh_ds, sip);
-
+
/* Tag the INVITE request */
tagged = nta_outgoing_tagged(cr->cr_orq,
nua_client_orq_response, cr,
@@ -898,18 +898,18 @@
ss->ss_reason = "SIP;cause=500;text=\"Cannot Create Early Dialog\"";
}
}
-
+
if (!rseq) {
SU_DEBUG_5(("nua(%p): 100rel missing RSeq\n", (void *)nh));
}
else if (nta_outgoing_rseq(cr->cr_orq) > rseq->rs_response) {
- SU_DEBUG_5(("nua(%p): 100rel bad RSeq %u (got %u)\n", (void *)nh,
+ SU_DEBUG_5(("nua(%p): 100rel bad RSeq %u (got %u)\n", (void *)nh,
(unsigned)rseq->rs_response,
nta_outgoing_rseq(cr->cr_orq)));
return 1; /* Do not send event */
}
else if (nta_outgoing_setrseq(cr->cr_orq, rseq->rs_response) < 0) {
- SU_DEBUG_1(("nua(%p): cannot set RSeq %u\n", (void *)nh,
+ SU_DEBUG_1(("nua(%p): cannot set RSeq %u\n", (void *)nh,
(unsigned)rseq->rs_response));
cr->cr_graceful = 1;
ss->ss_reason = "SIP;cause=400;text=\"Bad RSeq\"";
@@ -992,7 +992,7 @@
cr->cr_graceful = 1;
ss->ss_reason = "SIP;cause=400;text=\"Malformed Session Description\"";
}
- else
+ else
LOG5("got SDP");
}
@@ -1022,7 +1022,7 @@
nh_referral_respond(nh, status, phrase); /* XXX - restarting after 401/407 */
- nua_stack_event(nh->nh_nua, nh,
+ nua_stack_event(nh->nh_nua, nh,
nta_outgoing_getresponse(orq),
cr->cr_event,
status, phrase,
@@ -1060,7 +1060,7 @@
else if (status < 200) {
next_state = nua_callstate_proceeding;
- if (sip && sip->sip_rseq &&
+ if (sip && sip->sip_rseq &&
!SIP_IS_ALLOWED(NH_PGET(nh, appl_method), sip_method_prack)) {
sip_rack_t rack[1];
@@ -1070,7 +1070,7 @@
rack->ra_method = sip->sip_cseq->cs_method;
rack->ra_method_name = sip->sip_cseq->cs_method_name;
- error = nua_client_tcreate(nh, nua_r_prack, &nua_prack_client_methods,
+ error = nua_client_tcreate(nh, nua_r_prack, &nua_prack_client_methods,
SIPTAG_RACK(rack),
TAG_END());
if (error < 0) {
@@ -1126,7 +1126,7 @@
if (ss->ss_state > nua_callstate_proceeding || status >= 200)
error = nua_client_create(nh, nua_r_bye, &nua_bye_client_methods, NULL);
else
- error = nua_client_create(nh, nua_r_cancel,
+ error = nua_client_create(nh, nua_r_cancel,
&nua_cancel_client_methods, tags);
if (error) {
@@ -1154,7 +1154,7 @@
* @param nh Pointer to operation handle
* @param tag, value, ... List of tagged parameters
*
- * @return
+ * @return
* nothing
*
* @par Related Tags:
@@ -1162,7 +1162,7 @@
*
* @par Events:
* #nua_i_media_error \n
- * #nua_i_state (#nua_i_active, #nua_i_terminated)
+ * #nua_i_state (#nua_i_active, #nua_i_terminated)
*
* @sa NUTAG_AUTOACK(), @ref nua_call_model, #nua_i_state
*/
@@ -1196,8 +1196,8 @@
ss->ss_reporting = 1; /* We report terminated state here if BYE fails */
error = nua_client_create(nh, nua_r_bye, &nua_bye_client_methods, NULL);
ss->ss_reporting = 0;
- signal_call_state_change(nh, ss, 500, "Internal Error",
- error
+ signal_call_state_change(nh, ss, 500, "Internal Error",
+ error
? nua_callstate_terminated
: nua_callstate_terminating);
}
@@ -1254,11 +1254,11 @@
wa = sip_authorization(sip);
pa = sip_proxy_authorization(sip);
-
+
msg_destroy(msg);
msg = nta_msg_create(nh->nh_nua->nua_nta, 0);
- sip = sip_object(msg);
+ sip = sip_object(msg);
if (!msg)
return -1;
@@ -1339,7 +1339,7 @@
reason = "SIP;cause=488;text=\"Incomplete offer/answer\"";
}
}
-
+
proxy_is_set = NH_PISSET(nh, proxy);
proxy = NH_PGET(nh, proxy);
@@ -1406,12 +1406,12 @@
/**@fn void nua_cancel(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
*
- * Cancel an INVITE operation
+ * Cancel an INVITE operation
*
* @param nh Pointer to operation handle
* @param tag, value, ... List of tagged parameters
*
- * @return
+ * @return
* nothing
*
* @par Related Tags:
@@ -1458,7 +1458,7 @@
nua_handle_t *nh = cr->cr_owner;
nua_dialog_usage_t *du = nua_dialog_usage_for_session(nh->nh_ds);
- if (!du || !du->du_cr || !du->du_cr->cr_orq ||
+ if (!du || !du->du_cr || !du->du_cr->cr_orq ||
nta_outgoing_status(du->du_cr->cr_orq) >= 200) {
return nua_client_return(cr, 481, "No transaction to CANCEL", msg);
}
@@ -1485,12 +1485,12 @@
* The CANCEL may be sent explicitly by nua_cancel() or implicitly by NUA
* state machine.
*
- * @param status response status code
+ * @param status response status code
* @param phrase a short textual description of @a status code
* @param nh operation handle associated with the call
* @param hmagic application context associated with the call
* @param sip response to CANCEL request or NULL upon an error
- * (status code is in @a status and
+ * (status code is in @a status and
* descriptive message in @a phrase parameters)
* @param tags empty
*
@@ -1509,25 +1509,25 @@
nua_client_request_t const *cr = du->du_cr;
nua_server_request_t const *sr;
- if (ss->ss_state >= nua_callstate_terminating ||
+ if (ss->ss_state >= nua_callstate_terminating ||
/* INVITE is in progress or being authenticated */
(cr && (cr->cr_orq || cr->cr_wait_for_cred)))
return;
/* UPDATE has been queued */
- for (cr = ds->ds_cr; cr; cr = cr->cr_next)
+ for (cr = ds->ds_cr; cr; cr = cr->cr_next)
if (cr->cr_method == sip_method_update)
return;
/* INVITE or UPDATE in progress on server side */
for (sr = ds->ds_sr; sr; sr = sr->sr_next)
- if (sr->sr_usage == du &&
- (sr->sr_method == sip_method_invite ||
+ if (sr->sr_usage == du &&
+ (sr->sr_method == sip_method_invite ||
sr->sr_method == sip_method_update))
return;
if (ss->ss_timer->refresher == nua_remote_refresher) {
- ss->ss_reason = "SIP;cause=408;text=\"Session timeout\"";
+ ss->ss_reason = "SIP;cause=408;text=\"Session timeout\"";
nua_stack_bye(nh->nh_nua, nh, nua_r_bye, NULL);
return;
}
@@ -1542,7 +1542,7 @@
}
}
-/** @interal Shut down session usage.
+/** @interal Shut down session usage.
*
* @retval >0 shutdown done
* @retval 0 shutdown in progress
@@ -1609,21 +1609,21 @@
default:
break;
}
-
+
nua_dialog_usage_remove(nh, ds, du, NULL, NULL);
return 200;
}
/**@fn void nua_prack(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
- * Send a PRACK request.
+ * Send a PRACK request.
*
* PRACK is used to acknowledge receipt of 100rel responses. See @RFC3262.
*
* @param nh Pointer to operation handle
* @param tag, value, ... List of tagged parameters
*
- * @return
+ * @return
* nothing
*
* @par Related Tags:
@@ -1647,7 +1647,7 @@
* @param nh operation handle associated with the call
* @param hmagic application context associated with the call
* @param sip response to @b PRACK or NULL upon an error
- * (status code is in @a status and
+ * (status code is in @a status and
* descriptive message in @a phrase parameters)
* @param tags empty
*
@@ -1656,7 +1656,7 @@
* @END_NUA_EVENT
*/
-static int nua_prack_client_init(nua_client_request_t *cr,
+static int nua_prack_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags);
static int nua_prack_client_request(nua_client_request_t *cr,
@@ -1695,7 +1695,7 @@
return nua_client_create(nh, e, &nua_prack_client_methods, tags);
}
-static int nua_prack_client_init(nua_client_request_t *cr,
+static int nua_prack_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags)
{
@@ -1732,7 +1732,7 @@
rseq = sip->sip_rack->ra_response;
if (cri->cr_offer_recv && !cri->cr_answer_sent) {
- if (nh->nh_soa == NULL)
+ if (nh->nh_soa == NULL)
/* It is up to application to handle SDP */
answer_sent = session_get_description(sip, NULL, NULL);
else if (sip->sip_payload)
@@ -1780,12 +1780,12 @@
cr->cr_offer_sent = offer_sent;
cr->cr_answer_sent = answer_sent;
- if (offer_sent)
+ if (offer_sent)
ss->ss_oa_sent = Offer;
else if (answer_sent)
ss->ss_oa_sent = Answer;
- if (cr->cr_restarting)
+ if (cr->cr_restarting)
/* Restart logic calls nua_prack_client_report */;
else if (!cr->cr_auto && (!offer_sent || !answer_sent))
/* Suppose application know it called nua_prack() */;
@@ -1816,7 +1816,7 @@
nua_session_usage_t *ss = nua_dialog_usage_private(du);
int acked = 0;
- nua_stack_event(nh->nh_nua, nh,
+ nua_stack_event(nh->nh_nua, nh,
nta_outgoing_getresponse(orq),
cr->cr_event,
status, phrase,
@@ -1833,7 +1833,7 @@
else if (nua_invite_client_should_ack(du->du_cr)) {
/* There is an un-ACK-ed INVITE there */
assert(du->du_cr->cr_method == sip_method_invite);
- if (NH_PGET(nh, auto_ack) ||
+ if (NH_PGET(nh, auto_ack) ||
/* Auto-ACK response to re-INVITE unless auto_ack is set to 0 */
(ss->ss_state == nua_callstate_ready && !NH_PISSET(nh, auto_ack))) {
/* There should be no UPDATE with offer/answer
@@ -1858,7 +1858,7 @@
else if (ss->ss_update_needed && 200 <= status && status < 300 &&
!SIP_IS_ALLOWED(NH_PGET(nh, appl_method), sip_method_update))
nua_client_create(nh, nua_r_update, &nua_update_client_methods, NULL);
-
+
return 1;
}
@@ -1867,7 +1867,7 @@
/** @NUA_EVENT nua_i_invite
*
- * Indication of incoming call or re-INVITE request.
+ * Indication of incoming call or re-INVITE request.
*
* @param status statuscode of response sent automatically by stack
* @param phrase a short textual description of @a status code
@@ -1900,7 +1900,7 @@
* to a #soa_session_t object. The #nua_i_state event sent to the
* application immediately after #nua_i_invite will contain the parsing
* results in SOATAG_REMOTE_SDP() and SOATAG_REMOTE_SDP_STR() tags.
- *
+ *
* Note that currently the parser within @nua does not handle MIME
* multipart. The SDP Offer/Answer engine can get confused if the SDP offer
* is included in a MIME multipart, therefore such an @b INVITE is rejected
@@ -1945,8 +1945,8 @@
*
* @sa nua_respond(), @ref nua_uas_call_model, #nua_i_state,
* NUTAG_MEDIA_ENABLE(), SOATAG_USER_SDP(), SOATAG_USER_SDP_STR(),
- * @RFC3262, NUTAG_EARLY_ANSWER(), NUTAG_EARLY_MEDIA(),
- * NUTAG_ONLY183_100REL(),
+ * @RFC3262, NUTAG_EARLY_ANSWER(), NUTAG_EARLY_MEDIA(),
+ * NUTAG_ONLY183_100REL(),
* NUTAG_INCLUDE_EXTRA_SDP(),
* #nua_i_prack, #nua_i_update, nua_update(),
* nua_invite(), #nua_r_invite
@@ -1974,7 +1974,7 @@
static int nua_invite_server_report(nua_server_request_t *sr, tagi_t const *);
static int
- process_ack_or_cancel(nua_server_request_t *, nta_incoming_t *,
+ process_ack_or_cancel(nua_server_request_t *, nta_incoming_t *,
sip_t const *),
process_ack(nua_server_request_t *, nta_incoming_t *, sip_t const *),
process_ack_error(nua_server_request_t *sr, msg_t *ackmsg,
@@ -1986,11 +1986,11 @@
nta_incoming_t *irq,
sip_t const *sip);
-nua_server_methods_t const nua_invite_server_methods =
+nua_server_methods_t const nua_invite_server_methods =
{
SIP_METHOD_INVITE,
nua_i_invite, /* Event */
- {
+ {
1, /* Create dialog */
0, /* Initial request */
1, /* Target refresh request */
@@ -2004,8 +2004,8 @@
};
-/** @internal Preprocess incoming invite - sure we have a valid request.
- *
+/** @internal Preprocess incoming invite - sure we have a valid request.
+ *
* @return 0 if request is valid, or error statuscode otherwise
*/
static int
@@ -2022,9 +2022,9 @@
if (nua_session_server_init(sr))
return sr->sr_status;
-
+
if (sr->sr_usage) {
- /* Existing session - check for overlap and glare */
+ /* Existing session - check for overlap and glare */
nua_server_request_t const *sr0;
nua_client_request_t const *cr;
@@ -2040,7 +2040,7 @@
if (sr->sr_sdp && sr0->sr_offer_recv && !sr0->sr_answer_sent)
break;
}
-
+
if (sr0) {
/* Overlapping invites - RFC 3261 14.2 */
return nua_server_retry_after(sr, 500, "Overlapping Requests", 0, 10);
@@ -2148,9 +2148,9 @@
soa_init_offer_answer(nh->nh_soa);
if (sr->sr_sdp) {
- if (nh->nh_soa &&
+ if (nh->nh_soa &&
soa_set_remote_sdp(nh->nh_soa, NULL, sr->sr_sdp, sr->sr_sdp_len) < 0) {
- SU_DEBUG_5(("nua(%p): %s server: error parsing SDP\n", (void *)nh,
+ SU_DEBUG_5(("nua(%p): %s server: error parsing SDP\n", (void *)nh,
"INVITE"));
return SR_STATUS(sr, 400, "Bad Session Description");
}
@@ -2185,7 +2185,7 @@
if (NH_PGET(nh, auto_answer) ||
/* Auto-answer to re-INVITE unless auto_answer is set to 0 on handle */
(ss->ss_state == nua_callstate_ready &&
- /* Auto-answer requires enabled media (soa).
+ /* Auto-answer requires enabled media (soa).
* XXX - if the re-INVITE modifies the media we should not auto-answer.
*/
nh->nh_soa &&
@@ -2216,8 +2216,8 @@
nua_handle_t *nh = sr->sr_owner;
nua_dialog_usage_t *du = sr->sr_usage;
nua_session_usage_t *ss = nua_dialog_usage_private(du);
- msg_t *msg = sr->sr_response.msg;
- sip_t *sip = sr->sr_response.sip;
+ msg_t *msg = sr->sr_response.msg;
+ sip_t *sip = sr->sr_response.sip;
int reliable = 0, maybe_answer = 0, offer = 0, answer = 0, extra = 0;
@@ -2239,7 +2239,7 @@
if (sr->sr_neutral)
return nua_base_server_respond(sr, tags);
}
- else if (tags && 100 < sr->sr_status && sr->sr_status < 200 &&
+ else if (tags && 100 < sr->sr_status && sr->sr_status < 200 &&
!NHP_ISSET(nh->nh_prefs, early_answer)) {
sdp_session_t const *user_sdp = NULL;
char const *user_sdp_str = NULL;
@@ -2275,7 +2275,7 @@
extra = t && t->t_value;
}
else if (sr->sr_offer_recv && !sr->sr_answer_sent && maybe_answer) {
- /* Generate answer */
+ /* Generate answer */
if (soa_generate_answer(nh->nh_soa, NULL) >= 0 &&
soa_activate(nh->nh_soa, NULL) >= 0) {
answer = 1; /* signal that O/A answer sent (answer to invite) */
@@ -2287,11 +2287,11 @@
int wcode;
char const *text;
char const *host = "invalid.";
-
+
sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
-
+
wcode = soa_get_warning(nh->nh_soa, &text);
-
+
if (wcode) {
if (sip->sip_contact)
host = sip->sip_contact->m_url->url_host;
@@ -2344,7 +2344,7 @@
if (200 <= sr->sr_status && sr->sr_status < 300) {
session_timer_preferences(ss->ss_timer,
sip,
- NH_PGET(nh, supported),
+ NH_PGET(nh, supported),
NH_PGET(nh, session_timer),
NUA_PISSET(nh->nh_nua, nh, session_timer),
NH_PGET(nh, refresher),
@@ -2354,7 +2354,7 @@
session_timer_add_headers(ss->ss_timer, 0, msg, sip);
}
- return nua_base_server_respond(sr, tags);
+ return nua_base_server_respond(sr, tags);
}
/** Check if the response should be sent reliably.
@@ -2415,9 +2415,9 @@
}
retval = nua_base_server_report(sr, tags), sr = NULL; /* destroys sr */
-
+
if (retval >= 2 || ss == NULL) {
- /* Session has been terminated. */
+ /* Session has been terminated. */
if (!initial && !neutral) {
#if 0
signal_call_state_change(nh, NULL, status, phrase,
@@ -2483,8 +2483,8 @@
/** @NUA_EVENT nua_i_ack
*
- * Final response to INVITE has been acknowledged by UAC with ACK.
- *
+ * Final response to INVITE has been acknowledged by UAC with ACK.
+ *
* @note This event is only sent after 2XX response.
*
* @param nh operation handle associated with the call
@@ -2493,7 +2493,7 @@
* @param tags empty
*
* @sa #nua_i_invite, #nua_i_state, @ref nua_uas_call_model, nua_ack()
- *
+ *
* @END_NUA_EVENT
*/
static
@@ -2521,7 +2521,7 @@
ss->ss_oa_recv = recv;
}
- if (nh->nh_soa == NULL)
+ if (nh->nh_soa == NULL)
;
else if (recv == NULL ) {
if (ss->ss_state >= nua_callstate_ready &&
@@ -2530,7 +2530,7 @@
url_t const *m;
/* The re-INVITE was a refresh and re-INVITEr ignored our offer */
- ss->ss_oa_sent = NULL;
+ ss->ss_oa_sent = NULL;
if (sr->sr_request.sip->sip_contact)
m = sr->sr_request.sip->sip_contact->m_url;
@@ -2538,20 +2538,20 @@
m = sr->sr_request.sip->sip_from->a_url;
SU_DEBUG_3(("nua(%p): re-INVITEr ignored offer in our %u response "
- "(Contact: <" URL_PRINT_FORMAT ">)\n",
+ "(Contact: <" URL_PRINT_FORMAT ">)\n",
(void *)nh, sr->sr_status, URL_PRINT_ARGS(m)));
if (sr->sr_request.sip->sip_user_agent)
SU_DEBUG_3(("nua(%p): re-INVITE: \"User-Agent: %s\"\n", (void *)nh,
sr->sr_request.sip->sip_user_agent->g_string));
- }
- else
- return process_ack_error(sr, msg, 488, "Offer-Answer error",
+ }
+ else
+ return process_ack_error(sr, msg, 488, "Offer-Answer error",
"SIP;cause=488;text=\"No answer to offer\"");
}
else if (soa_set_remote_sdp(nh->nh_soa, NULL, sdp, len) >= 0 &&
soa_process_answer(nh->nh_soa, NULL) >= 0 &&
soa_activate(nh->nh_soa, NULL) >= 0) {
- ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
+ ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
}
else {
int status; char const *phrase, *reason;
@@ -2575,7 +2575,7 @@
return 0;
}
-static int
+static int
process_ack_error(nua_server_request_t *sr,
msg_t *ackmsg,
int status,
@@ -2585,14 +2585,14 @@
nua_handle_t *nh = sr->sr_owner;
nua_session_usage_t *ss = nua_dialog_usage_private(sr->sr_usage);
int error;
-
+
nua_stack_event(nh->nh_nua, nh, ackmsg,
nua_i_ack, status, phrase, NULL);
nua_stack_event(nh->nh_nua, nh, NULL,
nua_i_media_error, status, phrase, NULL);
if (reason) ss->ss_reason = reason;
- ss->ss_reporting = 1;
+ ss->ss_reporting = 1;
error = nua_client_create(nh, nua_r_bye, &nua_bye_client_methods, NULL);
ss->ss_reporting = 0;
@@ -2668,7 +2668,7 @@
if (nua_server_request_is_pending(sr)) {
/* PRACK timeout */
SR_STATUS1(sr, SIP_504_GATEWAY_TIME_OUT);
- nua_server_trespond(sr,
+ nua_server_trespond(sr,
SIPTAG_REASON_STR(reason),
TAG_END());
if (nua_server_report(sr) >= 2)
@@ -2709,7 +2709,7 @@
* @param tags empty
*
* @sa nua_prack(), #nua_r_prack, @RFC3262, NUTAG_EARLY_MEDIA()
- *
+ *
* @END_NUA_EVENT
*/
@@ -2717,11 +2717,11 @@
int nua_prack_server_respond(nua_server_request_t *sr, tagi_t const *tags);
int nua_prack_server_report(nua_server_request_t *sr, tagi_t const *tags);
-nua_server_methods_t const nua_prack_server_methods =
+nua_server_methods_t const nua_prack_server_methods =
{
SIP_METHOD_PRACK,
nua_i_prack, /* Event */
- {
+ {
0, /* Do not create dialog */
1, /* In-dialog request */
1, /* Target refresh request */
@@ -2744,7 +2744,7 @@
nua_dialog_usage_t *du;
nta_reliable_destroy(rel);
- if (irq == NULL)
+ if (irq == NULL)
/* Final response interrupted 100rel, we did not actually receive PRACK */
return 200;
@@ -2787,7 +2787,7 @@
if (sri == NULL)
return SR_STATUS(sr, 481, "No Such Preliminary Response");
-
+
if (nua_session_server_init(sr))
return sr->sr_status;
@@ -2796,7 +2796,7 @@
char const *offeranswer;
/* XXX - check for overlap? */
-
+
if (sri->sr_offer_sent && !sri->sr_answer_recv)
sr->sr_answer_recv = 1, sri->sr_answer_recv = 1, offeranswer = Answer;
else
@@ -2808,7 +2808,7 @@
soa_set_remote_sdp(nh->nh_soa, NULL, sr->sr_sdp, sr->sr_sdp_len) < 0) {
SU_DEBUG_5(("nua(%p): %s server: error parsing %s\n", (void *)nh,
"PRACK", offeranswer));
- return
+ return
sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
}
}
@@ -2820,7 +2820,7 @@
{
nua_handle_t *nh = sr->sr_owner;
- if (sr->sr_status < 200 || 300 <= sr->sr_status)
+ if (sr->sr_status < 200 || 300 <= sr->sr_status)
return nua_base_server_respond(sr, tags);
if (sr->sr_sdp) {
@@ -2834,8 +2834,8 @@
}
else if ((sr->sr_offer_recv && soa_generate_answer(nh->nh_soa, NULL) < 0) ||
(sr->sr_answer_recv && soa_process_answer(nh->nh_soa, NULL) < 0)) {
- SU_DEBUG_5(("nua(%p): %s server: %s %s\n",
- (void *)nh, "PRACK",
+ SU_DEBUG_5(("nua(%p): %s server: %s %s\n",
+ (void *)nh, "PRACK",
"error processing",
sr->sr_offer_recv ? Offer : Answer));
sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
@@ -2865,7 +2865,7 @@
if (retval >= 2 || ss == NULL) {
#if 0
signal_call_state_change(nh, NULL,
- status, phrase,
+ status, phrase,
nua_callstate_terminated);
#endif
return retval;
@@ -2874,11 +2874,11 @@
if (offer_recv_or_answer_sent) {
/* signal offer received, answer sent */
signal_call_state_change(nh, ss,
- status, phrase,
+ status, phrase,
ss->ss_state);
if (nh->nh_soa) {
soa_activate(nh->nh_soa, NULL);
- ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
+ ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
}
}
@@ -2888,15 +2888,15 @@
assert(sri);
if (sri == NULL) {
-
+
}
else if (SR_HAS_SAVED_SIGNAL(sri)) {
nua_signal_data_t const *e;
-
+
e = nua_signal_data(sri->sr_signal);
sri->sr_application = SR_STATUS(sri, e->e_status, e->e_phrase);
-
+
nua_server_params(sri, e->e_tags);
nua_server_respond(sri, e->e_tags);
nua_server_report(sri);
@@ -3028,15 +3028,15 @@
/**@fn void nua_info(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
*
- * Send an INFO request.
+ * Send an INFO request.
*
- * INFO is used to send call related information like DTMF
+ * INFO is used to send call related information like DTMF
* digit input events. See @RFC2976.
*
* @param nh Pointer to operation handle
* @param tag, value, ... List of tagged parameters
*
- * @return
+ * @return
* nothing
*
* @par Related Tags:
@@ -3048,7 +3048,7 @@
* @sa #nua_i_info
*/
-static int nua_info_client_init(nua_client_request_t *cr,
+static int nua_info_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags);
@@ -3080,7 +3080,7 @@
return nua_client_create(nh, e, &nua_info_client_methods, tags);
}
-static int nua_info_client_init(nua_client_request_t *cr,
+static int nua_info_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags)
{
@@ -3118,7 +3118,7 @@
* @param nh operation handle associated with the call
* @param hmagic application context associated with the call
* @param sip response to @b INFO or NULL upon an error
- * (status code is in @a status and
+ * (status code is in @a status and
* descriptive message in @a phrase parameters)
* @param tags empty
*
@@ -3139,15 +3139,15 @@
* @param tags empty
*
* @sa nua_info(), #nua_r_info, @RFC2976
- *
+ *
* @END_NUA_EVENT
*/
-nua_server_methods_t const nua_info_server_methods =
+nua_server_methods_t const nua_info_server_methods =
{
SIP_METHOD_INFO,
nua_i_info, /* Event */
- {
+ {
0, /* Do not create dialog */
1, /* In-dialog request */
0, /* Not a target refresh request */
@@ -3165,8 +3165,8 @@
/**@fn void nua_update(nua_handle_t *nh, tag_type_t tag, tag_value_t value, ...);
*
- * Update a session.
- *
+ * Update a session.
+ *
* Update a session using SIP UPDATE method. See @RFC3311.
*
* Update method can be used when the session has been established with
@@ -3177,7 +3177,7 @@
* @param nh Pointer to operation handle
* @param tag, value, ... List of tagged parameters
*
- * @return
+ * @return
* nothing
*
* @par Related Tags:
@@ -3191,7 +3191,7 @@
* @sa @ref nua_call_model, @RFC3311, nua_update(), #nua_i_update
*/
-static int nua_update_client_init(nua_client_request_t *cr,
+static int nua_update_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags);
static int nua_update_client_request(nua_client_request_t *cr,
@@ -3230,7 +3230,7 @@
return nua_client_create(nh, e, &nua_update_client_methods, tags);
}
-static int nua_update_client_init(nua_client_request_t *cr,
+static int nua_update_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags)
{
@@ -3252,7 +3252,7 @@
nua_server_request_t *sr;
nua_client_request_t *cri;
int offer_sent = 0, retval;
-
+
if (du == NULL) /* Call terminated */
return nua_client_return(cr, SIP_481_NO_TRANSACTION, msg);
@@ -3294,7 +3294,7 @@
/* Add session timer headers */
session_timer_preferences(ss->ss_timer,
sip,
- NH_PGET(nh, supported),
+ NH_PGET(nh, supported),
NH_PGET(nh, session_timer),
NUA_PISSET(nh->nh_nua, nh, session_timer),
NH_PGET(nh, refresher),
@@ -3368,7 +3368,7 @@
* @param nh operation handle associated with the call
* @param hmagic application context associated with the call
* @param sip response to UPDATE request or NULL upon an error
- * (status code is in @a status and
+ * (status code is in @a status and
* descriptive message in @a phrase parameters)
* @param tags empty
*
@@ -3387,7 +3387,7 @@
nua_dialog_usage_t *du = cr->cr_usage;
nua_session_usage_t *ss = nua_dialog_usage_private(du);
- nua_stack_event(nh->nh_nua, nh,
+ nua_stack_event(nh->nh_nua, nh,
nta_outgoing_getresponse(orq),
cr->cr_event,
status, phrase,
@@ -3405,7 +3405,7 @@
/* There is an un-ACK-ed INVITE there */
assert(du->du_cr->cr_method == sip_method_invite);
- if (NH_PGET(nh, auto_ack) ||
+ if (NH_PGET(nh, auto_ack) ||
/* Auto-ACK response to re-INVITE unless auto_ack is set to 0 */
(ss->ss_state == nua_callstate_ready && !NH_PISSET(nh, auto_ack))) {
if (nua_invite_client_ack(du->du_cr, NULL) > 0)
@@ -3429,11 +3429,11 @@
int nua_update_server_respond(nua_server_request_t *sr, tagi_t const *tags);
int nua_update_server_report(nua_server_request_t *, tagi_t const *);
-nua_server_methods_t const nua_update_server_methods =
+nua_server_methods_t const nua_update_server_methods =
{
SIP_METHOD_UPDATE,
nua_i_update, /* Event */
- {
+ {
0, /* Do not create dialog */
1, /* In-dialog request */
1, /* Target refresh request */
@@ -3498,7 +3498,7 @@
soa_set_remote_sdp(nh->nh_soa, NULL, sr->sr_sdp, sr->sr_sdp_len) < 0) {
SU_DEBUG_5(("nua(%p): %s server: error parsing %s\n", (void *)nh,
"UPDATE", Offer));
- return
+ return
sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
}
@@ -3524,7 +3524,7 @@
sr->sr_answer_sent = 1, ss ? ss->ss_oa_sent = Answer : Answer;
}
else if (soa_generate_answer(nh->nh_soa, NULL) < 0) {
- SU_DEBUG_5(("nua(%p): %s server: %s %s\n",
+ SU_DEBUG_5(("nua(%p): %s server: %s %s\n",
(void *)nh, "UPDATE", "error processing", Offer));
sr->sr_status = soa_error_as_sip_response(nh->nh_soa, &sr->sr_phrase);
}
@@ -3538,14 +3538,14 @@
}
else {
sr->sr_answer_sent = 1, ss->ss_oa_sent = Answer;
- ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
+ ss->ss_sdp_version = soa_get_user_version(nh->nh_soa);
}
}
if (200 <= sr->sr_status && sr->sr_status < 300) {
session_timer_preferences(ss->ss_timer,
sip,
- NH_PGET(nh, supported),
+ NH_PGET(nh, supported),
NH_PGET(nh, session_timer),
NUA_PISSET(nh->nh_nua, nh, session_timer),
NH_PGET(nh, refresher),
@@ -3597,7 +3597,7 @@
if (retval >= 2 || ss == NULL) {
#if 0
- signal_call_state_change(nh, NULL, status, phrase,
+ signal_call_state_change(nh, NULL, status, phrase,
nua_callstate_terminated);
#endif
return retval;
@@ -3606,7 +3606,7 @@
if (offer_recv_or_answer_sent) {
/* signal offer received, answer sent */
enum nua_callstate state = ss->ss_state;
-
+
if (state == nua_callstate_ready && status < 200)
state = nua_callstate_received;
@@ -3615,13 +3615,13 @@
if (200 <= status && status < 300
&& ss->ss_state < nua_callstate_ready
- && ss->ss_precondition
+ && ss->ss_precondition
&& !ss->ss_alerting
&& NH_PGET(nh, auto_alert)) {
nua_server_request_t *sri;
-
+
for (sri = nh->nh_ds->ds_sr; sri; sri = sr->sr_next)
- if (sri->sr_method == sip_method_invite &&
+ if (sri->sr_method == sip_method_invite &&
nua_server_request_is_pending(sri))
break;
@@ -3642,13 +3642,13 @@
*
* Hangdown a call.
*
- * Hangdown a call using SIP BYE method. Also the media session
- * associated with the call is terminated.
+ * Hangdown a call using SIP BYE method. Also the media session
+ * associated with the call is terminated.
*
* @param nh Pointer to operation handle
* @param tag, value, ... List of tagged parameters
*
- * @return
+ * @return
* nothing
*
* @par Related Tags:
@@ -3659,7 +3659,7 @@
* #nua_i_media_error
*/
-static int nua_bye_client_init(nua_client_request_t *cr,
+static int nua_bye_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags);
static int nua_bye_client_request(nua_client_request_t *cr,
@@ -3694,7 +3694,7 @@
{
nua_session_usage_t *ss = nua_session_usage_for_dialog(nh->nh_ds);
- if (ss &&
+ if (ss &&
nua_callstate_calling <= ss->ss_state &&
ss->ss_state <= nua_callstate_proceeding)
return nua_client_create(nh, e, &nua_cancel_client_methods, tags);
@@ -3702,7 +3702,7 @@
return nua_client_create(nh, e, &nua_bye_client_methods, tags);
}
-static int nua_bye_client_init(nua_client_request_t *cr,
+static int nua_bye_client_init(nua_client_request_t *cr,
msg_t *msg, sip_t *sip,
tagi_t const *tags)
{
@@ -3778,12 +3778,12 @@
* @param nh operation handle associated with the call
* @param hmagic application context associated with the call
* @param sip response to BYE request or NULL upon an error
- * (status code is in @a status and
+ * (status code is in @a status and
* descriptive message in @a phrase parameters)
* @param tags empty
*
* @sa nua_bye(), @ref nua_call_model, #nua_i_state, #nua_r_invite()
- *
+ *
* @END_NUA_EVENT
*/
@@ -3796,7 +3796,7 @@
nua_handle_t *nh = cr->cr_owner;
nua_dialog_usage_t *du = cr->cr_usage;
- nua_stack_event(nh->nh_nua, nh,
+ nua_stack_event(nh->nh_nua, nh,
nta_outgoing_getresponse(orq),
cr->cr_event,
status, phrase,
@@ -3821,7 +3821,7 @@
nua_client_bind(cr, NULL);
- signal_call_state_change(nh, ss, status, "to BYE",
+ signal_call_state_change(nh, ss, status, "to BYE",
nua_callstate_terminated);
for (cri = du->du_dialog->ds_cr; cri; cri = cri->cr_next) {
@@ -3857,11 +3857,11 @@
int nua_bye_server_init(nua_server_request_t *sr);
int nua_bye_server_report(nua_server_request_t *sr, tagi_t const *tags);
-nua_server_methods_t const nua_bye_server_methods =
+nua_server_methods_t const nua_bye_server_methods =
{
SIP_METHOD_BYE,
nua_i_bye, /* Event */
- {
+ {
0, /* Do not create dialog */
1, /* In-dialog request */
0, /* Not a target refresh request */
@@ -3949,7 +3949,7 @@
*
* @brief Call state has changed.
*
- * This event will be sent whenever the call state changes.
+ * This event will be sent whenever the call state changes.
*
* In addition to basic changes of session status indicated with enum
* ::nua_callstate, the @RFC3264 SDP Offer/Answer negotiation status is also
@@ -3977,7 +3977,7 @@
* @param nh operation handle associated with the call
* @param hmagic application context associated with the call
* @param sip NULL
- * @param tags NUTAG_CALLSTATE(),
+ * @param tags NUTAG_CALLSTATE(),
* SOATAG_LOCAL_SDP(), SOATAG_LOCAL_SDP_STR(),
* NUTAG_OFFER_SENT(), NUTAG_ANSWER_SENT(),
* SOATAG_REMOTE_SDP(), SOATAG_REMOTE_SDP_STR(),
@@ -3986,7 +3986,7 @@
* SOATAG_ACTIVE_IMAGE(), SOATAG_ACTIVE_CHAT().
*
* @sa @ref nua_call_model, #nua_i_active, #nua_i_terminated,
- * nua_invite(), #nua_r_invite, #nua_i_invite, nua_respond(),
+ * nua_invite(), #nua_r_invite, #nua_i_invite, nua_respond(),
* NUTAG_MEDIA_ENABLE(),
* NUTAG_AUTOALERT(), NUTAG_AUTOANSWER(), NUTAG_EARLY_MEDIA(),
* NUTAG_EARLY_ANSWER(), NUTAG_INCLUDE_EXTRA_SDP(),
@@ -4075,14 +4075,14 @@
next_state = ss->ss_state;
else if (ss->ss_state == nua_callstate_terminating)
return;
- else
+ else
ss->ss_state = next_state = nua_callstate_terminated;
}
else if (next_state > ss_state)
ss->ss_state = next_state;
}
- if (next_state == nua_callstate_init)
+ if (next_state == nua_callstate_init)
next_state = nua_callstate_terminated;
if (ss && ss->ss_state == nua_callstate_ready)
@@ -4165,7 +4165,7 @@
*
* @deprecated Use #nua_i_state instead.
*
- * @sa @ref nua_call_model, #nua_i_state, #nua_i_terminated,
+ * @sa @ref nua_call_model, #nua_i_state, #nua_i_terminated,
* #nua_i_invite
*
* @END_NUA_EVENT
@@ -4222,7 +4222,7 @@
return t->local.supported;
}
-/** Set session timer preferences */
+/** Set session timer preferences */
static
void session_timer_preferences(struct session_timer *t,
sip_t const *sip,
@@ -4260,7 +4260,7 @@
t->local.min_se = sip->sip_min_se->min_delta;
if (t->local.expires != 0 && t->local.min_se > t->local.expires)
t->local.expires = t->local.min_se;
-
+
return nua_client_restart(cr, 100, "Re-Negotiating Session Timer");
}
}
@@ -4301,7 +4301,7 @@
/* Include extension parameters, if any */
if (request->sip_min_se)
min_se->min_params = request->sip_min_se->min_params;
-
+
sip_add_dup(msg, sip, (sip_header_t *)min_se);
return 422;
@@ -4310,7 +4310,7 @@
return 0;
}
-/** Store session timer parameters in request from uac / response from uas */
+/** Store session timer parameters in request from uac / response from uas */
static
void session_timer_store(struct session_timer *t,
sip_t const *sip)
@@ -4349,7 +4349,7 @@
}
/** Add timer feature and Session-Expires/Min-SE headers to request/response
- *
+ *
*/
static int
session_timer_add_headers(struct session_timer *t,
@@ -4377,7 +4377,7 @@
if (uas) {
session_timer_negotiate(t);
-
+
refresher = t->refresher;
expires = t->interval;
}
@@ -4440,7 +4440,7 @@
t->interval = t->local.expires;
if (t->local.defaults != 0 && t->interval > t->local.defaults)
t->interval = t->local.defaults;
-
+
if (t->interval != 0) {
if (t->interval < t->local.min_se)
t->interval = t->local.min_se;
@@ -4652,11 +4652,11 @@
int nua_options_server_respond(nua_server_request_t *sr, tagi_t const *tags);
-nua_server_methods_t const nua_options_server_methods =
+nua_server_methods_t const nua_options_server_methods =
{
SIP_METHOD_OPTIONS,
nua_i_options, /* Event */
- {
+ {
0, /* Do not create dialog */
0, /* Initial request */
0, /* Not a target refresh request */
1
0
[commit] r10832 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua
by FreeSWITCH SVN 16 Dec '08
by FreeSWITCH SVN 16 Dec '08
16 Dec '08
Author: mikej
Date: Tue Dec 16 16:22:43 2008
New Revision: 10832
Log:
Thu Nov 27 06:09:44 CST 2008 Pekka Pessi <first.last(a)nokia.com>
* nua_session.c: use signed ss_sdp_version (soa_get_user_version() returns int)
Modified:
freeswitch/trunk/libs/sofia-sip/.update
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update (original)
+++ freeswitch/trunk/libs/sofia-sip/.update Tue Dec 16 16:22:43 2008
@@ -1 +1 @@
-Tue Dec 16 15:20:42 CST 2008
+Tue Dec 16 15:22:24 CST 2008
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Tue Dec 16 16:22:43 2008
@@ -173,7 +173,7 @@
char const *ss_oa_recv, *ss_oa_sent;
/**< Version of user SDP from latest successful O/A */
- unsigned ss_sdp_version;
+ int ss_sdp_version;
} nua_session_usage_t;
static char const Offer[] = "offer", Answer[] = "answer";
1
0