Another case here.
Scenario:
A SIP phone start a call to an external number routed via a BRI ISDN.
I have stripped any redundand message not related to the call, like RR and so on.
1) Called phone rings, the called answer, conversation start.
To help keeping logs short i am only reporting the call connect phase frames to note the time.
-- NT->TE - unit:09 frame:000115 - time:05.08 20:08:16.297248 - length:28 ----
L2 00 02 000000-- SAPI = 0 (Call Control)
------1- C/R = Command
-------0 Extension Bit = 0 (with extension, octet follows)
L2 01 01 0000000- TEI = 0 = 0x00 (Non-automatic TEI)
-------1 Extension Bit = 1 (no extension, final octet)
L2 02 D0 1101000- N(S) = 104 (send sequence number)
-------0 I-Frame: Information transfer
L2 03 DC 1101110- N(R) = 110 (receive sequence number)
-------0 P/F, Poll = No Immediate Response Required
L3 04 08 00001000 Protocol = Q.931/I.451/DSS1 (0x08)
L3 05 01 0000---- Call Reference
----0001 Call Reference length is 1 byte
L3 06 8B 1------- Call Reference is sent to call originator
-0001011 Call Reference = 11 = 0x0b
L3 07 07 0------- Message type extension = 0
-0000111 Message type = CONNECT (0x07)
L3 08 29 0------- Variable length Information element
-0101001 IE = date/time
L3 09 05 00000101 IE Length = 5 bytes
L3 0A 14 00010100 Year = 08
L3 0B 01 00000001 Month = 08
L3 0C 15 00010101 Day = 05
L3 0D 04 00000100 Hour = 20
L3 0E 20 00100000 Minute = 08
L3 0F 00 00000000 Second = 16 (invalid offset)
0------- Variable length Information element
-1001100 IE = connected number
L3 10 0B 00001011 IE Length = 11 bytes
L3 11 80 1------- Extension Bit = 1 (no extension, final octet)
-000---- Type = Unknown
----0000 Plan = Unknown (0x0)
L3 12 30 00110000 Number digit = 0
L3 13 36 00110110 Number digit = 6
L3 14 35 00110101 Number digit = 5
L3 15 35 00110101 Number digit = 5
L3 16 35 00110101 Number digit = 5
L3 17 35 00110101 Number digit = 5
L3 18 31 00110001 Number digit = 1
L3 19 31 00110001 Number digit = 1
L3 1A 31 00110001 Number digit = 1
L3 1B 31 00110001 Number digit = 1
-- TE->NT - unit:09 frame:000116 - time:05.08 20:08:16.297297 - length:8 -----
L2 00 00 000000-- SAPI = 0 (Call Control)
------0- C/R = Command
-------0 Extension Bit = 0 (with extension, octet follows)
L2 01 01 0000000- TEI = 0 = 0x00 (Non-automatic TEI)
-------1 Extension Bit = 1 (no extension, final octet)
L2 02 DC 1101110- N(S) = 110 (send sequence number)
-------0 I-Frame: Information transfer
L2 03 D3 1101001- N(R) = 105 (receive sequence number)
-------1 P/F, Poll = Immediate Response Required
L3 04 08 00001000 Protocol = Q.931/I.451/DSS1 (0x08)
L3 05 01 0000---- Call Reference
----0001 Call Reference length is 1 byte
L3 06 0B 0------- Call Reference is sent from call originator
-0001011 Call Reference = 11 = 0x0b
L3 07 0F 0------- Message type extension = 0
-0001111 Message type = CONNECT_ACKNOWLEDGE (0x0f)
2) Now the called part hang-up, then the public network (NT) notify to the pbx (TE). Starting here the network enter the disconnect state.
-- NT->TE - unit:09 frame:000138 - time:05.08 20:08:46.707859 - length:19 ----
L2 00 02 000000-- SAPI = 0 (Call Control)
------1- C/R = Command
-------0 Extension Bit = 0 (with extension, octet follows)
L2 01 01 0000000- TEI = 0 = 0x00 (Non-automatic TEI)
-------1 Extension Bit = 1 (no extension, final octet)
L2 02 E0 1110000- N(S) = 112 (send sequence number)
-------0 I-Frame: Information transfer
L2 03 E4 1110010- N(R) = 114 (receive sequence number)
-------0 P/F, Poll = No Immediate Response Required
L3 04 08 00001000 Protocol = Q.931/I.451/DSS1 (0x08)
L3 05 01 0000---- Call Reference
----0001 Call Reference length is 1 byte
L3 06 8B 1------- Call Reference is sent to call originator
-0001011 Call Reference = 11 = 0x0b
L3 07 45 0------- Message type extension = 0
-1000101 Message type = DISCONNECT (0x45)
L3 08 08 0------- Variable length Information element
-0001000 IE = cause
L3 09 02 00000010 IE Length = 2 bytes
L3 0A 80 1------- Extension Bit = 1 (no extension, final octet)
-00----- Coding standard = CCITT
---0---- Spare
----0000 Location = User
L3 0B 90 1------- Extension Bit = 1 (no extension, final octet)
-0010000 Cause = 16: Q.850: normal call clearing
L3 0C 29 0------- Variable length Information element
-0101001 IE = date/time
L3 0D 05 00000101 IE Length = 5 bytes
L3 0E 14 00010100 Year = 08
L3 0F 01 00000001 Month = 08
L3 10 15 00010101 Day = 05
L3 11 04 00000100 Hour = 20
L3 12 21 00100001 Minute = 08
L3 13 00 00000000 Second = 46
3) But the calling extension does nothing leaving the phone (hands free) off-hook.
Note that the DISCONNECT message do not contain the progress indicator #8 (isn't mandatory), no tones/inband info is available.
Here the calling phone remain silent.
After a number of fake STATUS_ENQUIRY from pbx about call reference 0x127 (stripped), the pbx do some STATUS_ENQUIRY about our call (0x0b) but again do nothing to clear it.
-- TE->NT - unit:09 frame:000149 - time:05.08 20:08:54.710670 - length:8 -----
L2 00 00 000000-- SAPI = 0 (Call Control)
------0- C/R = Command
-------0 Extension Bit = 0 (with extension, octet follows)
L2 01 01 0000000- TEI = 0 = 0x00 (Non-automatic TEI)
-------1 Extension Bit = 1 (no extension, final octet)
L2 02 EA 1110101- N(S) = 117 (send sequence number)
-------0 I-Frame: Information transfer
L2 03 E7 1110011- N(R) = 115 (receive sequence number)
-------1 P/F, Poll = Immediate Response Required
L3 04 08 00001000 Protocol = Q.931/I.451/DSS1 (0x08)
L3 05 01 0000---- Call Reference
----0001 Call Reference length is 1 byte
L3 06 0B 0------- Call Reference is sent from call originator
-0001011 Call Reference = 11 = 0x0b
L3 07 75 0------- Message type extension = 0
-1110101 Message type = STATUS_ENQUIRY (0x75)
-- NT->TE - unit:09 frame:000151 - time:05.08 20:08:54.742722 - length:15 ----
L2 00 02 000000-- SAPI = 0 (Call Control)
------1- C/R = Command
-------0 Extension Bit = 0 (with extension, octet follows)
L2 01 01 0000000- TEI = 0 = 0x00 (Non-automatic TEI)
-------1 Extension Bit = 1 (no extension, final octet)
L2 02 E6 1110011- N(S) = 115 (send sequence number)
-------0 I-Frame: Information transfer
L2 03 EC 1110110- N(R) = 118 (receive sequence number)
-------0 P/F, Poll = No Immediate Response Required
L3 04 08 00001000 Protocol = Q.931/I.451/DSS1 (0x08)
L3 05 01 0000---- Call Reference
----0001 Call Reference length is 1 byte
L3 06 8B 1------- Call Reference is sent to call originator
-0001011 Call Reference = 11 = 0x0b
L3 07 7D 0------- Message type extension = 0
-1111101 Message type = STATUS (0x7d)
L3 08 08 0------- Variable length Information element
-0001000 IE = cause
L3 09 02 00000010 IE Length = 2 bytes
L3 0A 80 1------- Extension Bit = 1 (no extension, final octet)
-00----- Coding standard = CCITT
---0---- Spare
----0000 Location = User
L3 0B 9E 1------- Extension Bit = 1 (no extension, final octet)
-0011110 Cause = 30: Q.850: response to STATUS ENQUIRY
L3 0C 14 0------- Variable length Information element
-0010100 IE = call state
L3 0D 01 00000001 IE Length = 1 bytes
L3 0E 0B -00----- Coding standard = CCITT
---01011 state = Disconnect request
4) After 30 seconds the network call for a RELEASE because it's T305 timer for the disconnect state elapsed.
-- NT->TE - unit:09 frame:000161 - time:05.08 20:09:16.703139 - length:19 ----
L2 00 02 000000-- SAPI = 0 (Call Control)
------1- C/R = Command
-------0 Extension Bit = 0 (with extension, octet follows)
L2 01 01 0000000- TEI = 0 = 0x00 (Non-automatic TEI)
-------1 Extension Bit = 1 (no extension, final octet)
L2 02 EC 1110110- N(S) = 118 (send sequence number)
-------0 I-Frame: Information transfer
L2 03 F0 1111000- N(R) = 120 (receive sequence number)
-------0 P/F, Poll = No Immediate Response Required
L3 04 08 00001000 Protocol = Q.931/I.451/DSS1 (0x08)
L3 05 01 0000---- Call Reference
----0001 Call Reference length is 1 byte
L3 06 8B 1------- Call Reference is sent to call originator
-0001011 Call Reference = 11 = 0x0b
L3 07 4D 0------- Message type extension = 0
-1001101 Message type = RELEASE (0x4d)
L3 08 08 0------- Variable length Information element
-0001000 IE = cause
L3 09 02 00000010 IE Length = 2 bytes
L3 0A 80 1------- Extension Bit = 1 (no extension, final octet)
-00----- Coding standard = CCITT
---0---- Spare
----0000 Location = User
L3 0B 90 1------- Extension Bit = 1 (no extension, final octet)
-0010000 Cause = 16: Q.850: normal call clearing
L3 0C 29 0------- Variable length Information element
-0101001 IE = date/time
L3 0D 05 00000101 IE Length = 5 bytes
L3 0E 14 00010100 Year = 08
L3 0F 01 00000001 Month = 08
L3 10 15 00010101 Day = 05
L3 11 04 00000100 Hour = 20
L3 12 21 00100001 Minute = 09
L3 13 00 00000000 Second = 16 (invalid offset)
5) finally this event is good enough for our PBX realease the call!
-- TE->NT - unit:09 frame:000162 - time:05.08 20:09:16.703208 - length:12 ----
L2 00 00 000000-- SAPI = 0 (Call Control)
------0- C/R = Command
-------0 Extension Bit = 0 (with extension, octet follows)
L2 01 01 0000000- TEI = 0 = 0x00 (Non-automatic TEI)
-------1 Extension Bit = 1 (no extension, final octet)
L2 02 F0 1111000- N(S) = 120 (send sequence number)
-------0 I-Frame: Information transfer
L2 03 EF 1110111- N(R) = 119 (receive sequence number)
-------1 P/F, Poll = Immediate Response Required
L3 04 08 00001000 Protocol = Q.931/I.451/DSS1 (0x08)
L3 05 01 0000---- Call Reference
----0001 Call Reference length is 1 byte
L3 06 0B 0------- Call Reference is sent from call originator
-0001011 Call Reference = 11 = 0x0b
L3 07 5A 0------- Message type extension = 0
-1011010 Message type = RELEASE_COMPLETE (0x5a)
L3 08 08 0------- Variable length Information element
-0001000 IE = cause
L3 09 02 00000010 IE Length = 2 bytes
L3 0A 80 1------- Extension Bit = 1 (no extension, final octet)
-00----- Coding standard = CCITT
---0---- Spare
----0000 Location = User
L3 0B E6 1------- Extension Bit = 1 (no extension, final octet)
-1100110 Cause = 102: Q.850: recovery on timer expiry
I have no idea to know if the problem is in i4BSD or in chan capi.
May be someone look this as a minor problem but there are almost two things to consider.
We can see the first evident one on the call logs:
Aug 05 20:08:08 698 33411112222 SIP/698-0876a000 -> CAPI/9/003933411112222 Dial( CAPI/9/003933411112222/bl||To ) 68 60 ANSWERED
Real call duration is 30 seconds but you get 60 seconds billable time, 30 real + 30 network time out.
The billable time must be stopped at the DISCONNECT message because the network drop the B channel so no audio stream is longer avalilable.
May be this problem is in chan_capi?
The least thing, but not last, it's about telecom regulations.
Here in the DISCONNECT message we do not have inband audio (no disconnect tome), the pbx must send a RELEASE COMPLETE to the network, not waiting a timeout, as per ETSI rules in ETS 300 102-1 (5.3.4.2):
ETS 300 102-1: December 1990
5.3.4.2 Clearing when tones/announcements not provided
When in-band tones/announcements are not provided, the DISCONNECT message does not contain
progress indicator #8 "in-band information or appropriate pattern now available". The network shall initiate
clearing by: sending the DISCONNECT message; starting timer T305; disconnecting the B-channel; and
entering the Disconnect Indication state.
On the receipt of the DISCONNECT message without progress indicator #8, the user shall: disconnect the
B-channel; send a RELEASE message; start timer T308; and enter the Release Request state.
On receipt of the RELEASE message, the network shall: stop timer T305; release the B-channel; send a
RELEASE COMPLETE message; release the call reference; and return to the Null state.
If timer T305 expires, the network shall: send a RELEASE message to the user with the cause number
originally contained in the DISCONNECT message; start timer T308; and enter the Release Request state.
In addition to the original clearing cause, the RELEASE message may contain a second cause information
element with cause #102 "recovery on timer expiry".
Don't worry Michael i just want contribute to have a better Askozia in the near future... [IT]un inglese non abbastanza buono per essere gentile :-))[/IT]