[SR-Users] Kamailio failed to start
Salman Zafar
msalman212 at gmail.com
Sat Oct 19 12:26:43 CEST 2013
You need to do the following:
1) Indent your config
2) Check request_route if/else condition and make sure you have proper
closing conditions
e.g
if (uri =~ "sip:.+ at .*xmpp.kamailio.test") {
route(PRESENCE);
if ($rU==$null)
{
are you sure the 2nd "if"s supposed to be nested?
if yes then why are you returning by sending 503.
t_reply("503", "Service unavailable");
return;
3) You can just make your config work by adding a log line in
route[REQINIT] but this is not a solution.
#!endif
xlog("L_INFO", "test \n");
}
On Sat, Oct 19, 2013 at 2:19 PM, Wingsravi R <wingsravi777 at gmail.com> wrote:
> Hi,
>
> Ya i do change the Presence block also, but the same error is logging:
>
>
> $ sudo /etc/init.d/kamailio start
> Not starting Kamailio: invalid configuration file!
> -e
> 0(5930) INFO: tls [tls_init.c:385]: init_tls_compression(): tls:
> init_tls: disabling compression...
> 0(5930) : <core> [cfg.y:3570]: yyerror_at(): parse error in config file
> /etc/kamailio/kamailio.cfg, line 815, column 1: syntax error
> 0(5930) : <core> [cfg.y:3570]: yyerror_at(): parse error in config file
> /etc/kamailio/kamailio.cfg, line 815, column 1: invalid route statement
> 0(5930) : <core> [cfg.y:3567]: yyerror_at(): parse error in config file
> /etc/kamailio/kamailio.cfg, line 818, column 1-5:
> ERROR: bad config file (3 errors)
>
> Here below is the script that looks like:
>
> # Per SIP request initial checks
> route[REQINIT] {
> #!ifdef WITH_ANTIFLOOD
> # flood dection from same IP and traffic ban for a while
> # be sure you exclude checking trusted peers, such as pstn gateways
> # - local host excluded (e.g., loop to self)
> if(src_ip!=myself)
> {
> if($sht(ipban=>$si)!=$null)
> {
> # ip is already blocked
> xdbg("request from blocked IP - $rm from $fu (IP:$si:$sp)\n");
> exit;
> }
> if (!pike_check_req())
> {
> xlog("L_ALERT","ALERT: pike blocking $rm from $fu
> (IP:$si:$sp)\n");
> $sht(ipban=>$si) = 1;
> exit;
> }
> }
> #!endif
> }
>
> # Presence server route
> route[PRESENCE] {
> if(!is_method("PUBLISH|SUBSCRIBE|NOTIFY"))
> return;
> #!ifdef WITH_PRESENCE
> # create new transaction to catch retransmissions
> if (!t_newtran())
> {
> sl_reply_error();
> exit;
> }
>
> if( is_method("NOTIFY"))
> {
> xlog("L_INFO", "*** xmpp-handled NOTIFY message.");
> if(pua_xmpp_notify())
> t_reply("200", "OK");
> t_release();
> exit;
> }
> else if( is_method("SUBSCRIBE"))
> {
> xlog("L_INFO", "*** xmpp-handled SUBSCRIBE message.\n");
> handle_subscribe();
> if($(hdr(Event))== "presence")
> {
> pua_xmpp_req_winfo("$ruri", "$hdr(Expires)");
> }
> t_release();
> exit;
> }
> else if(is_method("PUBLISH"))
> {
> handle_publish();
> t_release();
> exit;
> }
> #!endif
> }
>
> please help me in resolving this problem.
>
>
>
> On Sat, Oct 19, 2013 at 1:35 PM, Salman Zafar <msalman212 at gmail.com>wrote:
>
>> I think you the same problem with route[presence]
>>
>> }
>> #!endif
>>
>>
>>
>>
>> On Sat, Oct 19, 2013 at 12:55 PM, Wingsravi R <wingsravi777 at gmail.com>wrote:
>>
>>> Dear Salman,
>>>
>>> thank you for the reply.
>>>
>>> i did change as you suggested and then ran the kamailio, but it agian
>>> logged some errors:
>>>
>>>
>>> $ sudo /etc/init.d/kamailio start
>>> Not starting Kamailio: invalid configuration file!
>>> -e
>>> 0(5744) INFO: tls [tls_init.c:385]: init_tls_compression(): tls:
>>> init_tls: disabling compression...
>>> 0(5744) : <core> [cfg.y:3570]: yyerror_at(): parse error in config file
>>> /etc/kamailio/kamailio.cfg, line 815, column 1: syntax error
>>> 0(5744) : <core> [cfg.y:3570]: yyerror_at(): parse error in config file
>>> /etc/kamailio/kamailio.cfg, line 815, column 1: invalid route statement
>>> 0(5744) : <core> [cfg.y:3567]: yyerror_at(): parse error in config file
>>> /etc/kamailio/kamailio.cfg, line 817, column 1-5:
>>> ERROR: bad config file (3 errors)
>>>
>>> Regrards
>>> Ravi
>>>
>>>
>>> On Sat, Oct 19, 2013 at 1:03 PM, Salman Zafar <msalman212 at gmail.com>wrote:
>>>
>>>> check these lines:
>>>>
>>>> route[REQINIT] {
>>>> #!ifdef WITH_ANTIFLOOD
>>>>
>>>> .....
>>>> .....
>>>> ....
>>>> }
>>>> #!endif
>>>>
>>>>
>>>>
>>>> it should be
>>>>
>>>>
>>>> #!endif
>>>> }
>>>>
>>>>
>>>>
>>>> On Sat, Oct 19, 2013 at 12:11 PM, Wingsravi R <wingsravi777 at gmail.com>wrote:
>>>>
>>>>> Dear kamailio'ns
>>>>>
>>>>> I am running kamailio 4.0.3 on ubuntu 12.04 and installed kamailio
>>>>> from its repository. I had changed the default kamailio config file, and
>>>>> inserted xmpp and presence related script. But after all when i tried to
>>>>> start my kamailio server I am getting the following errors:
>>>>>
>>>>> $ sudo /etc/init.d/kamailio start
>>>>> Not starting Kamailio: invalid configuration file!
>>>>> -e
>>>>> 0(5502) INFO: tls [tls_init.c:385]: init_tls_compression(): tls:
>>>>> init_tls: disabling compression...
>>>>> 0(5502) : <core> [cfg.y:3570]: yyerror_at(): parse error in config
>>>>> file /etc/kamailio/kamailio.cfg, line 816, column 6: syntax error
>>>>> 0(5502) : <core> [cfg.y:3570]: yyerror_at(): parse error in config
>>>>> file /etc/kamailio/kamailio.cfg, line 816, column 6: missing '(' or ')' ?
>>>>> 0(5502) : <core> [cfg.y:3570]: yyerror_at(): parse error in config
>>>>> file /etc/kamailio/kamailio.cfg, line 816, column 6: bad command: missing
>>>>> ';'?
>>>>> 0(5502) : <core> [cfg.y:3570]: yyerror_at(): parse error in config
>>>>> file /etc/kamailio/kamailio.cfg, line 816, column 15: '('')' expected
>>>>> (function call)
>>>>> 0(5502) : <core> [cfg.y:3570]: yyerror_at(): parse error in config
>>>>> file /etc/kamailio/kamailio.cfg, line 816, column 15: bad command: missing
>>>>> ';'?
>>>>> 0(5502) : <core> [cfg.y:3570]: yyerror_at(): parse error in config
>>>>> file /etc/kamailio/kamailio.cfg, line 816, column 17: bad command
>>>>> ERROR: bad config file (6 errors)
>>>>>
>>>>> All of the above errors are pointing at route[Presence] block in the
>>>>> script.
>>>>> What could be the reason for the errors and is there any fault in my
>>>>> config file (please find the attachment for the same).
>>>>>
>>>>> Thanks in advance.
>>>>>
>>>>> Regards.
>>>>> Ravi
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>>>> sr-users at lists.sip-router.org
>>>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Regards
>>>>
>>>> M. Salman Zafar
>>>>
>>>> VoIP Professional
>>>>
>>>>
>>>> _______________________________________________
>>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>>> sr-users at lists.sip-router.org
>>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>>
>>>>
>>>
>>> _______________________________________________
>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>> sr-users at lists.sip-router.org
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>>
>>
>>
>> --
>> Regards
>>
>> M. Salman Zafar
>>
>>
>> VoIP Professional
>>
>>
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
--
Regards
M. Salman Zafar
VoIP Professional
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20131019/a36346e2/attachment-0001.html>
More information about the sr-users
mailing list