Uk ISDN and Early Media settings?

Hi there, I am currently running Asterisk 1.8.24.0 with Dahdi drivers DAHDI Version: 2.7.0.1.

I am trying to get early media working, Sip to Sip is fine but when a call comes in via ISDN no Audio is heard, even though asterisk show the media is being played.

Here is my settings
chan_dahdi.conf

[channels] language=en usecallerid=yes cidsignalling=v23 cidstart=polarity nationalprefix=44 internationalprefix=+ callprogress=yes progzone=uk

sip.conf

[general]
directmedia=no
dtmfmode=rfc2833
rtptimeout=600
jbenable=yes
prematuremedia=yes
progressinband=yes

extension.conf

exten => _1510,1,progress()
exten => _151,2,Wait(1)
exten => _151,3,Playback(tt-monkeys,noanswer)
exten => _151,4,Hangup()nf

pri dedug


PRI Span: 8 
PRI Span: 8 < Protocol Discriminator: Q.931 (8)  len=40
PRI Span: 8 < TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent from originator)
PRI Span: 8 < Message Type: SETUP (5)
PRI Span: 8 < [a1]
PRI Span: 8 < Sending Complete (len= 1)
PRI Span: 8 < [04 03 90 90 a3]
PRI Span: 8 < Bearer Capability (len= 5) [ Ext: 1  Coding-Std: 0  Info transfer capability: 3.1kHz audio (16)
PRI Span: 8 <                              Ext: 1  Trans mode/rate: 64kbps, circuit-mode (16)
PRI Span: 8 <                                User information layer 1: A-Law (35)
PRI Span: 8 < [18 03 a9 83 81]
PRI Span: 8 < Channel ID (len= 5) [ Ext: 1  IntID: Implicit  Other(PRI)  Spare: 0  Exclusive  Dchan: 0
PRI Span: 8 <                       ChanSel: As indicated in following octets
PRI Span: 8 <                       Ext: 1  Coding: 0  Number Specified  Channel Type: 3
PRI Span: 8 <                       Ext: 1  Channel: 1 Type: CPE]
PRI Span: 8 < [1e 02 85 81]
PRI Span: 8 < Progress Indicator (len= 4) [ Ext: 1  Coding: CCITT (ITU) standard (0)  0: 0  Location: Private network serving the remote user (5)
PRI Span: 8 <                               Ext: 1  Progress Description: Call is not end-to-end ISDN; further call progress information may be available inband. (1) ]
PRI Span: 8 < [6c 0c 21 83 37 39 31 37 33 30 31 34 32 36]
PRI Span: 8 < Calling Party Number (len=14) [ Ext: 0  TON: National Number (2)  NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1)
PRI Span: 8 <                                 Presentation: Presentation allowed, Network provided (3)  '7917301426' ]
PRI Span: 8 < [70 04 80 31 35 31]
PRI Span: 8 < Called Party Number (len= 6) [ Ext: 1  TON: Unknown Number Type (0)  NPI: Unknown Number Plan (0)  '151' ]
PRI Span: 8 -- Making new call for cref 1
PRI Span: 8 Received message for call 0x2b8ed81194b0 on link 0x2b8eb0035600 TEI/SAPI 0/0
PRI Span: 8 -- Processing Q.931 Call Setup
PRI Span: 8 -- Processing IE 161 (cs0, Sending Complete)
PRI Span: 8 -- Processing IE 4 (cs0, Bearer Capability)
PRI Span: 8 -- Processing IE 24 (cs0, Channel ID)
PRI Span: 8 -- Processing IE 30 (cs0, Progress Indicator)
PRI Span: 8 -- Processing IE 108 (cs0, Calling Party Number)
PRI Span: 8 -- Processing IE 112 (cs0, Called Party Number)
PRI Span: 8 q931.c:8646 post_handle_q931_message: Call 1 enters state 6 (Call Present).  Hold state: Idle
Span 8: Processing event PRI_EVENT_RING
PRI Span: 8 q931.c:5704 q931_call_proceeding: Call 1 enters state 9 (Incoming Call Proceeding).  Hold state: Idle
PRI Span: 8 
PRI Span: 8 > DL-DATA request
PRI Span: 8 > Protocol Discriminator: Q.931 (8)  len=10
PRI Span: 8 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 8 > Message Type: CALL PROCEEDING (2)
PRI Span: 8 TEI=0 Transmitting N(S)=97, window is open V(A)=97 K=7
PRI Span: 8 
PRI Span: 8 > Protocol Discriminator: Q.931 (8)  len=10
PRI Span: 8 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 8 > Message Type: CALL PROCEEDING (2)
PRI Span: 8 > [18 03 a9 83 81]
PRI Span: 8 > Channel ID (len= 5) [ Ext: 1  IntID: Implicit  Other(PRI)  Spare: 0  Exclusive  Dchan: 0
PRI Span: 8 >                       ChanSel: As indicated in following octets
PRI Span: 8 >                       Ext: 1  Coding: 0  Number Specified  Channel Type: 3
PRI Span: 8 >                       Ext: 1  Channel: 1 Type: CPE]
    -- Accepting call from 'Mymobile' to '151' on channel 0/1, span 8
    -- Executing [151@PBX-IN:1] Progress("DAHDI/i8/Mymobile-af3", "") in new stack
