Dev-scatch: Difference between revisions

From 탱이의 잡동사니
Jump to navigation Jump to search
No edit summary
Line 3: Line 3:


== Asterisk ==
== Asterisk ==
=== Fixing Dial event ===
For the first Dial ARI event, it comes with dialstate: "", always.
This should be fixed to dialsatate: "initial" something.
=== Make reason for mandatory ===
=== Make reason for mandatory ===
Currently, the Asterisk doesn't set the reason field as a requirement. It makes hard to use the ChannelHangupRequest and ChannelDestroyed event.
Currently, the Asterisk doesn't set the reason field as a requirement. It makes hard to use the ChannelHangupRequest and ChannelDestroyed event.

Revision as of 06:33, 30 April 2019

Overview

Simple development scatch for myself.

Asterisk

Fixing Dial event

For the first Dial ARI event, it comes with dialstate: "", always.

This should be fixed to dialsatate: "initial" something.

Make reason for mandatory

Currently, the Asterisk doesn't set the reason field as a requirement. It makes hard to use the ChannelHangupRequest and ChannelDestroyed event.

Add more Hangup reason

Currently, DELETE /ari/channels/<channelID> supports only few hangup reason.

res/ari/resource_channels.c <source lang=c> if (ast_strlen_zero(args->reason) || !strcmp(args->reason, "normal")) { cause = AST_CAUSE_NORMAL; } else if (!strcmp(args->reason, "busy")) { cause = AST_CAUSE_BUSY; } else if (!strcmp(args->reason, "congestion")) { cause = AST_CAUSE_CONGESTION; } else if (!strcmp(args->reason, "no_answer")) { cause = AST_CAUSE_NOANSWER; } else if(!strcmp(args->reason, "answered_elsewhere")) { cause = AST_CAUSE_ANSWERED_ELSEWHERE; } else { ast_ari_response_error( response, 400, "Invalid Reason", "Invalid reason for hangup provided"); return; } </source>