[asterisk-commits] oej: branch oej/darjeeling-prack-11 r400215 - in /team/oej/darjeeling-prack-1...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Oct 1 02:47:59 CDT 2013
Author: oej
Date: Tue Oct 1 02:47:54 2013
New Revision: 400215
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=400215
Log:
Resolve conflicts, sign peace agreement, award Nobel peace prize and continue as before.
Modified:
team/oej/darjeeling-prack-11/ (props changed)
team/oej/darjeeling-prack-11/UPGRADE.txt
team/oej/darjeeling-prack-11/apps/app_meetme.c
team/oej/darjeeling-prack-11/apps/app_queue.c
team/oej/darjeeling-prack-11/apps/confbridge/conf_state_multi_marked.c
team/oej/darjeeling-prack-11/bridges/bridge_softmix.c
team/oej/darjeeling-prack-11/build_tools/prep_tarball
team/oej/darjeeling-prack-11/channels/chan_dahdi.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/sig_ss7.c
team/oej/darjeeling-prack-11/channels/sip/include/sip.h
team/oej/darjeeling-prack-11/channels/sip/reqresp_parser.c
team/oej/darjeeling-prack-11/configs/chan_dahdi.conf.sample
team/oej/darjeeling-prack-11/configs/sip.conf.sample
team/oej/darjeeling-prack-11/configure
team/oej/darjeeling-prack-11/configure.ac
team/oej/darjeeling-prack-11/main/abstract_jb.c
team/oej/darjeeling-prack-11/main/asterisk.c
team/oej/darjeeling-prack-11/main/astobj2.c
team/oej/darjeeling-prack-11/main/config_options.c
team/oej/darjeeling-prack-11/main/features.c
team/oej/darjeeling-prack-11/main/logger.c
team/oej/darjeeling-prack-11/main/udptl.c
team/oej/darjeeling-prack-11/res/res_rtp_asterisk.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 Tue Oct 1 02:47:54 2013
@@ -1,1 +1,1 @@
-/branches/11:1-398825
+/branches/11:1-400213
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=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/UPGRADE.txt (original)
+++ team/oej/darjeeling-prack-11/UPGRADE.txt Tue Oct 1 02:47:54 2013
@@ -26,6 +26,9 @@
returning RESULT_SUCCESS even if there was an error.
* The libuuid development library is now optional for res_rtp_asterisk. If the
library is not present when building ICE and TURN support will not be present.
+* The option "register_retry_403" has been added to chan_sip to work around
+ servers that are known to erroneously send 403 in response to valid
+ REGISTER requests and allows Asterisk to continue attepmting to connect.
From 11.4 to 11.5:
* The default settings for chan_sip are now overriden properly by the general
Modified: team/oej/darjeeling-prack-11/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/apps/app_meetme.c?view=diff&rev=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/apps/app_meetme.c (original)
+++ team/oej/darjeeling-prack-11/apps/app_meetme.c Tue Oct 1 02:47:54 2013
@@ -5050,6 +5050,23 @@
res = -2;
goto usernotfound;
}
+ } else {
+ /* fail for commands that require a user */
+ switch (*args.command) {
+ case 'm': /* Unmute */
+ case 'M': /* Mute */
+ case 't': /* Lower user's talk volume */
+ case 'T': /* Raise user's talk volume */
+ case 'u': /* Lower user's listen volume */
+ case 'U': /* Raise user's listen volume */
+ case 'r': /* Reset user's volume level */
+ case 'k': /* Kick user */
+ res = -2;
+ ast_log(LOG_NOTICE, "No user specified!\n");
+ goto usernotfound;
+ default:
+ break;
+ }
}
switch (*args.command) {
@@ -5065,21 +5082,22 @@
case 101: /* e: Eject last user*/
{
int max_no = 0;
-
- /* If they passed in a user, disregard it */
- if (user) {
- ao2_ref(user, -1);
- }
+ RAII_VAR(struct ast_conf_user *, eject_user, NULL, ao2_cleanup);
ao2_callback(cnf->usercontainer, OBJ_NODATA, user_max_cmp, &max_no);
- user = ao2_find(cnf->usercontainer, &max_no, 0);
- if (!ast_test_flag64(&user->userflags, CONFFLAG_ADMIN))
- user->adminflags |= ADMINFLAG_KICKME;
- else {
+ eject_user = ao2_find(cnf->usercontainer, &max_no, 0);
+ if (!eject_user) {
+ res = -1;
+ ast_log(LOG_NOTICE, "No last user to kick!\n");
+ break;
+ }
+
+ if (!ast_test_flag64(&eject_user->userflags, CONFFLAG_ADMIN)) {
+ eject_user->adminflags |= ADMINFLAG_KICKME;
+ } else {
res = -1;
ast_log(LOG_NOTICE, "Not kicking last user, is an Admin!\n");
}
- ao2_ref(user, -1);
break;
}
case 77: /* M: Mute */
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=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/apps/app_queue.c (original)
+++ team/oej/darjeeling-prack-11/apps/app_queue.c Tue Oct 1 02:47:54 2013
@@ -9013,8 +9013,8 @@
case CLI_INIT:
e->command = "queue add member";
e->usage =
- "Usage: queue add member <channel> to <queue> [[[penalty <penalty>] as <membername>] state_interface <interface>]\n"
- " Add a channel to a queue with optionally: a penalty, membername and a state_interface\n";
+ "Usage: queue add member <dial string> to <queue> [[[penalty <penalty>] as <membername>] state_interface <interface>]\n"
+ " Add a dial string (Such as a channel,e.g. SIP/6001) to a queue with optionally: a penalty, membername and a state_interface\n";
return NULL;
case CLI_GENERATE:
return complete_queue_add_member(a->line, a->word, a->pos, a->n);
Modified: team/oej/darjeeling-prack-11/apps/confbridge/conf_state_multi_marked.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/apps/confbridge/conf_state_multi_marked.c?view=diff&rev=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/apps/confbridge/conf_state_multi_marked.c (original)
+++ team/oej/darjeeling-prack-11/apps/confbridge/conf_state_multi_marked.c Tue Oct 1 02:47:54 2013
@@ -95,6 +95,13 @@
AST_LIST_TRAVERSE_SAFE_BEGIN(&cbu->conference_bridge->active_list, cbu_iter, list) {
/* Kick ENDMARKED cbu_iters */
if (ast_test_flag(&cbu_iter->u_profile, USER_OPT_ENDMARKED)) {
+ if (ast_test_flag(&cbu_iter->u_profile, USER_OPT_WAITMARKED) &&
+ !ast_test_flag(&cbu_iter->u_profile, USER_OPT_MARKEDUSER)) {
+ AST_LIST_REMOVE_CURRENT(list);
+ cbu_iter->conference_bridge->activeusers--;
+ AST_LIST_INSERT_TAIL(&cbu_iter->conference_bridge->waiting_list, cbu_iter, list);
+ cbu_iter->conference_bridge->waitingusers++;
+ }
cbu_iter->kicked = 1;
ast_bridge_remove(cbu_iter->conference_bridge->bridge, cbu_iter->chan);
} else if (ast_test_flag(&cbu_iter->u_profile, USER_OPT_WAITMARKED) &&
Modified: team/oej/darjeeling-prack-11/bridges/bridge_softmix.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/bridges/bridge_softmix.c?view=diff&rev=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/bridges/bridge_softmix.c (original)
+++ team/oej/darjeeling-prack-11/bridges/bridge_softmix.c Tue Oct 1 02:47:54 2013
@@ -313,6 +313,7 @@
return -1;
}
if (!(softmix_data->timer = ast_timer_open())) {
+ ast_log(AST_LOG_WARNING, "Failed to open timer for softmix bridge\n");
ao2_ref(softmix_data, -1);
return -1;
}
Modified: team/oej/darjeeling-prack-11/build_tools/prep_tarball
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/build_tools/prep_tarball?view=diff&rev=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/build_tools/prep_tarball (original)
+++ team/oej/darjeeling-prack-11/build_tools/prep_tarball Tue Oct 1 02:47:54 2013
@@ -19,11 +19,11 @@
cd doc
echo "Downloading the PDF and HTML documentation from the Asterisk wiki (this will take a minute) ..."
-wget https://wiki.asterisk.org/wiki/download/attachments/19005471/Asterisk-Admin-Guide-$branch.pdf
+wget https://wiki.asterisk.org/wiki/download/attachments/19005471/Asterisk-$branch-Reference.pdf
+wget https://wiki.asterisk.org/wiki/download/attachments/19005471/Asterisk-Admin-Guide.pdf
wget https://wiki.asterisk.org/wiki/download/attachments/19005471/Asterisk-Admin-Guide-$branch.html.zip
echo "Extracting HTML Admin Guide"
unzip Asterisk-Admin-Guide-$branch.html.zip
mv AST/ Asterisk-Admin-Guide/
-mv Asterisk-Admin-Guide-$branch.pdf Asterisk-Admin-Guide.pdf
rm -f Asterisk-Admin-Guide-$branch.html.zip
echo "Documentation downloaded. Goodbye!"
Modified: team/oej/darjeeling-prack-11/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/channels/chan_dahdi.c?view=diff&rev=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/channels/chan_dahdi.c (original)
+++ team/oej/darjeeling-prack-11/channels/chan_dahdi.c Tue Oct 1 02:47:54 2013
@@ -17065,8 +17065,10 @@
#ifdef HAVE_PRI
for (i = 0; i < NUM_SPANS; i++) {
- if (pris[i].pri.master != AST_PTHREADT_NULL)
+ if (pris[i].pri.master != AST_PTHREADT_NULL) {
pthread_cancel(pris[i].pri.master);
+ pthread_kill(pris[i].pri.master, SIGURG);
+ }
}
ast_cli_unregister_multiple(dahdi_pri_cli, ARRAY_LEN(dahdi_pri_cli));
ast_unregister_application(dahdi_send_keypad_facility_app);
@@ -17076,9 +17078,11 @@
#endif
#if defined(HAVE_SS7)
for (i = 0; i < NUM_SPANS; i++) {
- if (linksets[i].ss7.master != AST_PTHREADT_NULL)
+ if (linksets[i].ss7.master != AST_PTHREADT_NULL) {
pthread_cancel(linksets[i].ss7.master);
- }
+ pthread_kill(linksets[i].ss7.master, SIGURG);
+ }
+ }
ast_cli_unregister_multiple(dahdi_ss7_cli, ARRAY_LEN(dahdi_ss7_cli));
#endif /* defined(HAVE_SS7) */
#if defined(HAVE_OPENR2)
@@ -17122,8 +17126,9 @@
#if defined(HAVE_PRI)
for (i = 0; i < NUM_SPANS; i++) {
- if (pris[i].pri.master && (pris[i].pri.master != AST_PTHREADT_NULL))
+ if (pris[i].pri.master && (pris[i].pri.master != AST_PTHREADT_NULL)) {
pthread_join(pris[i].pri.master, NULL);
+ }
for (j = 0; j < SIG_PRI_NUM_DCHANS; j++) {
dahdi_close_pri_fd(&(pris[i]), j);
}
@@ -17138,8 +17143,9 @@
#if defined(HAVE_SS7)
for (i = 0; i < NUM_SPANS; i++) {
- if (linksets[i].ss7.master && (linksets[i].ss7.master != AST_PTHREADT_NULL))
+ if (linksets[i].ss7.master && (linksets[i].ss7.master != AST_PTHREADT_NULL)) {
pthread_join(linksets[i].ss7.master, NULL);
+ }
for (j = 0; j < SIG_SS7_NUM_DCHANS; j++) {
dahdi_close_ss7_fd(&(linksets[i]), j);
}
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=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/channels/chan_iax2.c (original)
+++ team/oej/darjeeling-prack-11/channels/chan_iax2.c Tue Oct 1 02:47:54 2013
@@ -5655,35 +5655,44 @@
break;
}
other = (who == c0) ? c1 : c0; /* the 'other' channel */
- if ((f->frametype == AST_FRAME_CONTROL)) {
- if (f->subclass.integer == AST_CONTROL_PVT_CAUSE_CODE) {
+ if (f->frametype == AST_FRAME_CONTROL && !(flags & AST_BRIDGE_IGNORE_SIGS)) {
+ switch (f->subclass.integer) {
+ case AST_CONTROL_VIDUPDATE:
+ case AST_CONTROL_SRCUPDATE:
+ case AST_CONTROL_SRCCHANGE:
+ case AST_CONTROL_T38_PARAMETERS:
+ ast_write(other, f);
+ break;
+ case AST_CONTROL_PVT_CAUSE_CODE:
ast_channel_hangupcause_hash_set(other, f->data.ptr, f->datalen);
- } else if (!(flags & AST_BRIDGE_IGNORE_SIGS)
- && (f->subclass.integer != AST_CONTROL_SRCUPDATE)) {
+ break;
+ default:
*fo = f;
*rc = who;
- res = AST_BRIDGE_COMPLETE;
+ res = AST_BRIDGE_COMPLETE;
break;
}
- }
- if ((f->frametype == AST_FRAME_VOICE) ||
- (f->frametype == AST_FRAME_TEXT) ||
- (f->frametype == AST_FRAME_VIDEO) ||
- (f->frametype == AST_FRAME_IMAGE) ||
- (f->frametype == AST_FRAME_DTMF) ||
- (f->frametype == AST_FRAME_CONTROL && f->subclass.integer != AST_CONTROL_PVT_CAUSE_CODE)) {
+ if (res == AST_BRIDGE_COMPLETE) {
+ break;
+ }
+ } else if (f->frametype == AST_FRAME_VOICE
+ || f->frametype == AST_FRAME_TEXT
+ || f->frametype == AST_FRAME_VIDEO
+ || f->frametype == AST_FRAME_IMAGE) {
+ ast_write(other, f);
+ } else if (f->frametype == AST_FRAME_DTMF) {
/* monitored dtmf take out of the bridge.
* check if we monitor the specific source.
*/
int monitored_source = (who == c0) ? AST_BRIDGE_DTMF_CHANNEL_0 : AST_BRIDGE_DTMF_CHANNEL_1;
- if (f->frametype == AST_FRAME_DTMF && (flags & monitored_source)) {
+
+ if (flags & monitored_source) {
*rc = who;
*fo = f;
res = AST_BRIDGE_COMPLETE;
/* Remove from native mode */
break;
}
- /* everything else goes to the other side */
ast_write(other, f);
}
ast_frfree(f);
@@ -8838,6 +8847,22 @@
}
}
+ /* treat an unspecified refresh interval as the minimum */
+ if (!refresh) {
+ refresh = min_reg_expire;
+ }
+ if (refresh > max_reg_expire) {
+ ast_log(LOG_NOTICE, "Restricting registration for peer '%s' to %d seconds (requested %d)\n",
+ p->name, max_reg_expire, refresh);
+ p->expiry = max_reg_expire;
+ } else if (refresh < min_reg_expire) {
+ ast_log(LOG_NOTICE, "Restricting registration for peer '%s' to %d seconds (requested %d)\n",
+ p->name, min_reg_expire, refresh);
+ p->expiry = min_reg_expire;
+ } else {
+ p->expiry = refresh;
+ }
+
if (ast_sockaddr_cmp(&p->addr, &sockaddr)) {
if (iax2_regfunk) {
iax2_regfunk(p->name, 1);
@@ -8890,20 +8915,7 @@
peer_unref(p);
}
}
- /* treat an unspecified refresh interval as the minimum */
- if (!refresh)
- refresh = min_reg_expire;
- if (refresh > max_reg_expire) {
- ast_log(LOG_NOTICE, "Restricting registration for peer '%s' to %d seconds (requested %d)\n",
- p->name, max_reg_expire, refresh);
- p->expiry = max_reg_expire;
- } else if (refresh < min_reg_expire) {
- ast_log(LOG_NOTICE, "Restricting registration for peer '%s' to %d seconds (requested %d)\n",
- p->name, min_reg_expire, refresh);
- p->expiry = min_reg_expire;
- } else {
- p->expiry = refresh;
- }
+
if (p->expiry && sin->sin_addr.s_addr) {
p->expire = iax2_sched_add(sched, (p->expiry + 10) * 1000, expire_registry, peer_ref(p));
if (p->expire == -1)
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=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/channels/chan_sip.c (original)
+++ team/oej/darjeeling-prack-11/channels/chan_sip.c Tue Oct 1 02:47:54 2013
@@ -770,6 +770,7 @@
static int global_rtpkeepalive; /*!< Send RTP keepalives */
static int global_reg_timeout; /*!< Global time between attempts for outbound registrations */
static int global_regattempts_max; /*!< Registration attempts before giving up */
+static int global_reg_retry_403; /*!< Treat 403 responses to registrations as 401 responses */
static int global_shrinkcallerid; /*!< enable or disable shrinking of caller id */
static int global_callcounter; /*!< Enable call counters for all devices. This is currently enabled by setting the peer
* call-limit to INT_MAX. When we remove the call-limit from the code, we can make it
@@ -13340,13 +13341,9 @@
/* Our T.38 end is */
ast_udptl_get_us(p->udptl, &udptladdr);
- /* Determine T.38 UDPTL destination */
- if (!ast_sockaddr_isnull(&p->udptlredirip)) {
- ast_sockaddr_copy(&udptldest, &p->udptlredirip);
- } else {
- ast_sockaddr_copy(&udptldest, &p->ourip);
- ast_sockaddr_set_port(&udptldest, ast_sockaddr_port(&udptladdr));
- }
+ /* We don't use directmedia for T.38, so keep the destination the same as our IP address. */
+ ast_sockaddr_copy(&udptldest, &p->ourip);
+ ast_sockaddr_set_port(&udptldest, ast_sockaddr_port(&udptladdr));
if (debug) {
ast_debug(1, "T.38 UDPTL is at %s port %d\n", ast_sockaddr_stringify_addr(&p->ourip), ast_sockaddr_port(&udptladdr));
@@ -13357,9 +13354,9 @@
ast_str_append(&m_modem, 0, "m=image %d udptl t38\r\n", ast_sockaddr_port(&udptldest));
- if (!ast_sockaddr_cmp(&udptldest, &dest)) {
+ if (ast_sockaddr_cmp(&udptldest, &dest)) {
ast_str_append(&m_modem, 0, "c=IN %s %s\r\n",
- (ast_sockaddr_is_ipv6(&dest) && !ast_sockaddr_is_ipv4_mapped(&dest)) ?
+ (ast_sockaddr_is_ipv6(&udptldest) && !ast_sockaddr_is_ipv4_mapped(&udptldest)) ?
"IP6" : "IP4", ast_sockaddr_stringify_addr_remote(&udptldest));
}
@@ -16052,6 +16049,14 @@
}
}
+ if (expire > max_expiry) {
+ expire = max_expiry;
+ }
+ if (expire < min_expiry && expire != 0) {
+ expire = min_expiry;
+ }
+ pvt->expiry = expire;
+
copy_socket_data(&pvt->socket, &req->socket);
do {
@@ -16191,12 +16196,6 @@
AST_SCHED_DEL_UNREF(sched, peer->expire,
sip_unref_peer(peer, "remove register expire ref"));
- if (expire > max_expiry) {
- expire = max_expiry;
- }
- if (expire < min_expiry) {
- expire = min_expiry;
- }
if (peer->is_realtime && !ast_test_flag(&peer->flags[1], SIP_PAGE2_RTCACHEFRIENDS)) {
peer->expire = -1;
} else {
@@ -16206,7 +16205,6 @@
sip_unref_peer(peer, "remote registration ref");
}
}
- pvt->expiry = expire;
snprintf(data, sizeof(data), "%s:%d:%s:%s", ast_sockaddr_stringify(&peer->addr),
expire, peer->username, peer->fullcontact);
/* We might not immediately be able to reconnect via TCP, but try caching it anyhow */
@@ -17059,7 +17057,10 @@
break;
case PARSE_REGISTER_UPDATE:
ast_string_field_set(p, fullcontact, peer->fullcontact);
- update_peer(peer, p->expiry);
+ /* If expiry is 0, peer has been unregistered already */
+ if (p->expiry != 0) {
+ update_peer(peer, p->expiry);
+ }
/* Say OK and ask subsystem to retransmit msg counter */
transmit_response_with_date(p, "200 OK", req);
send_mwi = 1;
@@ -18416,9 +18417,9 @@
int sipmethod, const char *uri, enum xmittype reliable,
struct ast_sockaddr *addr, struct sip_peer **authpeer)
{
- char from[256] = "", *of, *name, *unused_password, *domain;
+ char from[256], *of, *name, *unused_password, *domain;
enum check_auth_result res = AUTH_DONT_KNOW;
- char calleridname[50];
+ char calleridname[256];
char *uri2 = ast_strdupa(uri);
terminate_uri(uri2); /* trim extra stuff */
@@ -20825,6 +20826,7 @@
ast_cli(a->fd, " Sub. max duration: %d secs\n", max_subexpiry);
ast_cli(a->fd, " Outbound reg. timeout: %d secs\n", global_reg_timeout);
ast_cli(a->fd, " Outbound reg. attempts: %d\n", global_regattempts_max);
+ ast_cli(a->fd, " Outbound reg. retry 403:%d\n", global_reg_retry_403);
ast_cli(a->fd, " Notify ringing state: %s\n", AST_CLI_YESNO(sip_cfg.notifyringing));
if (sip_cfg.notifyringing) {
ast_cli(a->fd, " Include CID: %s%s\n",
@@ -22984,6 +22986,15 @@
ast_set_flag(&p->flags[0], SIP_PENDINGBYE);
}
ast_rtp_instance_activate(p->rtp);
+ } else if (!reinvite) {
+ struct ast_sockaddr remote_address = {{0,}};
+
+ ast_rtp_instance_get_remote_address(p->rtp, &remote_address);
+ if (ast_sockaddr_isnull(&remote_address) || (!ast_strlen_zero(p->theirprovtag) && strcmp(p->theirtag, p->theirprovtag))) {
+ ast_log(LOG_WARNING, "Received response: \"200 OK\" from '%s' without SDP\n", p->relatedpeer->name);
+ ast_set_flag(&p->flags[0], SIP_PENDINGBYE);
+ ast_rtp_instance_activate(p->rtp);
+ }
}
if (!req->ignore && p->owner) {
@@ -23907,8 +23918,15 @@
so that we don't update the tag after a 200 or other final response.
Provided that SIP pedantic checking is turned on of course.
*/
- gettag(req, "To", tag, sizeof(tag));
- ast_string_field_set(p, theirtag, tag);
+ if (ast_strlen_zero(p->theirtag) || (resp >= 200)) {
+ char tag[128];
+
+ gettag(req, "To", tag, sizeof(tag));
+ ast_string_field_set(p, theirtag, tag);
+ } else {
+ /* Store theirtag to track for changes when 200 responses to invites are received without SDP */
+ ast_string_field_set(p, theirprovtag, p->theirtag);
+ }
/* This needs to be configurable on a channel/peer level,
not mandatory for all communication. Sadly enough, NAT implementations
@@ -31678,6 +31696,7 @@
sip_cfg.compactheaders = DEFAULT_COMPACTHEADERS;
global_reg_timeout = DEFAULT_REGISTRATION_TIMEOUT;
global_regattempts_max = 0;
+ global_reg_retry_403 = 0;
sip_cfg.pedanticsipchecking = DEFAULT_PEDANTIC;
sip_cfg.autocreatepeer = DEFAULT_AUTOCREATEPEER;
global_autoframing = 0;
@@ -32067,6 +32086,8 @@
}
} else if (!strcasecmp(v->name, "registerattempts")) {
global_regattempts_max = atoi(v->value);
+ } else if (!strcasecmp(v->name, "register_retry_403")) {
+ global_reg_retry_403 = ast_true(v->value);
} else if (!strcasecmp(v->name, "bindaddr") || !strcasecmp(v->name, "udpbindaddr")) {
if (ast_parse_arg(v->value, PARSE_ADDR, &bindaddr)) {
ast_log(LOG_WARNING, "Invalid address: %s\n", v->value);
Modified: team/oej/darjeeling-prack-11/channels/sig_ss7.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/channels/sig_ss7.c?view=diff&rev=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/channels/sig_ss7.c (original)
+++ team/oej/darjeeling-prack-11/channels/sig_ss7.c Tue Oct 1 02:47:54 2013
@@ -788,7 +788,9 @@
ss7_event *e = NULL;
struct sig_ss7_chan *p;
struct pollfd pollers[SIG_SS7_NUM_DCHANS];
- int nextms = 0;
+ int nextms;
+
+#define SS7_MAX_POLL 60000 /* Maximum poll time in ms. */
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
@@ -813,6 +815,11 @@
}
nextms = tv.tv_sec * 1000;
nextms += tv.tv_usec / 1000;
+ if (SS7_MAX_POLL < nextms) {
+ nextms = SS7_MAX_POLL;
+ }
+ } else {
+ nextms = SS7_MAX_POLL;
}
for (i = 0; i < linkset->numsigchans; i++) {
Modified: team/oej/darjeeling-prack-11/channels/sip/include/sip.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/channels/sip/include/sip.h?view=diff&rev=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/channels/sip/include/sip.h (original)
+++ team/oej/darjeeling-prack-11/channels/sip/include/sip.h Tue Oct 1 02:47:54 2013
@@ -1050,6 +1050,7 @@
AST_STRING_FIELD(theirtag); /*!< Their tag */
AST_STRING_FIELD(theirtag_prack); /*!< Current tag focus for PRACK handling */
AST_STRING_FIELD(theirtag_early); /*!< Current tag focus for early media handling */
+ AST_STRING_FIELD(theirprovtag); /*!< Provisional their tag, used when evaluating responses to invites */
AST_STRING_FIELD(tag); /*!< Our tag for this session */
AST_STRING_FIELD(username); /*!< [user] name */
AST_STRING_FIELD(peername); /*!< [peer] name, not set if [user] */
Modified: team/oej/darjeeling-prack-11/channels/sip/reqresp_parser.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/channels/sip/reqresp_parser.c?view=diff&rev=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/channels/sip/reqresp_parser.c (original)
+++ team/oej/darjeeling-prack-11/channels/sip/reqresp_parser.c Tue Oct 1 02:47:54 2013
@@ -806,7 +806,7 @@
int get_name_and_number(const char *hdr, char **name, char **number)
{
char header[256];
- char tmp_name[50];
+ char tmp_name[256];
char *tmp_number = NULL;
char *hostport = NULL;
char *dummy = NULL;
Modified: team/oej/darjeeling-prack-11/configs/chan_dahdi.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/configs/chan_dahdi.conf.sample?view=diff&rev=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/configs/chan_dahdi.conf.sample (original)
+++ team/oej/darjeeling-prack-11/configs/chan_dahdi.conf.sample Tue Oct 1 02:47:54 2013
@@ -582,7 +582,8 @@
; easily be re-attaching to a prior incoming call that was not yet hung up).
; This option changes the hangup to wait for a dialtone on the line, before
; marking the line as once again available for use with outgoing calls.
-;waitfordialtone=yes
+; Specified in milliseconds, not set by default.
+;waitfordialtone=1000
;
; For analog lines, enables Asterisk to use dialtone detection per channel
; if an incoming call was hung up before it was answered. If dialtone is
Modified: team/oej/darjeeling-prack-11/configs/sip.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/configs/sip.conf.sample?view=diff&rev=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/configs/sip.conf.sample (original)
+++ team/oej/darjeeling-prack-11/configs/sip.conf.sample Tue Oct 1 02:47:54 2013
@@ -788,6 +788,9 @@
; 0 = continue forever, hammering the other server
; until it accepts the registration
; Default is 0 tries, continue forever
+;register_retry_403=yes ; Treat 403 responses to registrations as if they were
+ ; 401 responses and continue retrying according to normal
+ ; retry rules.
;----------------------------------------- OUTBOUND MWI SUBSCRIPTIONS -------------------------
; Asterisk can subscribe to receive the MWI from another SIP server and store it locally for retrieval
Modified: team/oej/darjeeling-prack-11/configure.ac
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/configure.ac?view=diff&rev=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/configure.ac (original)
+++ team/oej/darjeeling-prack-11/configure.ac Tue Oct 1 02:47:54 2013
@@ -1217,6 +1217,11 @@
AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_check_format], [bfd.h], [-ldl -liberty])
fi
+if test "${PBX_BFD}" = "0"; then
+ # openSUSE requires -lz
+ AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_check_format], [bfd.h], [-ldl -liberty -lz])
+fi
+
if test "x${OSARCH}" = "xlinux-gnu" ; then
AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
fi
Modified: team/oej/darjeeling-prack-11/main/abstract_jb.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/main/abstract_jb.c?view=diff&rev=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/main/abstract_jb.c (original)
+++ team/oej/darjeeling-prack-11/main/abstract_jb.c Tue Oct 1 02:47:54 2013
@@ -443,7 +443,7 @@
char safe_logfile[30] = "/tmp/logfile-XXXXXX";
int safe_fd;
snprintf(name2, sizeof(name2), "%s", ast_channel_name(chan));
- if ((tmp = strchr(name2, '/'))) {
+ while ((tmp = strchr(name2, '/'))) {
*tmp = '#';
}
@@ -452,7 +452,7 @@
ast_assert(bridged != NULL);
snprintf(name1, sizeof(name1), "%s", ast_channel_name(bridged));
- if ((tmp = strchr(name1, '/'))) {
+ while ((tmp = strchr(name1, '/'))) {
*tmp = '#';
}
Modified: team/oej/darjeeling-prack-11/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/main/asterisk.c?view=diff&rev=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/main/asterisk.c (original)
+++ team/oej/darjeeling-prack-11/main/asterisk.c Tue Oct 1 02:47:54 2013
@@ -1918,14 +1918,12 @@
}
struct console_state_data {
- int newline;
char verbose_line_level;
};
static int console_state_init(void *ptr)
{
struct console_state_data *state = ptr;
- state->newline = 1;
state->verbose_line_level = 0;
return 0;
}
@@ -1938,42 +1936,40 @@
#define VERBOSE_MAGIC2LEVEL(x) (((char) -*(signed char *) (x)) - 1)
#define VERBOSE_HASMAGIC(x) (*(signed char *) (x) < 0)
-static int console_log_verbose(const char *s)
-{
- /* verbose level of 0 evaluates to a magic of -1, 1 to -2, etc...
- search up to -7 (level = 6) as this is currently the largest
- level used */
- static const char find_set[9] = { -1, -2, -3, -4, -5, -6, -7, '\n'};
-
+static int console_print(const char *s, int local)
+{
struct console_state_data *state =
ast_threadstorage_get(&console_state, sizeof(*state));
char prefix[80];
- const char *c = s;
+ const char *c;
int num, res = 0;
+ unsigned int newline;
do {
if (VERBOSE_HASMAGIC(s)) {
- /* if it has one always use the given line's level,
- otherwise we'll use the last line's level */
+ /* always use the given line's level, otherwise
+ we'll use the last line's level */
state->verbose_line_level = VERBOSE_MAGIC2LEVEL(s);
/* move past magic */
s++;
- }
-
- c = fix_header(prefix, sizeof(prefix), s,
- state->verbose_line_level);
-
- if (!state->newline) {
- /* don't use the prefix if line continuation */
+
+ if (local) {
+ s = fix_header(prefix, sizeof(prefix), s,
+ state->verbose_line_level);
+ }
+ } else {
*prefix = '\0';
}
-
- /* for a given line separate on verbose magic and newlines */
- if (!(s = strpbrk(c, find_set))) {
+ c = s;
+
+ /* for a given line separate on verbose magic, newline, and eol */
+ if ((s = strchr(c, '\n'))) {
+ ++s;
+ newline = 1;
+ } else {
s = strchr(c, '\0');
- } else if (*s == '\n') {
- ++s;
+ newline = 0;
}
/* check if we should write this line after calculating begin/end
@@ -1983,8 +1979,7 @@
continue;
}
- state->newline = *(s - 1) == '\n';
- if (!ast_strlen_zero(prefix)) {
+ if (local && !ast_strlen_zero(prefix)) {
fputs(prefix, stdout);
}
@@ -1998,8 +1993,13 @@
we'll want to return true */
res = 1;
}
- c = s;
} while (*s);
+
+ if (newline) {
+ /* if ending on a newline then reset last level to zero
+ since what follows may be not be logging output */
+ state->verbose_line_level = 0;
+ }
if (res) {
fflush(stdout);
@@ -2010,7 +2010,7 @@
static void console_verboser(const char *s)
{
- if (!console_log_verbose(s)) {
+ if (!console_print(s, 1)) {
return;
}
@@ -2497,7 +2497,7 @@
}
}
- console_log_verbose(buf);
+ console_print(buf, 0);
if ((res < EL_BUF_SIZE - 1) && ((buf[res-1] == '\n') || (buf[res-2] == '\n'))) {
*cp = CC_REFRESH;
Modified: team/oej/darjeeling-prack-11/main/astobj2.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/main/astobj2.c?view=diff&rev=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/main/astobj2.c (original)
+++ team/oej/darjeeling-prack-11/main/astobj2.c Tue Oct 1 02:47:54 2013
@@ -842,7 +842,7 @@
/* compute the container size */
unsigned int num_buckets = hash_fn ? n_buckets : 1;
size_t container_size = sizeof(struct ao2_container) + num_buckets * sizeof(struct bucket);
- struct ao2_container *c = __ao2_alloc_debug(container_size, container_destruct_debug, options, tag, file, line, func, ref_debug);
+ struct ao2_container *c = __ao2_alloc_debug(container_size, ref_debug ? container_destruct_debug : container_destruct, options, tag, file, line, func, ref_debug);
return internal_ao2_container_alloc(c, num_buckets, hash_fn, cmp_fn);
}
Modified: team/oej/darjeeling-prack-11/main/config_options.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/main/config_options.c?view=diff&rev=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/main/config_options.c (original)
+++ team/oej/darjeeling-prack-11/main/config_options.c Tue Oct 1 02:47:54 2013
@@ -370,10 +370,6 @@
}
if (type->type == ACO_GLOBAL && *field) {
- if (aco_set_defaults(type, cat, *field)) {
- ast_log(LOG_ERROR, "In %s: Setting defaults for %s failed\n", file->filename, cat);
- return -1;
- }
if (aco_process_category_options(type, cfg, cat, *field)) {
ast_log(LOG_ERROR, "In %s: Processing options for %s failed\n", file->filename, cat);
return -1;
@@ -504,6 +500,28 @@
while (res != ACO_PROCESS_ERROR && (file = info->files[x++])) {
const char *filename = file->filename;
+ struct aco_type *match;
+ int i;
+
+ /* set defaults for global objects */
+ for (i = 0, match = file->types[i]; match; match = file->types[++i]) {
+ void **field = info->internal->pending + match->item_offset;
+
+ if (match->type != ACO_GLOBAL || !*field) {
+ continue;
+ }
+
+ if (aco_set_defaults(match, match->category, *field)) {
+ ast_log(LOG_ERROR, "In %s: Setting defaults for %s failed\n", file->filename, match->category);
+ res = ACO_PROCESS_ERROR;
+ break;
+ }
+ }
+
+ if (res == ACO_PROCESS_ERROR) {
+ break;
+ }
+
try_alias:
if (!(cfg = ast_config_load(filename, cfg_flags))) {
if (file->alias && strcmp(file->alias, filename)) {
Modified: team/oej/darjeeling-prack-11/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/main/features.c?view=diff&rev=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/main/features.c (original)
+++ team/oej/darjeeling-prack-11/main/features.c Tue Oct 1 02:47:54 2013
@@ -6136,19 +6136,9 @@
);
AST_STANDARD_APP_ARGS(args, tmp_val);
- if ((new_syn = strchr(args.app, '('))) {
- /* New syntax */
- args.moh_class = args.app_args;
- args.app_args = new_syn;
- *args.app_args++ = '\0';
- if (args.app_args[strlen(args.app_args) - 1] == ')') {
- args.app_args[strlen(args.app_args) - 1] = '\0';
- }
- }
activateon = strsep(&args.activatedby, "/");
- /*! \todo XXX var_name or app_args ? */
if (ast_strlen_zero(args.app)
|| ast_strlen_zero(args.exten)
|| ast_strlen_zero(activateon)
@@ -6159,6 +6149,16 @@
return;
}
+ if ((new_syn = strchr(args.app, '('))) {
+ /* New syntax */
+ args.moh_class = args.app_args;
+ args.app_args = new_syn;
+ *args.app_args++ = '\0';
+ if (args.app_args[strlen(args.app_args) - 1] == ')') {
+ args.app_args[strlen(args.app_args) - 1] = '\0';
+ }
+ }
+
AST_RWLIST_RDLOCK(&feature_list);
if (find_dynamic_feature(var->name)) {
AST_RWLIST_UNLOCK(&feature_list);
Modified: team/oej/darjeeling-prack-11/main/logger.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/main/logger.c?view=diff&rev=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/main/logger.c (original)
+++ team/oej/darjeeling-prack-11/main/logger.c Tue Oct 1 02:47:54 2013
@@ -1782,10 +1782,11 @@
void __ast_verbose_ap(const char *file, int line, const char *func, int level, struct ast_callid *callid, const char *fmt, va_list ap)
{
- struct ast_str *buf = NULL;
+ const char *p;
+ struct ast_str *prefixed, *buf = NULL;
int res = 0;
const char *prefix = level >= 4 ? VERBOSE_PREFIX_4 : level == 3 ? VERBOSE_PREFIX_3 : level == 2 ? VERBOSE_PREFIX_2 : level == 1 ? VERBOSE_PREFIX_1 : "";
- signed char magic = level > 127 ? -128 : -level - 1; /* 0 => -1, 1 => -2, etc. Can't pass NUL, as it is EOS-delimiter */
+ signed char magic = level > 9 ? -10 : -level - 1; /* 0 => -1, 1 => -2, etc. Can't pass NUL, as it is EOS-delimiter */
/* For compatibility with modules still calling ast_verbose() directly instead of using ast_verb() */
if (level < 0) {
@@ -1802,37 +1803,43 @@
}
}
- if (!(buf = ast_str_thread_get(&verbose_buf, VERBOSE_BUF_INIT_SIZE))) {
+ if (!(prefixed = ast_str_thread_get(&verbose_buf, VERBOSE_BUF_INIT_SIZE)) ||
+ !(buf = ast_str_create(VERBOSE_BUF_INIT_SIZE))) {
return;
}
- if (ast_opt_timestamp) {
- struct timeval now;
- struct ast_tm tm;
- char date[40];
- char *datefmt;
-
- now = ast_tvnow();
- ast_localtime(&now, &tm, NULL);
- ast_strftime(date, sizeof(date), dateformat, &tm);
- datefmt = ast_alloca(strlen(date) + 3 + strlen(prefix) + strlen(fmt) + 1);
- sprintf(datefmt, "%c[%s] %s%s", (char) magic, date, prefix, fmt);
- fmt = datefmt;
- } else {
- char *tmp = ast_alloca(strlen(prefix) + strlen(fmt) + 2);
- sprintf(tmp, "%c%s%s", (char) magic, prefix, fmt);
- fmt = tmp;
- }
-
- /* Build string */
res = ast_str_set_va(&buf, 0, fmt, ap);
-
/* If the build failed then we can drop this allocated message */
if (res == AST_DYNSTR_BUILD_FAILED) {
+ ast_free(buf);
return;
}
- ast_log_callid(__LOG_VERBOSE, file, line, func, callid, "%s", ast_str_buffer(buf));
+ ast_str_reset(prefixed);
+ /* for every newline found in the buffer add verbose prefix data */
+ fmt = ast_str_buffer(buf);
+ do {
+ if (!(p = strchr(fmt, '\n'))) {
+ p = strchr(fmt, '\0') - 1;
+ }
+ ++p;
+
+ if (ast_opt_timestamp) {
+ struct ast_tm tm;
+ char date[40];
+ struct timeval now = ast_tvnow();
+ ast_localtime(&now, &tm, NULL);
+ ast_strftime(date, sizeof(date), dateformat, &tm);
+ ast_str_append(&prefixed, 0, "%c[%s] %s", (char) magic, date, prefix);
+ } else {
+ ast_str_append(&prefixed, 0, "%c%s", (char) magic, prefix);
+ }
+ ast_str_append_substr(&prefixed, 0, fmt, p - fmt);
+ fmt = p;
+ } while (p && *p);
+
+ ast_log_callid(__LOG_VERBOSE, file, line, func, callid, "%s", ast_str_buffer(prefixed));
+ ast_free(buf);
}
void __ast_verbose(const char *file, int line, const char *func, int level, const char *fmt, ...)
Modified: team/oej/darjeeling-prack-11/main/udptl.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/darjeeling-prack-11/main/udptl.c?view=diff&rev=400215&r1=400214&r2=400215
==============================================================================
--- team/oej/darjeeling-prack-11/main/udptl.c (original)
+++ team/oej/darjeeling-prack-11/main/udptl.c Tue Oct 1 02:47:54 2013
@@ -1419,14 +1419,17 @@
static void __ast_udptl_reload(int reload)
{
- RAII_VAR(struct udptl_config *, udptl_cfg, udptl_snapshot_alloc(), ao2_cleanup);
-
if (aco_process_config(&cfg_info, reload) == ACO_PROCESS_ERROR) {
if (!reload) {
- if (!aco_set_defaults(&general_option, "general", udptl_cfg->general)) {
- ast_log(LOG_WARNING, "Could not load udptl config; using defaults\n");
- ao2_global_obj_replace(globals, udptl_cfg);
+ RAII_VAR(struct udptl_config *, udptl_cfg, udptl_snapshot_alloc(), ao2_cleanup);
+
+ if (aco_set_defaults(&general_option, "general", udptl_cfg->general)) {
+ ast_log(LOG_ERROR, "Failed to load udptl.conf and failed to initialize defaults.\n");
+ return;
}
+
+ ast_log(LOG_NOTICE, "Could not load udptl config; using defaults\n");
+ ao2_global_obj_replace_unref(globals, udptl_cfg);
}
}
}
Modified: team/oej/darjeeling-prack-11/res/res_rtp_asterisk.c
[... 18 lines stripped ...]
More information about the asterisk-commits
mailing list