<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/1042/">https://reviewboard.asterisk.org/r/1042/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On May 23rd, 2011, 1:57 p.m., <b>marcelloceschia</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://reviewboard.asterisk.org/r/1042/diff/6/?file=15922#file15922line654" style="color: black; font-weight: bold; text-decoration: underline;">/trunk/main/message.c</a>
<span style="font-weight: normal;">
(Diff revision 6)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">static int msg_tech_cmp(void *obj, void *arg, int flags)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">654</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="n">res</span> <span class="o">=</span> <span class="n">strcasecmp</span><span class="p">(</span><span class="n">tech_holder</span><span class="o">-></span><span class="n">tech</span><span class="o">-></span><span class="n">name</span><span class="p">,</span> <span class="n">tech_holder2</span><span class="o">-></span><span class="n">tech</span><span class="o">-></span><span class="n">name</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="n">CMP_MATCH</span> <span class="o">|</span> <span class="n">CMP_STOP</span><span class="p">;</span></pre></td>
</tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">this should be
res = strcasecmp(tech_holder->tech->name, tech_holder2->tech->name);
otherwise you will invert this result with the return value</pre>
</blockquote>
<p>On May 31st, 2011, 6:13 p.m., <b>Russell Bryant</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The code looks fine to me. Can you expand on what you see wrong with this code?</pre>
</blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Yes i will try it.
Some example: if tech_holder->tech->name is equals to tech_holder2->tech->name you set res to CMP_MATCH | CMP_STOP. Thats fine, but in the return statement you do:
return res ? 0 : CMP_MATCH | CMP_STOP;
So if the tech name is equals you set it back to 0</pre>
<br />
<p>- marcelloceschia</p>
<br />
<p>On May 31st, 2011, 6:30 p.m., Russell Bryant wrote:</p>
<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 Russell Bryant.</div>
<p style="color: grey;"><i>Updated 2011-05-31 18:30:54</i></p>
<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;">This branch contains a proposal for adding protocol independent support for processing text messages into and out of the dialplan, outside of a call. The file doc/asterisk-messaging.txt contains more details on the proposal. The introduction of the document is quoted here:
" Asterisk has some limited support today for messaging. The support that
exists primarily includes passing text messages in the context of a call. The
SIP and IAX2 protocols have support for this, but that's it.
There are a couple of other messaging protocols that are supported: Skype
and XMPP (Jabber). The support of these is very minimal and not very integrated
into the architecture of Asterisk since these messages are not in the context of
a phone call. They provide a combination of dialplan and manager interface
interfaces that are specific to each protocol. There just is no current
architectural concept of dealing with text messages.
The purpose of this proposal is to introduce text messaging into the
architecture of Asterisk. For messaging support to exist in the true spirit of
Asterisk architecture, the design needs to achieve the following two goals:
a) Protocol Independence
b) Scriptable message routing
The rest of this document goes through some details about how these goals
will be achieved in a way that is both architecturally compatible with Asterisk
as well as practical to implement."
----------
In addition to the documented proposal, I have made some good progress on implementation. While the document includes some ideas for future enhancements, what is there so far should be usable.
- core modifications to allow sending incoming messages through the dialplan
- core modifications to allow outbound messages from the dialplan
- modifications to res_jabber to allow inbound and outbound messages in the new architecture
- changes to chan_sip to support inbound and outbound MESSAGE outside of a 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;">svn/testsuite/asterisk/team/russell/messaging:
- This branch of the testsuite contains my tests for this branch, which include:
- tests/sip/message_disabled
- Ensure MESSAGE outside of a call is rejected when disabled.
- tests/sip/message_unauth
- When enabled, test sending a MESSAGE to Asterisk and send another back out from the dialplan.
- tests/sip/message_auth
- Same as the last test, but authenticate MESSAGE both inbound and outbound.
- tests/sip/message_from_call
- Set up a normal SIP call and send an out of call MESSAGE from the dialplan processing the call
I have also written some simple apps using the pjsua Python module from pjsip that can send and receive messages sent through Asterisk.
Lastly, I have done some manual testing of XMPP messages in and out of Asterisk using this code.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/trunk/CHANGES <span style="color: grey">(321522)</span></li>
<li>/trunk/channels/chan_sip.c <span style="color: grey">(321522)</span></li>
<li>/trunk/channels/sip/include/sip.h <span style="color: grey">(321522)</span></li>
<li>/trunk/configs/jabber.conf.sample <span style="color: grey">(321522)</span></li>
<li>/trunk/configs/sip.conf.sample <span style="color: grey">(321522)</span></li>
<li>/trunk/doc/asterisk-messaging.txt <span style="color: grey">(PRE-CREATION)</span></li>
<li>/trunk/include/asterisk/_private.h <span style="color: grey">(321522)</span></li>
<li>/trunk/include/asterisk/channel.h <span style="color: grey">(321522)</span></li>
<li>/trunk/include/asterisk/jabber.h <span style="color: grey">(321522)</span></li>
<li>/trunk/include/asterisk/message.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>/trunk/main/asterisk.c <span style="color: grey">(321522)</span></li>
<li>/trunk/main/channel.c <span style="color: grey">(321522)</span></li>
<li>/trunk/main/message.c <span style="color: grey">(PRE-CREATION)</span></li>
<li>/trunk/res/res_jabber.c <span style="color: grey">(321522)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/1042/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>