Summary:ASTERISK-09344: Add support for Redial, Speeddials and Message button
Reporter:dea (dea)Labels:
Date Opened:2007-04-27 20:21:16Date Closed:2007-05-11 17:52:11
Versions:Frequency of
Environment:Attachments:( 0) skinny-speed-redial-vmail-patch.txt
( 1) skinny-speed-redial-vmail-patch2.txt
( 2) skinny-speed-redial-vmail-patch3.txt
( 3) skinny-speed-redial-vmail-patch4.txt
( 4) skinny-speed-redial-vmail-patch5.txt
( 5) skinny-speed-redial-vmail-patch7.txt
( 6) skinny-speed-redial-vmail-patch7-svn.txt
Description:Added a global config option to point to the VoiceMailMain
pilot number.  This can be extended to per-device or even per-line.

Fixed up SpeedDial and redial support.


Dialing from the directories.  Have to figure out how to collect
the number from the phone into Asterisk.

Determine the phones headset/speakerphone state.  Pressing any
speeddial button, the messages button or Dial/Redial softkeys should
follow this logic-

If offhook, use the open channel
   if Headset is enabled, put headset offhook
         if has_speakerphone, put speakerphone offhook
              ignore it.

I do not expect that last bit to be to miserable, but I am about
to be unavailable for a couple of weeks and wanted to share what
I have so far.  

Based on Branches/1.4, but looks like it will apply to trunk...
Comments:By: dea (dea) 2007-04-27 20:23:52

Oh, one quirk with the current patch.  These functions only work 100%
if used while onhook.  The existing code always allocated a new call,
and I followed that logic.  The next step would be to determine if
the phone is already offhook and use that session.

By: dea (dea) 2007-04-29 18:52:02

OK, quirk solved.

If the caller goes offhook before pressing ReDial, Messages or a SpeedDial
line, chan_skinny will use that session.  If the caller does not go offhook,
chan_skinny will do one of the following:

1.  If either the handset or headset is active, but the phone is onhook,
the phone will activate the audio path for the active 'interface'.
2.  If no interface is active, chan_skinny will activate the SpeakerPhone.

Item 2 may need to be tuned by device type.  Every Cisco phone I have
access to has a SpeakerPhone, even if it is listen only.  Older phones
or the 7920 might not like being told to activate an interface they do not

I even got dialing from directories working.

I think I need a small bit of cleanup regarding active softkey templates
during various call patterns, but I am happy enough with the code to
ask for comments and feedback,

Oh, and please delete patch2.  I cut it before tackling dialing from
directories, thinking it would be a challenge, but it turned out to be
fairly trivial.

The patch is not quite clean enough for merging, as I commented out some
of the original code instead of deleting it (internal reference to previous
attempts).  I'll clean the patch up and delete the commented code shortly,
pending comments....

By: dea (dea) 2007-04-30 14:07:55

Fixed a segfault caused by the dial-timeout in skinny_ss when the
caller went offhook before using one of these features.

I also cleaned up the commented out original code, and hopefully made
the patch more acceptable.

By: Michiel van Baak (mvanbaak) 2007-05-01 12:45:13

I had this patch for the voicemail button in issue 9249
Your way is nicer, because a device only has 1 messages button.

I took your patch and made it work with the latest svn-trunk (rev 62538) and made some changes to the code. (-patch5.txt)
Basically, I made the vmaccess to be vmexten and gave it the size of AST_MAX_EXTEN instead of the hardcoded value.
I also changed some if lines to be more compatible with the coding guidelines.

It compiles fine and everything works. Thanx for the great patch.

By: dea (dea) 2007-05-01 12:55:10

Great, glad you like it.

On the vmexten front, it is actually possible to extend that
to also be per-line.  A caller can then select a line (going
offhook) and press messages to get the VM for that line.

It would be trivial to do that, if it was a model that users
of chan_skinny wanted.

While you're looking, how about the other features?  SpeedDial/Redial?
Do they work as you would expect?

I also have MWI working in a follow-on patch and do not know if I should
just merge it into this set.

By: Michiel van Baak (mvanbaak) 2007-05-01 13:12:14

speeddial and redial do work as I used them with chan_sccp a year ago.

The vmexten I implemented was per device. That way every device could have it's own vmexten. If that is how people want it I can easily change your patch to have this as well.

Also, I used to do this:
+ if (ast_strlen_zero(d->vmexten)) {
+ ast_log(LOG_WARNING, "Attempted voicemail, but no voicemail number found.\n");
+ return 0;
+ }

You think we should put that in the new patch as well?

About the mwi: put it in this set ;)

By: dea (dea) 2007-05-01 13:28:08

Logging would be good.  I'll add that.

I'd take the vmexten a step further:
-Device  (inherited if not set)
  -Line   (inherited if not set)

Again, only is that makes sense (CCM works that way, for what it is worth)

By: Michiel van Baak (mvanbaak) 2007-05-01 13:39:13

Good idea there with the vmexten.
I'll add it later this week when I have some time to test/code

By: dea (dea) 2007-05-01 16:13:24

Now supports per-line vmexten setting.  If not set, it will inherit it
from the global setting.  Per device did not make sense after all, so I
skipped it.

This version also includes the MWI fixes, with the LED turned on if any
line has VM, and each line (on the 79[46]0 at least) getting the envelop
icon turned on/off if that line has VM.

By: dea (dea) 2007-05-04 11:25:40

Cool discovery!

The SpeedDial changes also activated/enabled the Abbrivated Dial
feature that is in recent Skinny Release (6.X and up I think).

As implimented in CCM, each phone can have 99 speeddials.  These
will be assigned to unused line buttons.  This gives the impression
that most phones can have at most 1 (794X), 5 (796X) or 7 (797X)

The Asterisk implimentation has no limit in the code.

Added 5 speeddials to a 794X.  While onhook press '5' or '05' and
then press the softkey 'AbbrDial' and your call goes to the 5th
SpeedDial assigned to your device.

Is that cool or what?

By: Michiel van Baak (mvanbaak) 2007-05-05 05:25:01

added version of patch7 that applies to current svn trunk.

By: dea (dea) 2007-05-05 10:45:54

It might help this bug to post what models of phones have been tested
and what firmware versions.

I have tested a 7940 running 8.0(1)

By: Michiel van Baak (mvanbaak) 2007-05-06 04:07:22

I'm running the patch succesfull on the following phones:

Cisco 7960G fw 8.0(5.0)
Cisco 7905G fw 8.0.3(070409A)

VM indication on the lamp works on both. The 7960 is showing the blinking envelope icon next to the line button.
All other features work on both phones. Since both phones dont have the AbbrDial button I dont know about that.

By: pj (pj) 2007-05-06 04:13:41

I think all 79xx ci$co phone have AbbrDial feature - when handset is onhook, press any number on dialpad and AbbrDial will be displayed as softkey. This is behaviour when phone is connected to callmanager.

By: Michiel van Baak (mvanbaak) 2007-05-06 04:30:48

PJ: thanks, never saw that. Must be because I always use click-n-dial from my ibook and/or web addressbook.
This works great on my 7960.

The 7905 does not have this softkey.

By: Jason Parker (jparker) 2007-05-08 15:36:27

So, is this ready to be merged?

By: Michiel van Baak (mvanbaak) 2007-05-09 01:00:17

I vote yes

By: Jason Parker (jparker) 2007-05-11 17:52:10

Added to svn trunk in revision 64030.

Thanks! :)