Hi ,I am a student studying in VoIP and implementing my theory in SER.
I try to access mysql database to get some information, but have a problem aboout paramaters of exe_msg.
My goal is :count the number of contact addresses that certain user registered, and take
this is my solution:
exec_msg(' Count="select count(contact) from location where username=\"$SIP_HF_CONTACT\" "'
CountResult=`mysql -user -pheslo -e "$Count" ser`;
')
What is the result of "CountResult" ?
I suppose originally that it will be the the number of the query, but it seems not.........
and i try the exec_msg('rm -r test'); but it failed;
Dose the function wored? and how to use it,Hhw can I get my answer what I want to get ?
Hoping someone can give me some advises ^^.
Thannks in advance.
2009-02-26
邱磊
Hello
I am having a prob handling the CANCEL in this scenario
Kamailio 1.4 doing basic load balancing with LCR module.
Calling party makes a call, sends it to Kamailio, Kamailio looks up the destination gw and sends the call to the dest IP.
I am using statefull mode and loose routing.
The calling party makes the call and while it is ringing it hangs up. Kamailio receives the CANCEL and forward it to the dest IP, it receives the 487 from dest IP and pass it back to the calling party.
This is when it gets weird. The calling party sends the ACK to the 487 and it looks like the proxy [kamailio] ignores it and keep sending the 487 to the calling party.
Calling party IP: 192.168.1.200
kamailio[proxy]: 192.168.1.50
dest IP: 192.168.11
PLease see below a tethereal output and my config file.
I would appreciate any help to help me fix this prob.
[root@proxy1 ~]# tethereal -i eth1 -S -w /root/call-with-cancel3.pcap udp port 5060
Running as user "root" and group "root". This could be dangerous.
Capturing on eth1
0.000000 192.168.1.200 -> 192.168.1.50 SIP/SDP Request: INVITE sip:664050495179280@192.168.1.50, with session description
0.000702 192.168.1.50 -> 192.168.1.200 SIP Status: 100 Giving a try
0.000774 192.168.1.50 -> 192.168.1.11 SIP/SDP Request: INVITE sip:664050495179280@192.168.1.11:5060;transport=udp, with session description
0.044219 192.168.1.11 -> 192.168.1.50 SIP Status: 100 Trying
0.731527 192.168.1.11 -> 192.168.1.50 SIP/SDP Status: 183 Session Progress, with session description
0.731585 192.168.1.50 -> 192.168.1.200 SIP/SDP Status: 183 Session Progress, with session description
1.869161 192.168.1.200 -> 192.168.1.50 SIP Request: CANCEL sip:664050495179280@192.168.1.50
1.869626 192.168.1.50 -> 192.168.1.200 SIP Status: 200 canceling
1.869738 192.168.1.50 -> 192.168.1.11 SIP Request: CANCEL sip:664050495179280@192.168.1.11:5060;transport=udp
1.869942 192.168.1.11 -> 192.168.1.50 SIP Status: 487 Request Terminated
1.869946 192.168.1.11 -> 192.168.1.50 SIP Status: 200 OK
1.870243 192.168.1.50 -> 192.168.1.11 SIP Request: ACK sip:664050495179280@192.168.1.11:5060;transport=udp
1.870273 192.168.1.50 -> 192.168.1.200 SIP Status: 487 Request Terminated
1.871112 192.168.1.200 -> 192.168.1.50 SIP Request: ACK sip:664050495179280@192.168.1.50
2.317041 192.168.1.50 -> 192.168.1.200 SIP Status: 487 Request Terminated
3.317025 192.168.1.50 -> 192.168.1.200 SIP Status: 487 Request Terminated
5.317028 192.168.1.50 -> 192.168.1.200 SIP Status: 487 Request Terminated
9.317036 192.168.1.50 -> 192.168.1.200 SIP Status: 487 Request Terminated
13.317043 192.168.1.50 -> 192.168.1.200 SIP Status: 487 Request Terminated
17.317049 192.168.1.50 -> 192.168.1.200 SIP Status: 487 Request Terminated
21.317057 192.168.1.50 -> 192.168.1.200 SIP Status: 487 Request Terminated
25.317064 192.168.1.50 -> 192.168.1.200 SIP Status: 487 Request Terminated
29.317071 192.168.1.50 -> 192.168.1.200 SIP Status: 487 Request Terminated
23 packets captured
This is my routing logic:
####### Routing Logic ########
# main routing logic
route{
xlog("L_INFO", "mylog: starting_main_logic.\n");
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
xlog("L_INFO","mylog: Too Many Hops.\n");
exit;
};
if (msg:len >= 2048 ) {
sl_send_reply("513", "Message too big");
xlog("L_INFO","mylog: Message too big.\n");
exit;
};
if (!method=="REGISTER") {
record_route();
xlog("L_INFO","mylog: Recording Route. Method: [$rm].\n");
}
if (loose_route()) {
# mark routing logic in request
append_hf("P-hint: rr-enforced\r\n");
xlog("L_INFO","mylog: Loose Route section. Method: [$rm].\n");
route(1);
};
if (method=="INVITE") {
if (!load_gws()) {
sl_send_reply("503", "Unable to load gateways");
exit;
}
if(!next_gw()){
sl_send_reply("503", "Unable to find a gateway");
exit;
}
route(1);
}
#CANCEL processing
if (is_method("CANCEL")) {
if (t_check_trans()) t_relay();
exit;
}
}
route[1] {
xlog("L_INFO","mylog: Route 1 section. Method [$rm].");
if (!t_relay()) {
xlog("L_INFO","mylog: Route 1 section. T_Relay failed. Method [$rm].");
sl_reply_error();
};
exit;
}
Hello,
I have a carrier who provides PSTN gateway services. They have
multiple redundant sip gateway devices in their network. The problem
occurs when one of their devices starts to have issues. I will
receive an INVITE request from both gateways with the same call-id.
The problem is that my Kamailio system doesn't detect that I already
set a call up for the INVITE once, and forwards the request to another
server in the dispatcher list. What I end up with is a call on two
asterisk servers, but only one has the actual RTP stream. The BYE
request gets routed to the wrong server, and everything just gets
screwy. If anyone could provide any hint on how I might be able to deal with
this scenario, I would really appreciate it.
I have attached my current config file, and the following is a link to
a google spreadsheet which
shows the SIP trace.
http://spreadsheets.google.com/ccc?key=pU5i2J6Ck3b519-_M6Et3cw
I have masked my IP addresses for my own sanity.
XX.XX.XX.179 - Kamailio SIP Gateway
XX.XX.XX.189 - Asterisk1
XX.XX.XX.186 - Asterisk2
Thanks!
Geoff
Hi,
I have a SRV setup with three equal priority entries and equal weights. I
expected openser (version 1.3.3) to distribute the INVITE requests equally
to all 3 hosts, but it seems that all requests are forwarded to only one
host.
The SRV entries look like this:
_sip._udp.mydomain.com. 8805 IN SRV 100 33 5060 proxy1.mydomain.com.
_sip._udp.mydomain.com. 8805 IN SRV 100 34 5060 proxy1.mydomain.com.
_sip._udp.mydomain.com. 8805 IN SRV 100 33 5060 proxy1.mydomain.com.
And my routing for INVITE request looks like this:
rewritehost("mydomain.com");
rewriteport("");
if (!t_relay()) {
sl_reply_error();
};
exit;
Am I wrong in expecting this to distribute equally to the three proxy hosts?
I thought this would just "work".
Thanks,
Brian.
Hi,
Finally, I've used the send() function in kamailio.cfg with the @ of my UDP server to know when invite and register requests arrive.
Thanks for your help.
marion
-----Message d'origine-----
De : Klaus Darilion [mailto:klaus.mailinglists@pernau.at]
Envoyé : mardi 24 février 2009 21:32
À : Marion.DELEY(a)fr.thalesgroup.com
Cc : users(a)lists.kamailio.org
Objet : Re: [Kamailio-Users] event in kamailio
Marion.DELEY(a)fr.thalesgroup.com wrote:
> Hi everybody,
>
> I'm novice in using Kamailio and I need to know if it's possible to create
> event from kamailio.cfg to another program.
> Actually, I use MI command but I would find a way to force kamailio to send
> me messages and not just responses.
If the other programm supports SIP or HTTP you can send SIP requests
from kamailio.cfg and generate HTTP requests.
regards
klaus
Hi everybody,
I'm novice in using Kamailio and I need to know if it's possible to create
event from kamailio.cfg to another program.
Actually, I use MI command but I would find a way to force kamailio to send
me messages and not just responses.
Some help?
thanks marion
Hello,
I am trying to compile CARRIERROUTE module, I am getting errors below;
Kamailio 1.4
make prefix=/usr modules=modules/carrierroute modules
make[1]: Entering directory
`/usr/local/src/kamailio/sip-server/modules/carrierroute'
Compiling carrierroute.c
gcc -fPIC -DPIC -g -O9 -funroll-loops -Wcast-align -Wall
-minline-all-stringops -falign-loops -ftree-vectorize -mtune=prescott
-Wold-style-definition -Wmissing-field-initializers -Wredundant-decls
-DMOD_NAME='"carrierroute"' -DNAME='"kamailio"' -DVERSION='"1.4.3-notls"'
-DARCH='"i386"' -DOS='"linux"' -DCOMPILER='"gcc 4.3.2"' -D__CPU_i386
-D__OS_linux -D__SMP_yes -DCFG_DIR='"/usr/etc/kamailio/"' -DPKG_MALLOC
-DSHM_MEM -DSHM_MMAP -DUSE_IPV6 -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE
-DHAVE_RESOLV_RES -DSTATISTICS -DCHANGEABLE_DEBUG_LEVEL -DF_MALLOC
-DSVNREVISION='"2:5452M"' -DFAST_LOCK -DADAPTIVE_WAIT
-DADAPTIVE_WAIT_LOOPS=1024 -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN
-DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL
-DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_EPOLL -DHAVE_SIGIO_RT -DHAVE_SELECT
-I/usr/local/include -c carrierroute.c -o carrierroute.o
In file included from carrierroute.c:30:
../../sr_module.h:48:19: error: dlfcn.h: No such file or directory
In file included from
/usr/lib/gcc/i486-linux-gnu/4.3.2/include-fixed/syslimits.h:7,
from
/usr/lib/gcc/i486-linux-gnu/4.3.2/include-fixed/limits.h:11,
from ../../parser/../flags.h:32,
from ../../parser/msg_parser.h:46,
from ../../sr_module.h:50,
from carrierroute.c:30:
/usr/lib/gcc/i486-linux-gnu/4.3.2/include-fixed/limits.h:122:61: error:
limits.h: No such file or directory
In file included from ../../parser/msg_parser.h:47,
from ../../sr_module.h:50,
from carrierroute.c:30:
../../parser/../ip_addr.h:38:20: error: string.h: No such file or directory
../../parser/../ip_addr.h:39:23: error: sys/types.h: No such file or
directory
../../parser/../ip_addr.h:40:24: error: sys/socket.h: No such file or
directory
../../parser/../ip_addr.h:41:24: error: netinet/in.h: No such file or
directory
../../parser/../ip_addr.h:42:19: error: netdb.h: No such file or directory
In file included from ../../parser/../ip_addr.h:46,
from ../../parser/msg_parser.h:47,
from ../../sr_module.h:50,
from carrierroute.c:30:
../../parser/../dprint.h:54:20: error: syslog.h: No such file or directory
../../parser/../dprint.h:55:18: error: time.h: No such file or directory
In file included from ../../parser/../ip_addr.h:46,
from ../../parser/msg_parser.h:47,
from ../../sr_module.h:50,
from carrierroute.c:30:
any idea ?
Thanks in advance.
Asim
On Tuesday 24 February 2009, Husna Bte Mad Baguri wrote:
> There is no error msg.just there is no file name ldap.cfg in
> usr/local/etc/kamailio.lets me explain how i install.
>
> 1.i using ubuntu 8.10
> 2.i use kamailio 1.4.3 with tls
> 3.i install open ldap --> libldap2-dev,ldap-utils,slapd
> 4.then i exclude module =ldap
Hi Husna,
did i understand you correctly, you excluded the ldap module from compilation?
This way it will not be compiled.
> 5.then i install.no error but no file ldap.cfg
> 6.can you explain what next.
It seems that the ldap.cfg file is not installed per default. You find this
file in modules/ldap/etc/ in the kamailio 1.4.3 directory. Just copy it to
the location you want, and probably adapt it to your setup.
Cheers,
Henning
Can someone help me,i counter this error when try to install ldap in kamailio
Compiling ldap_api_fn.c
gcc -fPIC -DPIC -g -O9 -funroll-loops -Wcast-align -Wall -minline-all-stringops -falign-loops -ftree-vectorize -mtune=prescott -Wold-style-definition -Wmissing-field-initializers -Wredundant-decls -DMOD_NAME='"ldap"' -DNAME='"kamailio"' -DVERSION='"1.4.3-notls"' -DARCH='"i386"' -DOS='"linux"' -DCOMPILER='"gcc 4.3.2"' -D__CPU_i386 -D__OS_linux -D__SMP_yes -DCFG_DIR='"/usr/local/etc/kamailio/"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DUSE_IPV6 -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DSTATISTICS -DCHANGEABLE_DEBUG_LEVEL -DF_MALLOC -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_EPOLL -DHAVE_SIGIO_RT -DHAVE_SELECT -I/usr/local/include -c ldap_api_fn.c -o ldap_api_fn.o
ldap_api_fn.c:38:18: error: ldap.h: No such file or directory
In file included from ldap_api_fn.c:40:
Plzzzzz help me
regards
Husna
This e-mail and the attachments are intended solely for the person to whom it has been addressed. It contains privileged and/or confidential information and is privileged or otherwise protected from disclosure. If you are not the person for whom this e-mail was intended, or the e-mail has reached you by mistake, please delete it immediately and
inform us of the error. Our e-mail address is administrator(a)uniten.edu.my.
All opinions, conclusions and other information in this message that do not relate to the official business of Universiti Tenaga Nasional (UNITEN) shall be understood as neither given nor endorsed by UNITEN. UNITEN shall not be responsible for any activity that may be considered as illegal and/or improper use of e-mail and UNITEN further is claims and shall not accept liability for any content of this e-mail, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing.
WARNING
Internet communications cannot be guaranteed to be secured or error-free as information could be intercepted, corrupted, lost, arrive late or contain viruses. As such, we do not accept liability for any errors or omissions in the content of this message which may arise as a result of internet transmission.
UNITEN does not authorize any of its employees to make any defamatory or seditious statements or commit any offence which is contrary to the laws of Malaysia. Any such communications and/or actions by such employees are outside the scope of employment of the said individuals and UNITEN shall not be liable for such communications and/or actions.