In article <[EMAIL PROTECTED]>,
Script Head <[EMAIL PROTECTED]> wrote:
> 
> I've been trying to originate calls and capture the DIALSTAUS via the
> manager API. The problem seems that the API doesn't expose enough data to
> make a decision of what exactly happened to the call. It results in
> something like this:
> 
> Action: Originate
> Channel: IAX2/switch/1<number>
> MaxRetries: 0
> WaitTime: 2
> Context: reminder
> Extension: s
> Priority: 1
> Callerid: "Reminder" <555-555-5555>
> 
> Event: Hangup
> Privilege: call,all
> Channel: IAX2/switch-3
> Uniqueid: 1132271784.42
> Cause: 0
> Cause-txt: Unknown
> 
> this is far from detailed. Is there a way to extract the actual DIALSTATUS
> such as ANSWER,BUSY,CONGESION, etc? The Cause doesn't seem to return 0 when
> the call is terminted thru IAX2 or SIP. It seems that it works on ZAP only.

There are two things you could try.

1. Add "Async: yes" to the Originate action, and then watch for the
OriginateSuccess and OriginateFailure events.

2. If that doesn't reveal the wanted information, then I would consider
it a bug, but you could workaround it by using a Local channel:

[outgoing]
exten => _X.,1,Dial(IAX2/switch/1${EXTEN})
exten => _X.,2,UserEvent(Fail|Dialstatus: ${DIALSTATUS})

Then in your Originate action use Channel: Local/<number>@outgoing
and look for the UserEventFail event.

Hope this helps!
Cheers
Tony
-- 
Tony Mountifield
Work: [EMAIL PROTECTED] - http://www.softins.co.uk
Play: [EMAIL PROTECTED] - http://tony.mountifield.org
_______________________________________________
--Bandwidth and Colocation sponsored by Easynews.com --

Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to