PRI Span: 8 
PRI Span: 8 > DL-DATA request
PRI Span: 8 > Protocol Discriminator: Q.931 (8)  len=9
PRI Span: 8 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 8 > Message Type: PROGRESS (3)
PRI Span: 8 TEI=0 Transmitting N(S)=98, window is open V(A)=97 K=7
PRI Span: 8 
PRI Span: 8 > Protocol Discriminator: Q.931 (8)  len=9
PRI Span: 8 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 8 > Message Type: PROGRESS (3)
PRI Span: 8 > [1e 02 81 88]
PRI Span: 8 > Progress Indicator (len= 4) [ Ext: 1  Coding: CCITT (ITU) standard (0)  0: 0  Location: Private network serving the local user (1)
PRI Span: 8 >                               Ext: 1  Progress Description: Inband information or appropriate pattern now available. (8) ]
    -- Executing [151@PBX-IN:2] Wait("DAHDI/i8/Mymobile-af3", "1") in new stack
    -- Executing [151@PBX-IN:3] Playback("DAHDI/i8/Mymobile-af3", "tt-monkeys,noanswer") in new stack
    -- <DAHDI/i8/Mymobile-af3> Playing 'tt-monkeys.gsm' (language 'en')
PRI Span: 8 
PRI Span: 8 < Protocol Discriminator: Q.931 (8)  len=13
PRI Span: 8 < TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent from originator)
PRI Span: 8 < Message Type: DISCONNECT (69)
PRI Span: 8 < [08 02 80 90]
PRI Span: 8 < Cause (len= 4) [ Ext: 1  Coding: CCITT (ITU) standard (0)  Spare: 0  Location: User (0)
PRI Span: 8 <                  Ext: 1  Cause: Normal Clearing (16), class = Normal Event (1) ]
PRI Span: 8 < [1e 02 81 88]
PRI Span: 8 < Progress Indicator (len= 4) [ Ext: 1  Coding: CCITT (ITU) standard (0)  0: 0  Location: Private network serving the local user (1)
PRI Span: 8 <                               Ext: 1  Progress Description: Inband information or appropriate pattern now available. (8) ]
PRI Span: 8 Received message for call 0x2b8ed81194b0 on link 0x2b8eb0035600 TEI/SAPI 0/0
PRI Span: 8 -- Processing IE 8 (cs0, Cause)
PRI Span: 8 -- Processing IE 30 (cs0, Progress Indicator)
PRI Span: 8 -- Found active call: 0x2b8ed81194b0 cref:1
PRI Span: 8 q931.c:9084 post_handle_q931_message: Call 1 enters state 12 (Disconnect Indication).  Hold state: Idle
Span 8: Processing event PRI_EVENT_HANGUP_REQ
    -- Span 8: Channel 0/1 got hangup request, cause 16
  == Spawn extension (PBX-IN, 151, 3) exited non-zero on 'DAHDI/i8/Mymobile-af3'
PRI Span: 8 q931.c:7135 q931_hangup: Hangup other cref:1
PRI Span: 8 q931.c:6892 __q931_hangup: ourstate Disconnect Indication, peerstate Disconnect Request, hold-state Idle
PRI Span: 8 q931.c:5930 q931_release: Call 1 enters state 19 (Release Request).  Hold state: Idle
PRI Span: 8 
PRI Span: 8 > DL-DATA request
PRI Span: 8 > Protocol Discriminator: Q.931 (8)  len=9
PRI Span: 8 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 8 > Message Type: RELEASE (77)
PRI Span: 8 TEI=0 Transmitting N(S)=99, window is open V(A)=99 K=7
PRI Span: 8 
PRI Span: 8 > Protocol Discriminator: Q.931 (8)  len=9
PRI Span: 8 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 8 > Message Type: RELEASE (77)
PRI Span: 8 > [08 02 81 90]
PRI Span: 8 > Cause (len= 4) [ Ext: 1  Coding: CCITT (ITU) standard (0)  Spare: 0  Location: Private network serving the local user (1)
PRI Span: 8 >                  Ext: 1  Cause: Normal Clearing (16), class = Normal Event (1) ]
    -- Hungup 'DAHDI/i8/Mymobile-af3'
PRI Span: 8 
PRI Span: 8 < Protocol Discriminator: Q.931 (8)  len=5
PRI Span: 8 < TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent from originator)
PRI Span: 8 < Message Type: RELEASE COMPLETE (90)
PRI Span: 8 Received message for call 0x2b8ed81194b0 on link 0x2b8eb0035600 TEI/SAPI 0/0
PRI Span: 8 q931.c:8944 post_handle_q931_message: Call 1 enters state 0 (Null).  Hold state: Idle
PRI Span: 8 q931.c:7135 q931_hangup: Hangup other cref:1
PRI Span: 8 q931.c:6892 __q931_hangup: ourstate Null, peerstate Null, hold-state Idle
PRI Span: 8 Destroying call 0x2b8ed81194b0, ourstate Null, peerstate Null, hold-state Idle
Span 8: Processing event PRI_EVENT_HANGUP_ACK

I have placed calls from mobiles and landlines. I get the same result as the debug, media is played but it cannot be heard.

I very much doubt that UK ISDN would support early media if you are not a licensed network operator; it is open to abuse for free of charge information calls.

