Re: [GnomeMeeting-list] External ringing program (was Re: Shifting set of features)



Am Dienstag, 3. Februar 2004 00:40 schrieb Pierre-Philippe Coupard:
> Damien Sandras wrote:
> >>Perhaps then another, easier to implement solution for those of us
> >>who have a less-than-usual needs would be to have a "run external program
> >> upon incoming call" checkbox, and a text entry to specify the
> >> executable's path. Gnomemeeting could then simply exec it to start
> >> ringing, and kill it (or send it another signal) to stop ringing.
>
> --8<--8<--
>
> > That is too late for 1.00 anyway, but if you can come with an
> > interesting patch, it can be considered for another version.
>
> Okay, I've made a quick something that works and solves the problem : with
> the patch below, there's a new "spawn external program on incoming calls"
> entry in the GnomeMeeting Sound Events submenu, and the sound file in that
> case is in fact the path to the program in question. It's a dirty UI hack,
> but I just wanted a quick fix for now.
>
> If the option is enabled, Gnomemeeting spawns the program when a call comes
> that's not refused or forwarded, and kills it when the call isn't answered
> in time, is rejected, or if the user picks up.

... deleted ...

> @@ -850,6 +860,19 @@
>     CallPendingTimer.RunContinuous (PTimeInterval (5));
>
>
> +  /* Do we need to run an external ringing program ? */
> +  if (enable_on_call_exec && on_call_exec) {
> +    argv[0] = on_call_exec;
> +    if (!g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL,
> +                       &on_call_exec_pid, &gerror)) {
> +      gnomemeeting_statusbar_push (gw->statusbar, gerror->message);
> +      gnomemeeting_log_insert (gerror->message);
> +      g_free (gerror);
> +    }
> +
> +    gnomemeeting_threads_leave ();
> +  }
> +
>     /* Incoming Call Popup, if needed */
>     if (show_popup) {
> --8<--8<--
>
> Take care!

I have spotted two problems:
1. You have added an unmatched gnomemeeting_threads_leave (); see the block 
above.
2. You are killing the programm the program you have started via its pid - 
this is dangerous, there is no guarantee it is the same programm, pids are 
reused.

Everything else looks good for me ...

Stefan

-- 
Stefan Brüns  /  Kastanienweg 6 - Zimmer 1206  /  52074 Aachen
mailto:lurch gmx li  http://www.kawo1.rwth-aachen.de/~lurchi/
   phone: +49 241 169-4206     mobile: +49 160 7532733 

Attachment: pgppeoTum0L80.pgp
Description: signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]