[asterisk-dev] [Code Review] New application JabberReceive, implement SendText in chan_gtalk and chan_jingle

Philippe Sultan philippe.sultan at gmail.com
Fri Dec 12 07:36:43 CST 2008



> On 2008-12-11 18:31:32, Jeff Gehlbach wrote:
> > Pasting my post from asterisk-dev now that I have a Review Board account:
> > 
> > I think this enhancement is very cool.  No issues spotted in a quick read through the diff, but I'm not at all familiar with the XMPP code.
> > 
> > The only thing I would add is that text received via JabberReceive should be treated skeptically as it is, after all, user input.  For instance, could a user interacting with Asterisk via this mechanism craft a reply that would perform a dialplan Goto to get access to another user's voicemail box?  Some of the burden for input validation surely rests with the person writing the dialplan, but perhaps there are some basic checks that should be done before the input is handed off.  I have no idea what those would be -- just throwing pebbles here :)
> > 
> > -jeff
> >

Jeff, thanks a lot for the review and advice. John Todd proposed to extend the application to check the message destination in the case where several XMPP accounts are configured on Asterisk (see the corresponding bug). Apart from this check, and given the fact that the received text is stored in a channel variable, I can't think of other verification outside of the dialplan that would help.

I investigated in the 'thread' feature of XMPP (http://xmpp.org/extensions/xep-0201.html), that permits XMPP peers to follow a conversation thread, and thought we could use it so that Asterisk can figure out that an incoming message is part (or not) of a conversation. Unfortunately, this feature is not yet standardized, and very few clients started implementing it.


- Philippe


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/88/#review199
-----------------------------------------------------------


On 2008-12-11 21:50:49, Philippe Sultan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/88/
> -----------------------------------------------------------
> 
> (Updated 2008-12-11 21:50:49)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> JabberReceive is a dialplan application that makes Asterisk wait for an XMPP message from a given user (identified with his JID), and store the content in a dialplan variable.
> 
> It can be used for example to notify a user (via XMPP) that a call is coming, and read input back from him.
> Taken from the documentation :
> In the following example, calls targeted to extension 1234 (be it 
> accessed from SIP, DAHDI or whatever channel type) are controlled by
> user bob at jabber.org. Asterisk notifies him that a call is coming, and
> asks him to take an action. This dialog takes place over an XMPP chat.
> 
> context from-ext {
> 	1234 => {
> 		Answer();
> 		JabberSend(asterisk-xmpp,bob at jabber.org,Call from $CALLERID(num) - choose an option to process the call);
> 		JabberSend(asterisk-xmpp,bob at jabber.org,1 : forward to cellphone);
> 		JabberSend(asterisk-xmpp,bob at jabber.org,2 : forward to work phone);
> 		JabberSend(asterisk-xmpp,bob at jabber.org,Default action : forward to your voicemail);
> 		JabberReceive(bob at jabber.org,OPTION,20);
> 		switch (${OPTION}) {
> 			case 1:
> 	  			JabberSend(asterisk-xmpp,bob at jabber.org,(Calling cellphone...);
> 				Dial(SIP/987654321);
> 				break;
> 			case 2:
> 				JabberSend(asterisk-xmpp,bob at jabber.org,(Calling workphone...);
> 				Dial(SIP/${EXTEN});
> 				break;
> 			default:
> 				Voicemail(${EXTEN}|u)
> 		}
> 	}
> }
> 
> The diff also includes an implementation of SendText as XMPP messages in both chan_jingle and chan_gtalk.
> 
> The corresponding bug contains more use cases : http://bugs.digium.com/view.php?id=12569
> 
> 
> This addresses bug 12569.
>     http://bugs.digium.com/view.php?id=12569
> 
> 
> Diffs
> -----
> 
>   http://svn.digium.com/svn/asterisk/trunk/channels/chan_gtalk.c 163162 
>   http://svn.digium.com/svn/asterisk/trunk/channels/chan_jingle.c 163162 
>   http://svn.digium.com/svn/asterisk/trunk/doc/jabber.txt 163162 
>   http://svn.digium.com/svn/asterisk/trunk/res/res_jabber.c 163162 
> 
> Diff: http://reviewboard.digium.com/r/88/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Philippe
> 
>




More information about the asterisk-dev mailing list