I do work for licensed network operator, just trying to rule out any settings/errors my end before I start asking BT.

I’m not sure that anyone else here is a licensed operator.

You’ll need to get protocol traces.

Hi all, I managed a fudge work round, not really sure why it works.

Setting the dialplan like this.
Inbound call. E1->Asterisk.
exten => _0121,1,Noop(‘Early Media test’)
exten => _0121,n,Dial(DAHDI/g0/0151,2,r)
exten => _0121,n,Wait(1)
exten => _0121,n,Playback(tt-monkeys,noanswer)
exten => _0121,n,Hangup()

By forcing the ‘r’ option in the the dial cmd allows for early media audio to be played to the caller once the Dial attempted finishes after 2ms. Can anybody shed any light on why this works and Progress doesn’t ?

Also routing the call to another server, No early media audio is heard. So it looks like only the receiving server using my fudge plays audio correctly. Clearly there must be signalling issue some where or am I missing some thing?

He is the pri debug and SIP trace to me forwarding the call to another server that plays the early media using Progress.

[code]TO media2

Reloading SIP
== Parsing ‘/etc/asterisk/sip.conf’: == Found
== Parsing ‘/etc/asterisk/users.conf’: == Found
== Using SIP CoS mark 4
== Parsing ‘/etc/asterisk/sip_notify.conf’: == Found
PRI Span: 1
PRI Span: 1 < Protocol Discriminator: Q.931 (8) len=48
PRI Span: 1 < TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent from originator)
PRI Span: 1 < Message Type: SETUP (5)
PRI Span: 1 < [a1]
PRI Span: 1 < Sending Complete (len= 1)
PRI Span: 1 < [04 03 90 90 a3]
PRI Span: 1 < Bearer Capability (len= 5) [ Ext: 1 Coding-Std: 0 Info transfer capability: 3.1kHz audio (16)
PRI Span: 1 < Ext: 1 Trans mode/rate: 64kbps, circuit-mode (16)
PRI Span: 1 < User information layer 1: A-Law (35)
PRI Span: 1 < [18 03 a9 83 81]
PRI Span: 1 < Channel ID (len= 5) [ Ext: 1 IntID: Implicit Other(PRI) Spare: 0 Exclusive Dchan: 0
PRI Span: 1 < ChanSel: As indicated in following octets
PRI Span: 1 < Ext: 1 Coding: 0 Number Specified Channel Type: 3
PRI Span: 1 < Ext: 1 Channel: 1 Type: CPE]
PRI Span: 1 < [1e 02 85 81]
PRI Span: 1 < Progress Indicator (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) 0: 0 Location: Private network serving the remote user (5)
PRI Span: 1 < Ext: 1 Progress Description: Call is not end-to-end ISDN; further call progress information may be available inband. (1) ]
PRI Span: 1 < [6c 0c 21 83 37 39 31 37 33 30 31 34 32 36]
PRI Span: 1 < Calling Party Number (len=14) [ Ext: 0 TON: National Number (2) NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1)
PRI Span: 1 < Presentation: Presentation allowed, Network provided (3) ‘0123456789’ ]
PRI Span: 1 < [70 0c 81 30 31 32 31 36 32 31 39 30 38 32]
PRI Span: 1 < Called Party Number (len=14) [ Ext: 1 TON: Unknown Number Type (0) NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1) ‘0121’ ]
PRI Span: 1 – Making new call for cref 1
PRI Span: 1 Received message for call 0xb839c80 on link 0xb79f050 TEI/SAPI 0/0
PRI Span: 1 – Processing Q.931 Call Setup
PRI Span: 1 – Processing IE 161 (cs0, Sending Complete)
PRI Span: 1 – Processing IE 4 (cs0, Bearer Capability)
PRI Span: 1 – Processing IE 24 (cs0, Channel ID)
PRI Span: 1 – Processing IE 30 (cs0, Progress Indicator)
PRI Span: 1 – Processing IE 108 (cs0, Calling Party Number)
PRI Span: 1 – Processing IE 112 (cs0, Called Party Number)
PRI Span: 1 q931.c:8646 post_handle_q931_message: Call 1 enters state 6 (Call Present). Hold state: Idle
Span 1: Processing event PRI_EVENT_RING
PRI Span: 1 q931.c:5704 q931_call_proceeding: Call 1 enters state 9 (Incoming Call Proceeding). Hold state: Idle
PRI Span: 1
PRI Span: 1 > DL-DATA request
PRI Span: 1 > Protocol Discriminator: Q.931 (8) len=10
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 1 > Message Type: CALL PROCEEDING (2)
PRI Span: 1 TEI=0 Transmitting N(S)=124, window is open V(A)=124 K=7
PRI Span: 1
PRI Span: 1 > Protocol Discriminator: Q.931 (8) len=10
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 1 > Message Type: CALL PROCEEDING (2)
PRI Span: 1 > [18 03 a9 83 81]
PRI Span: 1 > Channel ID (len= 5) [ Ext: 1 IntID: Implicit Other(PRI) Spare: 0 Exclusive Dchan: 0
PRI Span: 1 > ChanSel: As indicated in following octets
PRI Span: 1 > Ext: 1 Coding: 0 Number Specified Channel Type: 3
PRI Span: 1 > Ext: 1 Channel: 1 Type: CPE]
– Accepting call from ‘0123456789’ to ‘0121’ on channel 0/1, span 1
– Executing [0121@from-pstn:1] NoOp(“DAHDI/i1/0123456789-7e”, “‘Early Media test’”) in new stack
– Executing [0121@from-pstn:2] Dial(“DAHDI/i1/0123456789-7e”, “SIP/MediaUk2/151”) in new stack
== Using SIP RTP CoS mark 5
Audio is at 18752
Adding codec 0x8 (alaw) to SDP
Adding codec 0x4 (ulaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 10.103.1.105:5060:
INVITE sip:151@10.103.1.105 SIP/2.0
Via: SIP/2.0/UDP 10.103.1.180:5060;branch=z9hG4bK2ff3c578;rport
Max-Forwards: 70
From: “0123456789” sip:0123456789@10.103.1.180;tag=as3f3e134e
To: sip:151@10.103.1.105
Contact: sip:0123456789@10.103.1.180:5060
Call-ID: 73aa35232b51cb922c425e5652d99c83@10.103.1.180:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.8.25.0
Date: Fri, 17 Jan 2014 16:17:45 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 259

v=0
o=root 578907895 578907895 IN IP4 10.103.1.180
s=Asterisk PBX 1.8.25.0
c=IN IP4 10.103.1.180
t=0 0
m=audio 18752 RTP/AVP 8 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv


-- Called SIP/MediaUk2/151

<— SIP read from UDP:10.103.1.105:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.103.1.180:5060;branch=z9hG4bK2ff3c578;received=10.103.1.180;rport=5060
From: “0123456789” sip:0123456789@10.103.1.180;tag=as3f3e134e
To: sip:151@10.103.1.105
Call-ID: 73aa35232b51cb922c425e5652d99c83@10.103.1.180:5060
CSeq: 102 INVITE
Server: Asterisk PBX 1.8.24.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: sip:151@10.103.1.105:5060
Content-Length: 0

<------------->
— (12 headers 0 lines) —

<— SIP read from UDP:10.103.1.105:5060 —>
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 10.103.1.180:5060;branch=z9hG4bK2ff3c578;received=10.103.1.180;rport=5060
From: “0123456789” sip:0123456789@10.103.1.180;tag=as3f3e134e
To: sip:151@10.103.1.105;tag=as511e3d80
Call-ID: 73aa35232b51cb922c425e5652d99c83@10.103.1.180:5060
CSeq: 102 INVITE
Server: Asterisk PBX 1.8.24.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: sip:151@10.103.1.105:5060
Content-Type: application/sdp
Require: timer
Content-Length: 261

v=0
o=root 1736644127 1736644127 IN IP4 10.103.1.105
s=Asterisk PBX 1.8.24.0
c=IN IP4 10.103.1.105
t=0 0
m=audio 12648 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
<------------->
— (14 headers 12 lines) —
list_route: hop: sip:151@10.103.1.105:5060
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format telephone-event for ID 101
Capabilities: us - 0xc (ulaw|alaw), peer - audio=0xc (ulaw|alaw)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0xc (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 10.103.1.105:12648
– SIP/MediaUk2-00000016 is making progress passing it to DAHDI/i1/0123456789-7e
PRI Span: 1
PRI Span: 1 > DL-DATA request
PRI Span: 1 > Protocol Discriminator: Q.931 (8) len=9
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 1 > Message Type: PROGRESS (3)
PRI Span: 1 TEI=0 Transmitting N(S)=125, window is open V(A)=124 K=7
PRI Span: 1
PRI Span: 1 > Protocol Discriminator: Q.931 (8) len=9
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 1 > Message Type: PROGRESS (3)
PRI Span: 1 > [1e 02 81 88]
PRI Span: 1 > Progress Indicator (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) 0: 0 Location: Private network serving the local user (1)
PRI Span: 1 > Ext: 1 Progress Description: Inband information or appropriate pattern now available. (8) ]

<— SIP read from UDP:10.103.1.105:5060 —>
SIP/2.0 603 Declined
Via: SIP/2.0/UDP 10.103.1.180:5060;branch=z9hG4bK2ff3c578;received=10.103.1.180;rport=5060
From: “0123456789” sip:0123456789@10.103.1.180;tag=as3f3e134e
To: sip:151@10.103.1.105;tag=as511e3d80
Call-ID: 73aa35232b51cb922c425e5652d99c83@10.103.1.180:5060
CSeq: 102 INVITE
Server: Asterisk PBX 1.8.24.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0

<------------->
— (10 headers 0 lines) —
– Got SIP response 603 “Declined” back from 10.103.1.105:5060
set_destination: Parsing sip:151@10.103.1.105:5060 for address/port to send to
set_destination: set destination to 10.103.1.105:5060
Transmitting (NAT) to 10.103.1.105:5060:
ACK sip:151@10.103.1.105:5060 SIP/2.0
Via: SIP/2.0/UDP 10.103.1.180:5060;branch=z9hG4bK2ff3c578;rport
Max-Forwards: 70
From: “0123456789” sip:0123456789@10.103.1.180;tag=as3f3e134e
To: sip:151@10.103.1.105;tag=as511e3d80
Contact: sip:0123456789@10.103.1.180:5060
Call-ID: 73aa35232b51cb922c425e5652d99c83@10.103.1.180:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 1.8.25.0
Content-Length: 0


-- SIP/MediaUk2-00000016 is busy

== Everyone is busy/congested at this time (1:1/0/0)
– Executing [0121@from-pstn:3] Hangup(“DAHDI/i1/0123456789-7e”, “”) in new stack
== Spawn extension (from-pstn, 0121, 3) exited non-zero on 'DAHDI/i1/0123456789-7e’
PRI Span: 1 q931.c:7135 q931_hangup: Hangup other cref:1
PRI Span: 1 q931.c:6892 __q931_hangup: ourstate Incoming Call Proceeding, peerstate Outgoing Call Proceeding, hold-state Idle
PRI Span: 1 q931.c:6081 q931_disconnect: Call 1 enters state 11 (Disconnect Request). Hold state: Idle
PRI Span: 1
PRI Span: 1 > DL-DATA request
PRI Span: 1 > Protocol Discriminator: Q.931 (8) len=9
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 1 > Message Type: DISCONNECT (69)
PRI Span: 1 TEI=0 Transmitting N(S)=126, window is open V(A)=126 K=7
PRI Span: 1
PRI Span: 1 > Protocol Discriminator: Q.931 (8) len=9
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 1 > Message Type: DISCONNECT (69)
PRI Span: 1 > [08 02 81 95]
PRI Span: 1 > Cause (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) Spare: 0 Location: Private network serving the local user (1)
PRI Span: 1 > Ext: 1 Cause: Call Rejected (21), class = Normal Event (1) ]
– Hungup 'DAHDI/i1/0123456789-7e’
PRI Span: 1
PRI Span: 1 < Protocol Discriminator: Q.931 (8) len=5
PRI Span: 1 < TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent from originator)
PRI Span: 1 < Message Type: RELEASE (77)
PRI Span: 1 Received message for call 0xb839c80 on link 0xb79f050 TEI/SAPI 0/0
PRI Span: 1 q931.c:8997 post_handle_q931_message: Call 1 enters state 0 (Null). Hold state: Idle
Span 1: Processing event PRI_EVENT_HANGUP
PRI Span: 1 q931.c:7135 q931_hangup: Hangup other cref:1
PRI Span: 1 q931.c:6892 __q931_hangup: ourstate Null, peerstate Release Request, hold-state Idle
PRI Span: 1
PRI Span: 1 > DL-DATA request
PRI Span: 1 > Protocol Discriminator: Q.931 (8) len=9
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 1 > Message Type: RELEASE COMPLETE (90)
PRI Span: 1 TEI=0 Transmitting N(S)=127, window is open V(A)=127 K=7
PRI Span: 1
PRI Span: 1 > Protocol Discriminator: Q.931 (8) len=9
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 1 > Message Type: RELEASE COMPLETE (90)
PRI Span: 1 > [08 02 81 90]
PRI Span: 1 > Cause (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) Spare: 0 Location: Private network serving the local user (1)
PRI Span: 1 > Ext: 1 Cause: Normal Clearing (16), class = Normal Event (1) ]
PRI Span: 1 q931.c:7135 q931_hangup: Hangup other cref:1
PRI Span: 1 q931.c:6892 __q931_hangup: ourstate Null, peerstate Null, hold-state Idle
PRI Span: 1 Destroying call 0xb839c80, ourstate Null, peerstate Null, hold-state Idle
Really destroying SIP dialog ‘73aa35232b51cb922c425e5652d99c83@10.103.1.180:5060’ Method: INVITE
ivr-dev*CLI>
[/code]

