PJSIP T.38 Issues

Home » Asterisk Users » PJSIP T.38 Issues
Asterisk Users 4 Comments

Hi list,

2 weks ago I asked questions about PJSIP and T.38 but got no replies. I
upgraded Asterisk to git as of yesterday (309dd2a), and I’m still having the same issues.

In the trace below, I’m sending a fax from Hylafax server through iaxmodem on Asterisk-13 (tiare) to a second Asterisk (11.18.0 t0gw)
connected to the PSTN via ISDN; the call is to my test fax machine, connected to the PSTN. chan_pjsip is used on Asterisk-13, and chan_sip is used on Asterisk-11.

This how endpoint t0gw (Asterisk-11) is configured on tiare (Asterisk-13
):
tiare*CLI> pjsip show endpoint t0gw
… t38_udptl : true t38_udptl_ec : fec t38_udptl_ipv6 : false t38_udptl_maxdatagram : 400
t38_udptl_nat : false

Could someone explain why I’m getting “Not acceptable” below?

— Accepting AUTHENTICATED call from 127.0.0.1:4570:
— > requested format = slin,
— > requested prefs = (),
— > actual format = slin,
— > host prefs = (slin),
— > priority = mine
— Executing [40ZZZZZZ@fax-sortant:1] NoOp(“IAX2/iaxmodem0-7838″, ”
calls 40ZZZZZZ (local)”) in new stack
— Executing [40ZZZZZZ@fax-sortant:2] Set(“IAX2/iaxmodem0-7838”,
“FAXOPT(gateway)=yes”) in new stack
— Executing [40ZZZZZZ@fax-sortant:3] Dial(“IAX2/iaxmodem0-7838”,
“PJSIP/40ZZZZZZ@t0gw”) in new stack
— Called PJSIP/40ZZZZZZ@t0gw
<--- Transmitting SIP request (936 bytes) to UDP:192.168.0.10:5060 --->
INVITE sip:40ZZZZZZ@gw.sysnux.pf SIP/2.0
Via: SIP/2.0/UDP
192.168.0.200:5060;rport;branch=z9hG4bKPjba38816d-b5fe-4d5f-8bda-d0968e3
8e5f1
From: “SysNux”
;tag=22d8369f-061d-4232-9c4d-5068e81bc5c
5
To:
Contact:
Call-ID: 57283616-94e0-4052-bdff-491b31fdd229
CSeq: 31693 INVITE
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REGISTER, REFER
Supported: 100rel, timer, replaces, norefersub Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk GPL PBX
Content-Type: application/sdp Content-Length: 238

v=0
o=- 1710591484 1710591484 IN IP4 192.168.0.200
s=Asterisk c=IN IP4 192.168.0.200
t=0 0
m=audio 8834 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<--- Received SIP response (585 bytes) from UDP:192.168.0.10:5060 --->
SIP/2.0 100 Trying Via: SIP/2.0/UDP
192.168.0.200:5060;branch=z9hG4bKPjba38816d-b5fe-4d5f-8bda-d0968e38e5f1;
received=192.168.0.200;rport=5060
From: “SysNux”
;tag=22d8369f-061d-4232-9c4d-5068e81bc5c
5
To:
Call-ID: 57283616-94e0-4052-bdff-491b31fdd229
CSeq: 31693 INVITE
Server: Asterisk PBX 11.18.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer Session-Expires: 1800;refresher=uas Contact:
Content-Length: 0

<--- Received SIP response (895 bytes) from UDP:192.168.0.10:5060 --->
SIP/2.0 183 Session Progress Via: SIP/2.0/UDP
192.168.0.200:5060;branch=z9hG4bKPjba38816d-b5fe-4d5f-8bda-d0968e38e5f1;
received=192.168.0.200;rport=5060
From: “SysNux”
;tag=22d8369f-061d-4232-9c4d-5068e81bc5c
5
To: ;tag=as7bba6b0d Call-ID: 57283616-94e0-4052-bdff-491b31fdd229
CSeq: 31693 INVITE
Server: Asterisk PBX 11.18.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer Session-Expires: 1800;refresher=uas Contact:
Content-Type: application/sdp Require: timer Content-Length: 236

v=0
o=root 2087714374 2087714374 IN IP4 192.168.0.10
s=Asterisk PBX 11.18.0
c=IN IP4 192.168.0.10
t=0 0
m=audio 16834 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

— PJSIP/t0gw-0000001a is making progress passing it to IAX2/iaxmodem0-7838
<--- Received SIP response (601 bytes) from UDP:192.168.0.10:5060 --->
SIP/2.0 180 Ringing Via: SIP/2.0/UDP
192.168.0.200:5060;branch=z9hG4bKPjba38816d-b5fe-4d5f-8bda-d0968e38e5f1;
received=192.168.0.200;rport=5060
From: “SysNux”
;tag=22d8369f-061d-4232-9c4d-5068e81bc5c
5
To: ;tag=as7bba6b0d Call-ID: 57283616-94e0-4052-bdff-491b31fdd229
CSeq: 31693 INVITE
Server: Asterisk PBX 11.18.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer Session-Expires: 1800;refresher=uas Contact:
Content-Length: 0

— PJSIP/t0gw-0000001a is ringing
<--- Received SIP response (881 bytes) from UDP:192.168.0.10:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP
192.168.0.200:5060;branch=z9hG4bKPjba38816d-b5fe-4d5f-8bda-d0968e38e5f1;
received=192.168.0.200;rport=5060
From: “SysNux”
;tag=22d8369f-061d-4232-9c4d-5068e81bc5c
5
To: ;tag=as7bba6b0d Call-ID: 57283616-94e0-4052-bdff-491b31fdd229
CSeq: 31693 INVITE
Server: Asterisk PBX 11.18.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer Session-Expires: 1800;refresher=uas Contact:
Content-Type: application/sdp Require: timer Content-Length: 236

v=0
o=root 2087714374 2087714374 IN IP4 192.168.0.10
s=Asterisk PBX 11.18.0
c=IN IP4 192.168.0.10
t=0 0
m=audio 16834 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

<--- Transmitting SIP request (412 bytes) to UDP:192.168.0.10:5060 --->
ACK sip:40ZZZZZZ@192.168.0.10:5060 SIP/2.0
Via: SIP/2.0/UDP
192.168.0.200:5060;rport;branch=z9hG4bKPj8504e505-1222-4747-955f-4788fef f58d1
From: “SysNux”
;tag=22d8369f-061d-4232-9c4d-5068e81bc5c
5
To: ;tag=as7bba6b0d Call-ID: 57283616-94e0-4052-bdff-491b31fdd229
CSeq: 31693 ACK
Max-Forwards: 70
User-Agent: Asterisk GPL PBX
Content-Length: 0

— PJSIP/t0gw-0000001a answered IAX2/iaxmodem0-7838
— Channel PJSIP/t0gw-0000001a joined ‘simple_bridge’ basic-bridge
<56a7726f-44a3-4df3-aee0-d21020aa5be1>
— Channel IAX2/iaxmodem0-7838 joined ‘simple_bridge’ basic-bridge
<56a7726f-44a3-4df3-aee0-d21020aa5be1>

<--- Received SIP request (954 bytes) from UDP:192.168.0.10:5060 --->
UPDATE sip:63035284-ad7d-484f-8e54-f5ea54f39104@192.168.0.200:5060 SIP/2
.0
Via: SIP/2.0/UDP 192.168.0.10:5060;branch=z9hG4bK4fd84f17;rport Max-Forwards: 70
From: ;tag=as7bba6b0d To: “SysNux”
;tag=22d8369f-061d-4232-9c4d-5068e81bc5c
5
Contact:
Call-ID: 57283616-94e0-4052-bdff-491b31fdd229
CSeq: 102 UPDATE
User-Agent: Asterisk PBX 11.18.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer X-asterisk-Info: SIP re-invite (External RTP bridge)
Content-Type: application/sdp Content-Length: 287

v=0
o=root 2087714374 2087714375 IN IP4 192.168.0.10
s=Asterisk PBX 11.18.0
c=IN IP4 192.168.0.10
t=0 0
m=image 5720 udptl t38
c=IN IP4 192.168.0.10
a=T38FaxVersion:0
a=T38MaxBitRate:14400
a=T38FaxRateManagement:transferredTCF
a=T38FaxMaxDatagram:849
a=T38FaxUdpEC:t38UDPFEC

<--- Transmitting SIP response (376 bytes) to UDP:192.168.0.10:5060 --->
SIP/2.0 488 Not Acceptable Here Via: SIP/2.0/UDP
192.168.0.10:5060;rport=5060;received=192.168.0.10;branch=z9hG4bK4fd84f1
7
Call-ID: 57283616-94e0-4052-bdff-491b31fdd229
From: ;tag=as7bba6b0d To: “SysNux”
;tag=22d8369f-061d-4232-9c4d-5068e81bc5c
5
CSeq: 102 UPDATE
Server: Asterisk GPL PBX
Content-Length: 0

Is anyone successfully using chan_pjsip and iaxmodem?

Thanks,
– —
Jean-Denis Girard

SysNux Systèmes Linux en Polynésie française http://www.sysnux.pf/ Tél: +689 40.50.10.40 / GSM: +689 87.79.75.27
—–BEGIN PGP SIGNATURE—–

iEYEARECAAYFAlW1ojoACgkQuu7Rv+oOo/iU1gCglmxl6Pe3igseOwpbWfWtZdqg qzAAoJ8/zxzP3Eg79DxT7cjyXJj2oP9h
=FR59
—–END PGP SIGNATURE—–

4 thoughts on - PJSIP T.38 Issues

  • I think the “488 Not acceptable here” is occurring because the channel connecting through is not T.38 capable, that will be the IAX channel from iaxmomdem.

    I’ve not used PJSIP so cannot offer any advice regarding it however you may try to make iaxmodem connect through another context using either SIP or IAX (experiment with both bu most probably IAX) in an attempt to prevent the rejection of the T.38 establishment forcing the call to terminate. What I seem to recall when experimenting with SIP as the trunk, have UDPTL disabled i.e. t38pt_udptl=no, this would also induce
    “488 Not acceptable here”.

    Looking at a legacy configuration where I tested iaxmodem
    (context=faxgateway-iax) going through Asterisk 1.2 which then forwarded the request to Asterisk 11 (context=FAX-T30) where it then went out through the trunk with Fax Gateway enabled.

    In short;

    Asterisk 1.2
    IAX Modem in context faxgateway-iax, could change to faxgateway-sip.

    [faxgateway-iax]
    ; Incoming calls from iaxmodem to Asterisk are directed to
    ; other Asterisk server. exten => _XX.,1,Dial(IAX2/faxgw-iax@faxgw-iax/${EXTEN},55,t)
    exten => _XX.,n,Wait(1)
    exten => _XX.,n,Hangup
    ;

    [faxgateway-sip]
    ; Incoming calls from iaxmodem to Asterisk are directed to
    ; other Asterisk server. exten => _XX.,1,Dial(SIP/${EXTEN}@faxgw-sip,55,t)
    exten => _XX.,n,Wait(1)
    exten => _XX.,n,Hangup
    ;

    Asterisk 11
    IAX user faxgw-iax is in context FAX-T30

    extensions.ael on Asterisk 11 contains

    context FAX-T30 {

    _XXXXXXXX => {
    // Set(FAXOPT(t38gateway)=yes);
    Dial(SIP/${EXTEN}@itsp-fax,55);
    Hangup();
    };

    };

  • Thanks for your reply Larry.

    Le 27/07/2015 01:22, Larry Moore a écrit :

    This is what T38gateway is supposed to do. And I’m very happy to report that after one more day of efforts, I have everything working as I wante d.

    Thanks,
    – —
    Jean-Denis Girard

    SysNux Systèmes Linux en Polynésie française http://www.sysnux.pf/ Tél: +689 40.50.10.40 / GSM: +689 87.79.75.27

    —–BEGIN PGP SIGNATURE—–

    iEYEARECAAYFAlW4UuAACgkQuu7Rv+oOo/hN8gCeLE74bX+LCMHF/GQf3GkpaDph
    47sAnienQ5m2Fm2AI4BPIaqcYbMuiQZv
    =S4VT
    —–END PGP SIGNATURE—–

  • Pleased you have managed to get it working.

    Was it enabling alaw/ulaw which helped or did you need to use another method to route the IAX channel through PJSIP or some other configuration setting such as ‘faxdetect’ which may have been disabled?

    Cheers,

    Larry.

  • Le 30/07/2015 13:20, Larry Moore a écrit :
    ?

    Well, first, I had SELinux enabled, which blocked Hylafax, and I didn’t notice 🙁 I disabled it during testing.

    Then, I had inconsistencies in my asterisks configurations: working configuration is shown below. faxdetect is only needed when you want to redirect the call to the fax extension. faxgateway is obviously needed on both Asterisks.

    With this configuration, I’m able to send faxes from Hylafax to the PSTN. And receive fax from the PSTN on the same extension as my phone. And T.38 is used on the network between the 2 asterisk, so faxing reliability should be good.

    Here is the relevant configuration on the gateway (Asterisk-11.18.0):
    * chan_dahdi.conf:
    context=incoming_isdn switchtype = euroisdn faxdetect = no faxbuffers => 64,full

    * sip.conf:
    [general]
    faxdetect = no t38pt_udptl=yes,fec

    [tiare] ; Real IPBX
    type = friend context = outgoing host = tiare.sysnux.pf disallow = all allow = alaw qualify = 153

    * extensions.conf:
    [incoming_isdn]
    exten => s,1,Goto(1040,1)
    exten => _104[01234],1,NoOp(Appel entrant sur ligne RNIS)
    same => n,Set(FAXOPT(gateway)=yes)
    same => n,Dial(SIP/tiare/${EXTEN})

    [outgoing] ; Real IPBX !
    include => local include => gsm include => international

    [local]
    exten => _NXX.,1,Set(FAXOPT(gateway)=yes)
    same => n,Dial(${rnis}/${EXTEN})

    Here is the configuration on the IPBX (Asterisk-13 git-309dd2a):
    * pjsip.conf:
    [t0gw]
    type = endpoint transport = udp context = incoming allow = alaw aors = t0gw language=fr fax_detect = no t38_udptl=yes t38_udptl_ec=fec

    * iax.conf
    [iaxmodem0]
    type=friend secret=****
    context=fax-outgoing host=dynamic disallow=all allow=slin qualify=200
    jitterbuffer=no forcejitterbuffer=no requirecalltoken=no auth=md5
    port=4570

    * extensions.conf
    [fax-outgoing]
    include => local include => international

    [local]
    exten => _4[09]XXXXXX,1,NoOp(${CALLERID()} calls ${EXTEN} (local))
    same => n,Set(FAXOPT(gateway)=yes)
    same => n,Dial(PJSIP/${EXTEN}@t0gw)

    [stdexten] ; Extension “normale”
    include => faxin exten => _X.,1,NoOp(STDEXTEN ${EXTEN})
    same => n,Set(sip=${DB(exten/${EXTEN})}) ; Convert extension to SIP
    user
    same => n,GotoIf($[“${sip}” != “”]?sip_ok)
    same => n,Return
    same => n(sip_ok),Set(ext=${EXTEN}) ; Save extension
    same => n,Set(FAXOPT(faxdetect)=yes)
    same => n,Set(cfvm=${DB(CFVM/${sip})}) ; Check CFVM
    same => n,GotoIf(${cfvm}?:nocfvm)
    same => n,NoOp(Forward to voicemail ${ext})
    same => n,Voicemail(${ext}@astportal,u)
    same => n(nocfvm),Set(cfim=${DB(CFIM/${sip})})
    same => n,GotoIf($[${LEN(${cfim})} > 3]?${CHANNEL:4:8},${cfim},1)
    same => n,GotoIf(${cfim}?:nocfim)
    ; If caller is CFIM, pass the call (call screening)
    same => n,GotoIf($[${cfim} = ${DB(netxe/${CHANNEL:4:8})}]?nocfim)

    same => n,Set(sip=${DB(exten/${cfim})})
    same => n,NoOp(Forward immediate to ${sip})

    same => n,Dial(PJSIP/${sip},,)
    same => n(nocfim),Set(sip=${DB(exten/${ext})})
    same => n,Dial(${PJSIP_DIAL_CONTACTS(${sip})},25)

    [faxin]
    exten => fax,1,NoOp(FAXIN (${FAXEXTEN}) ${CALLERID(all)})
    same => n,Set(FAXOPT(gateway)=yes)
    same => n,Dial(IAX2/iaxmodem0/${FAXEXTEN})

    * /etc/iaxmodem/iaxmodem-cfg.ttyIAX
    evice /dev/ttyIAX
    owner uucp:uucp mode 660
    port 4570
    refresh 300
    server 127.0.0.1
    peername iaxmodem0
    secret hyla cidname SysNux cidnumber +689 40.50.10.40
    codec slin

    Thanks,
    – —
    Jean-Denis Girard

    SysNux Systèmes Linux en Polynésie française http://www.sysnux.pf/ Tél: +689 40.50.10.40 / GSM: +689 87.79.75.27
    —–BEGIN PGP SIGNATURE—–

    iEYEARECAAYFAlW9PmMACgkQuu7Rv+oOo/gT/ACghbAWtT5tu8bvMIugvLe/ozf5
    QnAAn08AFgIfKZaOXaSWgUfgx+hu2TD+
    =jIT0
    —–END PGP SIGNATURE—–