Early media from ISDN to SIP

Hello everyone,
I’m facing an issue with an asterisk connected to isdn lines.
Problem is that outgoing calls made from sip device, do not receive early media.
I spent a lot of time in trying figure out what is going on, and yet I do not have a clear picture.
It seems that operator’s isdn switch correctly send progress indicator with value 8.
Which is correct in most cases.
pri debug shows this progress indicator is indeed received by asterisk, or I should say libpri?
By the way looking at console output, it seems that also asterisk receive this indication.
But after, looking at sip signaling, it only appears a “180 ring”.
I expected to receive at first a “180 ring”, but after to have received progress from isdn, I also expected a “183 session progress”.
Final result is ringback tone generated from telephone, and no early media is heard.
In sip.conf I guess to have configured anything early media related, So I have both [general] and [peers] with both progressinband=yes and prematuremedia=yes.
Also this doesn’t made the difference.
Googling around I also stepped in two asterisk issue
The issue18868_19246_v1.8.patch seems to be already included in my asterisk 1.8.20.1
patch-LIBPRI-q931-handle-non-isdn-progress.diff which is related to libpri, is there to fix progress indicator = 1 which does not fit with my situation.

I hope someone may help me in point this issue.
thanks in advance
AC.

You must explicitly call Progress(), before the Dial.

Thank you for the quick answer.
I didn’t know I could use Progress() in such way.
Infact I always assumed Progres() provides a different service…
I thought its use was to provide early media…
So because my need was get early media from the network I didn’t use it.
My understanding was somehow encouraged by the examples asterisk wiki shows in its pages.
in this example, one of the few I found it shows only how to provide an early media to someone who calls into the asterisk.
exten => 500,1,Progress()
exten => 500,n,Wait(1)
exten => 500,n,Playback(WeAreClosedGoAway,noanswer)
exten => 500,n,Hangup()

My office is closed today, because national holiday.
My connection with it is only an iax2 connection, where Progress() does not seem to have changed the situation.
As soon as I’ll back to office I want to try it with sip devices which is where I meant to use it.

Thank you for your precious help.
AC

It is needed to forward early media. You should also be able to answer, but that will start charging.

My guess is that it was added because early media often doesn’t work because chargeable services won’t normally allow it on the outgoing side of an incoming call, as it could be used to defeat charging.

Thank you again for the answer.
Your first answer was pretty clear: “use Progress() before Dial()”.
It does not agree with my understanding about “Progress()”, but that’s ok, I’m asking because I don’t know how to resolve the issue.
It can be something I just don’t know… Very reasonable.
But reading further, get me confused.
You seems to confirm my understanding about “Progress()” in first place.
I try to explain what my problem is, which is very common I think.
Calling a mobile phone which is turned off, usually in my country, but I guess in the whole world, you can hear a message without charge, that message is played through the ISDN where my asterisk is connected using Progress Indicator = 8 (early Media).
Now in my situation, instead of hearing that message, I hear the ringback tone produced locally.

My only test so far, has been made using an IAX2 client, after having implemented the solution “Progress()”.
I do not know IAX2 that much, but I suppose it should have something like a “183 Session Progress” too.
Using that connection however, I couldn’t heard any early media. Is that an IAX2 issue?

Tomorrow I will test SIP devices. Tests made with command line SIP client show a change, this time I got a message “183 Session Progress”, which is what I wanted. However before tomorrow I cannot confirm SIP devices can hear the early media.

thank you for the support.
AC

Firstly, can I check that Lync is in no way involved here, as an issue has been raised, but treated as a feature request, relating to Lync’s unusual use of 183.

My reference for the need to use Progress is this:

[quote]From 1.6.1 to 1.6.2:

SIP no longer sends the 183 progress message for early media by
default. Applications requiring early media should use the
progress() dialplan app to generate the progress message. [/quote]

svn.digium.com/svn/asterisk/bran … PGRADE.txt

No Lync involved.
It’s just a few sip phone complaining they cannot hear the message when mobile phones are turned off.

Thank you again, for explanation and your patience.
AC

Hello,
Today I made my test about Early media using sip device.
Indeed, after inserting the “Progress()” before “Dial()” into the dialplan, “180 Ring” became “183 Session Progress”, and RTP stream is sent to the device.
However this seems to be not enough, because that RTP stream does not contains the early media took from the ISDN channels.
Instead it contains a ringback tone,which has to be produced locally by the asterisk.
I hope I won’t abuse your kindness, but I included in this post some informations to describe better my scenario.

