[Asterisk-Users] Manager redirect action does not appear to work in some cases.

David Wilson dw at botanicus.net
Mon Sep 20 07:54:53 MST 2004


Hi there,

I am currently developing the ability to have a unified system/telephone 
login, with SIP phones paired to a computer. When a user logs into a 
computer, a notification is sent to an external service program which 
connects to Asterisk through the manager API.

Besides that, the service program tracks user status on the computer, 
and triggers actions depending on various conditions. One of those 
actions is to play a recording to a caller depending on what the user is 
currently doing, eg. on the phone, not at work, and so on.

My setup is similar to this:

   [local_extensions]
   exten = _XXX,1,Macro(internal_call,${EXTEN})

   [macro-internal_call]
   exten = s,1,Answer
   exten = s,2,SetVar(destination_number=${ARG1})
   exten = s,3,UserEvent(InternalOriginate)


My service program connects to the manager API and waits for 
InternalOriginate events. When it sees one, it reads the destination 
number from the channel variable via the Getvar action, then looks at 
it's session information to determine whether the user is logged in, and 
if so, his current SIP channel, and so on.

Now, for the simple case of the user not being available and an 
announcement needs played, I have another context:

   [play_response]
   exten = s,1,Playback(/etc/asterisk/sounds/response-${RESPONSE})
   exten = s,2,Hangup

My service program first uses Setvar to set RESPONSE to the name of a 
recording, then Redirect to transfer the channel to that context. This 
is where it fails. I see no "Newexten" events indicating the beginning 
of playback, and the channel (as seen from output of the Status action) 
does not appear to change state.

The only thing that follows is a hang up at timeout.

Any ideas?



David.



More information about the asterisk-users mailing list