Kamailio - WebSocket - 设置

时间:2015-08-11 00:10:10

标签: kamailio

我是一名网络开发人员,想要创建一个WEBRTC应用程序。我在SIP的知识水平是初学者。我希望我的应用程序与kamailio交谈,并在设置kamailio的过程中遵循以下文章。

http://nil.uniza.sk/sip/kamailio/configuring-kamailio-4x-websocket http://kamailio.org/docs/modules/4.3.x/modules/websocket.html

我能够将(使用try.jssp.net)连接到kamailio作为多个客户端进行初始设置但无法从一个浏览器客户端调用到另一个客户端。以下是我在kamailio服务器中看到的日志消息。

我多次记录此错误消息

Aug  9 20:27:10 ip-10-94-99-80 /usr/sbin/kamailio[25063]: INFO: <core> [parser/parse_fline.c:146]: parse_first_line(): ERROR:parse_first_line: method not followed by SP
Aug  9 20:27:10 ip-10-94-99-80 /usr/sbin/kamailio[25063]: ERROR: <core> [parser/parse_fline.c:243]: parse_first_line(): parse_first_line: bad message (offset: 0)
Aug  9 20:27:10 ip-10-94-99-80 /usr/sbin/kamailio[25063]: DEBUG: <core> [parser/msg_parser.c:619]: parse_msg(): parse_msg: invalid message
Aug  9 20:27:10 ip-10-94-99-80 /usr/sbin/kamailio[25063]: ERROR: <core> [parser/msg_parser.c:705]: parse_msg(): ERROR: parse_msg: message=<#001#020#002#021#037?#037?#012^cP#012^cP#001#020#002#026?A#037?H#0229w>
Aug  9 20:27:10 ip-10-94-99-80 /usr/sbin/kamailio[25063]: ERROR: <core> [receive.c:149]: receive_msg(): core parsing of SIP message failed (10.94.99.80:8088/1)

并在日志中找到了这个

DEBUG: <core> [dset.c:774]: uri_add_rcv_alias(): encoded <sip:d63im5st@avltu6trdhg0.invalid;transport=ws;ob> => [sip:d63im5st@avltu6trdhg0.invalid;transport=ws;ob;alias=172.18.57.119~60481~5]
Aug  9 20:27:33 ip-10-94-99-80 /usr/sbin/kamailio[25074]: DEBUG: nathelper [nathelper.c:965]: add_contact_alias_0_f(): contact uri host is not an ip address
Aug  9 20:27:33 ip-10-94-99-80 /usr/sbin/kamailio[25074]: ERROR: nathelper [nathelper.c:977]: add_contact_alias_0_f(): you can't call add_contact_alias twice, check your config!
Aug  9 20:27:33 ip-10-94-99-80 /usr/sbin/kamailio[25074]: ERROR: <script>: Error aliasing contact <<sip:d63im5st@avltu6trdhg0.invalid;transport=ws;ob>>

其他日志信息

