astTapi integration Help

Hello I’ve found this proggy very nice and simple but there are few implementations to do into the asterisk code, so i’d like to know if anyone has got it working and what lines of code they implemented into it to make it all working… I’m quoting it’s instructions… Thanks!

[quote]
Putting it all together

For inbound calls we will extend the standard extension macro to include our TAPI events

[macro-tapi]
exten => s,1,UserEvent(TAPI|TAPIEVENT [~${ARG1}&sip/bob] LINE_CALLSTATE LINECALLSTATE_CONNECTED)
exten => s,1,UserEvent(TAPI|TAPIEVENT [~${ARG1}&!sip/bob] LINE_CALLSTATE LINECALLSTATE_HANGUP)

[macro-stdexten]

;Our TAPI events
exten => s,1,UserEvent(TAPI|TAPIEVENT: LINE_NEWCALL ${ARG3})
exten => s,n,UserEvent(TAPI|TAPIEVENT: LINE_CALLSTATE LINECALLSTATE_OFFERING)
exten => s,n,UserEvent(TAPI|TAPIEVENT: SET CALLERID ${CALLERID})
exten => s,n,UserEvent(TAPI|TAPIEVENT: LINE_CALLINFO LINECALLINFOSTATE_CALLERID)

;The normal macro
exten => s,n,Dial(${ARG1},20,TM(tapi^${UNIQUEID}))
exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
exten => s-NOANSWER,1,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce
exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start
exten => s-BUSY,1,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start
exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer
exten => a,1,VoicemailMain(${ARG1}) ; If they press *, send the user into VoicemailMain

We also have to remember to have the ‘h’ extension in the context the call came in on:

exten => h,1,UserEvent(TAPI|TAPIEVENT: LINE_CALLSTATE LINECALLSTATE_IDLE)

We also have to remember that Outlook and other diallers expect to see events to know about the progress of the call they have requested. Here we have to modify the way outgoing calls are made:

[trunklocal]
;
; Local seven digit dialling accessed through the trunk interface
;
exten => _9NXXXXXX,1,UserEvent(TAPI|TAPIEVENT: LINE_NEWCALL line_1)
exten => _9NXXXXXX,n,UserEvent(TAPI|TAPIEVENT: LINE_CALLSTATE LINECALLSTATE_DIALTONE)
exten => _9NXXXXXX,n,UserEvent(TAPI|TAPIEVENT: LINE_CALLSTATE LINECALLSTATE_DIALING)
exten => _9NXXXXXX,n,UserEvent(TAPI|TAPIEVENT: LINE_CALLSTATE LINECALLSTATE_PROCEEDING)
exten => _9NXXXXXX,1,Dial(${TRUNK}/${EXTEN:${TRUNKMSD}}||M(tapi^${UNIQUEID}))

Notes:

Because the TSP filters the LINE_NEWCALL event, this means this can be used in the situation where either the TAPI application initiates the call, or if it is a call which is initiated by the actual phone
Remember this must also pick up on the ‘h’ extension to signal when the call is idle again [/quote]