Outgoing DTMF / dialpad support
David Woodhouse
dwmw2 at infradead.org
Sun Oct 20 18:41:27 EDT 2013
On Sun, 2013-10-20 at 10:54 -0700, Elliott Sales de Andrade wrote:
> > + purple_media_send_dtmf(gtkmedia->priv->media, sid, num, 25, 50);
>
> What are these two numbers?
Volume, duration.
>
> + gchar *sid = g_strdup(_sid); /* FIXME: This leaks. */
> +
>
>
> You can use g_object_set_data_full on *one* button so it autofrees.
That's great; thanks. I'll make a new patch. May take a few days as I'm
at a conference now. Unless Jan feels like picking it up?
>
> + /* Button 1 */
> + button1 = phone_create_button("o_o", "<b>1</b>");
>
>
> Shouldn't one or both of these be marked for translation?
I don't think the number 1 on a telephone keypad really needs
translating. The o_o can possibly just be dropped. I think Jan was
copying the keypad of a mobile phone, where pressing and holding the '1'
key will typically autodial your voicemail, hence the tape-spool image
which o_o is an ASCII representation of.
> + g_signal_connect(button1, "pressed",
> G_CALLBACK(phone_dtmf_pressed_cb), gtkmedia);
> + g_object_set_data(G_OBJECT(button1), "dtmf-digit",
> GINT_TO_POINTER('1'));
> + g_object_set_data(G_OBJECT(button1), "session-id",
> sid);
> + gtk_table_attach(GTK_TABLE(grid), button1, 0, 1, 0, 1,
> GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 2, 2);
> +
> + /* Button 2 */
> ...
>
> + /* Button Pound */
> +
>
>
> All these buttons seem to be created the same way. I think this would
> be simpler if you looped through a static array of the elements.
Yeah, I actually thought the same when I was looking at it (and adding
the g_object_set_data() calls to every instance, making it *more*
duplicated code than Jan's original already was).
> I haven't looked into running this patch, so at a higher level, can I
> ask where the buttons go?
See attached.
--
dwmw2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pidgin-dtmf.png
Type: image/png
Size: 25273 bytes
Desc: not available
URL: <http://pidgin.im/pipermail/devel/attachments/20131020/104077d6/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5745 bytes
Desc: not available
URL: <http://pidgin.im/pipermail/devel/attachments/20131020/104077d6/attachment-0001.bin>
More information about the Devel
mailing list