Here is Pri debug with early media being played successfully using my fudge.

Ivr Dev

PRI Span: 1 
PRI Span: 1 < Protocol Discriminator: Q.931 (8)  len=48
PRI Span: 1 < TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent from originator)
PRI Span: 1 < Message Type: SETUP (5)
PRI Span: 1 < [a1]
PRI Span: 1 < Sending Complete (len= 1)
PRI Span: 1 < [04 03 90 90 a3]
PRI Span: 1 < Bearer Capability (len= 5) [ Ext: 1  Coding-Std: 0  Info transfer capability: 3.1kHz audio (16)
PRI Span: 1 <                              Ext: 1  Trans mode/rate: 64kbps, circuit-mode (16)
PRI Span: 1 <                                User information layer 1: A-Law (35)
PRI Span: 1 < [18 03 a9 83 81]
PRI Span: 1 < Channel ID (len= 5) [ Ext: 1  IntID: Implicit  Other(PRI)  Spare: 0  Exclusive  Dchan: 0
PRI Span: 1 <                       ChanSel: As indicated in following octets
PRI Span: 1 <                       Ext: 1  Coding: 0  Number Specified  Channel Type: 3
PRI Span: 1 <                       Ext: 1  Channel: 1 Type: CPE]
PRI Span: 1 < [1e 02 85 81]
PRI Span: 1 < Progress Indicator (len= 4) [ Ext: 1  Coding: CCITT (ITU) standard (0)  0: 0  Location: Private network serving the remote user (5)
PRI Span: 1 <                               Ext: 1  Progress Description: Call is not end-to-end ISDN; further call progress information may be available inband. (1) ]
PRI Span: 1 < [6c 0c 21 83 37 39 31 37 33 30 31 34 32 36]
PRI Span: 1 < Calling Party Number (len=14) [ Ext: 0  TON: National Number (2)  NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1)
PRI Span: 1 <                                 Presentation: Presentation allowed, Network provided (3)  '0123456789' ]
PRI Span: 1 < [70 0c 81 30 31 32 31 36 32 31 39 30 38 32]
PRI Span: 1 < Called Party Number (len=14) [ Ext: 1  TON: Unknown Number Type (0)  NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1)  '01216219082' ]
PRI Span: 1 -- Making new call for cref 1
PRI Span: 1 Received message for call 0x2ad35c6a7620 on link 0xb79f050 TEI/SAPI 0/0
PRI Span: 1 -- Processing Q.931 Call Setup
PRI Span: 1 -- Processing IE 161 (cs0, Sending Complete)
PRI Span: 1 -- Processing IE 4 (cs0, Bearer Capability)
PRI Span: 1 -- Processing IE 24 (cs0, Channel ID)
PRI Span: 1 -- Processing IE 30 (cs0, Progress Indicator)
PRI Span: 1 -- Processing IE 108 (cs0, Calling Party Number)
PRI Span: 1 -- Processing IE 112 (cs0, Called Party Number)
PRI Span: 1 q931.c:8646 post_handle_q931_message: Call 1 enters state 6 (Call Present).  Hold state: Idle
Span 1: Processing event PRI_EVENT_RING
PRI Span: 1 q931.c:5704 q931_call_proceeding: Call 1 enters state 9 (Incoming Call Proceeding).  Hold state: Idle
PRI Span: 1 
PRI Span: 1 > DL-DATA request
PRI Span: 1 > Protocol Discriminator: Q.931 (8)  len=10
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 1 > Message Type: CALL PROCEEDING (2)
PRI Span: 1 TEI=0 Transmitting N(S)=0, window is open V(A)=0 K=7
PRI Span: 1 
PRI Span: 1 > Protocol Discriminator: Q.931 (8)  len=10
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 1 > Message Type: CALL PROCEEDING (2)
PRI Span: 1 > [18 03 a9 83 81]
PRI Span: 1 > Channel ID (len= 5) [ Ext: 1  IntID: Implicit  Other(PRI)  Spare: 0  Exclusive  Dchan: 0
PRI Span: 1 >                       ChanSel: As indicated in following octets
PRI Span: 1 >                       Ext: 1  Coding: 0  Number Specified  Channel Type: 3
PRI Span: 1 >                       Ext: 1  Channel: 1 Type: CPE]
    -- Accepting call from '0123456789' to '01216219082' on channel 0/1, span 1
    -- Executing [01216219082@from-pstn:1] NoOp("DAHDI/i1/0123456789-7f", "'Early Media test'") in new stack
    -- Executing [01216219082@from-pstn:2] Dial("DAHDI/i1/0123456789-7f", "DAHDI/g0/0121,2,r") in new stack
