If that helps, here's the debug seen from asterisk when I try to call from testteopad2@domain.corp to siptest2@domain.corp: (.188 is the IP of testteopad2 and .181 the ip of siptest2)
<--- SIP read from TCP:192.168.14.25:44622 ---> INVITE sip:siptest2@192.168.14.25 SIP/2.0 Record-Route: sip:192.168.14.25;transport=tcp;lr=on;ftag=19669 Via: SIP/2.0/TCP 192.168.14.25;branch=z9hG4bK4c88.74c368d3.0;i=c Via: SIP/2.0/TCP 192.168.14.188:5060;rport=3075;branch=z9hG4bK5884 From: sip:testteopad2@domain.corp;tag=19669 To: "Alexis" sip:siptest2@192.168.14.25 Call-ID: 8250 CSeq: 20 INVITE Contact: sip:testteopad2@192.168.14.188:3075;transport=tcp Content-Type: application/sdp Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO Max-Forwards: 69 User-Agent: Linphone/3.5.0 (eXosip2/3.6.0) Subject: Phone call Content-Length: 320
v=0 o=testteopad2 752 752 IN IP4 192.168.14.188 s=Talk c=IN IP4 192.168.14.188 t=0 0 m=audio 7078 RTP/AVP 112 111 110 3 0 8 101 a=rtpmap:112 speex/32000 a=fmtp:112 vbr=on a=rtpmap:111 speex/16000 a=fmtp:111 vbr=on a=rtpmap:110 speex/8000 a=fmtp:110 vbr=on a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-11 <-------------> --- (15 headers 14 lines) --- Sending to 192.168.14.25:44622 (NAT) Using INVITE request as basis request - 8250 Found peer 'testteopad2' for 'testteopad2' from 192.168.14.25:44622 Found RTP audio format 112 Found RTP audio format 111 Found RTP audio format 110 Found RTP audio format 3 Found RTP audio format 0 Found RTP audio format 8 Found RTP audio format 101 Found audio description format speex for ID 112 Found audio description format speex for ID 111 Found audio description format speex for ID 110 Found audio description format telephone-event for ID 101 Capabilities: us - (gsm), peer - audio=(gsm|ulaw|alaw|speex|speex16|speex32)/video=(nothing)/text=(nothing), combined - (gsm) Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|) Peer audio RTP is at port 192.168.14.188:7078 Looking for siptest2 in teopad (domain 192.168.14.25) list_route: hop: sip:192.168.14.25;transport=tcp;lr=on;ftag=19669
<--- Transmitting (no NAT) to 192.168.14.25:5060 ---> SIP/2.0 100 Trying Via: SIP/2.0/TCP 192.168.14.25;branch=z9hG4bK4c88.74c368d3.0;i=c;received=192.168.14.25 Via: SIP/2.0/TCP 192.168.14.188:5060;rport=3075;branch=z9hG4bK5884 Record-Route: sip:192.168.14.25;transport=tcp;lr=on;ftag=19669 From: sip:testteopad2@domain.corp;tag=19669 To: "Alexis" sip:siptest2@192.168.14.25 Call-ID: 8250 CSeq: 20 INVITE Server: Asterisk PBX 11.0.1 Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH Supported: replaces, timer Contact: sip:siptest2@192.168.14.32:5060;transport=TCP Content-Length: 0
<------------> Really destroying SIP dialog '35ccffe644eb697214d4d7e34f968a2b@192.168.14.32:5060' Method: INVITE [Nov 19 16:00:59] WARNING[25058][C-00000002]: app_dial.c:2433 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent) Audio is at 19994 Adding codec 100002 (gsm) to SDP Adding non-codec 0x1 (telephone-event) to SDP
<--- Reliably Transmitting (no NAT) to 192.168.14.25:5060 ---> SIP/2.0 200 OK Via: SIP/2.0/TCP 192.168.14.25;branch=z9hG4bK4c88.74c368d3.0;i=c;received=192.168.14.25 Via: SIP/2.0/TCP 192.168.14.188:5060;rport=3075;branch=z9hG4bK5884 Record-Route: sip:192.168.14.25;transport=tcp;lr=on;ftag=19669 From: sip:testteopad2@domain.corp;tag=19669 To: "Alexis" sip:siptest2@192.168.14.25;tag=as73c46699 Call-ID: 8250 CSeq: 20 INVITE Server: Asterisk PBX 11.0.1 Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH Supported: replaces, timer Contact: sip:siptest2@192.168.14.32:5060;transport=TCP Content-Type: application/sdp Content-Length: 261
v=0 o=root 500542260 500542260 IN IP4 192.168.14.32 s=Asterisk PBX 11.0.1 c=IN IP4 192.168.14.32 t=0 0 m=audio 19994 RTP/AVP 3 101 a=rtpmap:3 GSM/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=silenceSupp:off - - - - a=ptime:20 a=sendrecv
<------------>
<--- SIP read from TCP:192.168.14.25:44622 ---> ACK sip:siptest2@192.168.14.32:5060;transport=TCP SIP/2.0 Via: SIP/2.0/TCP 192.168.14.25;branch=z9hG4bKcydzigwkX;i=c Via: SIP/2.0/TCP 192.168.14.188:5060;rport=3075;branch=z9hG4bK22228 From: sip:testteopad2@domain.corp;tag=19669 To: "Alexis" sip:siptest2@192.168.14.25;tag=as73c46699 Call-ID: 8250 CSeq: 20 ACK Contact: sip:testteopad2@192.168.14.188:3075;transport=tcp Max-Forwards: 69 User-Agent: Linphone/3.5.0 (eXosip2/3.6.0) Content-Length: 0
<-------------> --- (11 headers 0 lines) ---
<--- SIP read from TCP:192.168.14.25:44622 ---> BYE sip:siptest2@192.168.14.32:5060;transport=TCP SIP/2.0 Via: SIP/2.0/TCP 192.168.14.25;branch=z9hG4bK5c88.bc649332.0;i=c Via: SIP/2.0/TCP 192.168.14.188:5060;rport=3075;branch=z9hG4bK1571 From: sip:testteopad2@domain.corp;tag=19669 To: "Alexis" sip:siptest2@192.168.14.25;tag=as73c46699 Call-ID: 8250 CSeq: 21 BYE Contact: sip:testteopad2@192.168.14.188:5060;transport=TCP Max-Forwards: 69 User-Agent: Linphone/3.5.0 (eXosip2/3.6.0) Content-Length: 0
<-------------> --- (11 headers 0 lines) --- Sending to 192.168.14.25:5060 (no NAT) Scheduling destruction of SIP dialog '8250' in 32000 ms (Method: BYE)
<--- Transmitting (no NAT) to 192.168.14.25:5060 ---> SIP/2.0 200 OK Via: SIP/2.0/TCP 192.168.14.25;branch=z9hG4bK5c88.bc649332.0;i=c;received=192.168.14.25 Via: SIP/2.0/TCP 192.168.14.188:5060;rport=3075;branch=z9hG4bK1571 From: sip:testteopad2@domain.corp;tag=19669 To: "Alexis" sip:siptest2@192.168.14.25;tag=as73c46699 Call-ID: 8250 CSeq: 21 BYE Server: Asterisk PBX 11.0.1 Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH Supported: replaces, timer Content-Length: 0
<------------>
2012/11/19 Christophe ROY christophe.roy.thales@gmail.com:
Thanks Olle, it helped a lot Now, calls come through Asterisk and voicemail is working.... but it's "working too well" ;)
When I try to call someone, Asterisk tells me that the subscriber is absent and I'm sent directly to voicemail:
app_dial.c:2433 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent)
if I take a look in the asterisk CLI, I have that:
rtpproxy1*CLI> sip show peers Name/username Host Dyn Forcerport ACL Port Status Description Realtime kamailio (Unspecified) a A 0 Unmonitored siptest2/siptest2 (Unspecified) D 0 Unmonitored Cached RT testteopad2/testteopad2 (Unspecified) D 0 Unmonitored Cached RT 3 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 3 offline]
rtpproxy1*CLI> sip show registry Host dnsmgr Username Refresh State Reg.Time 0 SIP registrations.
And I'm not sure I understand correctly the line "Be sure you configure Asterisk to not authenticate SIP requests coming from Kamailio." in the tutorial: I've tried to add in sip.conf these lines:
[kamailio] type=friend permit=192.168.14.0/24 secret= transport=tcp outboundproxy=192.168.14.25
(Kamailio is 192.168.14.25)
Thanks for your help
Christophe
2012/11/15 Olle E. Johansson oej@edvina.net
15 nov 2012 kl. 11:58 skrev Christophe ROY christophe.roy.thales@gmail.com:
Hi everyone
I'm trying to integrate Asterisk with Kamailio for voicemail. I tried to follow this tutorial: http://kb.asipto.com/asterisk:realtime:kamailio-3.3.x-asterisk-10.7.0-astdb BUT:
- I had to adapt it because I use LDAP authentication with Kamailio
- I had problems with Asterisk 10.7 (problems with chan_sip module crashing) so I've installed Asterisk 11 on another VM
- we have high-availability with 2 Kamailio servers, with Kamailio listening on TCP (constraint from our SSL gateway in front of Kamailio) on a "virtual IP" (created by keep-alive): this VIP is not visible with ifconfig, but you can see it with the command "ip addr sh eth0"
For now, we use Linphone on Windows as SIP clients to test. If I don't define WITH_ASTERISK, calls work, I can call someone@domain.tld However, if I define WITH_ASTERISK, calls fail (even with destination registered and available) and I have these errors in the logfile:
Nov 15 11:45:08 kamailio1 /usr/sbin/kamailio[25308]: ERROR: tm [ut.h:333]: no corresponding socket for af 2 Nov 15 11:45:08 kamailio1 /usr/sbin/kamailio[25308]: ERROR: tm [t_fwd.c:424]: ERROR: can't fwd to af 2, proto 1 (no corresponding listening socket)
Seems like Kamailio and ASterisk is not using the same transports. Check sip.conf in Asterisk so that you enable the proper transports that you are using for forwarding. If Asterisk is ONLY listening to udp, add ";transport=udp" to the forwarding URI. To force TCP, use "transport=tcp".
Now since the error message indicates proto 1, which in Kamailio-speak is UDP, it seems like you have an issue with that.
Nov 15 11:45:08 kamailio1 /usr/sbin/kamailio[25308]: ERROR: tm [t_fwd.c:1530]: ERROR: t_forward_nonack: failure to add branches Nov 15 11:45:08 kamailio1 /usr/sbin/kamailio[25308]: INFO: <script>: reply error Nov 15 11:45:08 kamailio1 /usr/sbin/kamailio[25308]: ERROR: sl [sl_funcs.c:371]: ERROR: sl_reply_error used: I'm terribly sorry, server error occurred (1/SL)
It seems to happen on the if (!t_relay()) line in ROUTE[RELAY]
192.168.14.25 is the real IP of the Kamailio server, 192.168.14.24 is the VIP of the Kamailio "cluster" 192.168.14.28 is the IP of the Mysql server 192.168.14.32 is the IP of the Asterisk server
I can't find why the relay doesn't work. I've tried to bypass the VIP and have Kamailio listen on the real IP, but it still doesn't work: I don't seem to have the same errors as above, but I don't see any traffic between Kamailio and Asterisk.
What could be the problem? Thanks for your help
If you forward register to Asterisk, you have to configure outboundproxy in sip.conf in asterisk so that you get messages back from Asterisk. Or use one of my branchces with support for the SIP Path header in Asterisk (using the PATH module in Kamailio).
Using the onsend route you can check IP, port and transport used to deliver a message from Kamailio. CHeck the Kamailio cookbook on the wiki for more information about that.
/O
--
- Olle E. Johansson - oej@edvina.net
- Kamailio & SIP Masterclass Miami FL December 2012
- http://edvina.net/training/
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users