HI Alex,
Thanks for the suggestion. I tried using the function sl_send_reply(msg, 403, "Forbidden") in the receive.c file after including the header files. But the following error is coming when compiling the kamailio.
CC (gcc) [kamailio] receive.o receive.c: In function âsend_denialâ: receive.c:375: warning: implicit declaration of function âsl_send_replyâ LD (gcc) [kamailio] kamailio receive.o: In function `send_denial': /home/varun/EP1.0/kamailio-4.1.3_src/kamailio-4.1.3/receive.c:375: undefined reference to `sl_send_reply' collect2: ld returned 1 exit status make: *** [kamailio] Error 1
Please suggest any solution to this problem. So I have make some changes in the Makefile as it seems to be linking problem.
Thanks in advance.
Regards Varun
Date: Wed, 14 May 2014 13:09:44 +0100
From: varun pratapsingh varunps2003@gmail.com To: sr-users@lists.sip-router.org Subject: [SR-Users] How to reply an INVITE with 403 Message-ID: <CAMSCRPnCHq+v3hbirAAGWTP2kNSFvmxM=8g= uWHAk8evaUEr7A@mail.gmail.com> Content-Type: text/plain; charset="utf-8"
Hi All,
I want to handle a special case in the Kamailio 4.1.3. When I receive INVITE from some UAC I wanto reply it with 403 message. I am using the Kamailio in Proxy mode when the INVITE comes I want to reply it with 403 and do not want to send this INVITE to SIP Server.
I expored the Kamailio source code and found that fucntion receive_msg() in file receive.c receives all the SIP messages. I am able to parse the SIP INVITE from such UACs but how to reply them with 403 SIP Code. I am unable to use the t_reply("403","Forbidden") here in this function/file. Also in this function finally the forward_reply(msg); is called which sends the INVITE to the Sip Server. But I dont want to send anything to SIP Server in this case but want to reply the UAC with 403. Can you please guide me how to do and where to do this.
I am new to kamailio. Please help.
Regards Varun