[Asterisk-Dev] Comedian Mail's ADSI implementation broken on phones needing unlock codes?

Darren Nickerson darren.nickerson at ifax.com
Wed Dec 31 19:10:02 MST 2003


Life is good. I can download ADSI scripts to my Sayson (Aastra) ASDI
Screenphone! I don't have a good ADSI script yet (the default one seems to
only give me a 'VMail' softkey and very nothing useful when off-hook), but
at least I can download the one I do have to the phone. In the services
section, I now see:

> Asterisk PBX
   Asterisk PBX

(On this phone, slot 1 is the activated by telco events and slot 2 whenever
the phone's idle for 1s or more)

There's a little magic to making this happen with my phone that I should
clarify, because it will be important. In apps/app_adsiprog.c I see
adsi_begin_download being called with 5 parameters:

        /* Now begin the download attempt */
        if (adsi_begin_download(chan, scr->desc, scr->fdn, scr->sec,
scr->ver)) {

It appears scr->fdn and scr->sec are pulled from within the ADSI script
itself, which by default is:

SECURITY "_AST"                                ; Security code
FDN 0x0000000f                          ; Descriptor number

These are going to vary from phone model to phone model, and I had to get
the codes for ours. That's expected, which is why they're configurable. It
so happens they're available for the PT480s we sell so I had a shiny new
model to test this with. I modified the asterisk.adsi scripts for the slots
I wanted the script to be downloaded to, setup an extension to do the
ADSIProg(asterisk.adsi) and all was well as you can see by the services
menu - the downloads were successful.

Then I tried to access voicemail, and stumbled upon a problem. Comedian mail
appears to try to do a FDM* download as soon as the connection is made, but
it fails as follows:

    Comedian Mail
    download refused

    Services is full

Sayson technical support tell me this is what happens when one tries to do a
FDM download to one of the slots without the correct security code. And yet
somehow there does seem to be some ADSI functionality later on, when it
falls back to a voice prompt after the download is refused and I'm
navigating the voice prompts, reading the messages. I see details on the LCD
screen about which message I'm on, the caller-id of that message and when it
was left etc that seem to update correctly as I navigate the phone using the
numeric keys.  Apparently that's not FDM, but SDC** transactions ... at
least those appear to work.

It troubles me that Asterisk isn't very chatty about the ADSI stuff ... I
can't see any diagnostics about the failure I mention above. When I access
Comedian Mail and get the download failure all I see is:

   -- Starting simple switch on 'Zap/5-1'
    -- Executing VoiceMailMain("Zap/5-1", "") in new stack
    (here's where the ADSI stuff seems to happen on the phone, download
refused etc)
    -- Playing 'vm-login' (language 'en')
    [snip rest of log]

There's no indication that any ADSI transactions are going on here, but that
tell-tale tone can be heard and the little rotating animated cursor on the
phone means _something_ is definitely going on at the ADSI level. Am I
missing a debug option that could show me more about what may be going
wrong? Is this a bug?

Anyway, so I dug into the code a little deeper to see why the download might
be failing. In app_voicemail.c there's a different (less intuitive) variable
naming scheme, and adsi_begin_download is invoked as follows:

        if (adsi_begin_download(chan, addesc, adapp, adsec, adver)) {

It turns out that addapp (which would be better named fdn) and adsec are
hardcoded as follows:

static char *adapp = "CoMa";

static char *adsec = "_AST";

Which, unless I miss my guess, means I need to change these and recompile
app_voicemail or it's never going to be able to work with my handset (and
many others). Even if I could fix this, it seems like a fundamental
shortcoming in app_voicemail's ADSI implementation, does it not? It seems to
me that when we set adsi=yes in zapata.conf, we almost need to set 'adsisec'
and 'adsifdn' as well, and convince app_voicemail to use these when doing
fancy ADSI stuffage.

You'll notice I said 'even if I could fix this' above.  I tried using one of
the fdm/sec pairs I used in the ADSIProg:

static char *adapp = "0x85EFD9DA";
static char *adsec = "0x78921D49";

recompiled and restarted, but no joy - the download still fails and Asterisk
still fails to log any error at all.

Can anyone help?


* FDM (or just FD) = Feature Download Management (or just Feature Download).
It is used to load CPE-resident feature logic and data into the ADSI
compatible AST CPE. So basically, the programming that is downloaded to the
memory slots you see when you press services.

**SDC = Server Display Control. Interactive type of ADSI session between a
Server application and a CPE. The phone usually has to initiate this by
dialing into the software. ADSI screens built up of softkeys and text are
then pushed to the screen. These screens are just temporary. Once you hang
up or move on, the screen is gone. You can push an entire menu structure of
softkeys and text, or you can call softkeys and text (based on the
associated number or unique identifier) that already exist in the permanent
script (FDN) that has already been downloaded into the phone. The length of
time to push these screens to the phone depends on the amount of information
you are pushing. If you are calling softkeys and text, the temporary screens
are downloaded much more quickly than if you are pushing text and softkeys
including labels and values and sub menus etc..

Darren Nickerson
Senior Sales & Support Engineer
iFAX Solutions, Inc. www.ifax.com
darren.nickerson at ifax.com
+1.215.438.4638 ext 8106 office
+ fax

More information about the asterisk-dev mailing list