[Home]

Summary:ASTERISK-07994: Calling from SIP to ISDN via ZAP - hangup problem
Reporter:radon (radon)Labels:
Date Opened:2006-10-24 11:32:13Date Closed:2006-10-24 15:09:13
Priority:BlockerRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:When I call from SIP phone through ISDN card to PSTN and I hangup SIP phone, called side is continuing to ring and ring and ring ... I must manually press cancel on called site to cancel ringing.

---

Same problem tested on systems with software:
Gentoo - kernel 2.6.17-gentoo-r8 and vanilla kernel 2.6.15
Debian testing
Asterisk v. 1.2.10(debian), 1.2.12.1(debian, gentoo), 1.2.13(debian, gentoo)
Zaptel v. 1.2.9.1 (gentoo), 1.2.9.1.dfsg-2 (debian)
Libpri v. 1.2.3-1 (debian),  1.2.3-r1(gentoo)
Everything with BRIstuff patch.
---
HW isdn card:
02:0a.0 Network controller: Cologne Chip Designs GmbH ISDN network controller [HFC-PCI] (rev 02)
       Subsystem: Cologne Chip Designs GmbH ISDN Board
       Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
       Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
       Latency: 16 (4000ns max)
       Interrupt: pin A routed to IRQ 3
       Region 0: I/O ports at dff0 [disabled] [size=8]
       Region 1: Memory at feafec00 (32-bit, non-prefetchable) [size=256]
       Capabilities: [40] Power Management version 1
               Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold-)
               Status: D0 PME-Enable- DSel=0 DScale=0 PME+
---
Tested with hardware ip phone (Grandstream GXP-2000) and with software sip phone (x-lite).
---
I think it isn't hw problem, with mISDN it works ok.


****** ADDITIONAL INFORMATION ******

===============================================
Zaptel configuration
===============================================
iprouter ~ # modprobe zaptel
iprouter ~ # modprobe zaphfc
iprouter ~ # ztcfg -vv

SPAN 1: CCS/ AMI Build-out: 399-533 feet (DSX-1)

Channel map:

Channel 01: Clear channel (Default) (Slaves: 01)
Channel 02: Clear channel (Default) (Slaves: 02)
Channel 03: D-channel (Default) (Slaves: 03)

3 channels configured.

Changing signalling on channel 1 from Unused to Clear channel
Changing signalling on channel 2 from Unused to Clear channel
Changing signalling on channel 3 from Unused to HDLC with FCS check

---
From dmesg:
Zapata Telephony Interface Registered on major 196
Zaptel Version: 1.2.9.1 Echo Canceller: MG2
ACPI: PCI Interrupt Link [LNKG] enabled at IRQ 3
PCI: setting IRQ 3 as level-triggered
ACPI: PCI Interrupt 0000:02:0a.0[A] -> Link [LNKG] -> GSI 3 (level, low) -> IRQ 3
zaphfc: CCD/Billion/Asuscom 2BD0 configured at mem e0d02c00 fifo de8e8000(0x1e8e8000) IRQ 3 HZ 250
zaphfc: Card 0 configured for TE mode
zaphfc: 1 hfc-pci card(s) in this box.
Registered tone zone 3 (Netherlands)

Note:
I tried set loadzone/defaultzone in zaptel.conf with nl and cz (many ppl in cz runs it with nl ok).
--------------------------------------------------------------------

Configuration of zaptel.conf/zapata.conf

cat zapata.conf
;
; Zapata telephony interface
;
; Configuration file

[channels]
;
; Default language
;
language=cz
;
; Default context
;
;
switchtype = euroisdn
; p2mp TE mode
signalling = bri_cpe_ptmp

; p2p TE mode
;signalling = bri_cpe
; p2mp NT mode
;signalling = bri_net_ptmp
; p2p NT mode
;signalling = bri_net

pridialplan = dynamic
prilocaldialplan = local

nationalprefix =
internationalprefix = 00

echocancel=yes
echotraining = 100
echocancelwhenbridged=no

immediate=no
group = 1
context=isdn
channel => 1-2


cat zaptel.conf
# hfc-s pci a span definition
# most of the values should be bogus because we are not really zaptel
loadzone=nl
defaultzone=nl

#span=1,1,3,ccs,hdb3,crc4
span=1,1,3,ccs,ami
bchan=1-2
dchan=3

-------------------------------------------------------------------

Debug log:

iprouter*CLI> set verbose 5
iprouter*CLI> set debug 5
iprouter*CLI> sip debug
iprouter*CLI> pri debug span 1

---------

We are starting call from sip phone to ISDN

iprouter*CLI>
<-- SIP read from 89.76.27.25:5060:
INVITE sip:1005@83.10.21.42 SIP/2.0
Via: SIP/2.0/UDP 192.168.2.99:5060;branch=z9hG4bK71c64ba884b528f0
From: "peta" <sip:peta@83.10.21.42>;tag=d0beb7cc0faad732
To: <sip:1005@83.10.21.42>
Contact: <sip:peta@192.168.2.99:5060>
Supported: replaces, timer
Call-ID: d65e78c8ec10bfd3@192.168.2.99
CSeq: 20716 INVITE
User-Agent: Grandstream GXP2000 1.1.1.11
Max-Forwards: 70
Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK,MESSAGE
ontent-Type: application/sdp
Content-Length: 252

v=0
o=peta 8000 8000 IN IP4 192.168.2.99
s=SIP Call
c=IN IP4 192.168.2.99
t=0 0
m=audio 5004 RTP/AVP 3 8 18 4 0
a=sendrecv
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=rtpmap:4 G723/8000
a=rtpmap:0 PCMU/8000
a=ptime:20

--- (13 headers 13 lines) ---
Using INVITE request as basis request - d65e78c8ec10bfd3@192.168.2.99
Sending to 192.168.2.99 : 5060 (NAT)
Reliably Transmitting (NAT) to 89.76.27.25:5060:
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 192.168.2.99:5060;branch=z9hG4bK71c64ba884b528f0;received=89.76.27.25
From: "peta" <sip:peta@83.10.21.42>;tag=d0beb7cc0faad732
To: <sip:1005@83.10.21.42>;tag=as3450040d
Call-ID: d65e78c8ec10bfd3@192.168.2.99
CSeq: 20716 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Proxy-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="0e74039f"
Content-Length: 0


---
Scheduling destruction of call 'd65e78c8ec10bfd3@192.168.2.99' in 15000 ms
Found user 'peta'
iprouter*CLI>
<-- SIP read from 89.76.27.25:5060:
ACK sip:1005@83.10.21.42 SIP/2.0
Via: SIP/2.0/UDP 192.168.2.99:5060;branch=z9hG4bK71c64ba884b528f0
From: "peta" <sip:peta@83.10.21.42>;tag=d0beb7cc0faad732
To: <sip:1005@83.10.21.42>;tag=as3450040d
Contact: <sip:peta@192.168.2.99:5060>
Call-ID: d65e78c8ec10bfd3@192.168.2.99
CSeq: 20716 ACK
User-Agent: Grandstream GXP2000 1.1.1.11
Max-Forwards: 70
Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK,MESSAGE
Content-Length: 0    


--- (11 headers 0 lines) ---
iprouter*CLI>
<-- SIP read from 89.76.27.25:5060:
INVITE sip:1005@83.10.21.42 SIP/2.0
Via: SIP/2.0/UDP 192.168.2.99:5060;branch=z9hG4bKbe09fc25bf3c4bf9
From: "peta" <sip:peta@83.10.21.42>;tag=d0beb7cc0faad732
To: <sip:1005@83.10.21.42>
Contact: <sip:peta@192.168.2.99:5060>
Supported: replaces, timer
Proxy-Authorization: Digest username="peta", realm="asterisk", algorithm=MD5, uri="sip:1005@83.10.21.42", nonce="0e74039f", response="dd0ce75d46647fa8163f8a7b57127eee"
Call-ID: d65e78c8ec10bfd3@192.168.2.99
CSeq: 20717 INVITE
User-Agent: Grandstream GXP2000 1.1.1.11
Max-Forwards: 70
Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK,MESSAGE
Content-Type: application/sdp
Content-Length: 252

v=0
o=peta 8000 8001 IN IP4 192.168.2.99
s=SIP Call
c=IN IP4 192.168.2.99
t=0 0
m=audio 5004 RTP/AVP 3 8 18 4 0
a=sendrecv
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=rtpmap:4 G723/8000
a=rtpmap:0 PCMU/8000
a=ptime:20