PRI Span: 1 -- Making new call for cref 32837
    -- Requested transfer capability: 0x10 - 3K1AUDIO
PRI Span: 1 
PRI Span: 1 > DL-DATA request
PRI Span: 1 > Protocol Discriminator: Q.931 (8)  len=44
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 69/0x45) (Sent from originator)
PRI Span: 1 > Message Type: SETUP (5)
PRI Span: 1 TEI=0 Transmitting N(S)=1, window is open V(A)=0 K=7
PRI Span: 1 
PRI Span: 1 > Protocol Discriminator: Q.931 (8)  len=44
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 69/0x45) (Sent from originator)
PRI Span: 1 > Message Type: SETUP (5)
PRI Span: 1 > [04 03 90 90 a3]
PRI Span: 1 > Bearer Capability (len= 5) [ Ext: 1  Coding-Std: 0  Info transfer capability: 3.1kHz audio (16)
PRI Span: 1 >                              Ext: 1  Trans mode/rate: 64kbps, circuit-mode (16)
PRI Span: 1 >                                User information layer 1: A-Law (35)
PRI Span: 1 > [18 03 a1 83 82]
PRI Span: 1 > Channel ID (len= 5) [ Ext: 1  IntID: Implicit  Other(PRI)  Spare: 0  Preferred  Dchan: 0
PRI Span: 1 >                       ChanSel: As indicated in following octets
PRI Span: 1 >                       Ext: 1  Coding: 0  Number Specified  Channel Type: 3
PRI Span: 1 >                       Ext: 1  Channel: 2 Type: CPE]
PRI Span: 1 > [6c 0c 21 81 37 39 31 37 33 30 31 34 32 36]
PRI Span: 1 > Calling Party Number (len=14) [ Ext: 0  TON: National Number (2)  NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1)
PRI Span: 1 >                                 Presentation: Presentation allowed, User-provided, verified and passed (1)  '0123456789' ]
PRI Span: 1 > [70 0c 80 30 31 32 31 36 32 30 39 31 35 31]
PRI Span: 1 > Called Party Number (len=14) [ Ext: 1  TON: Unknown Number Type (0)  NPI: Unknown Number Plan (0)  '0121' ]
PRI Span: 1 > [a1]
PRI Span: 1 > Sending Complete (len= 1)
PRI Span: 1 q931.c:6334 q931_setup: Call 32837 enters state 1 (Call Initiated).  Hold state: Idle
    -- Called DAHDI/g0/0121
