[asterisk-commits] oej: branch oej/darjeeling-prack-11 r411780 - in /team/oej/darjeeling-prack-1...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Apr 7 05:06:17 CDT 2014
Author: oej
Date: Mon Apr 7 05:05:48 2014
New Revision: 411780
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=411780
Log:
Reset, resolve and live a happy life.
Modified:
team/oej/darjeeling-prack-11/ (props changed)
team/oej/darjeeling-prack-11/UPGRADE.txt
team/oej/darjeeling-prack-11/addons/chan_ooh323.c
team/oej/darjeeling-prack-11/addons/ooh323c/src/ooCmdChannel.c
team/oej/darjeeling-prack-11/addons/ooh323c/src/ooGkClient.c
team/oej/darjeeling-prack-11/addons/ooh323c/src/oochannels.c
team/oej/darjeeling-prack-11/addons/ooh323c/src/ooh323.c
team/oej/darjeeling-prack-11/addons/ooh323c/src/ooq931.c
team/oej/darjeeling-prack-11/apps/app_confbridge.c
team/oej/darjeeling-prack-11/apps/app_jack.c
team/oej/darjeeling-prack-11/apps/app_queue.c
team/oej/darjeeling-prack-11/apps/app_speech_utils.c
team/oej/darjeeling-prack-11/apps/app_stack.c
team/oej/darjeeling-prack-11/apps/app_voicemail.c
team/oej/darjeeling-prack-11/apps/confbridge/conf_config_parser.c
team/oej/darjeeling-prack-11/apps/confbridge/conf_state.c
team/oej/darjeeling-prack-11/apps/confbridge/conf_state_inactive.c
team/oej/darjeeling-prack-11/apps/confbridge/conf_state_single.c
team/oej/darjeeling-prack-11/apps/confbridge/conf_state_single_marked.c
team/oej/darjeeling-prack-11/channels/chan_iax2.c
team/oej/darjeeling-prack-11/channels/chan_sip.c
team/oej/darjeeling-prack-11/channels/sip/include/sip.h
team/oej/darjeeling-prack-11/configs/asterisk.conf.sample
team/oej/darjeeling-prack-11/configs/res_odbc.conf.sample
team/oej/darjeeling-prack-11/configs/sip.conf.sample
team/oej/darjeeling-prack-11/funcs/func_blacklist.c
team/oej/darjeeling-prack-11/funcs/func_callcompletion.c
team/oej/darjeeling-prack-11/funcs/func_callerid.c
team/oej/darjeeling-prack-11/funcs/func_channel.c
team/oej/darjeeling-prack-11/funcs/func_dialplan.c
team/oej/darjeeling-prack-11/funcs/func_frame_trace.c
team/oej/darjeeling-prack-11/funcs/func_global.c
team/oej/darjeeling-prack-11/funcs/func_groupcount.c
team/oej/darjeeling-prack-11/funcs/func_jitterbuffer.c
team/oej/darjeeling-prack-11/funcs/func_math.c
team/oej/darjeeling-prack-11/funcs/func_odbc.c
team/oej/darjeeling-prack-11/funcs/func_pitchshift.c
team/oej/darjeeling-prack-11/funcs/func_speex.c
team/oej/darjeeling-prack-11/funcs/func_strings.c
team/oej/darjeeling-prack-11/funcs/func_volume.c
team/oej/darjeeling-prack-11/include/asterisk.h
team/oej/darjeeling-prack-11/include/asterisk/options.h
team/oej/darjeeling-prack-11/include/asterisk/res_odbc.h
team/oej/darjeeling-prack-11/main/asterisk.c
team/oej/darjeeling-prack-11/main/callerid.c
team/oej/darjeeling-prack-11/main/channel.c
team/oej/darjeeling-prack-11/main/db.c
team/oej/darjeeling-prack-11/main/features.c
team/oej/darjeeling-prack-11/main/format.c
team/oej/darjeeling-prack-11/main/http.c
team/oej/darjeeling-prack-11/main/manager.c
team/oej/darjeeling-prack-11/main/message.c
team/oej/darjeeling-prack-11/main/say.c
team/oej/darjeeling-prack-11/main/tcptls.c
team/oej/darjeeling-prack-11/res/res_calendar.c
team/oej/darjeeling-prack-11/res/res_config_odbc.c
team/oej/darjeeling-prack-11/res/res_fax_spandsp.c
team/oej/darjeeling-prack-11/res/res_jabber.c
team/oej/darjeeling-prack-11/res/res_mutestream.c
team/oej/darjeeling-prack-11/res/res_odbc.c
team/oej/darjeeling-prack-11/res/res_odbc.exports.in
team/oej/darjeeling-prack-11/res/res_xmpp.c
team/oej/darjeeling-prack-11/utils/extconf.c
Propchange: team/oej/darjeeling-prack-11/
------------------------------------------------------------------------------
automerge = Is-there-life-off-net?
Propchange: team/oej/darjeeling-prack-11/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.
Propchange: team/oej/darjeeling-prack-11/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Apr 7 05:05:48 2014
@@ -1,1 +1,1 @@
-/branches/11:1-410247
+/branches/11:1-411779
Modified: team/oej/darjeeling-prack-11/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/UPGRADE.txt?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/UPGRADE.txt (original)
+++ team/oej/darjeeling-prack-11/UPGRADE.txt Mon Apr 7 05:05:48 2014
@@ -19,19 +19,41 @@
=== UPGRADE-10.txt -- Upgrade info for 1.8 to 10
===
===========================================================
+
+from 11.9 to 11.10
+ - The asterisk command line -I option and the asterisk.conf internal_timing
+ option are removed and always enabled if any timing module is loaded.
+
from 11.8 to 11.9
-* res_fax now returns the correct rates for V.27ter (4800 or 9600 bit/s).
+- res_fax now returns the correct rates for V.27ter (4800 or 9600 bit/s).
Because of this the default settings would not load, so the minrate (minimum
transmission rate) option was changed to default to 4800 since that is the
minimum rate for v.27 which is included in the default modem options.
-* The sound_place_into_conference sound used in Confbridge is now deprecated
+
+- The sound_place_into_conference sound used in Confbridge is now deprecated
and is no longer functional since it has been broken since its inception
and the fix involved using a different method to achieve the same goal. The
new method to achieve this functionality is by using sound_begin to play
a sound to the conference when waitmarked users are moved into the conference.
+- When communicating with a peer on an Asterisk 1.4 or earlier system, the
+ chan_iax2 parameter 'connectedline' must be set to "no" in iax.conf. This
+ prevents an incompatible connected line frame from an Astersik 1.8 or later
+ system from causing a hangup in an Asterisk 1.4 or earlier system. Note that
+ this particular incompatibility has always existed between 1.4 and 1.8 and
+ later versions; this upgrade note is simply informing users of its existance.
+
+- A compatibility setting, allow_empty_string_in_nontext, has been added to
+ res_odbc.conf. When enabled (default behavior), empty column values are
+ stored as empty strings during realtime updates. Disabling this option
+ causes empty column values to be stored as NULLs for non-text columns.
+
+ Disable it for PostgreSQL backends in order to avoid errors caused by
+ updating integer columns with an empty string instead of NULL
+ (sipppeers,sipregs)
+
From 11.7 to 11.8:
-* The per console verbose level feature as previously implemented caused a
+- The per console verbose level feature as previously implemented caused a
large performance penalty. The fix required some minor incompatibilities
if the new rasterisk is used to connect to an earlier version. If the new
rasterisk connects to an older Asterisk version then the root console verbose
Modified: team/oej/darjeeling-prack-11/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/addons/chan_ooh323.c?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/addons/chan_ooh323.c (original)
+++ team/oej/darjeeling-prack-11/addons/chan_ooh323.c Mon Apr 7 05:05:48 2014
@@ -2203,6 +2203,10 @@
ast_channel_unlock(p->owner);
p->owner = NULL;
ast_module_unref(myself);
+ }
+
+ if (!p->rtp) {
+ ast_cond_signal(&p->rtpcond);
}
ast_set_flag(p, H323_NEEDDESTROY);
Modified: team/oej/darjeeling-prack-11/addons/ooh323c/src/ooCmdChannel.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/addons/ooh323c/src/ooCmdChannel.c?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/addons/ooh323c/src/ooCmdChannel.c (original)
+++ team/oej/darjeeling-prack-11/addons/ooh323c/src/ooCmdChannel.c Mon Apr 7 05:05:48 2014
@@ -172,11 +172,6 @@
if(cmd.type == OO_CMD_NOOP)
continue;
- if(gH323ep.gkClient && gH323ep.gkClient->state != GkClientRegistered && cmd.type != OO_CMD_STOPMONITOR)
- {
- OOTRACEINFO1("Ignoring stack command as Gk Client is not registered"
- " yet\n");
- }
else {
switch(cmd.type) {
case OO_CMD_MAKECALL:
@@ -336,11 +331,6 @@
if(cmd.type == OO_CMD_NOOP)
continue;
- if(gH323ep.gkClient && gH323ep.gkClient->state != GkClientRegistered)
- {
- OOTRACEINFO1("Ignoring stack command as Gk Client is not registered"
- " yet\n");
- }
else {
switch(cmd.type) {
case OO_CMD_MAKECALL:
Modified: team/oej/darjeeling-prack-11/addons/ooh323c/src/ooGkClient.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/addons/ooh323c/src/ooGkClient.c?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/addons/ooh323c/src/ooGkClient.c (original)
+++ team/oej/darjeeling-prack-11/addons/ooh323c/src/ooGkClient.c Mon Apr 7 05:05:48 2014
@@ -210,7 +210,7 @@
if(iRet != OO_OK)
{
OOTRACEERR1("Error:Failed to send GRQ message\n");
- pGkClient->state = GkClientFailed;
+ pGkClient->state = GkClientGkErr;
ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
@@ -433,7 +433,7 @@
if(iRet != OO_OK)
{
OOTRACEERR1("Error: Failed to handle received RAS message\n");
- pGkClient->state = GkClientFailed;
+ pGkClient->state = GkClientGkErr;
}
memReset(pctxt);
}
@@ -702,7 +702,7 @@
{
OOTRACEERR1("Error: Failed to send GRQ message\n");
memReset(&pGkClient->msgCtxt);
- pGkClient->state = GkClientFailed;
+ pGkClient->state = GkClientGkErr;
ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
@@ -1530,7 +1530,7 @@
{
OOTRACEERR1("Error:Failed to send UnregistrationRequest message\n");
memReset(pctxt);
- pGkClient->state = GkClientFailed;
+ pGkClient->state = GkClientGkErr;
ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
@@ -1909,7 +1909,7 @@
{
OOTRACEERR1("Error:Failed to send AdmissionRequest message\n");
memReset(pctxt);
- pGkClient->state = GkClientFailed;
+ pGkClient->state = GkClientGkErr;
ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
@@ -2423,7 +2423,7 @@
{
OOTRACEERR1("Error:Failed to send IRR message\n");
memReset(pctxt);
- pGkClient->state = GkClientFailed;
+ pGkClient->state = GkClientGkErr;
ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
@@ -2576,7 +2576,7 @@
if(iRet != OO_OK)
{
OOTRACEERR1("Error: Failed to send DRQ message\n");
- pGkClient->state = GkClientFailed;
+ pGkClient->state = GkClientGkErr;
}
@@ -2736,7 +2736,7 @@
if(ret != OO_OK)
{
OOTRACEERR1("Error:Failed to send Additive RRQ message\n");
- pGkClient->state = GkClientFailed;
+ pGkClient->state = GkClientGkErr;
return OO_FAILED;
}
return OO_OK;
Modified: team/oej/darjeeling-prack-11/addons/ooh323c/src/oochannels.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/addons/ooh323c/src/oochannels.c?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/addons/ooh323c/src/oochannels.c (original)
+++ team/oej/darjeeling-prack-11/addons/ooh323c/src/oochannels.c Mon Apr 7 05:05:48 2014
@@ -822,7 +822,8 @@
if(OO_OK != ooGkClientStart(gH323ep.gkClient))
{
OOTRACEERR1("Error:Failed to start Gatekeeper client\n");
- ooGkClientDestroy();
+ // not need more, now it can be restarted correctly
+ // ooGkClientDestroy();
}
}
Modified: team/oej/darjeeling-prack-11/addons/ooh323c/src/ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/addons/ooh323c/src/ooh323.c?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/addons/ooh323c/src/ooh323.c (original)
+++ team/oej/darjeeling-prack-11/addons/ooh323c/src/ooh323.c Mon Apr 7 05:05:48 2014
@@ -1719,12 +1719,12 @@
if(gH323ep.gkClient->state == GkClientRegistered)
{
call->callState = OO_CALL_WAITING_ADMISSION;
+ ast_mutex_lock(&call->GkLock);
ret = ooGkClientSendAdmissionRequest(gH323ep.gkClient, call,
FALSE);
tv = ast_tvnow();
ts.tv_sec = tv.tv_sec + 24;
ts.tv_nsec = tv.tv_usec * 1000;
- ast_mutex_lock(&call->GkLock);
if (call->callState == OO_CALL_WAITING_ADMISSION)
ast_cond_timedwait(&call->gkWait, &call->GkLock, &ts);
if (call->callState == OO_CALL_WAITING_ADMISSION)
Modified: team/oej/darjeeling-prack-11/addons/ooh323c/src/ooq931.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/addons/ooh323c/src/ooq931.c?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/addons/ooh323c/src/ooq931.c (original)
+++ team/oej/darjeeling-prack-11/addons/ooh323c/src/ooq931.c Mon Apr 7 05:05:48 2014
@@ -2604,11 +2604,11 @@
{
if(gH323ep.gkClient->state == GkClientRegistered) {
call->callState = OO_CALL_WAITING_ADMISSION;
+ ast_mutex_lock(&call->GkLock);
ret = ooGkClientSendAdmissionRequest(gH323ep.gkClient, call, FALSE);
tv = ast_tvnow();
ts.tv_sec = tv.tv_sec + 24;
ts.tv_nsec = tv.tv_usec * 1000;
- ast_mutex_lock(&call->GkLock);
if (call->callState == OO_CALL_WAITING_ADMISSION)
ast_cond_timedwait(&call->gkWait, &call->GkLock, &ts);
if (call->callState == OO_CALL_WAITING_ADMISSION)
Modified: team/oej/darjeeling-prack-11/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/apps/app_confbridge.c?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/apps/app_confbridge.c (original)
+++ team/oej/darjeeling-prack-11/apps/app_confbridge.c Mon Apr 7 05:05:48 2014
@@ -992,6 +992,13 @@
ast_channel_name(user->chan), mute_effective ? "muted" : "unmuted",
mute_user, mute_system);
user->features.mute = mute_effective;
+ ast_test_suite_event_notify("CONF_MUTE_UPDATE",
+ "Mode: %s\r\n"
+ "Conference: %s\r\n"
+ "Channel: %s",
+ mute_effective ? "muted" : "unmuted",
+ user->b_profile.name,
+ ast_channel_name(user->chan));
}
void conf_moh_stop(struct conference_bridge_user *user)
@@ -1664,6 +1671,12 @@
conf_name);
}
+ /* If the caller should be joined already muted, set the flag before we join. */
+ if (ast_test_flag(&conference_bridge_user.u_profile, USER_OPT_STARTMUTED)) {
+ /* Set user level mute request. */
+ conference_bridge_user.muted = 1;
+ }
+
/* Look for a conference bridge matching the provided name */
if (!(conference_bridge = join_conference_bridge(args.conf_name, &conference_bridge_user))) {
res = -1;
@@ -1673,12 +1686,6 @@
/* Keep a copy of volume adjustments so we can restore them later if need be */
volume_adjustments[0] = ast_audiohook_volume_get(chan, AST_AUDIOHOOK_DIRECTION_READ);
volume_adjustments[1] = ast_audiohook_volume_get(chan, AST_AUDIOHOOK_DIRECTION_WRITE);
-
- /* If the caller should be joined already muted, make it so */
- if (ast_test_flag(&conference_bridge_user.u_profile, USER_OPT_STARTMUTED)) {
- /* Set user level mute request. */
- conference_bridge_user.muted = 1;
- }
if (ast_test_flag(&conference_bridge_user.u_profile, USER_OPT_DROP_SILENCE)) {
conference_bridge_user.tech_args.drop_silence = 1;
Modified: team/oej/darjeeling-prack-11/apps/app_jack.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/apps/app_jack.c?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/apps/app_jack.c (original)
+++ team/oej/darjeeling-prack-11/apps/app_jack.c Mon Apr 7 05:05:48 2014
@@ -951,6 +951,11 @@
{
int res;
+ if (!chan) {
+ ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
+ return -1;
+ }
+
if (!strcasecmp(value, "on"))
res = enable_jack_hook(chan, data);
else if (!strcasecmp(value, "off"))
Modified: team/oej/darjeeling-prack-11/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/apps/app_queue.c?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/apps/app_queue.c (original)
+++ team/oej/darjeeling-prack-11/apps/app_queue.c Mon Apr 7 05:05:48 2014
@@ -7936,7 +7936,7 @@
static int mark_member_dead(void *obj, void *arg, int flags)
{
struct member *member = obj;
- if (!member->dynamic) {
+ if (!member->dynamic && !member->realtime) {
member->delme = 1;
}
return 0;
Modified: team/oej/darjeeling-prack-11/apps/app_speech_utils.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/apps/app_speech_utils.c?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/apps/app_speech_utils.c (original)
+++ team/oej/darjeeling-prack-11/apps/app_speech_utils.c Mon Apr 7 05:05:48 2014
@@ -284,7 +284,11 @@
{
struct ast_speech *speech = NULL;
struct ast_datastore *datastore = NULL;
-
+
+ if (!chan) {
+ return NULL;
+ }
+
datastore = ast_channel_datastore_find(chan, &speech_datastore, NULL);
if (datastore == NULL) {
return NULL;
Modified: team/oej/darjeeling-prack-11/apps/app_stack.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/apps/app_stack.c?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/apps/app_stack.c (original)
+++ team/oej/darjeeling-prack-11/apps/app_stack.c Mon Apr 7 05:05:48 2014
@@ -687,6 +687,11 @@
struct gosub_stack_frame *frame;
struct ast_var_t *variables;
+ if (!chan) {
+ ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
+ return -1;
+ }
+
ast_channel_lock(chan);
if (!(stack_store = ast_channel_datastore_find(chan, &stack_info, NULL))) {
ast_channel_unlock(chan);
@@ -720,6 +725,11 @@
struct ast_datastore *stack_store;
struct gosub_stack_list *oldlist;
struct gosub_stack_frame *frame;
+
+ if (!chan) {
+ ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
+ return -1;
+ }
ast_channel_lock(chan);
if (!(stack_store = ast_channel_datastore_find(chan, &stack_info, NULL))) {
Modified: team/oej/darjeeling-prack-11/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/apps/app_voicemail.c?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/apps/app_voicemail.c (original)
+++ team/oej/darjeeling-prack-11/apps/app_voicemail.c Mon Apr 7 05:05:48 2014
@@ -12045,7 +12045,9 @@
} else if (!strncasecmp(arg.attribute, "pager", 5)) {
ast_copy_string(buf, vmu->pager, len);
} else if (!strncasecmp(arg.attribute, "language", 8)) {
- ast_copy_string(buf, S_OR(vmu->language, ast_channel_language(chan)), len);
+ const char *lang = S_OR(vmu->language, chan ?
+ ast_channel_language(chan) : ast_defaultlanguage);
+ ast_copy_string(buf, lang, len);
} else if (!strncasecmp(arg.attribute, "locale", 6)) {
ast_copy_string(buf, vmu->locale, len);
} else if (!strncasecmp(arg.attribute, "tz", 2)) {
Modified: team/oej/darjeeling-prack-11/apps/confbridge/conf_config_parser.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/apps/confbridge/conf_config_parser.c?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/apps/confbridge/conf_config_parser.c (original)
+++ team/oej/darjeeling-prack-11/apps/confbridge/conf_config_parser.c Mon Apr 7 05:05:48 2014
@@ -353,6 +353,11 @@
AST_APP_ARG(type);
AST_APP_ARG(option);
);
+
+ if (!chan) {
+ ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
+ return -1;
+ }
/* parse all the required arguments and make sure they exist. */
if (ast_strlen_zero(data)) {
Modified: team/oej/darjeeling-prack-11/apps/confbridge/conf_state.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/apps/confbridge/conf_state.c?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/apps/confbridge/conf_state.c (original)
+++ team/oej/darjeeling-prack-11/apps/confbridge/conf_state.c Mon Apr 7 05:05:48 2014
@@ -74,6 +74,9 @@
void conf_default_leave_waitmarked(struct conference_bridge_user *cbu)
{
conf_remove_user_waiting(cbu->conference_bridge, cbu);
+ if (cbu->playing_moh) {
+ conf_moh_stop(cbu);
+ }
}
void conf_change_state(struct conference_bridge_user *cbu, struct conference_state *newstate)
Modified: team/oej/darjeeling-prack-11/apps/confbridge/conf_state_inactive.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/apps/confbridge/conf_state_inactive.c?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/apps/confbridge/conf_state_inactive.c (original)
+++ team/oej/darjeeling-prack-11/apps/confbridge/conf_state_inactive.c Mon Apr 7 05:05:48 2014
@@ -68,7 +68,7 @@
static void leave_waitmarked(struct conference_bridge_user *cbu)
{
- conf_remove_user_waiting(cbu->conference_bridge, cbu);
+ conf_default_leave_waitmarked(cbu);
if (cbu->conference_bridge->waitingusers == 0) {
conf_change_state(cbu, CONF_STATE_EMPTY);
}
Modified: team/oej/darjeeling-prack-11/apps/confbridge/conf_state_single.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/apps/confbridge/conf_state_single.c?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/apps/confbridge/conf_state_single.c (original)
+++ team/oej/darjeeling-prack-11/apps/confbridge/conf_state_single.c Mon Apr 7 05:05:48 2014
@@ -72,6 +72,9 @@
static void leave_unmarked(struct conference_bridge_user *cbu)
{
conf_remove_user_active(cbu->conference_bridge, cbu);
+ if (cbu->playing_moh) {
+ conf_moh_stop(cbu);
+ }
if (cbu->conference_bridge->waitingusers) {
conf_change_state(cbu, CONF_STATE_INACTIVE);
Modified: team/oej/darjeeling-prack-11/apps/confbridge/conf_state_single_marked.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/apps/confbridge/conf_state_single_marked.c?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/apps/confbridge/conf_state_single_marked.c (original)
+++ team/oej/darjeeling-prack-11/apps/confbridge/conf_state_single_marked.c Mon Apr 7 05:05:48 2014
@@ -71,6 +71,9 @@
static void leave_marked(struct conference_bridge_user *cbu)
{
conf_remove_user_marked(cbu->conference_bridge, cbu);
+ if (cbu->playing_moh) {
+ conf_moh_stop(cbu);
+ }
conf_change_state(cbu, CONF_STATE_EMPTY);
}
Modified: team/oej/darjeeling-prack-11/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/channels/chan_iax2.c?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/channels/chan_iax2.c (original)
+++ team/oej/darjeeling-prack-11/channels/chan_iax2.c Mon Apr 7 05:05:48 2014
@@ -10013,10 +10013,16 @@
static int acf_iaxvar_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
{
- struct ast_datastore *variablestore = ast_channel_datastore_find(chan, &iax2_variable_datastore_info, NULL);
+ struct ast_datastore *variablestore;
AST_LIST_HEAD(, ast_var_t) *varlist;
struct ast_var_t *var;
+ if (!chan) {
+ ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
+ return -1;
+ }
+
+ variablestore = ast_channel_datastore_find(chan, &iax2_variable_datastore_info, NULL);
if (!variablestore) {
*buf = '\0';
return 0;
@@ -10036,10 +10042,16 @@
static int acf_iaxvar_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)
{
- struct ast_datastore *variablestore = ast_channel_datastore_find(chan, &iax2_variable_datastore_info, NULL);
+ struct ast_datastore *variablestore;
AST_LIST_HEAD(, ast_var_t) *varlist;
struct ast_var_t *var;
+ if (!chan) {
+ ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
+ return -1;
+ }
+
+ variablestore = ast_channel_datastore_find(chan, &iax2_variable_datastore_info, NULL);
if (!variablestore) {
variablestore = ast_datastore_alloc(&iax2_variable_datastore_info, NULL);
if (!variablestore) {
@@ -14307,8 +14319,9 @@
/* if our channel, return the IP address of the endpoint of current channel */
if (!strcmp(peername,"CURRENTCHANNEL")) {
unsigned short callno;
- if (ast_channel_tech(chan) != &iax2_tech)
+ if (!chan || ast_channel_tech(chan) != &iax2_tech) {
return -1;
+ }
callno = PTR_TO_CALLNO(ast_channel_tech_pvt(chan));
ast_copy_string(buf, iaxs[callno]->addr.sin_addr.s_addr ? ast_inet_ntoa(iaxs[callno]->addr.sin_addr) : "", len);
return 0;
Modified: team/oej/darjeeling-prack-11/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/channels/chan_sip.c?view=diff&rev=411780&r1=411779&r2=411780
==============================================================================
--- team/oej/darjeeling-prack-11/channels/chan_sip.c (original)
+++ team/oej/darjeeling-prack-11/channels/chan_sip.c Mon Apr 7 05:05:48 2014
@@ -4641,8 +4641,20 @@
const char *msg = NULL;
struct ast_channel *chan;
int res = 0;
+ int old_sched_id = pvt->provisional_keepalive_sched_id;
chan = sip_pvt_lock_full(pvt);
+ /* Check that nothing has changed while we were waiting for the lock */
+ if (old_sched_id != pvt->provisional_keepalive_sched_id) {
+ /* Keepalive has been cancelled or rescheduled, clean up and leave */
+ if (chan) {
+ ast_channel_unlock(chan);
+ chan = ast_channel_unref(chan);
+ }
+ sip_pvt_unlock(pvt);
+ dialog_unref(pvt, "dialog ref for provisional keepalive");
+ return 0;
+ }
if (!pvt->last_provisional || !strncasecmp(pvt->last_provisional, "100", 3)) {
msg = "183 Session Progress";
@@ -4668,20 +4680,9 @@
sip_pvt_unlock(pvt);
-#if 0
- /*
- * XXX BUG TODO
- *
- * Without this code, it appears as if this function is leaking its
- * reference to the sip_pvt. However, adding it introduces a crash.
- * This points to some sort of reference count imbalance elsewhere,
- * but I'm not sure where ...
- */
if (!res) {
dialog_unref(pvt, "dialog ref for provisional keepalive");
}
-#endif
-
return res;
}
@@ -12574,7 +12575,6 @@
const char *fromdomain;
const char *privacy = NULL;
const char *screen = NULL;
- const char *anonymous_string = "\"Anonymous\" <sip:anonymous at anonymous.invalid>";
struct ast_party_id connected_id;
if (!ast_test_flag(&p->flags[0], SIP_SENDRPID)) {
@@ -12600,12 +12600,11 @@
lid_num = ast_uri_encode(lid_num, tmp2, sizeof(tmp2), ast_uri_sip_user);
if (ast_test_flag(&p->flags[0], SIP_SENDRPID_PAI)) {
+ ast_str_set(&tmp, -1, "\"%s\" <sip:%s@%s>", lid_name, lid_num, fromdomain);
+ add_header(req, "P-Asserted-Identity", ast_str_buffer(tmp));
if ((lid_pres & AST_PRES_RESTRICTION) != AST_PRES_ALLOWED) {
- ast_str_set(&tmp, -1, "%s", anonymous_string);
- } else {
- ast_str_set(&tmp, -1, "\"%s\" <sip:%s@%s>", lid_name, lid_num, fromdomain);
- }
- add_header(req, "P-Asserted-Identity", ast_str_buffer(tmp));
+ add_header(req, "Privacy", "id");
+ }
} else {
ast_str_set(&tmp, -1, "\"%s\" <sip:%s@%s>;party=%s", lid_name, lid_num, fromdomain, p->outgoing_call ? "calling" : "called");
@@ -13373,8 +13372,9 @@
ast_debug(3, "-- Done with adding codecs to SDP\n");
- if (!p->owner || !ast_internal_timing_enabled(p->owner))
+ if (!p->owner || ast_channel_timingfd(p->owner) == -1) {
ast_str_append(&a_audio, 0, "a=silenceSupp:off - - - -\r\n");
+ }
if (min_audio_packet_size)
ast_str_append(&a_audio, 0, "a=ptime:%d\r\n", min_audio_packet_size);
@@ -13889,7 +13889,9 @@
snprintf(p->lastmsg, sizeof(p->lastmsg), "Init: %s", sip_methods[sipmethod].text);
- d = S_OR(p->fromdomain, ast_sockaddr_stringify_host_remote(&p->ourip));
+ if (ast_strlen_zero(p->fromdomain)) {
+ d = ast_sockaddr_stringify_host_remote(&p->ourip);
+ }
if (p->owner) {
connected_id = ast_channel_connected_effective_id(p->owner);
@@ -13939,6 +13941,12 @@
n = p->fromname;
else /* Save for any further attempts */
ast_string_field_set(p, fromname, n);
+
+ /* Allow domain to be overridden */
+ if (!ast_strlen_zero(p->fromdomain))
+ d = p->fromdomain;
+ else /* Save for any further attempts */
+ ast_string_field_set(p, fromdomain, d);
ast_copy_string(tmp_l, l, sizeof(tmp_l));
if (sip_cfg.pedanticsipchecking) {
@@ -22133,7 +22141,12 @@
);
int i, number, start = 0;
- if (ast_strlen_zero(data)) {
+ if (!chan) {
+ ast_log(LOG_WARNING, "No channel was provided to %s function.\n", function);
+ return -1;
+ }
+
+ if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "This function requires a header name.\n");
return -1;
}
@@ -22318,8 +22331,13 @@
static int deprecated = 0;
*buf = 0;
-
- if (!data) {
+
+ if (!chan) {
+ ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);
+ return -1;
+ }
+
+ if (!data) {
ast_log(LOG_WARNING, "This function requires a parameter name.\n");
return -1;
}
@@ -25306,6 +25324,145 @@
return 0;
}
+/*
+ * \internal \brief Check Session Timers for an INVITE request
+ *
+ * \retval 0 ok
+ * \retval -1 failure
+ */
+static int handle_request_invite_st(struct sip_pvt *p, struct sip_request *req,
+ const char *required, int reinvite)
+{
+ const char *p_uac_se_hdr; /* UAC's Session-Expires header string */
+ const char *p_uac_min_se; /* UAC's requested Min-SE interval (char string) */
+ int uac_max_se = -1; /* UAC's Session-Expires in integer format */
+ int uac_min_se = -1; /* UAC's Min-SE in integer format */
+ int st_active = FALSE; /* Session-Timer on/off boolean */
+ int st_interval = 0; /* Session-Timer negotiated refresh interval */
+ enum st_refresher tmp_st_ref = SESSION_TIMER_REFRESHER_AUTO; /* Session-Timer refresher */
+ int dlg_min_se = -1;
+ int dlg_max_se = global_max_se;
+ int rtn;
+
+ /* Session-Timers */
+ if ((p->sipoptions & SIP_OPT_TIMER)) {
+ enum st_refresher_param st_ref_param = SESSION_TIMER_REFRESHER_PARAM_UNKNOWN;
+
+ /* The UAC has requested session-timers for this session. Negotiate
+ the session refresh interval and who will be the refresher */
+ ast_debug(2, "Incoming INVITE with 'timer' option supported\n");
+
+ /* Allocate Session-Timers struct w/in the dialog */
+ if (!p->stimer) {
+ sip_st_alloc(p);
+ }
+
+ /* Parse the Session-Expires header */
+ p_uac_se_hdr = sip_get_header(req, "Session-Expires");
+ if (!ast_strlen_zero(p_uac_se_hdr)) {
+ ast_debug(2, "INVITE also has \"Session-Expires\" header.\n");
+ rtn = parse_session_expires(p_uac_se_hdr, &uac_max_se, &st_ref_param);
+ tmp_st_ref = (st_ref_param == SESSION_TIMER_REFRESHER_PARAM_UAC) ? SESSION_TIMER_REFRESHER_THEM : SESSION_TIMER_REFRESHER_US;
+ if (rtn != 0) {
+ transmit_response_reliable(p, "400 Session-Expires Invalid Syntax", req);
+ return -1;
+ }
+ }
+
+ /* Parse the Min-SE header */
+ p_uac_min_se = sip_get_header(req, "Min-SE");
+ if (!ast_strlen_zero(p_uac_min_se)) {
+ ast_debug(2, "INVITE also has \"Min-SE\" header.\n");
+ rtn = parse_minse(p_uac_min_se, &uac_min_se);
+ if (rtn != 0) {
+ transmit_response_reliable(p, "400 Min-SE Invalid Syntax", req);
+ return -1;
+ }
+ }
+
+ dlg_min_se = st_get_se(p, FALSE);
+ switch (st_get_mode(p, 1)) {
+ case SESSION_TIMER_MODE_ACCEPT:
+ case SESSION_TIMER_MODE_ORIGINATE:
+ if (uac_max_se > 0 && uac_max_se < dlg_min_se) {
+ transmit_response_with_minse(p, "422 Session Interval Too Small", req, dlg_min_se);
+ return -1;
+ }
+
+ p->stimer->st_active_peer_ua = TRUE;
+ st_active = TRUE;
+ if (st_ref_param == SESSION_TIMER_REFRESHER_PARAM_UNKNOWN) {
+ tmp_st_ref = st_get_refresher(p);
+ }
+
+ dlg_max_se = st_get_se(p, TRUE);
+ if (uac_max_se > 0) {
+ if (dlg_max_se >= uac_min_se) {
+ st_interval = (uac_max_se < dlg_max_se) ? uac_max_se : dlg_max_se;
+ } else {
+ st_interval = uac_max_se;
+ }
+ } else if (uac_min_se > 0) {
+ st_interval = MAX(dlg_max_se, uac_min_se);
+ } else {
+ st_interval = dlg_max_se;
+ }
+ break;
+
+ case SESSION_TIMER_MODE_REFUSE:
+ if (p->reqsipoptions & SIP_OPT_TIMER) {
+ transmit_response_with_unsupported(p, "420 Option Disabled", req, required);
+ ast_log(LOG_WARNING, "Received SIP INVITE with supported but disabled option: %s\n", required);
+ return -1;
+ }
+ break;
+
+ default:
+ ast_log(LOG_ERROR, "Internal Error %d at %s:%d\n", st_get_mode(p, 1), __FILE__, __LINE__);
+ break;
+ }
+ } else {
+ /* The UAC did not request session-timers. Asterisk (UAS), will now decide
+ (based on session-timer-mode in sip.conf) whether to run session-timers for
+ this session or not. */
+ switch (st_get_mode(p, 1)) {
+ case SESSION_TIMER_MODE_ORIGINATE:
+ st_active = TRUE;
+ st_interval = st_get_se(p, TRUE);
+ tmp_st_ref = SESSION_TIMER_REFRESHER_US;
+ p->stimer->st_active_peer_ua = (p->sipoptions & SIP_OPT_TIMER) ? TRUE : FALSE;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (reinvite == 0) {
+ /* Session-Timers: Start session refresh timer based on negotiation/config */
+ if (st_active == TRUE) {
+ p->stimer->st_active = TRUE;
+ p->stimer->st_interval = st_interval;
+ p->stimer->st_ref = tmp_st_ref;
+ }
+ } else {
+ if (p->stimer->st_active == TRUE) {
+ /* Session-Timers: A re-invite request sent within a dialog will serve as
+ a refresh request, no matter whether the re-invite was sent for refreshing
+ the session or modifying it.*/
+ ast_debug (2, "Restarting session-timers on a refresh - %s\n", p->callid);
+
+ /* The UAC may be adjusting the session-timers mid-session */
+ if (st_interval > 0) {
+ p->stimer->st_interval = st_interval;
+ p->stimer->st_ref = tmp_st_ref;
+ }
+ }
+ }
+
+ return 0;
+}
+
/*!
* \brief Handle incoming INVITE request
* \note If the INVITE has a Replaces header, it is part of an
@@ -25325,19 +25482,9 @@
struct ast_channel *c = NULL; /* New channel */
struct sip_peer *authpeer = NULL; /* Matching Peer */
int reinvite = 0;
- int rtn;
struct ast_party_redirecting redirecting;
struct ast_set_party_redirecting update_redirecting;
- const char *p_uac_se_hdr; /* UAC's Session-Expires header string */
- const char *p_uac_min_se; /* UAC's requested Min-SE interval (char string) */
- int uac_max_se = -1; /* UAC's Session-Expires in integer format */
- int uac_min_se = -1; /* UAC's Min-SE in integer format */
- int st_active = FALSE; /* Session-Timer on/off boolean */
- int st_interval = 0; /* Session-Timer negotiated refresh interval */
- enum st_refresher tmp_st_ref = SESSION_TIMER_REFRESHER_AUTO; /* Session-Timer refresher */
- int dlg_min_se = -1;
- int dlg_max_se = global_max_se;
struct {
char exten[AST_MAX_EXTENSION];
char context[AST_MAX_CONTEXT];
@@ -25836,6 +25983,14 @@
/* Initialize our tag */
make_our_tag(p);
+
+ if (handle_request_invite_st(p, req, required, reinvite)) {
+ p->invitestate = INV_COMPLETED;
+ sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
+ res = INV_REQ_ERROR;
+ goto request_invite_cleanup;
+ }
+
/* First invitation - create the channel. Allocation
* failures are handled below. */
@@ -25870,6 +26025,16 @@
}
if (!req->ignore)
reinvite = 1;
+
+ if (handle_request_invite_st(p, req, required, reinvite)) {
+ p->invitestate = INV_COMPLETED;
+ if (!p->lastinvite) {
+ sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
+ }
+ res = INV_REQ_ERROR;
+ goto request_invite_cleanup;
+ }
+
c = p->owner;
change_redirecting_information(p, req, &redirecting, &update_redirecting, FALSE); /*Will return immediately if no Diversion header is present */
if (c) {
@@ -25881,140 +26046,10 @@
/* Check if OLI/ANI-II is present in From: */
parse_oli(req, p->owner);
- /* Session-Timers */
- if ((p->sipoptions & SIP_OPT_TIMER)) {
- enum st_refresher_param st_ref_param = SESSION_TIMER_REFRESHER_PARAM_UNKNOWN;
-
- /* The UAC has requested session-timers for this session. Negotiate
- the session refresh interval and who will be the refresher */
- ast_debug(2, "Incoming INVITE with 'timer' option supported\n");
-
- /* Allocate Session-Timers struct w/in the dialog */
- if (!p->stimer)
- sip_st_alloc(p);
-
- /* Parse the Session-Expires header */
- p_uac_se_hdr = sip_get_header(req, "Session-Expires");
- if (!ast_strlen_zero(p_uac_se_hdr)) {
- ast_debug(2, "INVITE also has \"Session-Expires\" header.\n");
- rtn = parse_session_expires(p_uac_se_hdr, &uac_max_se, &st_ref_param);
- tmp_st_ref = (st_ref_param == SESSION_TIMER_REFRESHER_PARAM_UAC) ? SESSION_TIMER_REFRESHER_THEM : SESSION_TIMER_REFRESHER_US;
- if (rtn != 0) {
- transmit_response_reliable(p, "400 Session-Expires Invalid Syntax", req);
- p->invitestate = INV_COMPLETED;
- if (!p->lastinvite) {
- sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
- }
- res = INV_REQ_ERROR;
- goto request_invite_cleanup;
- }
- }
-
- /* Parse the Min-SE header */
- p_uac_min_se = sip_get_header(req, "Min-SE");
- if (!ast_strlen_zero(p_uac_min_se)) {
- ast_debug(2, "INVITE also has \"Min-SE\" header.\n");
- rtn = parse_minse(p_uac_min_se, &uac_min_se);
- if (rtn != 0) {
- transmit_response_reliable(p, "400 Min-SE Invalid Syntax", req);
- p->invitestate = INV_COMPLETED;
- if (!p->lastinvite) {
- sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
- }
- res = INV_REQ_ERROR;
- goto request_invite_cleanup;
- }
- }
-
- dlg_min_se = st_get_se(p, FALSE);
- switch (st_get_mode(p, 1)) {
- case SESSION_TIMER_MODE_ACCEPT:
- case SESSION_TIMER_MODE_ORIGINATE:
- if (uac_max_se > 0 && uac_max_se < dlg_min_se) {
- transmit_response_with_minse(p, "422 Session Interval Too Small", req, dlg_min_se);
- p->invitestate = INV_COMPLETED;
[... 1797 lines stripped ...]
More information about the asterisk-commits
mailing list