[Kamailio-Users] content about kamailio start error

Daniel-Constantin Mierla miconda at gmail.com
Wed Sep 30 21:29:19 CEST 2009



On 27.09.2009 3:08 Uhr, zhangchao00001 wrote:
> Dear sir:
> I get the error during during processing of SIP message. The config 
> file i used is below (the config works well on other kamailio server). 
> By the way , the email system i used dosen't support:/all the time 
> please keep CC-ing to mailing list address /
> or maybe i add the mailing list address in a wrong place, mails with a 
> cc-ing added will be posted back.
> is it CC:users at lists.kamailio.org <mailto:users at lists.kamailio.org>?
yes this is the right email address to cc.


To spot if there is a memleak, you have to follow these instructions:

http://www.kamailio.org/dokuwiki/doku.php/troubleshooting:memory

Once you have the memlog, send it over.

Cheers,
Daniel


> debug=3
> fork=yes
> log_stderror=yes
> port=5060
> ####### Modules Section ########
> mpath="/usr/local/lib/kamailio/modules/"
> loadmodule "db_mysql.so"
> loadmodule "mi_fifo.so"
> loadmodule "sl.so"
> loadmodule "tm.so"
> loadmodule "rr.so"
> loadmodule "pv.so"
> loadmodule "maxfwd.so"
> loadmodule "usrloc.so"
> loadmodule "registrar.so"
> loadmodule "textops.so"
> loadmodule "uri_db.so"
> loadmodule "siputils.so"
> loadmodule "xlog.so"
> loadmodule "acc.so"
> loadmodule "path.so"
> loadmodule "auth.so"
> loadmodule "auth_db.so"
> loadmodule "domain.so"
> loadmodule "presence.so"
> loadmodule "presence_xml.so"
> loadmodule "nathelper.so"
> # ----------------- setting module-specific parameters ---------------
> modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
> modparam("rr", "enable_full_lr", 1)
> modparam("rr", "append_fromtag", 0)
> modparam("registrar", "method_filtering", 1)
> modparam("registrar", "append_branches", 0)
> modparam("registrar", "max_contacts", 10)
> modparam("uri_db", "use_uri_table", 0)
> modparam("uri_db", "db_url", "")
> modparam("acc", "early_media", 1)
> modparam("acc", "report_ack", 1)
> modparam("acc", "report_cancels", 1)
> modparam("acc", "detect_direction", 0)
> modparam("acc", "failed_transaction_flag", 3)
> modparam("acc", "log_flag", 1)
> modparam("acc", "log_missed_flag", 2)
> modparam("acc", "log_extra", 
> "src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd")
> modparam("acc", "db_flag", 1)
> modparam("acc", "db_missed_flag", 2)
> modparam("domain", "db_url", "mysql://root:123456@localhost/SIP")
> modparam("acc", "db_extra", 
> "src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd")
> modparam("usrloc", "db_mode", 2)
> modparam("usrloc", "db_url", "mysql://root:123456@localhost/SIP")
> modparam("auth_db", "calculate_ha1", yes)
> modparam("auth_db", "password_column", "password")
> modparam("auth_db", "db_url", "mysql://root:123456@localhost/SIP")
> modparam("auth_db", "load_credentials", "")
> modparam("domain", "db_url", "mysql://root:123456@localhost/SIP")
> modparam("domain", "db_mode", 1)
> modparam("alias_db|auth_db|usrloc|uri_db", "use_domain", 1)
> modparam("presence|presence_xml", "db_url", 
> "mysql://root:123456@localhost/SIP")
> modparam("presence_xml", "force_active", 1)
> modparam("presence", "server_address", "sip:26.28.29.253:5060")
> modparam("nathelper", "rtpproxy_sock", "udp:26.28.249.253:7722")
> modparam("nathelper", "natping_interval", 30)
> modparam("nathelper", "rtpproxy_tout", 10)
> modparam("nathelper", "ping_nated_only", 1)
> modparam("nathelper", "sipping_bflag", 7)
> modparam("nathelper", "sipping_from", "sip:pinger at kamailio.org 
> <mailto:pinger at kamailio.org>")
> modparam("registrar|nathelper", "received_avp", "$avp(i:80)")
> modparam("usrloc", "nat_bflag", 6)
> modparam("path", "use_received", 1)
>
> ####### Routing Logic ########
> route{
> if (!mf_process_maxfwd_header("10")) {
> sl_send_reply("483","Too Many Hops");
> exit;
> }
> if(msg:len>=2048)
> {
> sl_send_reply("513","Message too big");
> exit;
> }
> route(4);
> if (has_totag()) {
> if (loose_route()) {
> if (is_method("BYE")) {
> setflag(1); # do accounting ...
> setflag(3); # ... even if the transaction fails
> }
> route(1);
> } else {
> if (is_method("SUBSCRIBE") && uri == myself) {
> # in-dialog subscribe requests
> route(2);
> exit;
> }
> if ( is_method("ACK") ) {
> if ( t_check_trans() ) {
> # non loose-route, but stateful ACK; must be an ACK after a 487 or 
> e.g. 404 from upstream server
> t_relay();
> exit;
> } else {
> # ACK without matching transaction ... ignore and discard.\n");
> exit;
> }
> }
> sl_send_reply("404","Not here");
> }
> exit;
> }
> if (is_method("CANCEL"))
> {
> if (t_check_trans())
> t_relay();
> exit;
> }
> t_check_trans();
> if(!uri==myself)
> {
> append_hf("P-hint: outbound\r\n");
> if(is_method("REGISTER|MESSAGE"))
> {
> if(is_method("REGISTER"))
> {
> if(!add_path_received())
> {
> sl_send_reply("503","Internal Path Error!");
> exit();
> }
> }
> }
> else
> {
> record_route();
> }
> route(1);
> }
> # authentication
> route(3);
> # record routing
> if (!is_method("REGISTER|MESSAGE"))
> record_route();
> # account only INVITEs
> if (is_method("INVITE")) {
> setflag(1); # do accounting
> }
> if( is_method("PUBLISH|SUBSCRIBE"))
> route(2);
> if (is_method("REGISTER"))
> {
> if (!save("location"))
> sl_reply_error();
>
> exit;
> }
> if ($rU==NULL) {
> # request with no Username in RURI
> sl_send_reply("484","Address Incomplete");
> exit;
> }
> if (!lookup("location")) {
> switch ($retcode) {
> case -1:
> case -3:
> t_newtran();
> t_reply("404", "Not Found");
> exit;
> case -2:
> sl_send_reply("405", "Method Not Allowed");
> exit;
> }
> }
> # when routing via usrloc, log the missed calls also
> setflag(2);
> route(1);
> }
> route[1] {
> if (check_route_param("nat=yes")) {
> setbflag(6);
> }
> if (isflagset(5) || isbflagset(6)) {
> route(5);
> }
> /* example how to enable some additional event routes */
> if (is_method("INVITE"))
> {
> #t_on_branch("1");
> t_on_reply("1");
> t_on_failure("1");
> }
> if (!t_relay()) {
> sl_reply_error();
> }
> exit;
> }
> # Presence route
> /* uncomment the whole following route for enabling presence server */
> route[2]
> {
> if (!t_newtran())
> {
> sl_reply_error();
> exit;
> };
>
> if(is_method("PUBLISH"))
> {
> handle_publish();
> t_release();
> }
> else
> if( is_method("SUBSCRIBE"))
> {
> handle_subscribe();
> t_release();
> }
> exit;
>
> # if presence enabled, this part will not be executed
> if (is_method("PUBLISH") || $rU==null)
> {
> sl_send_reply("404", "Not here");
> exit;
> }
> return;
> }
>
> # Authentication route
> /* uncomment the whole following route for enabling authentication */
> route[3] {
> if (is_method("REGISTER"))
> {
> # authenticate the REGISTER requests (uncomment to enable auth)
> /*if (!www_authorize("", "subscriber"))
> {
> www_challenge("", "0");
> exit;
> }
> if ($au!=$tU)
> {
> sl_send_reply("403","Forbidden auth ID");
> exit;
> }*/
> } else {
> # authenticate if from local subscriber (uncomment to enable auth)
> /*if (from_uri==myself)
> {
> if (!proxy_authorize("", "subscriber")) {
> proxy_challenge("", "0");
> exit;
> }
> if (is_method("PUBLISH"))
> {
> if ($au!=$tU) {
> sl_send_reply("403","Forbidden auth ID");
> exit;
> }
> } else {
> if ($au!=$fU) {
> sl_send_reply("403","Forbidden auth ID");
> exit;
> }
> }
>
> consume_credentials();
> # caller authenticated
> }*/
> }
> return;
> }
> # Caller NAT detection route
> /* uncomment the whole following route for enabling Caller NAT 
> Detection */
> route[4]{
> force_rport();
> if (nat_uac_test("19")) {
> if (method=="REGISTER") {
> fix_nated_register();
> } else {
> fix_nated_contact();
> }
> setflag(5);
> }
> return;
> }
>
> # RTPProxy control
> /* uncomment the whole following route for enabling RTPProxy Control */
> route[5] {
> if (is_method("BYE")) {
> unforce_rtp_proxy();
> } else if (is_method("INVITE")){
> force_rtp_proxy();
> }
> if (!has_totag()) add_rr_param(";nat=yes");
> return;
> }
>
> branch_route[1] {
> xdbg("new branch at $ru\n");
> }
> onreply_route[1] {
> xdbg("incoming reply\n");
> if ((isflagset(5) || isbflagset(6)) && status=~"(183)|(2[0-9][0-9])") {
> force_rtp_proxy();
> }
> if (isbflagset(6)) {
> fix_nated_contact();
> }
> }
> failure_route[1] {
> if (is_method("INVITE") && (isbflagset(6) || isflagset(5)))
> {
> unforce_rtp_proxy();
> }
> if (t_was_cancelled())
> {
> exit;
> }
> if (t_check_status("486|408")) {
> sethostport("26.28.249.125:5060");
> append_branch();
> # do not set the missed call flag again
> t_relay();
> }
> }
>
> ÔÚ2009-09-25£¬"Daniel-Constantin Mierla" <miconda at gmail.com <mailto:miconda at gmail.com>> дµÀ£º
> >Hello,
> >
> >do keep mailing list CC-ed for every mail, otherwise I will stop replying.
> >
> >On 25.09.2009 3:33 Uhr, zhangchao00001 wrote:
> >> Dear sir:
> >> thank you for your reply.
> >> The Kamailio -V result :
> >> version: kamailio 1.5.2-notls (i386/linux)
> >> flags: STATISTICS, USE_IPV6, USE_TCP, DISABLE_NAGLE, USE_MCAST, 
> >> SHM_MMAP, PKG_MALLOC, F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
> >> ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 
> >> MAX_URI_SIZE 1024, BUF_SIZE 65535, PKG_SIZE 4194304
> >> poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
> >> svnrevision: unknown
> >> @(#) $Id: main.c 5608 2009-02-13 16:48:17Z henningw $
> >> main.c compiled on 10:23:04 Sep 23 2009 with gcc 4.3.0
> >> when there's no user, it reports no error, when a UAC register, it 
> >> reports the error below:
> >> Sep 25 09:24:21 [3323] ERROR:core:build_req_buf_from_sip_req: out of 
> >> pkg memory
> >> Sep 25 09:24:21 [3323] ERROR:tm:print_uac_request: no more shm_mem
> >> Sep 25 09:24:21 [3323] ERROR:tm:t_forward_nonack: failure to add branches
> >> Sep 25 09:24:21 [3323] ERROR:tm:_reply_light: failed to allocate shmem 
> >> buffer
> >> Sep 25 09:24:21 [3323] ERROR:tm:relay_reply: no more share memory
> >> what should i do to fix it?
> >does it happen after startup, during processing of SIP message? Is a 
> >stress test? What is the list of loaded modules? If you can share the 
> >config, would be good.
> >
> >Daniel
> >
> >-- 
> >Daniel-Constantin Mierla
> >* Kamailio SIP Masterclass, Nov 9-13, 2009, Berlin
> >* http://www.asipto.com/index.php/sip-router-masterclass/
> >
>   
>
>
> ------------------------------------------------------------------------
> ÍøÒ×ÓÊÏäÓû§¹ºÎï¶ÀÏíÏֽ𷵻¹ 
> <http://fanxian.163.com/fanxian/?keyfrom=163mail.footer>
>
> ------------------------------------------------------------------------
> ÍøÒ×ÓÊÏäÓû§¹ºÎï¶ÀÏíÏֽ𷵻¹ 
> <http://fanxian.163.com/fanxian/?keyfrom=163mail.footer>
>
> ------------------------------------------------------------------------
> ÍøÒ×ÓÊÏäÓû§¹ºÎï¶ÀÏíÏֽ𷵻¹ 
> <http://fanxian.163.com/fanxian/?keyfrom=163mail.footer>
>
> ------------------------------------------------------------------------
> "ÖйúÖÆÔì ",½²ÊöÖйú60ÄêÍùÊ 
> <http://news.163.com/madeinchina/index.html?from=mailfooter>
>
> ------------------------------------------------------------------------
> "ÖйúÖÆÔì ",½²ÊöÖйú60ÄêÍùÊ 
> <http://news.163.com/madeinchina/index.html?from=mailfooter>
>
> ------------------------------------------------------------------------
> "ÖйúÖÆÔì ",½²ÊöÖйú60ÄêÍùÊ 
> <http://news.163.com/madeinchina/index.html?from=mailfooter>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Kamailio (OpenSER) - Users mailing list
> Users at lists.kamailio.org
> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
> http://lists.openser-project.org/cgi-bin/mailman/listinfo/users

-- 
Daniel-Constantin Mierla
* Kamailio SIP Masterclass, Nov 9-13, 2009, Berlin
* http://www.asipto.com/index.php/sip-router-masterclass/




More information about the Users mailing list