From PRI Debug I see that ISDN switch send a Progress Indicator = 8, asterisk receive it and produce the an event for the SIP subsystem.
From the SIP point of view, progress is received from the DAHDI channel and passed to SIP.
Sip telephone, now with the “Progress()”, receive the “183 Session Progress” with the RTP stream.
Why this rtp stream does not contains the ISDN sent early media?

[i]
--------------------------------------- console output ---------------------------------------
weboffice*CLI>
== Using SIP RTP CoS mark 5
– Executing [3398xxxxxx@from-nwo:1] Progress(“SIP/weboffice-0000002e”, “”) in new stack
– Executing [3398xxxxx8@from-nwo:2] Dial(“SIP/weboffice-0000002e”, “dahdi/13/3398xxxxxx,40,rTt”) in new stack
– Requested transfer capability: 0x00 - SPEECH
– Called dahdi/13/3398xxxxxx
– DAHDI/i5/3398xxxxxx-10 is making progress passing it to SIP/weboffice-0000002e
– DAHDI/i5/3398xxxxxx-10 is proceeding passing it to SIP/weboffice-0000002e

--------------------------------------- PRI debug ---------------------------------------

PRI Span: 5 – Making new call for cref 32771
PRI Span: 5
PRI Span: 5 > DL-DATA request
PRI Span: 5 > Protocol Discriminator: Q.931 (8) len=60
PRI Span: 5 > TEI=0 Call Ref: len= 1 (reference 3/0x3) (Sent from originator)
PRI Span: 5 > Message Type: SETUP (5)
PRI Span: 5 TEI=0 Transmitting N(S)=6, window is open V(A)=6 K=1
PRI Span: 5
PRI Span: 5 > Protocol Discriminator: Q.931 (8) len=60
PRI Span: 5 > TEI=0 Call Ref: len= 1 (reference 3/0x3) (Sent from originator)
PRI Span: 5 > Message Type: SETUP (5)
PRI Span: 5 > [04 03 80 90 a3]
PRI Span: 5 > Bearer Capability (len= 5) [ Ext: 1 Coding-Std: 0 Info transfer capability: Speech (0)
PRI Span: 5 > Ext: 1 Trans mode/rate: 64kbps, circuit-mode (16)
PRI Span: 5 > User information layer 1: A-Law (35)
PRI Span: 5 > [18 01 81]
PRI Span: 5 > Channel ID (len= 3) [ Ext: 1 IntID: Implicit BRI Spare: 0 Preferred Dchan: 0
PRI Span: 5 > ChanSel: B1 channel
PRI Span: 5 > ]
PRI Span: 5 > [1e 02 80 83]
PRI Span: 5 > Progress Indicator (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) 0: 0 Location: User (0)
PRI Span: 5 > Ext: 1 Progress Description: Calling equipment is non-ISDN. (3) ]
PRI Span: 5 > [28 15 b1 41 6c 65 73 73 61 6e 64 72 6f 20 43 61 72 6d 69 6e 61 74 69]
PRI Span: 5 > Display (len=21) Charset: 31 [ Alessandro ]
PRI Span: 5 > [6c 05 21 80 35 31 33]
PRI Span: 5 > Calling Number (len= 7) [ Ext: 0 TON: National Number (2) NPI: ISDN/Telephony Numbering Plan (E.164/E.163) (1)
PRI Span: 5 > Presentation: Presentation permitted, user number not screened (0) ‘513’ ]
PRI Span: 5 > [70 0c 80 31 39 39 31 39 39 33 34 35 32 31]
PRI Span: 5 > Called Number (len=14) [ Ext: 1 TON: Unknown Number Type (0) NPI: Unknown Number Plan (0) ‘3398xxxxxx’ ]
PRI Span: 5 q931.c:6037 q931_setup: Call 32771 enters state 1 (Call Initiated). Hold state: Idle
– Called dahdi/13/3398xxxxxx
PRI Span: 5
PRI Span: 5 < Protocol Discriminator: Q.931 (8) len=7
PRI Span: 5 < TEI=0 Call Ref: len= 1 (reference 3/0x3) (Sent to originator)
PRI Span: 5 < Message Type: SETUP ACKNOWLEDGE (13)
PRI Span: 5 < [18 01 89]
PRI Span: 5 < Channel ID (len= 3) [ Ext: 1 IntID: Implicit BRI Spare: 0 Exclusive Dchan: 0
PRI Span: 5 < ChanSel: B1 channel
PRI Span: 5 < ]
PRI Span: 5 Received message for call 0x93a2a90 on link 0x92f88bc TEI/SAPI 0/0
PRI Span: 5 – Processing IE 24 (cs0, Channel Identification)
PRI Span: 5 q931.c:8810 post_handle_q931_message: Call 32771 enters state 2 (Overlap Sending). Hold state: Idle
Span 5: Processing event PRI_EVENT_SETUP_ACK
– DAHDI/i5/3398xxxxxx-3 is making progress passing it to SIP/weboffice-00000002
PRI Span: 5
PRI Span: 5 < Protocol Discriminator: Q.931 (8) len=8
PRI Span: 5 < TEI=0 Call Ref: len= 1 (reference 3/0x3) (Sent to originator)
PRI Span: 5 < Message Type: CALL PROCEEDING (2)
PRI Span: 5 < [1e 02 82 88]
PRI Span: 5 < Progress Indicator (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) 0: 0 Location: Public network serving the local user (2)
PRI Span: 5 < Ext: 1 Progress Description: Inband information or appropriate pattern now available. (8) ]
PRI Span: 5 Received message for call 0x93a2a90 on link 0x92f88bc TEI/SAPI 0/0
PRI Span: 5 – Processing IE 30 (cs0, Progress Indicator)
PRI Span: 5 q931.c:8455 post_handle_q931_message: Call 32771 enters state 3 (Outgoing Call Proceeding). Hold state: Idle
Span 5: Processing event PRI_EVENT_PROCEEDING
– DAHDI/i5/3398xxxxxx-3 is proceeding passing it to SIP/weboffice-00000002
PRI Span: 5
PRI Span: 5 < Protocol Discriminator: Q.931 (8) len=8
PRI Span: 5 < TEI=0 Call Ref: len= 1 (reference 3/0x3) (Sent to originator)
PRI Span: 5 < Message Type: PROGRESS (3)
PRI Span: 5 < [1e 02 82 88]
PRI Span: 5 < Progress Indicator (len= 4) [ Ext: 1 Coding: CCITT (ITU) standard (0) 0: 0 Location: Public network serving the local user (2)
PRI Span: 5 < Ext: 1 Progress Description: Inband information or appropriate pattern now available. (8) ]
PRI Span: 5 Received message for call 0x93a2a90 on link 0x92f88bc TEI/SAPI 0/0
PRI Span: 5 – Processing IE 30 (cs0, Progress Indicator)
Span 5: Processing event PRI_EVENT_PROGRESS
– DAHDI/i5/3398xxxxxx-3 is making progress passing it to SIP/weboffice-00000002