PRI Span: 1 q931.c:5736 q931_alerting: Call 1 enters state 7 (Call Received).  Hold state: Idle
PRI Span: 1 
PRI Span: 1 > DL-DATA request
PRI Span: 1 > Protocol Discriminator: Q.931 (8)  len=9
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 1 > Message Type: ALERTING (1)
PRI Span: 1 TEI=0 Transmitting N(S)=2, window is open V(A)=0 K=7
PRI Span: 1 
PRI Span: 1 > Protocol Discriminator: Q.931 (8)  len=9
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 1 > Message Type: ALERTING (1)
PRI Span: 1 > [1e 02 81 88]
PRI Span: 1 > Progress Indicator (len= 4) [ Ext: 1  Coding: CCITT (ITU) standard (0)  0: 0  Location: Private network serving the local user (1)
PRI Span: 1 >                               Ext: 1  Progress Description: Inband information or appropriate pattern now available. (8) ]
PRI Span: 1 
PRI Span: 1 < Protocol Discriminator: Q.931 (8)  len=10
PRI Span: 1 < TEI=0 Call Ref: len= 2 (reference 69/0x45) (Sent to originator)
PRI Span: 1 < Message Type: CALL PROCEEDING (2)
PRI Span: 1 < [18 03 a9 83 82]
PRI Span: 1 < Channel ID (len= 5) [ Ext: 1  IntID: Implicit  Other(PRI)  Spare: 0  Exclusive  Dchan: 0
PRI Span: 1 <                       ChanSel: As indicated in following octets
PRI Span: 1 <                       Ext: 1  Coding: 0  Number Specified  Channel Type: 3
PRI Span: 1 <                       Ext: 1  Channel: 2 Type: CPE]
PRI Span: 1 Received message for call 0xb856e10 on link 0xb79f050 TEI/SAPI 0/0
PRI Span: 1 -- Processing IE 24 (cs0, Channel ID)
PRI Span: 1 q931.c:8831 post_handle_q931_message: Call 32837 enters state 3 (Outgoing Call Proceeding).  Hold state: Idle
Span 1: Processing event PRI_EVENT_PROCEEDING
    -- DAHDI/i1/0121-80 is proceeding passing it to DAHDI/i1/0123456789-7f
    -- Nobody picked up in 2000 ms
