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

Tilghman Lesher tlesher at digium.com
Tue Apr 21 13:33:28 CDT 2009


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


I'm partially curious about using this as a generic message passing system, but that may mean that someone would like to turn off timeouts on a per-user basis.  Do you think that would be useful to have here?


http://svn.digium.com/svn/asterisk/trunk/res/res_jabber.c
<http://reviewboard.digium.com/r/88/#comment1867>

    What gets me about lowering the default timeout to 2 is that the resolution only to a single second means that you could in reality only be waiting between 1.001 and 2.000 seconds before deleting the message.  This wasn't as critical when the default timeout was 100 seconds, but the shortness becomes troubling now.  I'd suggest changing to use struct timeval and using the ast_tv... functions in include/asterisk/time.h.


- Tilghman


On 2009-04-17 09:18:26, Philippe Sultan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/88/
> -----------------------------------------------------------
> 
> (Updated 2009-04-17 09:18:26)
> 
> 
> 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/CHANGES 188900 
>   http://svn.digium.com/svn/asterisk/trunk/channels/chan_gtalk.c 188900 
>   http://svn.digium.com/svn/asterisk/trunk/channels/chan_jingle.c 188900 
>   http://svn.digium.com/svn/asterisk/trunk/configs/jabber.conf.sample 188900 
>   http://svn.digium.com/svn/asterisk/trunk/doc/jabber.txt 188900 
>   http://svn.digium.com/svn/asterisk/trunk/res/res_jabber.c 188900 
> 
> Diff: http://reviewboard.digium.com/r/88/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Philippe
> 
>




More information about the asterisk-dev mailing list