Je vais répondre pour partager l’expérience, après avoir fait le debug q.931 il se trouve que l'operateur ne fait pas le TERMINAL RELEASE immédiatement.

Il se passe une chose êtrange, l'appel arrive sur la patton:


SETUP (DSS1 User)
[A1]
Sending complete
[04038090A3]
Bearer capability : speech - CCITT
circuit mode - 64kBit/s - G.711 A-law
[180189]
Channel id : 1 - exclusive
basic rate interface - is not d-channel - CCITT - b-channel units
[6C0B2183363233323431363836]
Calling party number : 888888888
national number - E.164 numbering plan
presentation allowed - network provided
[700AA1343938303730333437]
Called party number : 999999999
national number - E.164 numbering plan
[740C21008F343934303532323332]
Redirecting number : 123246546
national number - E.164 numbering plan
presentation allowed - user provided not screened
Call forwarding unconditional or systematic call redirection
[7D029181]
High layer compatibility : telephony
CCITT
Il est renvoyé vers asterisk, et asterisk décroche:


03:07:02 ICC > [EP 4_in_out-0109b558] State: NULL, Event: TERMINAL SETUP IND
03:07:02 ICC > [EP 4_in_out-0109b558] Set state to CALL PRESENT
03:07:02 ICC > [EP 4_in_out-0109b558] set call key: 1961
03:07:02 CC > [EP 4_in_out-0109b558/active] Set call-leg property: E164-Number -> 9999999999
03:07:02 CC > [EP 4_in_out-0109b558/active] Set call-leg property: Type-Of-Number -> Unknown
03:07:02 CC > [EP 4_in_out-0109b558/active] Set call-leg property: Numbering-Plan -> ISDN/Telephony numbering plan
03:07:02 CC > [EP 4_in_out-0109b558/active] Set call-leg property: Presentation-Indicator -> Presentation allowed
03:07:02 CC > [EP 4_in_out-0109b558/active] Set call-leg property: Screening-Indicator -> Network provided
03:07:02 CC > [EP 4_in_out-0109b558/active] Set call-leg property: Name ->
03:07:02 CC > [EP 4_in_out-0109b558/active] Set call-leg property: Supports Overlap-Sending -> false
03:07:02 CC > [EP 4_in_out-0109b558/active] Set call-leg property: Redirecting-E164-Number -> 9999999999
03:07:02 CC > [EP 4_in_out-0109b558/active] Set call-leg property: Redirecting-Reason -> Call forwarding unconditional or systematic call redirection
03:07:02 CC > [EP 4_in_out-0109b558/active] Set call-leg property: Redirecting-Counter -> 0x00000001
03:07:02 CC > [EP 4_in_out-0109b558/active] Set call-leg property: Unique Identifier -> 1961
03:07:02 CC > [EP 4_in_out-0109b558/active] Set call-leg property: Endpoint-Is-Isdn -> true
03:07:02 CC > [EP 4_in_out-0109b558/active] Set call-leg property: Quality-Of-Service -> MOS 4.50, DS0
03:07:02 CC > [EP 4_in_out-0109b558/active] Set call-leg property: Network -> 4_in_out
03:07:02 CC > [EP 4_in_out-0109b558/active] Set call-leg property: Call-Leg-ID -> 0x00aac958
03:07:02 CC > [EP 4_in_out-0109b558/active] Set call-leg property: State -> CONNECTED
03:07:02 ICC > [EP 4_in_out-0109b558] Set state to INCOMING PROCEEDING
03:07:02 ICC > [EP 4_in_out-0109b558] >> [080002]
CALL PROCEEDING (DSS1 User)
[1E028582]
Progress indicator : destination address is non-ISDN
private network serving remote user - CCITT

03:07:03 ICC > [EP 4_in_out-0109b558] State: INCOMING PROCEEDING, Event: PEER TRYING
03:07:03 ICC > [EP 4_in_out-0109b558] Hold State: IDLE, Hold Event: PEER TRYING
03:07:03 ICC > [EP 4_in_out-0109b558] State: INCOMING PROCEEDING, Event: PEER CONNECTED
03:07:03 ICC > [EP 4_in_out-0109b558] Set state to CONNECT REQUEST
03:07:03 ICC > [EP 4_in_out-0109b558] >> [080007]
CONNECT (DSS1 User)

03:07:03 ICC > [EP 4_in_out-0109b558] Hold State: IDLE, Hold Event: PEER CONNECTED
03:07:03 ICC > [EP 4_in_out-0109b558] State: CONNECT REQUEST, Event: PEER INBAND INFO
03:07:04 ICC > [4_in_out] << Message: primitive=59
03:07:04 ICC > [EP 4_in_out-0109b558] << [08000F]
CONNECT ACKNOWLEDGEMENT (DSS1 User)

03:07:04 ICC > [EP 4_in_out-0109b558] State: CONNECT REQUEST, Event: TERMINAL SETUP COMP IND
03:07:04 ICC > [EP 4_in_out-0109b558] Set state to ACTIVE
03:07:04 CC > [EP 4_in_out-0109b558/active] Set call-leg property: Provides Data -> true
03:07:07 CC > [EP IF_SIP-010688a0/active] Set call-leg property: Quality-Of-Service -> MOS 3.78, RTP, G.711 u-law (20ms), Local: Rx 188 pkts, 30080 bytes, 0 lost$
3 secondes après le client raccroche, et on reçoit DISCONNECT par T0:


03:07:07 ICC > [4_in_out] << Message: primitive=34
03:07:07 ICC > [EP 4_in_out-0109b558] << [080045]
DISCONNECT (DSS1 User)
[08028290]
Cause : normal call clearing
public network serving local user - CCITT - Q.931
[1E028288]
Progress indicator : inband information available
public network serving local user - CCITT
Il est possible de le voir sur la graphique:



Mais patton n'envoie pas le BYE vers asterisk elle se met a générer le son de raccroché (seconde partie de graphique) et en bleue sur les traces:

03:07:07 ICC > [EP 4_in_out-0109b558] State: ACTIVE, Event: TERMINAL DISCONNECT IND
03:07:07 CC > [EP 4_in_out-0109b558/active] Set call-leg property: Cause -> Normal call clearing
03:07:07 ICC > [EP 4_in_out-0109b558] Set state to DISCONNECT INDICATION
03:07:07 CC > [EP 4_in_out-0109b558/active] Set call-leg property: State -> DISCONNECTING
Elle raccroche la communication au bout de 30 secondes, parce que le terminal release arrive trop tard:


03:07:37 ICC > [EP 4_in_out-0109b558] << [08004D]
RELEASE (DSS1 User)
[08028290]
Cause : normal call clearing
public network serving local user - CCITT - Q.931

03:07:37 ICC > [EP 4_in_out-0109b558] State: DISCONNECT INDICATION, Event: TERMINAL RELEASE IND
03:07:37 ICC > [EP 4_in_out-0109b558] Set state to NULL
03:07:37 CC > [EP 4_in_out-0109b558/active] Drop call 01078450
03:07:37 CC > [EP 4_in_out-0109b558/active] Set call-leg property: Provides Data -> false
03:07:37 CC > [EP 4_in_out-0109b558/active] Set call-leg property: State -> RELEASED
Par moment ce terminal release n'arrive jamais, il est possible en theorie de demander a patton de raccrocher avec l'option "Early Disconnect" dans la gateway SIP.



Cette option est désactivé par défaut. J'ai absolument pas ce comportement chez mes client ailleurs (même opérateur). J’espère que ça va aider les personnes qui vont tomber dans le même panneau.