[asterisk-users] Using server side phonebook directory with SPA941

Maxim Veksler hq4ever at gmail.com
Wed Mar 28 08:40:27 MST 2007


On 3/27/07, Robert Lister <robl at linx.net> wrote:
> On Tue, Mar 27, 2007 at 12:45:44PM +0200, Maxim Veksler wrote:
> > Hello list,
> >
> > I got a couple of those "wouldn't it be great questions", as following:
> >
> > 1. Is it possible, with asterisk to hold a central phonebook directory
> > of callers?, so that when this party calls a "textual" caller ID will
> > be displayed on the phone display.
>
> Can be done reasonably easily in the dial plan. What I have is quite noddy
> but it does the job. In the incoming bits of dial plan where calls come in,
> I call this as a macro in the context where incoming calls arrive, before
> handing it off to the Dial() bits:
>
> exten => _4535XX,1,Macro(setisdncallerid,${EXTEN},PSTN,9)
>
> What this macro (pasted below) does is allow alpha tagging of incoming
> calls, plus some defaulty stuff set by the gateway (caller ID not
> present/withheld comes through in my case as either anonymous or just "0" or
> "00", so this macro tidies this up before passing the call on.)
>
> It also inserts the access digit (9) in front of the caller ID as in my case
> outside calls need a 9 prefix. This is just so that call routing works
> correctly if people return missed calls/save numbers from the handset etc.
> Obviously you will have to tweak this for your setup.
>
> If there is no alpha tag in the DB, it sets some defaulty thing (In my case
> "PSTN" to give some indication where the call is coming from.)
>
> It can also do a CPI tag based on destination number, for queues/group
> numbers, so that the alpha tag on the call gets set to something like
> "Main Number" etc. to distinguish a DDI call from a Queue Call.
>
> The database entries look like:
>
> *CLI>database put tag 01234567890 "Some Name Here"
>
> and for CPI (called party) Tag:
>
> *CLI>database put 453510 tag "Helpdesk"
>
> [macro-setisdncallerid]
> ; ${ARG1} = Called Party Number (XXXXXX) as presented from BT.
> ; ${ARG2} = default tag to add to incoming calls
> ; ${ARG3} = prefix to insert to incoming CLI
> ;
> ; Frobs the incoming caller ID headers how we like it:
>
> exten => s,1,NoOp("macro-setisdncallerid: ${ARG1}")
>
> ; In my case the internal extension is 7XX where XX is the
> ; last two digits of the incoming DDI number. This just makes
> ; it display right in the caller ID:
> exten => s,2,Set(DIALED_EXTEN=7${ARG1:-2})
>
> ; For cisco phone, set different ring cadence to indicate
> ; an external call:
> exten => s,3,SIPAddHeader(Alert-Info: Bellcore-dr2)
>
> exten => s,4,GotoIf($[ "${CALLERID(num)}" = "anonymous" ]?400)
> exten => s,5,GotoIf($[ "${CALLERID(num)}" = "0" ]?500)
> exten => s,6,GotoIf($[ "${CALLERID(num)}" = "00" ]?500)
> exten => s,7,GotoIf($[ "${DB(tag/${CALLERID(num)})}" != ""]?700)
> exten => s,8,Set(CALLERID(name)=${ARG2} to ${DIALED_EXTEN})
> exten => s,9,Set(CALLERID(num)=${ARG3}${CALLERID(num)})
> exten => s,10,Goto(900)
>
> exten => s,400,Set(CALLERID(name)=${ARG2})
> exten => s,401,Goto(900)
>
> exten => s,500,Set(CALLERID(num)=unknown)
> exten => s,501,Set(CALLERID(name)=${ARG2})
> exten => s,502,Goto(900)
>
> exten => s,700,Set(CALLERID(name)=${DB(tag/${CALLERID(num)})})
> exten => s,701,Set(CALLERID(num)=${ARG3}${CALLERID(num)})
> exten => s,702,Goto(900)
>
> ; If there is a CPI tag set, use that: (i.e. SUPPORT)
> exten => s,900,GotoIf($[ "${DB(${ARG1}/cpitag)}" != ""]?950)
>
> exten => s,950,Set(CALLERID(name)=${DB(${ARG1}/cpitag)})
>
> > 2. How can this be configured with Trixbox, I've looked at the
> > configuration options - I assume it plays no difference me basing it
> > on mysql or astdb?
> >
> > 3. What protocol does the phone (Linksys SPA941) talks to the
> > asterisk server to retrieve this information ?
>
> When an incoming call arrives with asterisk, the SIP headers can be set
> appropriately before you present this information to the handset. It's in
> the incoming SIP packets to the handset.
>
> > 4. Has someone done this? What softphone should I use to test it first
> > (I'm connecting it with outlook, so it has to be win* software)
>
> There are a few to choose from. I use Counterpath's X-Lite client:
> http://www.counterpath.com/
>

Thank you Rob for the detailed reply.

It solves one side of the problem (In a very cool and unexpected way I
must admit) but not the whole demand. I still would like to have a
centrally managed caller phonebook directory, available from the
phone's "Directory" menu. I did found some solutions[1] involving a
push method with wget to each phone. It slick, but it requires some
API between a php script and asterisk to query for registered devices,
then making a push to them.

see,

[1] http://grimsy.blogspot.com/2007/02/spa942-personal-directory-ldap.html

> Rob
>

Maxim.

-- 
Cheers,
Maxim Veksler

"Free as in Freedom" - Do u GNU ?


More information about the asterisk-users mailing list