[jitsi-issues] [JIRA] Commented: (JITSI-1035) events: pass arguments to custom command scripts

vieridipaola (JIRA) jira-no-reply at java.net
Tue Apr 24 18:57:08 CEST 2012


    [ http://java.net/jira/browse/JITSI-1035?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=338463#action_338463 ] 

vieridipaola commented on JITSI-1035:
-------------------------------------

I think that the following in NotificationServiceImpl.java:

public NotificationData fireNotification(
        String eventType,
        String title,
        String message,
        byte[] icon,
        Object tag)
    {

could be changed to something like:

public NotificationData fireNotification(
        String eventType,
        String title,
        String message,
        String xtradata,
        byte[] icon,
        Object tag)
    {

(update NotificationData.java so it also contains a String xtradata and a method to getxtraData)

within:
    private void fireNotification(NotificationData data)
modify:
            else if (actionType.equals(ACTION_COMMAND))
            {
                ((CommandNotificationHandler) handler)
                    .execute((CommandNotificationAction) action, data.getxtraData);
            }


In NotificationManager.java add:

    public static NotificationData fireNotification(String eventType,
                                        String messageTitle,
                                        String message,
                                        String xtradata)
and make it return:
         return notificationService.fireNotification(   eventType,
                                                messageTitle,
                                                message,
                                                xtradata,
                                                null,
                                                null);

Also modify:

    public void incomingCallReceived(CallEvent event)
    {
        try
        {
            Call call = event.getSourceCall();
            String peerName = event.getSourceCall()
                .getCallPeers().next().getDisplayName();
            String callerURI = event.getSourceCall()
                .getCallPeers().next().getURI(); //.getAddress();

            callNotifications.put(event.getSourceCall(),
                fireNotification(
                    INCOMING_CALL,
                    "",
                    NotificationWiringActivator.getResources()
                            .getI18NString("service.gui.INCOMING_CALL",
                                    new String[]{peerName}),
                    callerURI));

In CommandNotificationHandler.java modify:

    public void execute(CommandNotificationAction action, String cmdparams);

In CommandNotificationHandlerImpl.java modify:
    public void execute(CommandNotificationAction action, String cmdparams)
    {
    // ...
       if(StringUtils.isNullOrEmpty(cmdparams, false))
             Runtime.getRuntime().exec(action.getDescriptor() + " \"" + cmdparams + "\"");
    // ...



> events: pass arguments to custom command scripts
> ------------------------------------------------
>
>                 Key: JITSI-1035
>                 URL: http://java.net/jira/browse/JITSI-1035
>             Project: jitsi
>          Issue Type: New Feature
>            Reporter: vieridipaola
>
> The Jitsi "events" mechanism should pass arguments to the custom user scripts. For example, whenever there's an incoming call, I'd like to run a custom script but I'd also like to know who's calling. So Jitsi could pass the caller's number to the custom script. That way, integrating with a CRM is simple - the script can lookup the caller's number in a database and show it to the callee before answering the phone.
> http://java.net/nonav/projects/jitsi/lists/dev/archive/2012-04/message/155

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://java.net/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        




More information about the issues mailing list