<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/1185/">https://reviewboard.asterisk.org/r/1185/</a>
</td>
</tr>
</table>
<br />
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.orgrb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By Alec Davis.</div>
<p style="color: grey;"><i>Updated 2011-05-09 06:11:17.048545</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">chan_sip:handle_request_invite() cannot afford to call ast_stream_and_wait(pickupsound).
changing features.conf 'pickupsound = tt-somethingwrong' highlights the issue.
during playout period 'core show locks, has the following lock, no others waiting.
=== ---> Lock #0 (chan_sip.c): MUTEX 24533 handle_request_do &netlock 0xb6684ce0 (1)
The fix, spawn a new thread 'sip_pickup' from handle_request_invite to do the pickup, and more importantly playout the audio..
The result:
4 SIP phones required. A rings B, C and D (at exactly the same time) use the *8 pickup feature code to pickup B.
Both C and D at the same time, hear the respective 'success, or 'failure' beep.
Below correct console output.
[2011-05-09 22:43:27.510121] NOTICE[22857]: chan_sip.c:20909 sip_pickup: Group pickup thread started by channel SIP/gxp824-00000011
[2011-05-09 22:43:27.511548] NOTICE[22886]: features.c:5732 ast_pickup_call: pickup SIP/snom8929-00000010 attempt by SIP/gxp824-00000011
== Using SIP RTP CoS mark 5
[2011-05-09 22:43:27.526062] NOTICE[22857]: chan_sip.c:20909 sip_pickup: Group pickup thread started by channel SIP/gxp822-00000012
-- <SIP/gxp824-00000011> Playing 'tt-somethingwrong.gsm' (language 'en')
-- <SIP/gxp822-00000012> Playing 'beeperr.gsm' (language 'en')
[2011-05-09 22:43:28.020374] NOTICE[22887]: chan_sip.c:20888 sip_pickup_thread: Nothing to pick up for SIP/gxp822-00000012
</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">debugging mantis 18654, found common code, of which 1 set was wrong, the ast_pickup_call() code in features.c
The actual fault was ast_pickup_call where the target chan was unlocked too early - see bug18654.diff2.txt
Moved app_directed:pickup_do() to features:ast_do_pickup().
Now functions below all now use the new ast_do_pickup()
app_directed_pickup.c:
pickup_by_channel()
pickup_by_exten()
pickup_by_mark()
pickup_by_part()
features.c:
ast_pickup_call() </pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">pickup using *8 feature code, with pickup sounds enabled/disabled
exten => 71,1,Pickup() ; any ringing extension in same pickupgroup
exten => 72,1,Pickup(85@phones) ; dahdi extension
exten => 73,1,Pickup(823@phones) ; sip extension
</pre>
</td>
</tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="https://issues.asterisk.org/view.php?id=18654">18654</a>
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> (updated)</h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>trunk/apps/app_directed_pickup.c <span style="color: grey">(317665)</span></li>
<li>trunk/channels/chan_sip.c <span style="color: grey">(317665)</span></li>
<li>trunk/include/asterisk/features.h <span style="color: grey">(317665)</span></li>
<li>trunk/main/features.c <span style="color: grey">(317665)</span></li>
<li>trunk/res/res_features.exports.in <span style="color: grey">(317665)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/1185/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>