Announce extension when calling

Hello. Thanks in advance to anyone who can offer me some assistance.

We’re running a custom build of Asterisk from our vendor. However, they won’t add this feature, so I’m trying to do it myself. What I want to happen is the system, when calling any extension, announces the callee’s recorded name before transferring.

Here’s the relevant portion of macro-stdexten.conf with both my version (commented out) and the current version. The line I added is also commented.

When I tried this, it worked fine for normal extensions, but virtual extensions disconnected instead of transferring. I also suspect, but have not absolutely confirmed, Asterisk instability after the disconnections (unanswered calls, strange behavior).

I can supply more information, if needed. Please let me know! And thanks again, in advance, for any help offered! :smile:


[macro-stdexten];
;
; Standard extension macro:
; ${ARG1} - Extension (we could have used ${MACRO_EXTEN} here as well
; ${ARG2} - Mailbox Number
; ${ARG3} - Device(s) to ring
; ${ARG4} - How long to ring
;
;ORIGINAL SEQUENCE
exten => s,1,SetVar(EXTEN=${ARG1})
exten => s,2,AGI(fon://localhost:4574)
exten => s,3,Dial(${ARG3},${ARG4},r) ; Ring the interface
exten => s,4,Goto(s-${DIALSTATUS},1)
exten => s,5,Voicemail(u${ARG2}) ; If unavail, send to VM w/unavail ann.
exten => s,6,Goto(130)

;NEW SEQUENCE, SECOND TRY
;exten => s,1,SetVar(EXTEN=${ARG1})
;exten => s,2,Playback(vm/${ARG2}/greet) ; my addition. greet.wav is user name
;exten => s,3,AGI(fon://localhost:4574)
;exten => s,4,Dial(${ARG3},${ARG4},r) ; Ring the interface
;exten => s,5,Goto(s-${DIALSTATUS},1)
;exten => s,6,Voicemail(u${ARG2}) ; If unavail, send to VM w/unavail ann.
;exten => s,7,Goto(130)

Any one have any ideas?

Just curious: what is a “virtual extension”?

[quote=“cwpt”]
;exten => s,7,Goto(130)[/quote]

What does priority 130 do? Is the sequence still valid after you added your priority? This may not be related to your problem, though.

What does the AGI do? Can you run your PlayBack after that? What CLI messages are displayed when the call gets disconnected?

You were absolutely right. Also, I didn’t know about the CLI until about an hour before you posted that message. :wink:

I had two errors in the file. First, I needed the |skip argument to Playback. Second, priority 130 - which I didn’t even post here (oops) - checks the call status (busy, noanswer, etc) and sends it to voicemail with the appropriate message. I needed to change the Goto statement there, since it was sending the macro into an infinite loop.

I have no idea what that AGI script does.

“Virtual extension” is pretty language my vendor uses to describe any extension with the device set to /dev/null (for forwarding or voicemail only purposes). Not sure if the Asterisk community has a specific term for it.

Thank you for your help! The caller name is announced properly now when dialed from the main menu. :smile: