[jitsi-dev] events: pass arguments to custom command scripts


#1

Hi,

I posted a feature request and an implementation for it:

http://java.net/jira/browse/JITSI-1035

With this patch Jitsi can now pass arguments to custom command scripts. In particular, Jitsi can pass the caller's ID (hard-coded) to an incoming call event triggering a custom command. This allows running external scripts each time there's an incoming call and eg. look the caller up in a database before even answering (CRM integration).

Hope you can improve it and eventually include it in Jitsi.

Thanks,

Vieri


#2

Hey Vieri

I posted a feature request and an implementation for it:

http://java.net/jira/browse/JITSI-1035

With this patch Jitsi can now pass arguments to custom command scripts. In
particular, Jitsi can pass the caller's ID (hard-coded) to an incoming

call

event triggering a custom command. This allows running external scripts

each

time there's an incoming call and eg. look the caller up in a database

before

even answering (CRM integration).

Hope you can improve it and eventually include it in Jitsi.

Thanks for the Patch!
I took a look at it, and in general it's okay, but I have some comments:

- Simply passing an array as possible arguments is a bit inflexible. I think
this should be done similarly to the provisioning URL: Allow the user to
select a program to execute and then amend the commandline so it looks like
"crm.exe -openCustomer ${caller.uri}". So if you would use a Map<string,

instead of simply an array, the commandline could be freely

customized. The CommandNotificationHandlerImpl would then need to replace
the placeholders in the commandline against with the corresponding value in
the map.

- There are some JavaDocs missing (in NotificationData, NotificationManager,
NotificationService, NotificationServiceImpl)
- Could please remove those "Vieri - Ref." lines? :slight_smile:

I currently don't have the time to address these myself, so if you could
provide an updated version, I'll try to apply it. Also Emil might ask you to
sign the "BCA" so we don't run into legal issues with your contributions.

Thanks,
Vieri

Regards,
Ingo


#3

Hi Ingo,

···

--- On Fri, 5/4/12, Ingo Bauersachs <ingo@jitsi.org> wrote:

- Simply passing an array as possible arguments is a bit
inflexible. I think
this should be done similarly to the provisioning URL: Allow
the user to
select a program to execute and then amend the commandline
so it looks like
"crm.exe -openCustomer ${caller.uri}". So if you would use a
Map<string,
> instead of simply an array, the commandline could
be freely
customized. The CommandNotificationHandlerImpl would then
need to replace
the placeholders in the commandline against with the
corresponding value in
the map.

- There are some JavaDocs missing (in NotificationData,
NotificationManager,
NotificationService, NotificationServiceImpl)
- Could please remove those "Vieri - Ref." lines? :slight_smile:

I currently don't have the time to address these myself, so
if you could
provide an updated version, I'll try to apply it.

Thanks for the feedback. I see what you mean. I'll try to fix these issues as soon as possible. It's not a priority for me anymore because I have Jitsi working as I needed to but I will try to apply your suggestions so as to commit it to the source tree.

Thanks for the great software.

Vieri


#4

Hello Ingo,

- Simply passing an array as possible arguments is a bit
inflexible. I think
this should be done similarly to the provisioning URL: Allow
the user to
select a program to execute and then amend the commandline

I've updated the JIRA feature request:

http://java.net/jira/browse/JITSI-1035

- There are some JavaDocs missing (in NotificationData,
NotificationManager,
NotificationService, NotificationServiceImpl)

I think I fixed it now.

- Could please remove those "Vieri - Ref." lines? :slight_smile:

Done.

Hope it's ok now.

Thanks,

Vieri

···

--- On Fri, 5/4/12, Ingo Bauersachs <ingo@jitsi.org> wrote:


#5

Hey

Hope it's ok now.

It is. I committed & acked your patch, the feature is available since build
4018.

Thanks,

Vieri

Thanks again,
Ingo


#6

Thanks Vieri, and Ingo!

I was just thinking that it would probably make sense to add an "Add
Variable" or "Add Parameter" button, that shows the list of the
available options, since otherwise it would be hard for people to know
what to put in there.

Vieri, do you think you would be interested in adding that?

Emil

···

On 08.05.12 21:50, Ingo Bauersachs wrote:

Hey

Hope it's ok now.

It is. I committed & acked your patch, the feature is available since build
4018.

Thanks,

Vieri

Thanks again,
Ingo


#7

Hi,

Thanks Vieri, and Ingo!

Thank you both and the rest of the devs for a great project.

I was just thinking that it would probably make sense to add
an "Add
Variable" or "Add Parameter" button, that shows the list of
the
available options, since otherwise it would be hard for
people to know
what to put in there.

Vieri, do you think you would be interested in adding that?

As I stated earlier, I'm not an expert Java programmer ;-( but I may give it a shot.
I'm more of a console-based system administrator and once in a while I do some programming, not too much in the GUI area.
I'm usually happy if I can set things up via text files (properties in this case or via provisioning) just as long as it's documented somewhere. Actually, I don't even want my users to be able to mess with the arguments/variables.
However, I understand the need for it for domestic use.
So if I find the time, I'd be glad to do it.
But if anyone else wants to jump in, no problem on my behalf :wink:

Thanks,

Vieri

···

--- On Tue, 5/8/12, Emil Ivov <emcho@jitsi.org> wrote: