I have the following scheme:
User - sip phone
ServerА - Asterisk 11.6-cert2 with chan_sip
sip.conf:
[general]
context=default
allowguest=no
alwaysauthreject=yes
match_auth_username=yes
allowoverlap=no
udpbindaddr=0.0.0.0
tcpenable=yes
tcpbindaddr=0.0.0.0
tos_sip=cs3
tos_audio=ef
tos_video=af41
tos_text=af41
cos_sip=3
cos_audio=5
cos_video=4
cos_text=3
storesipcause=yes
disallow=all
allow=g729,alaw
language=ru
rtptimeout=60
callcounter=yes
jbenable=yes
jbmaxsize=200
prematuremedia=no
progressinband=yes
srvlookup=yes
ignoresdpversion=yes
[serverB](!)
type=friend
secret=xxx
qualify=yes
insecure=port,invite
dtmfmode=auto
context=from-core
directmedia=no
disallow=all
allow=g729:60
allow=alaw
host=xxx.xxx.xxx.xxx
[user]
host = dynamic
type = friend
context = from-local
deny = 0.0.0.0/0.0.0.0
permit = 162.168.0.0/16
dtmfmode = auto
directmedia = no
nat = no
language = ru
disallow = all
allow = g729,alaw,ulaw
qualify = yes
defaultuser = xxx
secret = xxx
serverB - Asterisk 13.12.2 with chan_sip
sip.conf:
[general]
context=default
allowguest=no
alwaysauthreject=yes
match_auth_username=yes
allowoverlap=no
udpbindaddr=0.0.0.0
tcpenable=yes
tcpbindaddr=0.0.0.0
tos_sip=cs3
tos_audio=ef
tos_video=af41
tos_text=af41
cos_sip=3
cos_audio=5
cos_video=4
cos_text=3
storesipcause=yes
disallow=all
allow=g729,alaw
language=ru
rtptimeout=60
callcounter=yes
jbenable=yes
jbmaxsize=200
prematuremedia=no
progressinband=yes
srvlookup=yes
ignoresdpversion=yes
[serverA](!)
type=friend
secret=xxx
qualify=yes
insecure=port,invite
dtmfmode=auto
context=from-core
directmedia=no
disallow=all
allow=g729:60
allow=alaw:60
host=xxx.xxx.xxx.xxx
[pstn]
type=peer
qualify=yes
port=5060
insecure=port,invite
dtmfmode=auto
context=from-pstn
directmedia=no
disallow=all
allow=alaw
host=xxx.xxx.xxx.xxx
outboundproxy=xxx.xxx.xxx.xxx
fromdomain=xxx.xxx.xxx.xxx
fromuser=xxx
nat=yes
When I call from the phone (User) to pstn, the traffic goes with the packetization specified on the scheme: from pstn with ptime 20, to pstn with packetization 60 (dump from serverB):
No. Time Source Destination Protocol Length Info
50 0.890426 zzz.zzz.zzz.zzz yyy.yyy.yyy.yyy RTP 134 PT=ITU-T G.711 PCMA, SSRC=0x2247B41C, Seq=17970, Time=2952
51 0.909801 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=43, Time=116099159
52 0.929335 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=44, Time=116099319
53 0.950007 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=45, Time=116099479
54 0.950811 zzz.zzz.zzz.zzz yyy.yyy.yyy.yyy RTP 534 PT=ITU-T G.711 PCMA, SSRC=0x2247B41C, Seq=17971, Time=1832
55 0.969213 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=46, Time=116099639
56 0.990912 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=47, Time=116099799
57 1.010409 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=48, Time=116099959
58 1.010638 zzz.zzz.zzz.zzz yyy.yyy.yyy.yyy RTP 534 PT=ITU-T G.711 PCMA, SSRC=0x2247B41C, Seq=17972, Time=2312
59 1.029825 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=49, Time=116100119
60 1.049588 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=50, Time=116100279
61 1.069352 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=51, Time=116100439
62 1.070778 zzz.zzz.zzz.zzz yyy.yyy.yyy.yyy RTP 534 PT=ITU-T G.711 PCMA, SSRC=0x2247B41C, Seq=17973, Time=2792
63 1.090640 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=52, Time=116100599
64 1.109852 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=53, Time=116100759
65 1.121636 zzz.zzz.zzz.zzz yyy.yyy.yyy.yyy RTP 534 PT=ITU-T G.711 PCMA, SSRC=0x2247B41C, Seq=17974, Time=3272
66 1.130087 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=54, Time=116100919
67 1.150256 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=55, Time=116101079
68 1.170998 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=56, Time=116101239
69 1.184092 zzz.zzz.zzz.zzz yyy.yyy.yyy.yyy RTP 534 PT=ITU-T G.711 PCMA, SSRC=0x2247B41C, Seq=17975, Time=3752
70 1.190948 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=57, Time=116101399
71 1.209808 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=58, Time=116101559
72 1.229512 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=59, Time=116101719
73 1.246590 zzz.zzz.zzz.zzz yyy.yyy.yyy.yyy RTP 534 PT=ITU-T G.711 PCMA, SSRC=0x2247B41C, Seq=17976, Time=4232
74 1.249221 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=60, Time=116101879
75 1.269439 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=61, Time=116102039
76 1.289175 yyy.yyy.yyy.yyy zzz.zzz.zzz.zzz RTP 214 PT=ITU-T G.711 PCMA, SSRC=0x2959B06, Seq=62, Time=116102199
77 1.309120 zzz.zzz.zzz.zzz yyy.yyy.yyy.yyy RTP 534 PT=ITU-T G.711 PCMA, SSRC=0x2247B41C, Seq=17977, Time=4712
But for the sip session, the packetization to pstn should be 20:
Invite from ServerB to pstn:
INVITE sip:500600@zzz.zzz.zzz.zzz:5060 SIP/2.0
Via: SIP/2.0/UDP yyy.yyy.yyy.yyy:5060;branch=z9hG4bK706a8a1e;rport
Max-Forwards: 70
From: "555555" <sip:555555@zzz.zzz.zzz.zzz>;tag=as7da65f01
To: <sip:500600@zzz.zzz.zzz.zzz:5060>
Contact: <sip:555555@yyy.yyy.yyy.yyy:5060>
Call-ID: 515e0108432fae34617da7c41cbc7d05@zzz.zzz.zzz.zzz
CSeq: 102 INVITE
User-Agent: Asterisk PBX 13.12.2
Date: Mon, 27 Mar 2017 11:36:24 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 256
v=0
o=root 1021517374 1021517374 IN IP4 yyy.yyy.yyy.yyy
s=Asterisk PBX 13.12.2
c=IN IP4 yyy.yyy.yyy.yyy
t=0 0
m=audio 32432 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
SDP packet from pstn to serverB:
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP yyy.yyy.yyy.yyy:5060;received=yyy.yyy.yyy.yyy;branch=z9hG4bK706a8a1e;rport=5060
From: "555555" <sip:555555@zzz.zzz.zzz.zzz>;tag=as7da65f01
To: <sip:500600@zzz.zzz.zzz.zzz:5060>;tag=SDaut5c99-x8cphhauh0
Call-ID: 515e0108432fae34617da7c41cbc7d05@zzz.zzz.zzz.zzz
CSeq: 102 INVITE
Allow: INVITE,ACK,CANCEL,INFO,PRACK,UPDATE,OPTIONS,REGISTER,REFER,SUBSCRIBE,PUBLISH
Contact: <sip:500600@zzz.zzz.zzz.zzz:5060;transport=udp>
Content-Length: 221
Content-Type: application/sdp
Content-Disposition: session;handling=required
v=0
o=- 7856137 8145714 IN IP4 zzz.zzz.zzz.zzz
s=-
c=IN IP4 zzz.zzz.zzz.zzz
b=AS:64
t=0 0
m=audio 49024 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=sendrecv
Are my conclusions and my configuration correct? How can I change the packetization to pstn by 20?