Aug  9 20:27:10 ip-10-94-99-80 /usr/sbin/kamailio[25072]: DEBUG: websocket [ws_frame.c:661]: ws_frame_receive(): Rx SIP message:#012REGISTER sip:ip-10-94-99-80.customdomain.com SIP/2.0#015#012Via: SIP/2.0/WS avltu6trdhg0.invalid;branch=z9hG4bK6572200#015#012Max-Forwards: 69#015#012To: <sip:agent01@ip-10-94-99-80.customdomain.com>#015#012From: "agent01" <sip:agent01@ip-10-94-99-80.customdomain.com>;tag=68gqn060sb#015#012Call-ID: 22oik6ujj2bfjuuauasgdq#015#012CSeq: 1 REGISTER#015#012Contact: <sip:d63im5st@avltu6trdhg0.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:74809558-6d30-42c3-afbd-072d5d0ad5ab>";expires=600#015#012Expires: 600#015#012Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER#015#012Supported: path,gruu,outbound#015#012User-Agent: JsSIP 0.7.3#015#012Content-Length: 0#015#012#015#012
Aug  9 20:27:15 ip-10-94-99-80 /usr/sbin/kamailio[25073]: DEBUG: websocket [ws_frame.c:661]: ws_frame_receive(): Rx SIP message:#012REGISTER sip:ip-10-94-99-80.customdomain.com SIP/2.0#015#012Via: SIP/2.0/WS egvf3nqhdl35.invalid;branch=z9hG4bK4737687#015#012Max-Forwards: 69#015#012To: <sip:agent02@ip-10-94-99-80.customdomain.com>#015#012From: "agent02" <sip:agent02@ip-10-94-99-80.customdomain.com>;tag=8dldgic783#015#012Call-ID: v4rim0ku5dtqrtqkcgv0an#015#012CSeq: 1 REGISTER#015#012Contact: <sip:bh9ao5ab@egvf3nqhdl35.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:f593c0a4-0984-46a0-8f3e-a231fb4d1713>";expires=600#015#012Expires: 600#015#012Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER#015#012Supported: path,gruu,outbound#015#012User-Agent: JsSIP 0.7.3#015#012Content-Length: 0#015#012#015#012
Aug  9 20:27:33 ip-10-94-99-80 /usr/sbin/kamailio[25074]: DEBUG: websocket [ws_frame.c:661]: ws_frame_receive(): Rx SIP message:#012INVITE sip:agent02@ip-10-94-99-80.customdomain.com SIP/2.0#015#012Via: SIP/2.0/WS avltu6trdhg0.invalid;branch=z9hG4bK9231290#015#012Max-Forwards: 69#015#012To: <sip:agent02@ip-10-94-99-80.customdomain.com>#015#012From: "agent01" <sip:agent01@ip-10-94-99-80.customdomain.com>;tag=jngmrtvvec#015#012Call-ID: s1fdqticqc31ru6p5cfs#015#012CSeq: 9973 INVITE#015#012X-Can-Renegotiate: true#015#012Contact: <sip:d63im5st@avltu6trdhg0.invalid;transport=ws;ob>#015#012Content-Type: application/sdp#015#012Session-Expires: 90#015#012Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER#015#012Supported: timer,ice,replaces,outbound#015#012User-Agent: JsSIP 0.7.3#015#012Content-Length: 3876#015#012#015#012v=0#015#012o=- 7098982196661734965 2 IN IP4 127.0.0.1#015#012s=-#015#012t=0 0#015#012a=group:BUNDLE audio video#015#012a=msid-semantic: WMS XynF2020ZZYtShWgfoYkS23q5sgbtcquUl0s#015#012m=audio 56249 RTP/SAVPF 111 103 104 9 0 8 106 105 13 126#015#012c=IN IP4 172.18.57.119#015#012a=rtcp:54672 IN IP4 172.18.57.119#015#012a=candidate:2390899093 1 udp 2122260223 172.18.57.119 56249 typ host generation 0#015#012a=candidate:1221703924 1 udp 2122194687 192.168.0.105 60197 typ host generation 0#015#012a=candidate:2390899093 2 udp 2122260222 172.18.57.119 54672 typ host generation 0#015#012a=candidate:1221703924 2 udp 2122194686 192.168.0.105 54423 typ host generation 0#015#012a=candidate:3221341541 1 tcp 1518280447 172.18.57.119 0 typ host tcptype active generation 0#015#012a=candidate:106054660 1 tcp 1518214911 192.168.0.105 0 typ host tcptype active generation 0#015#012a=candidate:3221341541 2 tcp 1518280446 172.18.57.119 0 typ host tcptype active generation 0#015#012a=candidate:106054660 2 tcp 1518214910 192.168.0.105 0 typ host tcptype active generation 0#015#012a=ice-ufrag:Las7oILW40BIM8zF#015#012a=ice-pwd:A3ewod5vG57HcA/JvnAaRGWV#015#012a=fingerprint:sha-256 31:22:C5:67:B6:CB:D0:66:7D:E4
Aug  9 20:27:33 ip-10-94-99-80 /usr/sbin/kamailio[25074]: DEBUG: websocket [ws_frame.c:661]: ws_frame_receive(): Rx SIP message:#012ACK sip:agent02@ip-10-94-99-80.customdomain.com SIP/2.0#015#012Via: SIP/2.0/WS avltu6trdhg0.invalid;branch=z9hG4bK9231290#015#012To: <sip:agent02@ip-10-94-99-80.customdomain.com>;tag=5f994d94abde79a17171e171202b0e42.d13e#015#012From: "agent01" <sip:agent01@ip-10-94-99-80.customdomain.com>;tag=jngmrtvvec#015#012Call-ID: s1fdqticqc31ru6p5cfs#015#012CSeq: 9973 ACK#015#012Content-Length: 0#015#012#015#012

感谢任何帮助

1 个答案:

答案 0 :(得分:0)

所以你应该检查你的kamailio.cfg,我认为配置已经坏了。

也许您想将Asterisk或Freeswitch用于WebRTC和PBX。您可以在此处找到Kamailio和Freeswitch集成教程:

http://kb.asipto.com/freeswitch:kamailio-3.1.x-freeswitch-1.0.6d-sbc

使用Kamailio作为路由和注册服务器将是一个不错的选择。通常我们使用Freeswitch或Asterisk作为这类操作的媒体服务器。

请随时问我任何问题。