--- (14 headers 13 lines) ---
Using INVITE request as basis request - d65e78c8ec10bfd3@192.168.2.99
Sending to 192.168.2.99 : 5060 (NAT)
Found user 'peta'
Found RTP audio format 3
Found RTP audio format 8
Found RTP audio format 18
Found RTP audio format 4
Found RTP audio format 0
Peer audio RTP is at port 192.168.2.99:5004
Found description format GSM
Found description format PCMA
Found description format G729
Found description format G723
Found description format PCMU
Capabilities: us - 0x11e (gsm|ulaw|alaw|g726|g729), peer - audio=0x10f (g723|gsm|ulaw|alaw|g729)/video=0x0 (nothing), combined - 0x10e (gsm|ulaw|alaw|g729)
Non-codec capabilities: us - 0x1 (telephone-event), peer - 0x0 (nothing), combined - 0x0 (nothing)
Looking for 1005 in internal (domain 83.10.21.42)
list_route: hop: <sip:peta@192.168.2.99:5060>
Transmitting (NAT) to 89.76.27.25:5060:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.2.99:5060;branch=z9hG4bKbe09fc25bf3c4bf9;received=89.76.27.25
From: "peta" <sip:peta@83.10.21.42>;tag=d0beb7cc0faad732
To: <sip:1005@83.10.21.42>
Call-ID: d65e78c8ec10bfd3@192.168.2.99
CSeq: 20717 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: <sip:1005@83.10.21.42>
Content-Length: 0


---
   -- Executing Dial("SIP/peta-0817f350", "Zap/g1/603961234||r") in new stack
1 -- Making new call for cr 131
   -- Requested transfer capability: 0x00 - SPEECH
1 > Protocol Discriminator: Q.931 (8)  len=33
1 > Call Ref: len= 1 (reference 3/0x3) (Originator)
1 > Message type: SETUP (5)
1 > [1 041  031  801  901  a31 ]
1 > Bearer Capability (len= 5) [ Ext: 1  Q.931 Std: 0  Info transfer capability: Speech (0)
1 >                              Ext: 1  Trans mode/rate: 64kbps, circuit-mode (16)
1 >                              Ext: 1  User information layer 1: A-Law (35)
1 > [1 181  011  811 ]
1 > Channel ID (len= 3) [ Ext: 1  IntID: Implicit, Other Spare: 0, Preferred Dchan: 0
1 >                        ChanSel: B1 channel
1                          ]
1 > [1 6c1  061  411  811  701  651  741  611 ]
1 > Calling Number (len= 8) [ Ext: 0  TON: Subscriber Number (4)  NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1)
1 >                           Presentation: Presentation permitted, user number passed network screening (1) 'peta' ]
1 > [1 701  0a1  a11  361  301  321  311  391  361  351  361  301 ]
1 > Called Number (len=12) [ Ext: 1  TON: National Number (2)  NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1) '603961234' ]
1 > [1 a11 ]
1 > Sending Complete (len= 1)
   -- Called g1/603961234
Transmitting (NAT) to 89.76.27.25:5060:
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.2.99:5060;branch=z9hG4bKbe09fc25bf3c4bf9;received=89.76.27.25
From: "peta" <sip:peta@83.10.21.42>;tag=d0beb7cc0faad732
To: <sip:1005@83.10.21.42>;tag=as727f0068
Call-ID: d65e78c8ec10bfd3@192.168.2.99
CSeq: 20717 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: <sip:1005@83.10.21.42>
Content-Length: 0


