问题描述:


WEBRTC 呼出错误、返回422 。 呼入目前没问题、mod_verto已经安装,FS版本1.4.7

日志如下:

freeswitch@localhost.localdomain> 
freeswitch@localhost.localdomain> 
freeswitch@localhost.localdomain> 
freeswitch@localhost.localdomain> 
freeswitch@localhost.localdomain> 
freeswitch@localhost.localdomain> 
freeswitch@localhost.localdomain> recv 2122 bytes from ws/[172.16.150.1]:52969 at 12:02:45.265658:


INVITE sip:1009@172.16.150.142 SIP/2.0
Via: SIP/2.0/WS vl2ck7hc139b.invalid;branch=z9hG4bK5466877
Max-Forwards: 69
To: 
From: "1010" ;tag=q87utpe07r
Call-ID: 26btpu9503qvokvpmo20
CSeq: 9262 INVITE
X-Foo: foo
X-Bar: bar
Contact: 
Content-Type: application/sdp
Session-Expires: 90
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER
Supported: timer,ice,replaces,outbound
User-Agent: JsSIP 0.7.4
Content-Length: 1577

v=0
o=- 3680702864966919687 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio
a=msid-semantic: WMS IvH8lMXanelENfUwO4JmUDk54vtQ1PhaHFOU
m=audio 61567 RTP/SAVPF 111 103 104 9 0 8 106 105 13 126
c=IN IP4 192.168.36.148
a=rtcp:61567 IN IP4 192.168.36.148
a=candidate:2480072599 1 udp 2122194687 192.168.36.148 61567 typ host generation 0
a=candidate:2480072599 2 udp 2122194687 192.168.36.148 61567 typ host generation 0
a=candidate:3713080167 1 tcp 1518214911 192.168.36.148 0 typ host tcptype active generation 0
a=candidate:3713080167 2 tcp 1518214911 192.168.36.148 0 typ host tcptype active generation 0
a=ice-ufrag:dqUm4XWyB9HadRvl
a=ice-pwd:Cuxedv+ecFPZWNnI9HQqfGbO
a=ice-options:google-ice
a=fingerprint:sha-256 8B:8B:06:27:D7:CE:11:61:7D:71:FB:51:E1:0B:B2:FF:4D:2E:0A:78:B3:AE:38:8E:2C:15:47:8F:E6:05:46:32
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=sendrecv
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10; useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:126 telephone-event/8000
a=maxptime:60
a=ssrc:2638032736 cname:VWZ1ppth7+Rds6/J
a=ssrc:2638032736 msid:IvH8lMXanelENfUwO4JmUDk54vtQ1PhaHFOU 9bd42347-56dc-4880-8ff7-08723aaa029f
a=ssrc:2638032736 mslabel:IvH8lMXanelENfUwO4JmUDk54vtQ1PhaHFOU
a=ssrc:2638032736 label:9bd42347-56dc-4880-8ff7-08723aaa029f


send 713 bytes to ws/[172.16.150.1]:52969 at 12:02:45.266010:


SIP/2.0 422 Session Interval Too Small
Via: SIP/2.0/WS vl2ck7hc139b.invalid;branch=z9hG4bK5466877;received=172.16.150.1;rport=52969
From: "1010" ;tag=q87utpe07r
To: ;tag=8Bjjrp69mpDQc
Call-ID: 26btpu9503qvokvpmo20
CSeq: 9262 INVITE
User-Agent: FreeSWITCH-mod_sofia/1.4.7~64bit
Accept: application/sdp
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: timer, path, replaces
Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
Min-SE: 120
Content-Length: 0


recv 274 bytes from ws/[172.16.150.1]:52969 at 12:02:45.304677:


ACK sip:1009@172.16.150.142 SIP/2.0
Via: SIP/2.0/WS vl2ck7hc139b.invalid;branch=z9hG4bK5466877
To: ;tag=8Bjjrp69mpDQc
From: "1010" ;tag=q87utpe07r
Call-ID: 26btpu9503qvokvpmo20
CSeq: 9262 ACK
Content-Length: 0


解决方案:


把session expires 加到大于120



/* SIP Response Reasons
* DOC: http://www.iana.org/assignments/sip-parameters1
* Copied from https://github.com/versatica/OverSIP/blob/master/lib/oversip/sip/constants.rb#L7
*/
REASON_PHRASE: {
100: 'Trying',
180: 'Ringing',
181: 'Call Is Being Forwarded',
182: 'Queued',
183: 'Session Progress',
199: 'Early Dialog Terminated', // draft-ietf-sipcore-199
200: 'OK',
202: 'Accepted', // RFC 3265
204: 'No Notification', //RFC 5839
300: 'Multiple Choices',
301: 'Moved Permanently',
302: 'Moved Temporarily',
305: 'Use Proxy',
380: 'Alternative Service',
400: 'Bad Request',
401: 'Unauthorized',
402: 'Payment Required',
403: 'Forbidden',
404: 'Not Found',
405: 'Method Not Allowed',
406: 'Not Acceptable',
407: 'Proxy Authentication Required',
408: 'Request Timeout',
410: 'Gone',
412: 'Conditional Request Failed', // RFC 3903
413: 'Request Entity Too Large',
414: 'Request-URI Too Long',
415: 'Unsupported Media Type',
416: 'Unsupported URI Scheme',
417: 'Unknown Resource-Priority', // RFC 4412
420: 'Bad Extension',
421: 'Extension Required',
422: 'Session Interval Too Small', // RFC 4028
423: 'Interval Too Brief',
428: 'Use Identity Header', // RFC 4474
429: 'Provide Referrer Identity', // RFC 3892
430: 'Flow Failed', // RFC 5626
433: 'Anonymity Disallowed', // RFC 5079
436: 'Bad Identity-Info', // RFC 4474
437: 'Unsupported Certificate', // RFC 4744
438: 'Invalid Identity Header', // RFC 4744
439: 'First Hop Lacks Outbound Support', // RFC 5626
440: 'Max-Breadth Exceeded', // RFC 5393
469: 'Bad Info Package', // draft-ietf-sipcore-info-events
470: 'Consent Needed', // RFC 5360
478: 'Unresolvable Destination', // Custom code copied from Kamailio.
480: 'Temporarily Unavailable',
481: 'Call/Transaction Does Not Exist',
482: 'Loop Detected',
483: 'Too Many Hops',
484: 'Address Incomplete',
485: 'Ambiguous',
486: 'Busy Here',
487: 'Request Terminated',
488: 'Not Acceptable Here',
489: 'Bad Event', // RFC 3265
491: 'Request Pending',
493: 'Undecipherable',
494: 'Security Agreement Required', // RFC 3329
500: 'JsSIP Internal Error',
501: 'Not Implemented',
502: 'Bad Gateway',
503: 'Service Unavailable',
504: 'Server Time-out',
505: 'Version Not Supported',
513: 'Message Too Large',
580: 'Precondition Failure', // RFC 3312
600: 'Busy Everywhere',
603: 'Decline',
604: 'Does Not Exist Anywhere',
606: 'Not Acceptable'
},

ALLOWED_METHODS: 'INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER',
ACCEPTED_BODY_TYPES: 'application/sdp, application/dtmf-relay',
MAX_FORWARDS: 180,
SESSION_EXPIRES: 180,
MIN_SESSION_EXPIRES: 180
};