--------------------------------------- phone received traffic ---------------------------------------

0.000000 192.168.1.34 -> 192.168.1.116 SIP/SDP Request: INVITE sip:3398xxxxxx@weboffice.nextel.it;user=phone, with session description
0.000893 192.168.1.116 -> 192.168.1.34 SIP Status: 100 Trying
0.002102 192.168.1.116 -> 192.168.1.34 SIP Status: 407 Proxy Authentication Required
0.033751 192.168.1.34 -> 192.168.1.116 SIP Request: ACK sip:3398xxxxxx@weboffice.nextel.it;user=phone
0.039169 192.168.1.34 -> 192.168.1.116 SIP/SDP Request: INVITE sip:3398xxxxxx@weboffice.nextel.it;user=phone, with session description
0.039908 192.168.1.116 -> 192.168.1.34 SIP Status: 100 Trying
0.401398 192.168.1.116 -> 192.168.1.34 SIP/SDP Status: 183 Session Progress, with session description
0.421900 192.168.1.116 -> 192.168.1.34 RTP PT=ITU-T G.711 PCMU, SSRC=0x6CE7990C, Seq=5161, Time=160
0.441880 192.168.1.116 -> 192.168.1.34 RTP PT=ITU-T G.711 PCMU, SSRC=0x6CE7990C, Seq=5162, Time=320
0.461880 192.168.1.116 -> 192.168.1.34 RTP PT=ITU-T G.711 PCMU, SSRC=0x6CE7990C, Seq=5163, Time=480
0.481875 192.168.1.116 -> 192.168.1.34 RTP PT=ITU-T G.711 PCMU, SSRC=0x6CE7990C, Seq=5164, Time=640
0.490876 192.168.1.34 -> 192.168.1.116 RTP PT=ITU-T G.711 PCMU, SSRC=0x7C15383F, Seq=40853, Time=3107480083, Mark
0.501875 192.168.1.116 -> 192.168.1.34 RTP PT=ITU-T G.711 PCMU, SSRC=0x6CE7990C, Seq=5165, Time=800
0.521881 192.168.1.116 -> 192.168.1.34 RTP PT=ITU-T G.711 PCMU, SSRC=0x6CE7990C, Seq=5166, Time=960
0.530702 192.168.1.34 -> 192.168.1.116 RTP PT=ITU-T G.711 PCMU, SSRC=0x7C15383F, Seq=40854, Time=3107480483, Mark
0.541878 192.168.1.116 -> 192.168.1.34 RTP PT=ITU-T G.711 PCMU, SSRC=0x6CE7990C, Seq=5167, Time=1120
0.550726 192.168.1.34 -> 192.168.1.116 RTP PT=ITU-T G.711 PCMU, SSRC=0x7C15383F, Seq=40855, Time=3107480643
0.561873 192.168.1.116 -> 192.168.1.34 RTP PT=ITU-T G.711 PCMU, SSRC=0x6CE7990C, Seq=5168, Time=1280
0.580714 192.168.1.34 -> 192.168.1.116 RTP PT=ITU-T G.711 PCMU, SSRC=0x7C15383F, Seq=40856, Time=3107480803
0.581872 192.168.1.116 -> 192.168.1.34 RTP PT=ITU-T G.711 PCMU, SSRC=0x6CE7990C, Seq=5169, Time=1440
0.600728 192.168.1.34 -> 192.168.1.116 RTP PT=ITU-T G.711 PCMU, SSRC=0x7C15383F, Seq=40857, Time=3107480963
0.601867 192.168.1.116 -> 192.168.1.34 RTP PT=ITU-T G.711 PCMU, SSRC=0x6CE7990C, Seq=5170, Time=1600