---
1 < Protocol Discriminator: Q.931 (8)  len=12
1 < Call Ref: len= 1 (reference 131/0x83) (Terminator)
1 < Message type: STATUS (125)
1 < [1 081  031  821  e41  6c1 ]
1 < Cause (len= 5) [ Ext: 1  Coding: CCITT (ITU) standard (0) 0: 0   Location: Public network serving the local user (2)
1 <                  Ext: 1  Cause: Unknown (100), class = Protocol Error (6) ]
1 <              Cause data 1: 6c (108)
1 < [1 141  011  011 ]
1 < Call State (len= 3) [ Ext: 0  Coding: CCITT (ITU) standard (0) Call state: Call Initiated (1)
1 -- Processing IE 8 (cs0, Cause)
1 -- Processing IE 20 (cs0, Call State)
Oct 24 04:02:34 WARNING[6529]: chan_zap.c:8528 zt_pri_error: 1 updating callstate, peercallstate 2 to 1
1 < Protocol Discriminator: Q.931 (8)  len=7
1 < Call Ref: len= 1 (reference 131/0x83) (Terminator)
1 < Message type: CALL PROCEEDING (2)
1 < [1 181  011  891 ]
1 < Channel ID (len= 3) [ Ext: 1  IntID: Implicit, Other Spare: 0, Exclusive Dchan: 0
1 <                        ChanSel: B1 channel
1                          ]
1 -- Processing IE 24 (cs0, Channel Identification)
   -- Zap/1-1 is proceeding passing it to SIP/peta-0817f350
iprouter*CLI>
1 < Protocol Discriminator: Q.931 (8)  len=4
1 < Call Ref: len= 1 (reference 131/0x83) (Terminator)
1 < Message type: ALERTING (1)
   -- Zap/1-1 is ringing
iprouter*CLI>
Destroying call '93c49078b92ea34a@192.168.2.99'

-------------------------------------------------------------------------
Now we press cancel on SIP phone
-------------------------------------------------------------------------

<-- SIP read from 89.76.27.25:5060:

--- (0 headers 0 lines) Nat keepalive ---
iprouter*CLI>
<-- SIP read from 89.76.27.25:5060:
CANCEL sip:1005@83.10.21.42 SIP/2.0
Via: SIP/2.0/UDP 192.168.2.99:5060;branch=z9hG4bKbe09fc25bf3c4bf9
From: "peta" <sip:peta@83.10.21.42>;tag=d0beb7cc0faad732
To: <sip:1005@83.10.21.42>
Call-ID: d65e78c8ec10bfd3@192.168.2.99
CSeq: 20717 CANCEL
User-Agent: Grandstream GXP2000 1.1.1.11
Max-Forwards: 70
Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK,MESSAGE
Content-Length: 0    


--- (10 headers 0 lines) ---
Sending to 192.168.2.99 : 5060 (NAT)
Reliably Transmitting (NAT) to 89.76.27.25:5060:
SIP/2.0 487 Request Terminated
Via: SIP/2.0/UDP 192.168.2.99:5060;branch=z9hG4bKbe09fc25bf3c4bf9;received=89.76.27.25
From: "peta" <sip:peta@83.10.21.42>;tag=d0beb7cc0faad732
To: <sip:1005@83.10.21.42>;tag=as727f0068
Call-ID: d65e78c8ec10bfd3@192.168.2.99
CSeq: 20717 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Content-Length: 0


---
Transmitting (NAT) to 89.76.27.25:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.2.99:5060;branch=z9hG4bKbe09fc25bf3c4bf9;received=89.76.27.25
From: "peta" <sip:peta@83.10.21.42>;tag=d0beb7cc0faad732
To: <sip:1005@83.10.21.42>;tag=as727f0068
Call-ID: d65e78c8ec10bfd3@192.168.2.99
CSeq: 20717 CANCEL
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: <sip:1005@83.10.21.42>
Content-Length: 0


---
1 NEW_HANGUP DEBUG: Calling q931_hangup, ourstate Call Delivered, peerstate Call Received
   -- Hungup 'Zap/1-1'
 == Spawn extension (internal, 1005, 1) exited non-zero on 'SIP/peta-0817f350'
iprouter*CLI>
<-- SIP read from 89.76.27.25:5060:
ACK sip:1005@83.10.21.42 SIP/2.0
Via: SIP/2.0/UDP 192.168.2.99:5060;branch=z9hG4bKbe09fc25bf3c4bf9
From: "peta" <sip:peta@83.10.21.42>;tag=d0beb7cc0faad732
To: <sip:1005@83.10.21.42>;tag=as727f0068
Contact: <sip:peta@192.168.2.99:5060>
Proxy-Authorization: Digest username="peta", realm="asterisk", algorithm=MD5, uri="sip:1005@83.10.21.42", nonce="0e74039f", response="fa004d4e666eb10a0605d9b4f4698905"
Call-ID: d65e78c8ec10bfd3@192.168.2.99
CSeq: 20717 ACK
User-Agent: Grandstream GXP2000 1.1.1.11
Max-Forwards: 70
Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK,MESSAGE
Content-Length: 0    


--- (12 headers 0 lines) ---
Destroying call 'd65e78c8ec10bfd3@192.168.2.99'

Zap/1-1 didn't really hangup ... it continuous calling to called said.
Called side is still ringing and ringing ...
I must manually press cancel on called side to cancel ringing.

------------------------------------------------------------------------

Comments:By: Russell Bryant (russell) 2006-10-24 15:09:13

Since this issue happens on a patched system, we can not help you.