Consider the following scenario in Asterisk 13, when I am monitoring the log via AMI:
An originator (51999887766), external to my PBX makes a call, which, through a distribution queue (192), is connected to one of my attendants. After my attendant has connected the call, the attendant makes a blind transfer to another queue (444), and the call with the attendant’s extension (135) is terminated, where I receive a Hangup event via AMI.
BlindTransfer Event from my attendant extension
Event: BlindTransfer
Privilege: call,all
Result: Success
TransfererChannel: SIP/135-00000294
TransfererChannelState: 6
TransfererChannelStateDesc: Up
TransfererCallerIDNum: 135
TransfererCallerIDName: TARM 135
TransfererConnectedLineNum: 51999887766
TransfererConnectedLineName: 51999887766
TransfererLanguage: en
TransfererAccountCode:
TransfererContext: from-internal
TransfererExten: 192
TransfererPriority: 1
TransfererUniqueid: 1722012249.660
TransfererLinkedid: 1722012242.659
TransfereeChannel: SIP/Elastix-00000293
TransfereeChannelState: 6
TransfereeChannelStateDesc: Up
TransfereeCallerIDNum: 51999887766
TransfereeCallerIDName: 51999887766
TransfereeConnectedLineNum: 135
TransfereeConnectedLineName: TARM 135
TransfereeLanguage: en
TransfereeAccountCode:
TransfereeContext: from-internal-xfer
TransfereeExten: 192
TransfereePriority: 40
TransfereeUniqueid: 1722012242.659
TransfereeLinkedid: 1722012242.659
BridgeUniqueid: fe9bbb0d-bcf0-4d26-a9e1-ce8ae655f56c
BridgeType: basic
BridgeTechnology: simple_bridge
BridgeCreator: <unknown>
BridgeName: <unknown>
BridgeNumChannels: 2
BridgeVideoSourceMode: none
IsExternal: Yes
Context: from-internal-xfer
Extension: 444
Hangup Event for my attendant extension
Event: Hangup
Privilege: call,all
Channel: SIP/135-00000294
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 135
CallerIDName: TARM 135
ConnectedLineNum: 51999887766
ConnectedLineName: 51999887766
Language: en
AccountCode:
Context: from-internal
Exten: 192
Priority: 1
Uniqueid: 1722012249.660
Linkedid: 1722012242.659
Cause: 16
Cause-txt: Normal Clearing
While the originator is in the queue, the originator hangs up and the call is ended, and at this moment I receive a HangupRequest event, however in this event ConnectedLineNum attribute is being signaled as still connected to the extension of my attendant who had already transferred the call earlier.
Event: HangupRequest
Privilege: call,all
Channel: SIP/Elastix-00000293
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 51999887766
CallerIDName: 51999887766
ConnectedLineNum: 135
ConnectedLineName: TARM 135
Language: en
AccountCode:
Context: from-internal-xfer
Exten: 444
Priority: 39
Uniqueid: 1722012242.659
Linkedid: 1722012242.659
Why?
This gets worse, when another attendant (158) retrieves the call that was in the queue, and the originator ends the call, it is still signaled in the AMI that the ConnectedLineNum is the previous extension (135).
Event: HangupRequest
Privilege: call,all
Channel: SIP/Elastix-0000028c
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 51992812162
CallerIDName: 51992812162
ConnectedLineNum: 135
ConnectedLineName: TARM 135
Language: en
AccountCode:
Context: macro-dial-one
Exten: s
Priority: 55
Uniqueid: 1722010500.652
Linkedid: 1722010500.652
And I will only see the Hangup event related to extension 158, only here:
Event: HangupHandlerRun
Privilege: dialplan,all
Channel: SIP/158-0000028e
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 158
CallerIDName: REG 158
ConnectedLineNum: 51992812162
ConnectedLineName: 51992812162
Language: en
AccountCode:
Context: macro-dial-one
Exten: s
Priority: 1
Uniqueid: 1722010558.654
Linkedid: 1722010500.652
Handler: crm-hangup,s,1
Does anyone know how to explain the reason for this?