PRI Span: 1 q931.c:7135 q931_hangup: Hangup other cref:32837
PRI Span: 1 q931.c:6892 __q931_hangup: ourstate Outgoing Call Proceeding, peerstate Incoming Call Proceeding, hold-state Idle
PRI Span: 1 q931.c:6081 q931_disconnect: Call 32837 enters state 11 (Disconnect Request).  Hold state: Idle
PRI Span: 1 
PRI Span: 1 > DL-DATA request
PRI Span: 1 > Protocol Discriminator: Q.931 (8)  len=9
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 69/0x45) (Sent from originator)
PRI Span: 1 > Message Type: DISCONNECT (69)
PRI Span: 1 TEI=0 Transmitting N(S)=3, window is open V(A)=3 K=7
PRI Span: 1 
PRI Span: 1 > Protocol Discriminator: Q.931 (8)  len=9
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 69/0x45) (Sent from originator)
PRI Span: 1 > Message Type: DISCONNECT (69)
PRI Span: 1 > [08 02 81 90]
PRI Span: 1 > Cause (len= 4) [ Ext: 1  Coding: CCITT (ITU) standard (0)  Spare: 0  Location: Private network serving the local user (1)
PRI Span: 1 >                  Ext: 1  Cause: Normal Clearing (16), class = Normal Event (1) ]
    -- Hungup 'DAHDI/i1/0121-80'
    -- Executing [01216219082@from-pstn:3] Wait("DAHDI/i1/0123456789-7f", "1") in new stack
PRI Span: 1 
PRI Span: 1 < Protocol Discriminator: Q.931 (8)  len=5
PRI Span: 1 < TEI=0 Call Ref: len= 2 (reference 69/0x45) (Sent to originator)
PRI Span: 1 < Message Type: RELEASE (77)
PRI Span: 1 Received message for call 0xb856e10 on link 0xb79f050 TEI/SAPI 0/0
PRI Span: 1 q931.c:8997 post_handle_q931_message: Call 32837 enters state 0 (Null).  Hold state: Idle
Span 1: Processing event PRI_EVENT_HANGUP
PRI Span: 1 q931.c:7135 q931_hangup: Hangup other cref:32837
PRI Span: 1 q931.c:6892 __q931_hangup: ourstate Null, peerstate Release Request, hold-state Idle
PRI Span: 1 
PRI Span: 1 > DL-DATA request
PRI Span: 1 > Protocol Discriminator: Q.931 (8)  len=9
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 69/0x45) (Sent from originator)
PRI Span: 1 > Message Type: RELEASE COMPLETE (90)
PRI Span: 1 TEI=0 Transmitting N(S)=4, window is open V(A)=4 K=7
PRI Span: 1 
PRI Span: 1 > Protocol Discriminator: Q.931 (8)  len=9
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 69/0x45) (Sent from originator)
PRI Span: 1 > Message Type: RELEASE COMPLETE (90)
PRI Span: 1 > [08 02 81 90]
PRI Span: 1 > Cause (len= 4) [ Ext: 1  Coding: CCITT (ITU) standard (0)  Spare: 0  Location: Private network serving the local user (1)
PRI Span: 1 >                  Ext: 1  Cause: Normal Clearing (16), class = Normal Event (1) ]
PRI Span: 1 q931.c:7135 q931_hangup: Hangup other cref:32837
PRI Span: 1 q931.c:6892 __q931_hangup: ourstate Null, peerstate Null, hold-state Idle
PRI Span: 1 Destroying call 0xb856e10, ourstate Null, peerstate Null, hold-state Idle
    -- Executing [01216219082@from-pstn:4] Playback("DAHDI/i1/0123456789-7f", "tt-monkeys,noanswer") in new stack
    -- <DAHDI/i1/0123456789-7f> Playing 'tt-monkeys.gsm' (language 'en')
    -- Executing [01216219082@from-pstn:5] Hangup("DAHDI/i1/0123456789-7f", "") in new stack
  == Spawn extension (from-pstn, 01216219082, 5) exited non-zero on 'DAHDI/i1/0123456789-7f'
