[asterisk-commits] dlee: branch group/performance r399890 - in /team/group/performance: ./ apps/...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Sep 26 10:44:07 CDT 2013
Author: dlee
Date: Thu Sep 26 10:43:53 2013
New Revision: 399890
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=399890
Log:
Multiple revisions 399781,399796,399798,399842,399874,399887
........
r399781 | newtonr | 2013-09-25 13:36:54 -0500 (Wed, 25 Sep 2013) | 13 lines
Fixing documentation for the configOption "external_media_address" of both Endpoints and Transports
Re-using some of Mark Michelson's text from an E-mail discussion for:
* Modifying synopsis for both options
* Adding description to both options
* Changing name of "external_media_address" for Endpoint configuration to "media_address" in anticipation of the option name being changed. (As it is not really specific to external destinations)
(issue ASTERISK-22405)
(closes issue ASTERISK-22405)
Reported by: Rusty Newton
Review: https://reviewboard.asterisk.org/r/2850/
........
r399796 | elguero | 2013-09-25 14:28:30 -0500 (Wed, 25 Sep 2013) | 48 lines
Fix Realtime Peer Update Problem When Un-registering And Expires Header In 200ok
1st Issue
When a realtime peer sends an un-REGISTER request, Asterisk
un-registers the peer but the database table record still has regseconds and
fullcontact for the peer. This results in calls attempting to be routed to the
peer which is no longer registered. The expected behavior is to get
busy/congested when attempting to call an un-registered peer through the
dialplan.
What was discovered is that we are clearing out the peer's registration in the
database in parse_register_contact() when calling expire_register() but then
upon returning from parse_register_contact(), update_peer() is run which stores
back in the database table regseconds and fullcontact.
2nd Issue
The reporter pointed out that the 200 ok being returned by Asterisk
after un-registering a peer contains a Contact header with ;expires= and the
Expires header is not set to 0. This is actually a regression.
Tests were created for this second issue (ASTERISK-22548). The tests have been
reviewed and a Ship It! was received on those tests.
This patch does the following:
* Do not ignore the Expires header value even when it is set to 0. The patch
sets the pvt->expiry earlier on in the function so that it is set properly and
used.
* If pvt->expiry is 0, do not call update_peer since that means the peer has
already been un-registered and there is no need to update the database record
again since nothing has changed.
(closes issue ASTERISK-22428)
Reported by: Ben Smithurst
Tested by: Ben Smithurst, Michael L. Young
Patches:
asterisk-22428-rt-peer-update-and-expires-header.diff
by Michael L. Young (license 5026)
Review: https://reviewboard.asterisk.org/r/2869/
........
Merged revisions 399794 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 399795 from http://svn.asterisk.org/svn/asterisk/branches/11
........
r399798 | newtonr | 2013-09-25 14:40:43 -0500 (Wed, 25 Sep 2013) | 2 lines
Broke the build - Fixing XML DTD violation added in r399782, missing <para> tags inside a <note>
........
r399842 | rmudgett | 2013-09-25 15:36:08 -0500 (Wed, 25 Sep 2013) | 23 lines
chan_dahdi: CLI "core stop gracefully" has needless delay for PRI and SS7.
The PRI and SS7 link control threads are not stopped correctly when the
chan_dahdi.so module is unloaded. The link control threads pri_dchannel()
and ss7_linkset() are not awakened from a poll() to cancel the thread.
* Added a SIGURG signal after requesting the thread cancel to break the
link control thread poll() immediately.
For SS7 it was slightly worse, the link poll() timeout would always be
whatever was the last libss7 scheduled event time used. If no libss7
scheduled event was pending, the thread could run more often than
necessary.
* Set nextms to 60 seconds for the ss7_linkset() poll() if there is no
other libss7 scheduled event.
........
Merged revisions 399818 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 399834 from http://svn.asterisk.org/svn/asterisk/branches/11
........
r399874 | newtonr | 2013-09-26 09:12:29 -0500 (Thu, 26 Sep 2013) | 2 lines
Adding a few words to the Dial option 'r' help text to clarify its tone argument description
........
r399887 | dlee | 2013-09-26 10:41:47 -0500 (Thu, 26 Sep 2013) | 1 line
Minor performance bump by not allocate manager variable struct if we don't need it
........
Merged revisions 399781,399796,399798,399842,399874,399887 from http://svn.asterisk.org/svn/asterisk/branches/12
Modified:
team/group/performance/ (props changed)
team/group/performance/apps/app_dial.c
team/group/performance/channels/chan_dahdi.c
team/group/performance/channels/chan_sip.c
team/group/performance/channels/sig_ss7.c
team/group/performance/res/res_pjsip.c
Propchange: team/group/performance/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.
Propchange: team/group/performance/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Sep 26 10:43:53 2013
@@ -1,1 +1,1 @@
-/branches/12:1-399753 /team/dlee/performance:1-399887 /team/dlee/stasis-forward-optimization:1-399888 /team/dlee/taskprocessor-optimization:1-399654 /team/dlee/tp-local:1-399866
+/branches/12:1-399889 /team/dlee/performance:1-399887 /team/dlee/stasis-forward-optimization:1-399888 /team/dlee/taskprocessor-optimization:1-399654 /team/dlee/tp-local:1-399866
Modified: team/group/performance/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/group/performance/apps/app_dial.c?view=diff&rev=399890&r1=399889&r2=399890
==============================================================================
--- team/group/performance/apps/app_dial.c (original)
+++ team/group/performance/apps/app_dial.c Thu Sep 26 10:43:53 2013
@@ -377,7 +377,7 @@
<para>Default: Indicate ringing to the calling party, even if the called party isn't actually ringing. Pass no audio to the calling
party until the called channel has answered.</para>
<argument name="tone" required="false">
- <para>Indicate progress to calling party. Send audio 'tone' from indications.conf</para>
+ <para>Indicate progress to calling party. Send audio 'tone' from the indications.conf tonezone currently in use.</para>
</argument>
</option>
<option name="S">
Modified: team/group/performance/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/group/performance/channels/chan_dahdi.c?view=diff&rev=399890&r1=399889&r2=399890
==============================================================================
--- team/group/performance/channels/chan_dahdi.c (original)
+++ team/group/performance/channels/chan_dahdi.c Thu Sep 26 10:43:53 2013
@@ -14124,6 +14124,7 @@
}
cancel_code = pthread_cancel(master);
+ pthread_kill(master, SIGURG);
ast_debug(4,
"Waiting to join thread of span %d "
"with pid=%p cancel_code=%d\n",
@@ -16428,8 +16429,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);
@@ -16439,9 +16442,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)
@@ -16485,8 +16490,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);
}
@@ -16501,8 +16507,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/group/performance/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/performance/channels/chan_sip.c?view=diff&rev=399890&r1=399889&r2=399890
==============================================================================
--- team/group/performance/channels/chan_sip.c (original)
+++ team/group/performance/channels/chan_sip.c Thu Sep 26 10:43:53 2013
@@ -16118,6 +16118,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 {
@@ -16257,12 +16265,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 {
@@ -16272,7 +16274,6 @@
sip_unref_peer(peer, "remote registration ref");
}
}
- pvt->expiry = expire;
if (!build_path(pvt, peer, req, NULL)) {
/* Tell the dialog to use the Path header in the response */
ast_set2_flag(&pvt->flags[0], 1, SIP_USEPATH);
@@ -17294,7 +17295,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;
Modified: team/group/performance/channels/sig_ss7.c
URL: http://svnview.digium.com/svn/asterisk/team/group/performance/channels/sig_ss7.c?view=diff&rev=399890&r1=399889&r2=399890
==============================================================================
--- team/group/performance/channels/sig_ss7.c (original)
+++ team/group/performance/channels/sig_ss7.c Thu Sep 26 10:43:53 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/group/performance/res/res_pjsip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/performance/res/res_pjsip.c?view=diff&rev=399890&r1=399889&r2=399890
==============================================================================
--- team/group/performance/res/res_pjsip.c (original)
+++ team/group/performance/res/res_pjsip.c Thu Sep 26 10:43:53 2013
@@ -208,8 +208,17 @@
</enumlist>
</description>
</configOption>
- <configOption name="external_media_address">
- <synopsis>IP used for External Media handling</synopsis>
+ <configOption name="media_address">
+ <synopsis>IP address used in SDP for media handling</synopsis>
+ <description><para>
+ At the time of SDP creation, the IP address defined here will be used as
+ the media address for individual streams in the SDP.
+ </para>
+ <note><para>
+ Be aware that the <literal>external_media_address</literal> option, set in Transport
+ configuration, can also affect the final media address used in the SDP.
+ </para></note>
+ </description>
</configOption>
<configOption name="force_rport" default="yes">
<synopsis>Force use of return port</synopsis>
@@ -730,7 +739,14 @@
<synopsis>Domain the transport comes from</synopsis>
</configOption>
<configOption name="external_media_address">
- <synopsis>External Address to use in RTP handling</synopsis>
+ <synopsis>External IP address to use in RTP handling</synopsis>
+ <description><para>
+ When a request or response is sent out, if the destination of the
+ message is outside the IP network defined in the option <literal>localnet</literal>,
+ and the media address in the SDP is within the localnet network, then the
+ media address in the SDP will be rewritten to the value defined for
+ <literal>external_media_address</literal>.
+ </para></description>
</configOption>
<configOption name="external_signaling_address">
<synopsis>External address for SIP signalling</synopsis>
More information about the asterisk-commits
mailing list