--------------------------------------- sip.conf ---------------------------------------
[general]
maxexpirey = 300
defaultexpirey = 300

context=default
allowoverlap=no
udpbindaddr=0.0.0.0:25060
tcpenable=no
tcpbindaddr=0.0.0.0
srvlookup=yes
domain=asterisk
domain=192.168.1.116
domain=192.168.1.116:25060
allowexternaldomains=yes
progressinband=yes
prematuremedia=yes

[weboffice] ; the proxy which mantains sip device registrations
type=peer
host=weboffice.nextel.it
port=5060
fromdomain=weboffice.nextel.it
canreinvite=yes
qualify=yes
context=from-nwo
progressinband=yes
prematuremedia=yes

--------------------------------------- chan_dahdi.conf ---------------------------------------
[trunkgroups]

[channels]
context=default
usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
callcounter = yes
cancallforward=yes
callreturn=yes
echocancel=yes
echotraining=no
echocancelwhenbridged=yes
relaxdtmf=yes
rxgain=0.0
txgain=0.0
group=1
callgroup=1
pickupgroup=1
immediate=no
overlapdial=yes
callprogress=yes

;Sangoma AFT-B500 port 5 [slot:0 bus:10 span:5]
context=from-pstn_channel_1
group=2
callgroup=1
echocancel=yes
signalling=bri_cpe
channel =>13

[/i]

Remove the “r” from the Dial options.

Yes it is that.
I saw it just before you make me note.
But I didn’t have the time to remove my last post.
I want to to thank you for your patience.
and please forgive this last post.
I just forgot I added that “r”.

thank you and have a nice day.

Hi there,
I have same problem,
I cannot hear mobile messages like turn off or unreachable. Only simulated ring can be hear.
could you help me step by step to solve this problem?
I use elastix as phone engin with cisco as5400 as gateway.
thanks in advance

Peer support forums are nor appropriate places for step by step instructions, as those require more time than is reasonable to expect.

Have you tried what has been suggested up-thread? Do you have relevant logging?

I add this statement to /etc/asterisk/chan_dahdi.conf

context=default
usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
callcounter=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echotraining=no
echocancelwhenbridged=yes
relaxdtmf=yes
rxgain=0.0
txgain=0.0
group=1
callgroup=1
pickupgroup=1
immediate=no
overlapdial=yes
callprogress=yes
progzone=uk
switchtype=euroisdn
inbanddisconnect=yes
priindication=outofband

but still I cannot hear mobile system messages like turn off or not reachable. :exclamation:
my Email is : Houshyar.m13@gmail.com
if you can mail me step by step configuration for hearing messages instead simulated asterisk tone.
thank in advance.