[Serusers] separately calls limitation

Peter Lemenkov lemenkov at gmail.com
Thu Mar 6 12:39:13 CET 2008


Hello All!

05.03.08, tatarskiy at severen.net<tatarskiy at severen.net> написал(а):
>
>  Нello !
>  I need of help  (it is important for me)
>
>  Canaanite !
>
>  Я использую SER Sip EXpress Router 0.9.6), пока в режиме теста.
>  Он у меня работает как:
>   - Location Server (+ Auth);
>   - Proxy Server;
>   Используется MySQL.
>
>  Вопрос (question) !
>   Как мне сделать так, чтобы SER ограничивал колличество вызовов по
>   номеру и/или по имени !?

We use self-written module with connection to database to rewrite all
incoming call for purposes of call limitations for users.

Just FYI - easy example (w/o many necessary details)

===========================================
static int rewrite_address(struct sip_msg* m, char* foo, char* bar)
{

       char from[256];
       char to[256];
       char result[256];

       struct action a;

               if (parse_headers(m, HDR_TO_F|HDR_FROM_F, 1) != 0){
                       printf ("destination_rewrite: can't parse headers!\n");
                       return 0;
               }

               sprintf (from, "%.*s", ((m->from)->body).len,
((m->from)->body).s);
               sprintf (to,   "%.*s", ((m->to)->body).len,   ((m->to)->body).s);

               get_new_dest_from_db (result, from, to);

               a.type = SET_URI_T;
               a.p1_type = STRING_ST;
               a.p1.string = result;
               a.next = NULL;

               do_action (&a, m);

               return 1;
}
===========================================

In case user from overcomes its call limits you need to forward calls
somethere to sip:sems#notaccepted_here at youraddress.com where ypou may
setup SEMS (for example) which tell user that he runs out of call
lines.

-- 
With best regards!


More information about the sr-users mailing list