Hi,
I have two SIP servers, *A* and *B*, connected each other though a OPENVPN
tunnel. The server *B* needs to t_relay() every SIP message containing the
method MESSAGE to the server *A* but these messages never reach destination.
I have tested the tunnel connectivity and works fine. I wrote a Perl script
(located in *B*) that sends SIP MESSAGES to Kamailio (located in *A*) trying
to figure out what is happening but these messages are received by *A* and
processed correctly but when *B* does the same from Kamailio, it is never
received.
Here is the route part of kamailio.cfg in *B*:
Observation: ($rU == "1004") result is *true*
*
if(is_method("MESSAGE"))
{
if($rU == "1004")
{
xlog("L_INFO","En 1004");
rewritehost("10.8.0.1");
if (!t_relay())
xlog("L_INFO","MIO Error en t_relay");
t_reply("200", "Ok");
xlog("L_INFO","MIO despues rewrite");
exit;
}
.....*
The perl script that WORKS:
*$msg = 'MESSAGE sip:1004@192.168.1.2:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.2
From: "2002" <sip:2002@192.168.1.2 <sip%3A2002(a)192.168.1.2>>;tag=1837944796
To: <sip:1004@192.168.1.2 <sip%3A1004(a)192.168.1.2>>
Call-ID: 19722852989(a)192.168.1.2
CSeq: 15773 MESSAGE
Contact: <sip:2002@**PublicIP-protected**:5060>
Max-Forwards: 29
User-Agent: DBL
Content-Type: text/plain
Content-Length: 34
+595981[protected]
hello from kamailio
';
use IO::Socket;
my $sock = IO::Socket::INET->new( Proto=>'udp',
PeerHost=>'192.168.2.102',
PeerPort=>'5060');
print "Sending msg $msg\n";
$sock->send($msg) or die "error sending $!\n";
*Please help!
Thanks in advance.
Carlos.
Hello all,
Just wondering if anyone know any tutorial on setting up HA+DRBD solution for kamailio.
Especially creating partitions, DRBD devices and mount points.
Thanks in advance,
-Sid
"May the light be with you." ______________________________________________
Siddhardha Garige
www.luminepixels.com
Hi all..
I have solve the problem .
Cheers,
vivi
From: vivi [mailto:vivi.hilton@gmail.com]
Sent: Saturday, June 06, 2009 11:29 PM
To: 'users(a)lists.kamailio.org'
Subject: /usr/local/sbin/kamdbctl create error
Hi all
I have specify the wanted db type (DBENGINE=MYSQL) in the
/usr/local/etc/kamailio/kamctlrc
then I using "/usr/local/sbin/kamdbctl create" to create MySQL database,
but I got this error:
ERROR: database engine not specified, please setup one in the config script
root@acer:/usr/local/src/kamailio-1.5.0/sip-server# vim
/usr/local/etc/kamailio/kamctlrc
root@acer:/usr/local/src/kamailio-1.5.0/sip-server# /usr/local/sbin/kamdbctl
create
MySQL password for root:
INFO: test server charset
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2)
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2)
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
/usr/local/lib/kamailio/kamctl/kamdbctl.mysql: line 112: [: =: unary
operator expected
INFO: creating database openser ...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2)
ERROR: Creating core database and grant privileges failed!
Cheers,
vivi
Dear Sir,
I am using kamailio 1.5.0, having installed and configured as given on the
kamailio site
<http://www.kamailio.org/dokuwiki/doku.php/install:kamailio-1.5.x-from-svn>
on my PC having Centos operating system. I have configured the config files
kamailio.cfg, kamctlrc accordingly as given on site.
when I start the kamailio using kamctl start command. it gives the error
message like
*[root@localhost ~]# kamctl start
database engine 'MYSQL' loaded
Control engine 'FIFO' loaded
INFO: Starting Kamailio :
ERROR: PID file /var/run/kamailio.pid does not exist -- Kamailio start
failed
*please* *help me out to solve this problem and suggest me where I am
wrong. * *I have configured kamalio so many times it gives me the same kind
of error message.
*
*
-
With Regards,
Dinesh Kumar Gautam
Noida,
+919911838275
Hello,
My setup includes a cellphone that uses Wi-Fi to hookup to the internet
with IP 192.168.1.101. Cellphone app, tries to register with VOIPSwitch
through an outbound proxy server(Kamailio + rtpproxy), which rewrites SDP
to force rtp through an rtpproxy.
I can make a call from the cellphone to a PSTN number. When the PSTN
endpoint hangs up, VOIPSwitch relays a BYE message to the proxy that looks
like :
No. Time Source Destination Protocol Info
27 18.383929 IPaddr_VoipSwitch IPaddr_proxy SIP
Request: BYE sip:1234@IPaddr_VoipSwitch
Frame 27 (420 bytes on wire, 420 bytes captured)
Ethernet II, Src: Unispher_40:b5:39 (00:90:1a:40:b5:39), Dst:
Supermic_bd:b9:bc (00:30:48:bd:b9:bc)
Internet Protocol, Src: IPaddr_VoipSwitch , Dst: IPaddr_proxy
User Datagram Protocol, Src Port: sip (5060), Dst Port: 7160 (7160)
Session Initiation Protocol
Request-Line: BYE sip:1234@IPaddr_VoipSwitch SIP/2.0
Method: BYE
[Resent Packet: False]
Message Header
Route: <sip:IPaddr_proxy:7160;lr=on;nat=yes>
CSeq: 1 BYE
Via: SIP/2.0/UDP IPaddr_VoipSwitch:5060;
branch=z9hG4bk180242100434182912333954
From: sip:5678@IPaddr_VoipSwitch;tag=18024210041929123187506289
Call-ID: LUOyIDm-ecy36NcUfj5G3v1lM6g5snkM
To: "1234"
<sip:1234@IPaddr_VoipSwitch>;tag=9XHJmiuf58vTrF7.vwflEK-G63JVPQSi
Content-Length: 0
The request URI in the above message is the IP address of VOIPSwitch
itself, which causes the proxy to forward the BYE message back to
VOIPSwitch. The cellphone never receives the BYE message and consequently
never hangs up.
Any suggestions on how i can get around this problem ?
Thanks and Regards,
Vikram.
Hello all,
I recently add a classical Audiocodes Mediant 2000 with 2x 8E1, the purpose
is to have several interconnections with PSTN.
I configured it like this :
Audiocodes registers as a gateway to the Kamailio, using a dedicated port
(5062).
Registration seems to be OK, and the pstn gw uses OPTIONS method to ping the
proxy.
I can attack the Audiocodes with a SIP phone behind Kamailio, no pbm.
But the audiocodes returns some errors about SIP headers sent by Kamailio :
( sip_stack)(44732 ) AcSIPParser: Problem in SIP Message Headers [Time:
12:30:26]
( sip_stack)(44733 ) !! [ERROR] AcSIPParser: Parse Error. Unexpected symbol
'0' in scheme. ALPHA expected
Here you have the example of an INVITE from a SIP phone to the PSTN :
** audiocodes debug **
4d:12h:30m:26s ( lgr_flow)(44730 ) ---- Incoming SIP Message from
77.246.81.132:5060 ----
INVITE sip:0323719001@77.246.81.136:5062;transport=udp SIP/2.0
Record-Route: <sip:77.246.81.132;lr=on;ftag=71078b346a20fb3eo0;nat=yes>
Via: SIP/2.0/UDP 77.246.81.132;branch=z9hG4bKdace.1ab1d59.0
Via: SIP/2.0/UDP
192.168.0.113:5060;rport=15170;received=77.246.81.162;branch=z9hG4bK-b432f96
From: "Sam" <sip:0123451010@sip.720.fr
<sip%3A0123451010(a)sip.720.fr>>;tag=71078b346a20fb3eo0
To: <sip:0323719001@sip.720.fr <sip%3A0323719001(a)sip.720.fr>>
Call-ID: 944d8aec-27503ee6(a)192.168.0.113
CSeq: 102 INVITE
Max-Forwards: 49
Contact: "Sam" <sip:0123451010@77.246.81.162:15170>
Expires: 240
User-Agent: Linksys/SPA941-5.1.8
Content-Length: 281
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, PRACK, REFER
Supported: 100rel, replaces
Content-Type: application/sdp
P-Asserted-Identity: <0123451010>
Remote-Party-ID: <0123451010>;party=caller;privacy=none;screen=yes
v=0
o=- 26933860 26933860 IN IP4 192.168.0.113
s=-
c=IN IP4 77.246.81.133
t=0 0
m=audio 35038 RTP/AVP 18 0 8 101
a=rtpmap:18 G729a/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:30
a=sendrecv
a=nortpproxy:yes
( sip_stack)(44732 ) AcSIPParser: Problem in SIP Message Headers [Time:
12:30:26]
( sip_stack)(44733 ) !! [ERROR] AcSIPParser: Parse Error. Unexpected symbol
'0' in scheme. ALPHA expected
( sip_stack)(44734 ) !! [ERROR] Message type: INVITE [Time: 12:30:26]
( sip_stack)(44735 ) !! [ERROR] Source header: [Time: 12:30:26]
( sip_stack)(44736 ) !! [ERROR] Line: 17. Column: 23 [Time: 12:30:26]
The outgoing INVITE from Kamailio is exactly the same received by the
AudioCodes.
When I searched over Google, I just found 2 answers about Asterisk /
Audiocodes unsolved problem, but no more informations.
I supposed that the problem is as indicated : " s=- " where source is empty
in place of "NULL" / "0" or something like this ...
Someone can confirm or already met the problem ?
Many thanks all :)
.Sam.
Hi all,
For a project on which I'm currently working, I am having some problems
figuring out how to correctly configure Kamailio to communicate with RTP
Proxy in order to send media into and out of a network with private IP
address ranges.
I have a proxy set up to send the SIP traffic, and all of this is
working fine. However, I'm having some trouble getting the RTP Proxy
set up. Currently, when the call is connected, the offer/answer is made
and RTP Proxy seems to be taking over, but I'm having trouble getting my
audio to flow in both directions.
Examination of the traffic coming into and out of this machine seems to
indicate that the IP addresses aren't being mangled correctly.
Specifically, it appears the internal IP address isn't being changed to
reflect the IP address of the machine on which RTP Proxy is running, so
that when the caller tries to send audio back, the IP it's given to
reply to is 10.10.x.x, which obviously won't work.
I have tried experimenting with specifically setting IP addresses in the
rtpproxy_offer() and _answer() methods to no avail, as well as setting
various flags in those methods. However, I must admit that I'm not
entirely sure what's happening under the hood with these methods, or
what rtpproxy is doing with that information when it gets it. Rather
than continue to hack at this by trial and error, I'm hoping someone
here can point me in the right direction.
Any advice, example code or pep talks would be greatly appreciated.
Thanks in advance,
--
Joe Hart
Voice Systems Integrator
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0673
Hello,
I used Kamailio+rtpproxy to record a session and rtpproxy outputs the
following files
long_file_name.a.rtp, long_file_name.a.rtcp, long_file_name.o.rtp,
long_file_name.o.rtcp
http://www.rtpproxy.org/wiki/RTPproxy/FAQ
From the Rtpproxy FAQ above, i tried to extract the audio using
rtpbreak and sox.
rtpbreak -W -r long_file_name.a.rtp
rtpbreak -W -r long_file_name.o.rtp
The above commands generate rtp.0.0.raw, rtp.1.0.raw.
Then when i run sox using
sox --combine merge -r 8k -A rtp.0.0.raw -r 8k -A rtp.1.0.raw -t wavpcm
-s out.wav i get the following errors :
sox: invalid option -- -
sox: -c must be given a number
Is there a switch/anything else that i am missing ?
Thanks in advance,
Regards,
Vikram.
Hello,
We are using kamailio 1.5 and we have the following problem with ldap_search:
A call comes in. If it is to a VOIP user, it will be routed to kamailio, and eventually go to the ldap lookup route: route[10] to look up the user.
This is always successful (LDAP can connect).
It will then look up user preferences (call forwarding etc.) from SQL in route[12] and route based on this result in route[13].
If the result is "CFU (call forward unconditional) = on", the URI is changed and route[10] (LDAP lookup) is called again.
This is always successful (LDAP can connect).
If the result is "CFB (call forward busy) = on" and the user is busy, the URI is changed and route[10] (LDAP lookup) is called again.
This is also always successful (LDAP can connect).
If the result is "CFNR (call forward no reply) = on", the timeout is changed and the call is delivered to the phone through route[14] (location) and route[15] (relay).
If the user does not answer, the URI is changed in failure_route[1] and route[10] is called.
For some unknown reason, ldap_search always fails in this scenario with the messages: "ldap_session not found", "couldn't get ldap session" and then "no LDAP entry found".
Why?
And why does this result in the -1 return code and not the -2 return code for ldap_search?
The only differences I can think of is that the unsuccessful scenario comes from FAILURE_ROUTE instead of REQUEST_ROUTE, and that longer time has passed since the original invite.
Here's a sample log:
NOTE the three ERROR lines, the INFO line and the ROUTE 10 line.
Dec 27 13:31:55 [3373]: INVITE received from sip:<CALLER>@<SBC_IP> <source IP: <SBC_IP>> to sip:<CALLEE>@<KAM_IP>:
Dec 27 13:31:55 [3373]: ERROR:ldap:ldap_reconnect: [ldapprod]: LDAP reconnect successful
Dec 27 13:31:55 [3373]: ROUTE 10: LDAP returned: UID = <UID>, voipSipPrimaryUri = <PRIMARY_URI>, voipExtensionUri = sip:<CALLEE>@<DOMAIN>
Dec 27 13:31:55 [3373]: ROUTE 12: Effective user properties for UID <UID>: CFU: off <FORWARDTO>, CFB: off <FORWARDTO>, CFNR: on:25 <FORWARDTO>, CFNC: off <FORWARDTO>, VM: <CALLEE>, busy_level: 1, DBrows: 1
Dec 27 13:31:55 [3373]: -------------------- Calling sip:<CALLEE>@<DOMAIN> for 25 seconds. --------------------
Dec 27 13:31:55 [3373]: ROUTE 15: Sending 105 INVITE from sip:<CALLER>@<SBC_IP> to sip:<CALLEE>@<CALLEE_IP> (via <<null>>)
Dec 27 13:31:55 [3383]: Response 100 Trying to Cseq 102 INVITE received from <PROTO>:<CALLEE_IP>:<PORT>
Dec 27 13:31:55 [3385]: Response 180 Ringing to Cseq 102 INVITE received from <PROTO>:<CALLEE_IP>:<PORT>
Dec 27 13:32:20 [3388]: FAILURE_ROUTE 1: Timeout for: 104 INVITE from <CALLER> -> <CALLEE>
Dec 27 13:32:20 [3388]: -------------------- Forwarding on no reply to <FORWARDTO> --------------------
Dec 27 13:32:20 [3388]: ERROR:ldap:get_connected_ldap_session: [ldapprod]: ldap_session not found
Dec 27 13:32:20 [3388]: ERROR:ldap:lds_search: [ldapprod]: couldn't get ldap session
Dec 27 13:32:20 [3388]: INFO:ldap:ldap_search_impl: no LDAP entry found
Dec 27 13:32:20 [3388]: ROUTE 11: Number lookup results for <FORWARDTO>: Node: VOIP.
Dec 27 13:32:20 [3388]: CONFIG ERROR: VOIP number not found in LDAP. Hanging up.
Dec 27 13:32:20 [3373]: Response 487 Request Cancelled to Cseq 102 INVITE received from <PROTO>:<CALLEE_IP>:<PORT>
Here's the ldap config file:
[ldapprod]
ldap_server_url = "ldap://ldap.<DOMAIN>"
ldap_network_timeout = 500
ldap_client_bind_timeout = 500
kamailio config snippets (in case you need them):
# LDAP lookup for UID and primary URI
route[10] {
...
ldap_search("ldap://ldapprod/<DN>?uid,voipSipPrimaryUri,voipExtensionUri?one?(&(objectClass=voipAddress)(|(voipSipUri=sip:$rU@uio.no)(|(voipSipUri=$var(uri))(voipSipUri=$var(e164uri)))))");
if ($retcode < 1) {
switch ($retcode) {
case -1:
# no LDAP entry found
route(11);
return(1);
case -2:
# internal error
sl_send_reply("500", "Internal server error");
exit;
}
}
ldap_result("uid/$avp(s:uid)");
$avp(s:exten) = null;
if (!ldap_result("voipExtensionUri/$avp(s:exten)")) {
xlog("L_INFO", "voipExtensionUri not found.\n");
}
if (!ldap_result("voipSipPrimaryUri/$avp(s:p-uri)")) {
xlog("L_WARN", "voipSipPrimaryUri not found.\n");
#exit here?
}
if (isflagset(1)) {
xlog("L_INFO", "ROUTE 10: LDAP returned: UID = $avp(s:uid), voipSipPrimaryUri = $avp(s:p-uri), voipExtensionUri = $avp(s:exten)\n");
}
if $avp(s:exten) != null {
$ru=$avp(s:exten);
} else {
$ru=$avp(s:p-uri);
}
route(12);
}
}
# Number lookup. Non-VoIP URI's go here.
route[11] {
...
}
# Database lookup for call forwarding.
route[12] {
...
}
# Call forwarding logic
route[13] {
if (is_method("INVITE")) {
$avp(s:uio_timer_avp) = "300";
if ($avp(s:cfu_status) == "on") {
# Forward immediately
xlog("L_INFO", "-------------------- $rU forwarded unconditionally to $avp(s:cfu_number). --------------------\n");
$rU = $avp(s:cfu_number);
route(10);
}
...
if ( $var(dlg_busy) >= $avp(s:busy_level) ) {
if ($avp(s:cfb_status) == "on") {
xlog("L_INFO", "-------------------- $rU has $var(dlg_busy) active calls. Treshold $avp(s:busy_level). Forwarding on busy to $avp(s:cfb_number) --------------------\n");
$rU = $avp(s:cfb_number);
route(10);
}
...
else if ($avp(s:cfnr_status) == "on") {
# Forward to phone with timeout then to $avp(s:cfnr_number).
# t_set_fr($avp(s:cfnr_timeout) + "000"); # Recommended method in 3.1. Function does not exist in 1.5. Using old method (avp).
$avp(s:uio_timer_avp) = $avp(s:cfnr_timeout);
xlog("L_INFO", "-------------------- Calling $ru for $avp(s:uio_timer_avp) seconds. --------------------\n");
route(14);
}
...
}
failure_route[1] {
...
if $avp(s:cfnr_status) == "on" {
if (isflagset(1)) {
xlog("L_INFO", "FAILURE_ROUTE 1: Timeout for: $mi $rm from $fU -> $rU\n");
}
revert_uri();
$rU = $avp(s:cfnr_number);
xlog("L_INFO", "-------------------- Forwarding on no reply to $rU --------------------\n");
route(10);
}
...
}
With kind regards,
Pan