Added variable DISCONNECT_IND_REASON when DISCONNECT_IND is received.
parent
c5f9794303
commit
a4f7b18361
1
CHANGES
1
CHANGES
|
@ -10,6 +10,7 @@ HEAD
|
|||
- Fixed memory leak in chat_play if using with 's' option
|
||||
- Add 'econtransitconn' configurations parameter. Allows to preserve
|
||||
EC for transit connections
|
||||
- added variable DISCONNECT_IND_REASON to get real reason code from CAPI
|
||||
|
||||
chan_capi-1.1.5
|
||||
------------------
|
||||
|
|
7
README
7
README
|
@ -530,6 +530,13 @@ CONNECTEDNUMBER
|
|||
Can be set before answering and if set, the content is used for
|
||||
IE 'Connected Number' on answering.
|
||||
|
||||
DISCONNECT_IND_REASON
|
||||
When CAPI reports DISCONNECT_IND, some CAPI reason codes are not set
|
||||
in HANGUPCAUSE, because they are not valid cause codes. To also
|
||||
get those CAPI reason codes, you can check this variable on hangup.
|
||||
This is e.g. useful for reason 0x3301, which tells that the ISDN
|
||||
connection is physically broken (cable).
|
||||
|
||||
FAXEXTEN
|
||||
If chan_capi sends the call to extensions 'fax', the original extension number
|
||||
is saved in this variable.
|
||||
|
|
20
chan_capi.c
20
chan_capi.c
|
@ -4698,6 +4698,7 @@ static void capidev_handle_disconnect_indication(_cmsg *CMSG, unsigned int PLCI,
|
|||
{
|
||||
struct ast_frame fr = { AST_FRAME_CONTROL, };
|
||||
int state;
|
||||
char buffer[CAPI_MAX_STRING];
|
||||
|
||||
FRAME_SUBCLASS_INTEGER(fr.subclass) = AST_CONTROL_HANGUP;
|
||||
|
||||
|
@ -4717,13 +4718,18 @@ static void capidev_handle_disconnect_indication(_cmsg *CMSG, unsigned int PLCI,
|
|||
|
||||
i->reason = DISCONNECT_IND_REASON(CMSG);
|
||||
|
||||
if ((i->owner) && (i->owner->hangupcause == 0)) {
|
||||
/* set hangupcause, in case there is no
|
||||
* "cause" information element:
|
||||
*/
|
||||
i->owner->hangupcause =
|
||||
((i->reason & 0xFF00) == 0x3400) ?
|
||||
i->reason & 0x7F : AST_CAUSE_NORMAL_CLEARING;
|
||||
if (i->owner) {
|
||||
if (i->owner->hangupcause == 0) {
|
||||
/* set hangupcause, in case there is no
|
||||
* "cause" information element:
|
||||
*/
|
||||
i->owner->hangupcause =
|
||||
((i->reason & 0xFF00) == 0x3400) ?
|
||||
i->reason & 0x7F : AST_CAUSE_NORMAL_CLEARING;
|
||||
}
|
||||
/* the real reason could be != 0x34xx, so provide this value in variable */
|
||||
sprintf(buffer, "%d", i->reason);
|
||||
pbx_builtin_setvar_helper(i->owner, "DISCONNECT_IND_REASON", buffer);
|
||||
}
|
||||
|
||||
if (i->FaxState & CAPI_FAX_STATE_ACTIVE) {
|
||||
|
|
Loading…
Reference in New Issue