<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000066">
    Hello All;<br>
     Kamailio V4.3.2 gives errors "out of memory" after 339000 calls.my
    server has centos 6.6 and 2.6.32-573.3.1.el6.x86_64 kernel version.
    How can we solve this problem. do i set memdb=1 and then try again?<br>
    <br>
    Thanks<br>
    <br>
    <br>
    Starting with this error;<br>
    <br>
    Sep 24 12:38:50 localhost /usr/local/sbin/kamailio[3518]: ERROR:
    <core> [msg_translator.c:2127]: build_req_buf_from_sip_req():
    out of memory<br>
    Sep 24 12:38:50 localhost /usr/local/sbin/kamailio[3518]: ERROR:
    <core> [forward.c:548]: forward_request(): building failed<br>
    Sep 24 12:38:50 localhost /usr/local/sbin/kamailio[3518]: ERROR: sl
    [sl_funcs.c:363]: sl_reply_error(): ERROR: sl_reply_error used: No
    error (2/SL)<br>
    Sep 24 12:39:06 localhost /usr/local/sbin/kamailio[3514]: ERROR:
    <core> [parser/parse_rr.c:63]: do_parse_rr_body(): parse_rr():
    No memory left<br>
    ..<br>
    ..<br>
    ..<br>
    Sep 24 12:39:02 localhost /usr/local/sbin/kamailio[3484]: ERROR:
    <core> [parser/msg_parser.c:329]: parse_headers():
    ERROR:parse_headers: memory allocation error<br>
    Sep 24 12:39:02 localhost /usr/local/sbin/kamailio[3484]: ERROR:
    dialog [dlg_handlers.c:208]: populate_leg_info(): bad sip message or
    missing Contact hdr<br>
    Sep 24 12:39:02 localhost /usr/local/sbin/kamailio[3484]: ERROR:
    dialog [dlg_handlers.c:488]: dlg_onreply(): could not add further
    info to the dialog<br>
    Sep 24 12:39:02 localhost /usr/local/sbin/kamailio[3484]: ERROR: acc
    [acc_extra.c:267]: extra2strar(): extra2strar: out of memory.<br>
    Sep 24 12:39:02 localhost /usr/local/sbin/kamailio[3484]: ERROR: acc
    [acc_extra.c:267]: extra2strar(): extra2strar: out of memory.<br>
    ..<br>
    ..<br>
    ..<br>
    <br>
    Sep 24 12:39:06 localhost /usr/local/sbin/kamailio[3514]: ERROR:
    <core> [parser/parse_rr.c:360]: print_rr_body(): failed to
    parse RR<br>
    Sep 24 12:39:06 localhost /usr/local/sbin/kamailio[3514]: ERROR:
    dialog [dlg_handlers.c:239]: populate_leg_info(): failed to print
    route records<br>
    Sep 24 12:39:06 localhost /usr/local/sbin/kamailio[3514]: ERROR:
    dialog [dlg_handlers.c:488]: dlg_onreply(): could not add further
    info to the dialog<br>
    Sep 24 12:39:06 localhost /usr/local/sbin/kamailio[3514]: ERROR: acc
    [acc_extra.c:267]: extra2strar(): extra2strar: out of memory.<br>
    Sep 24 12:39:06 localhost /usr/local/sbin/kamailio[3514]: ERROR: acc
    [acc_extra.c:267]: extra2strar(): extra2strar: out of memory.<br>
    ...<br>
    ...<br>
    Going like that.<br>
    <div class="moz-signature">-- <br>
      kamailio.cfg<br>
      ------------<br>
      <br>
      #!KAMAILIO<br>
      #!define WITH_MYSQL<br>
      #!define WITH_AUTH<br>
      #!define WITH_CARR<br>
      #!define WITH_ACC<br>
      ##!define WITH_ACCDB<br>
      #!define WITH_DIALOG<br>
      #!define WITH_ACCDB_COMMENT<br>
      #!define WITH_IPAUTH<br>
      #!define WITH_MULTIDOMAIN<br>
      #!define WITH_SAYAC<br>
      ##!define WITH_BLCKLST<br>
      #!define WITH_NAT<br>
      #!define WITH_UTILS<br>
      #!define WITH_RECORDR<br>
      <br>
      ##!define WITH_JSN<br>
      ##!define WITH_XMLRPC<br>
      ##!define WITH_PIKE<br>
      #!define WITH_RAD<br>
      <br>
      <br>
      ### LOG Levels: 3=DBG, 2=INFO, 1=NOTICE, 0=WARN, -1=ERR<br>
      #!ifdef WITH_DEBUG<br>
      debug=4<br>
      log_stderror=yes<br>
      #!else<br>
      debug=0<br>
      log_stderror=no<br>
      #!endif<br>
      <br>
      memdbg=5<br>
      memlog=5<br>
      <br>
      log_facility=LOG_LOCAL0<br>
      <br>
      fork=yes<br>
      children=64<br>
      <br>
      disable_sctp=yes<br>
      udp4_raw = on<br>
      <br>
      port=5061<br>
      <br>
      #!ifdef WITH_TLS<br>
      enable_tls=yes<br>
      #!endif<br>
      <br>
      # life time of TCP connection when there is no traffic<br>
      # - a bit higher than registration expires to cope with UA behind
      NAT<br>
      tcp_connection_lifetime=3605<br>
      <br>
      ####### Custom Parameters #########<br>
      <br>
      # These parameters can be modified runtime via RPC interface<br>
      # - see the documentation of 'cfg_rpc' module.<br>
      #<br>
      # Format: group.id = value 'desc' description<br>
      # Access: $sel(cfg_get.group.id) or @cfg_get.group.id<br>
      #<br>
      <br>
      <br>
      ####### Modules Section ########<br>
      <br>
      # set paths to location of modules (to sources or installation
      folders)<br>
      #!ifdef WITH_SRCPATH<br>
      mpath="modules/"<br>
      #!else<br>
      mpath="/usr/local/lib64/kamailio/modules/"<br>
      #!endif<br>
      <br>
      #!ifdef WITH_MYSQL<br>
      loadmodule "db_mysql.so"<br>
      #!endif<br>
      loadmodule "mi_fifo.so"<br>
      loadmodule "kex.so"<br>
      loadmodule "corex.so"<br>
      loadmodule "tm.so"<br>
      loadmodule "tmx.so"<br>
      loadmodule "sl.so"<br>
      #!ifdef WITH_RECORDR<br>
      loadmodule "rr.so"<br>
      #!endif<br>
      loadmodule "pv.so"<br>
      loadmodule "maxfwd.so"<br>
      loadmodule "usrloc.so"<br>
      loadmodule "registrar.so"<br>
      loadmodule "textops.so"<br>
      loadmodule "siputils.so"<br>
      loadmodule "xlog.so"<br>
      loadmodule "sanity.so"<br>
      loadmodule "ctl.so"<br>
      loadmodule "cfg_rpc.so"<br>
      loadmodule "mi_rpc.so"<br>
      loadmodule "acc.so"<br>
      loadmodule "db_flatstore.so"<br>
      <br>
      #!ifdef WITH_RAD<br>
      loadmodule "misc_radius.so"<br>
      loadmodule "acc_radius.so"<br>
      #!endif<br>
      #!ifdef WITH_JSN<br>
      loadmodule "json.so"<br>
      #!endif<br>
      <br>
      #!ifdef WITH_UTILS<br>
      loadmodule "cfgutils.so"<br>
      loadmodule "utils.so"<br>
      #!endif<br>
      <br>
      #!ifdef WITH_AUTH<br>
      loadmodule "auth.so"<br>
      loadmodule "auth_db.so"<br>
      #!ifdef WITH_IPAUTH<br>
      loadmodule "permissions.so"<br>
      #!endif<br>
      #!endif<br>
      <br>
      #!ifdef WITH_ALIASDB<br>
      loadmodule "alias_db.so"<br>
      #!endif<br>
      <br>
      #!ifdef WITH_SPEEDDIAL<br>
      loadmodule "speeddial.so"<br>
      #!endif<br>
      <br>
      #!ifdef WITH_MULTIDOMAIN<br>
      loadmodule "domain.so"<br>
      #!endif<br>
      <br>
      #!ifdef WITH_NAT<br>
      loadmodule "nathelper.so"<br>
      loadmodule "rtpproxy.so"<br>
      #!endif<br>
      <br>
      #!ifdef WITH_TLS<br>
      loadmodule "tls.so"<br>
      #!endif<br>
      <br>
      loadmodule "htable.so"<br>
      <br>
      #!ifdef WITH_GRP<br>
      loadmodule "group.so"<br>
      #!endif<br>
      <br>
      <br>
      #!ifdef WITH_ANTIFLOOD<br>
      loadmodule "pike.so"<br>
      #!endif<br>
      <br>
      #!ifdef WITH_XMLRPC<br>
      loadmodule "xmlrpc.so"<br>
      #!endif<br>
      <br>
      #!ifdef WITH_DEBUG<br>
      loadmodule "debugger.so"<br>
      #!endif<br>
      <br>
      #!ifdef WITH_CARR<br>
      loadmodule "carrierroute.so"<br>
      #!endif<br>
      <br>
      #!ifdef WITH_DIALOG<br>
      loadmodule "dialog.so"<br>
      #!endif<br>
      <br>
      #!ifdef WITH_BLCKLST<br>
      loadmodule "userblacklist.so"<br>
      #!endif<br>
      <br>
      #!ifdef WITH_LIMIT<br>
      loadmodule "ratelimit.so"<br>
      loadmodule "pipelimit.so"<br>
      #!endif<br>
      #!ifdef WITH_PIKE<br>
      loadmodule "pike.so"<br>
      #!endif<br>
      # ----------------- setting module-specific parameters
      ---------------<br>
      <br>
      #!ifdef WITH_PIKE<br>
      modparam("pike", "sampling_time_unit", 2)<br>
      modparam("pike", "reqs_density_per_unit", 100)<br>
      modparam("pike", "remove_latency", 300)<br>
      #!endif<br>
      <br>
      #!ifdef WITH_BLCKLST<br>
      modparam("userblacklist", "db_url",DBURL)<br>
      modparam("userblacklist", "match_mode", 128)<br>
      modparam("userblacklist", "use_domain", 1)<br>
      #!endif<br>
      <br>
      #!ifdef WITH_CARR<br>
      modparam("carrierroute","config_source","db")<br>
      modparam("carrierroute","db_url",DBURL)<br>
      modparam("carrierroute","carrierroute_table","carrierroute")<br>
      modparam("carrierroute","default_tree","default")<br>
      ## tekrar yuklenirken cabuk olsun diye asagidaki limit
      yazilabilir.<br>
      modparam("carrierroute", "fetch_rows", 2000)<br>
      modparam("carrierroute", "subscriber_table", "subscriber")<br>
      modparam("carrierroute", "subscriber_user_col", "username")<br>
      modparam("carrierroute", "subscriber_carrier_col",
      "cr_preferred_carrier")<br>
      #!endif<br>
      <br>
      <br>
      <br>
      # ----- mi_fifo params -----<br>
      modparam("mi_fifo", "fifo_name",
      "/var/run/kamailio/kamailio_fifo")<br>
      <br>
      <br>
      # ----- tm params -----<br>
      # auto-discard branches from previous serial forking leg<br>
      modparam("tm", "failure_reply_mode", 3)<br>
      # default retransmission timeout: 30sec<br>
      modparam("tm", "fr_timer", 30000)<br>
      # default invite retransmission timeout after 1xx: 120sec<br>
      modparam("tm", "fr_inv_timer", 120000)<br>
      <br>
      #!ifdef WITH_RECORDR<br>
      # ----- rr params -----<br>
      # add value to ;lr param to cope with most of the UAs<br>
      modparam("rr", "enable_full_lr", 0)<br>
      # do not append from tag to the RR (no need for this script)<br>
      modparam("rr", "append_fromtag", 1)<br>
      modparam("rr", "enable_socket_mismatch_warning", 1)<br>
      modparam("rr", "enable_double_rr", 0)<br>
      #!endif<br>
      # ----- registrar params -----<br>
      modparam("registrar", "method_filtering", 1)<br>
      /* uncomment the next line to disable parallel forking via
      location */<br>
      # modparam("registrar", "append_branches", 0)<br>
      /* uncomment the next line not to allow more than 10 contacts per
      AOR */<br>
      #modparam("registrar", "max_contacts", 10)<br>
      # max value for expires of registrations<br>
      modparam("registrar", "max_expires", 3600)<br>
      # set it to 1 to enable GRUU<br>
      modparam("registrar", "gruu_enabled", 0)<br>
      <br>
      <br>
      # ----- acc params -----<br>
      /* what special events should be accounted ? */<br>
      modparam("acc", "early_media", 0)<br>
      modparam("acc", "report_ack", 1)<br>
      modparam("acc", "report_cancels", 1)<br>
      modparam("acc", "detect_direction", 0)<br>
      modparam("acc", "failed_transaction_flag", FLT_ACCFAILED)<br>
      modparam("acc",
"log_extra","src_user=$fU;src_domain=$fd;src_ip=$si;dst_user=$rU;dst_domain=$rd;src_ousername=$avp(poparty);networkdatetime=$avp(networkdatetime);dst_ouser=$avp(ptparty);provider=$avp(pprovider);m_id=$avp(maliyet_id);tibtip=$avp(tibtip);src_userid=$avp(userid);dst_userid=$avp(dst_userid);flags=$avp(ucrflag);op_kodu=$avp(op_kodu);lifetime=$avp(i:77);uniqueid=$avp(unique_id);servis=$avp(servis);numbasekle=$avp(69)")<br>
      modparam("acc", "log_flag", FLT_ACC)<br>
      modparam("acc", "db_missed_flag", FLT_ACCMISSED)<br>
      modparam("acc", "acc_time_column", "calldatetime")<br>
      <br>
      <br>
      <br>
      #!ifdef WITH_ACCDB<br>
      modparam("acc", "cdr_enable", 1)<br>
      modparam("acc", "early_media", 0)<br>
      modparam("acc", "report_ack", 1)<br>
      modparam("acc", "report_cancels", 1)<br>
      modparam("acc", "detect_direction", 0)<br>
      modparam("acc", "db_url", DBURLCDR)<br>
      modparam("acc", "log_flag", FLT_ACC)<br>
      modparam("acc", "db_missed_flag", FLT_ACCMISSED)<br>
      modparam("acc", "db_table_missed_calls", "missed_calls")<br>
      modparam("acc", "db_flag", 1)<br>
      modparam("acc", "db_missed_flag", 3)<br>
      modparam("acc", "acc_time_column", "calldatetime")<br>
      #modparam("acc", "time_mode", 2)<br>
      #modparam("acc", "time_exten", "micorsecs")<br>
      #modparam("acc", "time_attr", "seconds")<br>
      modparam("acc",
"db_extra","src_user=$fU;src_domain=$fd;src_ip=$si;dst_user=$rU;dst_domain=$rd;src_ousername=$avp(poparty);networkdatetime=$avp(networkdatetime);dst_ouser=$avp(ptparty);provider=$avp(pprovider);m_id=$avp(maliyet_id);tibtip=$avp(tibtip);src_userid=$avp(userid);dst_userid=$avp(dst_userid);flags=$avp(ucrflag);op_kodu=$avp(op_kodu);lifetime=$avp(i:77);uniqueid=$avp(unique_id);servis=$avp(servis);numbasekle=$avp(69)")<br>
      #!endif<br>
      <br>
      <br>
      #!ifdef WITH_RAD<br>
      modparam("acc_radius",
      "radius_config","/etc/radiusclient/radiusclient.conf")<br>
      modparam("acc_radius", "radius_flag", FLT_ACC)<br>
      modparam("acc_radius", "radius_missed_flag", FLT_ACCMISSED)<br>
      modparam("acc_radius", "service_type", 15)<br>
      modparam("acc_radius", "radius_extra",
"src_ip=$si;Sip-Uri-User=$fu;provider=$avp(pprovider);uniqueid=$avp(unique_id);src_user=$fU;dst_user=$rU;dst_domain=$rd;src_ousername=$avp(poparty);networkdatetime=$avp(networkdatetime);dst_ouser=$avp(ptparty);m_id=$avp(maliyet_id);tibtip=$avp(tibtip);src_userid=$avp(userid);dst_userid=$avp(dst_userid);flags=$avp(ucrflag);op_kodu=$avp(op_kodu);lifetime=$avp(i:77);servis=$avp(servis);numbasekle=$_s($avp(69))")<br>
      <br>
      modparam("misc_radius", "radius_config",
      "/etc/radiusclient/radiusclient.conf")<br>
      modparam("misc_radius", "group_service_type", 12)<br>
      modparam("misc_radius", "uri_service_type", 10)<br>
      modparam("misc_radius", "caller_service_type", 30)<br>
      modparam("misc_radius", "callee_service_type", 31)<br>
      #Arayan<br>
      modparam("misc_radius", "caller_extra",
"Calling-Station-Id=$ci;Acct-Status-Type=$avp(ucrflag);Acct-Multi-Session-Id=$rU;Acct-Delay-Time=$avp(servis)")<br>
      #Aranan<br>
      modparam("misc_radius", "callee_extra",
"Called-Station-Id=$ci;Acct-Status-Type=$avp(ucrflag);Acct-Multi-Session-Id=$rU;Acct-Delay-Time=$avp(servis)")<br>
      <br>
      <br>
      modparam("misc_radius", "uri_extra", "Called-Station-Id=$tu")<br>
      modparam("misc_radius", "common_response", 0)<br>
      <br>
      #!endif<br>
      # ----- usrloc params -----<br>
      /* enable DB persistency for location entries */<br>
      #!ifdef WITH_USRLOCDB<br>
      modparam("usrloc", "db_url", DBURL)<br>
      modparam("usrloc", "db_mode", 2)<br>
      modparam("usrloc", "use_domain", MULTIDOMAIN)<br>
      #!endif<br>
      <br>
      <br>
      # ----- auth_db params -----<br>
      #!ifdef WITH_AUTH<br>
      modparam("auth_db", "db_url", DBURL)<br>
      modparam("auth_db", "calculate_ha1", yes)<br>
      modparam("auth_db", "password_column", "sippasswd")<br>
      modparam("auth_db", "load_credentials", "$avp(userid)=userid")<br>
      modparam("auth_db", "use_domain", MULTIDOMAIN)<br>
      <br>
      # ----- permissions params -----<br>
      #!ifdef WITH_IPAUTH<br>
      modparam("permissions", "db_url", DBURL)<br>
      modparam("permissions", "db_mode", 1)<br>
      modparam("permissions", "peer_tag_avp", "$avp(i:770)")<br>
      #!endif<br>
      <br>
      #!endif<br>
      <br>
      <br>
      # ----- alias_db params -----<br>
      #!ifdef WITH_ALIASDB<br>
      modparam("alias_db", "db_url", DBURL)<br>
      modparam("alias_db", "use_domain", MULTIDOMAIN)<br>
      #!endif<br>
      <br>
      <br>
      # ----- speeddial params -----<br>
      #!ifdef WITH_SPEEDDIAL<br>
      modparam("speeddial", "db_url", DBURL)<br>
      modparam("speeddial", "use_domain", MULTIDOMAIN)<br>
      #!endif<br>
      <br>
      <br>
      # ----- domain params -----<br>
      #!ifdef WITH_MULTIDOMAIN<br>
      modparam("domain", "db_url", DBURL)<br>
      # register callback to match myself condition with domains list<br>
      modparam("domain", "register_myself", 0)<br>
      #!endif<br>
      <br>
      #!ifdef WITH_NAT<br>
      # ----- rtpproxy params -----<br>
      #modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:7722")<br>
      <br>
      # ----- nathelper params -----<br>
      modparam("nathelper", "natping_interval", 30)<br>
      modparam("nathelper", "ping_nated_only", 1)<br>
      modparam("nathelper", "sipping_bflag", FLB_NATSIPPING)<br>
      modparam("nathelper", "sipping_from", <a class="moz-txt-link-rfc2396E" href="mailto:sip:pinger@kamailio.org">"sip:pinger@kamailio.org"</a>)<br>
      <br>
      # params needed for NAT traversal in other modules<br>
      modparam("nathelper|registrar", "received_avp", "$avp(RECEIVED)")<br>
      modparam("usrloc", "nat_bflag", FLB_NATB)<br>
      #!endif<br>
      <br>
      #!ifdef WITH_TLS<br>
      # ----- tls params -----<br>
      modparam("tls", "config", "/usr/local/etc/kamailio/tls.cfg")<br>
      #!endif<br>
      <br>
      #!ifdef WITH_ANTIFLOOD<br>
      # ----- pike params -----<br>
      modparam("pike", "sampling_time_unit", 10)<br>
      modparam("pike", "reqs_density_per_unit", 1000)<br>
      modparam("pike", "remove_latency", 120)<br>
      <br>
      # ----- htable params -----<br>
      # ip ban htable with autoexpire after 5 minutes<br>
      modparam("htable", "htable", "ipban=>size=8;autoexpire=300;")<br>
      #!endif<br>
      <br>
      #!ifdef WITH_XMLRPC<br>
      # ----- xmlrpc params -----<br>
      modparam("xmlrpc", "route", "XMLRPC");<br>
      modparam("xmlrpc", "url_match", "^/RPC")<br>
      #!endif<br>
      <br>
      #!ifdef WITH_DEBUG<br>
      # ----- debugger params -----<br>
      modparam("debugger", "cfgtrace", 1)<br>
      #!endif<br>
      #---------------- dialog params -------------<br>
      #!ifdef WITH_DIALOG<br>
      modparam("dialog", "enable_stats", 1)<br>
      modparam("dialog", "hash_size", 4096)<br>
      modparam("dialog", "rr_param", "did")<br>
      modparam("dialog", "dlg_flag",4)<br>
      modparam("dialog", "timeout_avp", "$avp(i:10)")<br>
      modparam("dialog", "dlg_match_mode", 1)<br>
      modparam("dialog", "default_timeout", 3600)<br>
      modparam("dialog", "detect_spirals", 1)<br>
      modparam("dialog", "profiles_no_value", "inbound")<br>
      modparam("dialog", "profiles_with_value", "userid ; opkodu ;
      useropkodu ")<br>
      modparam("dialog", "dlg_extra_hdrs", "Hint: Hell Yeah\r\n")<br>
      modparam("dialog", "send_bye", 1)<br>
      modparam("dialog", "db_url", DBURL)<br>
      modparam("dialog", "db_mode", 3)<br>
      modparam("dialog", "db_fetch_rows", 500)<br>
      #!endif<br>
      <br>
      #!ifdef WITH_SAYAC<br>
      modparam("htable",
      "htable","sayac=>size=16;dbtable=htable;initval=0;")<br>
      modparam("htable", "db_url", DBURL)<br>
      modparam("htable", "fetch_rows", 1000)<br>
      #!endif<br>
      <br>
      #!ifdef WITH_GRP<br>
      modparam("group", "db_url", DBURL)<br>
      modparam("group", "use_domain", 0)<br>
      #!endif<br>
      <br>
      #!ifdef WITH_UTILS<br>
      modparam("utils", "http_query_timeout", 4)<br>
      modparam("utils", "forward_active", 0)<br>
      #!endif<br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <title></title>
      <div align="left">
        <div style="width:300px;" align="left">
          <a href="http://www.netgsm.com.tr" target="_blank">
            <br>
          </a>
        </div>
      </div>
    </div>
  </body>
</html>