[Serusers] caller=callee, Not giving me Busy

Andrey Kouprianov andrey.kouprianov at gmail.com
Thu Aug 31 16:44:43 CEST 2006


Hi,

As I understand you need to send a Busy response, if caller is the
same as callee.
There is no easy way to do it. You need to match your From and To
headers' URIs and see if they are same or not.

You can do it this way, but I dont guarantee that it works. And this
way is quite ugly.

You'd have to use exec_dst() function from exec.so module to execute
some perl file (or PHP if you like it more). Inside this perl/PHP file
 match the URI from To: header field with URI from From: header field
(read README file from exec module to see how you can get the header
fields, it's not too difficult).

Anyway, exec_dst() function will execute any system command and if
that command prints out a SIP URI, it will append it as a Contact
header field to your request (i hope im not wrong, because it was a
long time since I havent used exec module). For instance,
exec_dst("echo 'sip:127.0.0.1' "); should append a Contact header
field as follows:

Contact: sip:127.0.0.1

So, in your perl/PHP program match the header fields against each
other. If they match (caller==callee), then print "sip:127.0.0.1" or
smth like that.

Then in your ser.cfg write like this

if(!exec_dst("perl /path/to/perl/script/myscript.pl")) { #execute your
perl/php code

       if(search("Contact:[ ]*sip:127\.0\.0\.1) ) { #see if Contact
header was attached
              sl_send_reply("600", "Busy Everywhere");
              break;
       };
};

***I really hope that works, cause if it doesnt, you most probably
have to quickly move to OpenSER (like you said in ur last email).

<Error logs>
I dont know what's causing this "ERROR: sl_reply_error used: I'm
terribly sorry, server error occured (1/SL)". As for "ERROR: tcp_init:
bind(6, 0x80bd7c0, 16)" error in your log, there's something already
listening on this address and port. I think, you can avoid this error
if you just add a listen directive somewhere before alias:

listen=<your server ip>

This should make SER listen on only this address and forget about the
loopback address.

<Cron jobs>
More, you dont have to chmod 777 /tmp/ser_fifo in your cron. Just add
this directive to your ser.cfg :

fifo_mode = 666

   Good luck,

     Andrey.

On 8/30/06, ram <talk2ram at gmail.com> wrote:
>
>
> Hi
>
> iam using old SER 0.814, since its deployed already in my Office
> we are in process of migrationg to openser soon
> mean time i need to fix some problems with existing server only
> that is the reason iam trying to modify the code and achive the following
> things
>
> 1. Voice mail
> 2. Caller =callee
> 3. if the user not in voicemail group ( get busy), if the user off  line,
> Not found
>
> I have modified some code after reading all news group
> here iam attaching the config file which iam trying
>
> iam also getting the some errors in Log
>
> Aug 30 17:58:20 router ser[609]: ERROR: sl_reply_error used: I'm terribly
> sorry, server error occured (1/SL)
> Aug 30 17:58:27 router ser[604]: ERROR: sl_reply_error used: I'm terribly
> sorry, server error occured (1/SL)
> Aug 30 18:00:05 router ser[1564]: ERROR: tcp_init: bind(6, 0x80bd7c0, 16) on
> 127.0.0.1: Address already in use
> Aug 30 18:00:06 router ser[1571]: ERROR: tcp_init: bind(6, 0x80bd7c0, 16) on
> 127.0.0.1: Address already in use
>
>
> iam running a cron job to check the services
>
> #!/bin/sh
> mysqlcheck --password=cdrouter --auto-repair --all-databases
> sleep 4
> ser
> sleep 4
> chmod 777 /tmp/ser_fifo
>
>
>
> help will be appriciated
>
> Ram
>
> _______________________________________________
> Serusers mailing list
> Serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers
>
>
>
>



More information about the sr-users mailing list