PRI Span: 1 q931.c:7135 q931_hangup: Hangup other cref:1
PRI Span: 1 q931.c:6892 __q931_hangup: ourstate Call Received, peerstate Call Delivered, hold-state Idle
PRI Span: 1 q931.c:6081 q931_disconnect: Call 1 enters state 11 (Disconnect Request).  Hold state: Idle
PRI Span: 1 
PRI Span: 1 > DL-DATA request
PRI Span: 1 > Protocol Discriminator: Q.931 (8)  len=9
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 1 > Message Type: DISCONNECT (69)
PRI Span: 1 TEI=0 Transmitting N(S)=5, window is open V(A)=5 K=7
PRI Span: 1 
PRI Span: 1 > Protocol Discriminator: Q.931 (8)  len=9
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 1 > Message Type: DISCONNECT (69)
PRI Span: 1 > [08 02 81 90]
PRI Span: 1 > Cause (len= 4) [ Ext: 1  Coding: CCITT (ITU) standard (0)  Spare: 0  Location: Private network serving the local user (1)
PRI Span: 1 >                  Ext: 1  Cause: Normal Clearing (16), class = Normal Event (1) ]
    -- Hungup 'DAHDI/i1/0123456789-7f'
PRI Span: 1 
PRI Span: 1 < Protocol Discriminator: Q.931 (8)  len=5
PRI Span: 1 < TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent from originator)
PRI Span: 1 < Message Type: RELEASE (77)
PRI Span: 1 Received message for call 0x2ad35c6a7620 on link 0xb79f050 TEI/SAPI 0/0
PRI Span: 1 q931.c:8997 post_handle_q931_message: Call 1 enters state 0 (Null).  Hold state: Idle
Span 1: Processing event PRI_EVENT_HANGUP
PRI Span: 1 q931.c:7135 q931_hangup: Hangup other cref:1
PRI Span: 1 q931.c:6892 __q931_hangup: ourstate Null, peerstate Release Request, hold-state Idle
PRI Span: 1 
PRI Span: 1 > DL-DATA request
PRI Span: 1 > Protocol Discriminator: Q.931 (8)  len=9
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 1 > Message Type: RELEASE COMPLETE (90)
PRI Span: 1 TEI=0 Transmitting N(S)=6, window is open V(A)=6 K=7
PRI Span: 1 
PRI Span: 1 > Protocol Discriminator: Q.931 (8)  len=9
PRI Span: 1 > TEI=0 Call Ref: len= 2 (reference 1/0x1) (Sent to originator)
PRI Span: 1 > Message Type: RELEASE COMPLETE (90)
PRI Span: 1 > [08 02 81 90]
PRI Span: 1 > Cause (len= 4) [ Ext: 1  Coding: CCITT (ITU) standard (0)  Spare: 0  Location: Private network serving the local user (1)
PRI Span: 1 >                  Ext: 1  Cause: Normal Clearing (16), class = Normal Event (1) ]
PRI Span: 1 q931.c:7135 q931_hangup: Hangup other cref:1
PRI Span: 1 q931.c:6892 __q931_hangup: ourstate Null, peerstate Null, hold-state Idle
PRI Span: 1 Destroying call 0x2ad35c6a7620, ourstate Null, peerstate Null, hold-state Idle
ivr-dev*CLI> 
Disconnected from Asterisk server
[root@ivr-dev.uk:/etc/asterisk]$ 

Just an update for anybody else running in the same issues.

Progress does work, but not sure if its bug with DAHDI and Asterisk or how BT/Uk networks are set up.

To get progress to work as per instruction, you have to to enable ringing like this.

exten => _151,1,Noop(‘Early Media’)
exten => _151,n,Progress()
exten => _151,n,RInging()
exten => _151,n,wait(2)
exten => _151,n,Playback(tt-monkeys,noanswer)
exten => _151,n,Hangup()

This works every time.
Also to note if you are just passing the calls on to another server/peer you must have prematuremedia=yes enabled in the sip.conf and on the server that will be playing the early media (Not connected to DAHDI). You must have progressinband=never set.