Hi, i tried to create an aliase and i got an error message:
400 Table 'aliases' not found in memory. Use save("aliases") or
lookup("aliases") in configuration script first.
I have added lookup("aliases") just before the lookup("location"),
restarted the srver and it still doesn't work. what do i do now? Thanks.
regards,
Onyeka
Hi John!
please send your emails always to the list, so others might help you too.
John LI wrote:
> Hi Klause,
>
> I have installed the serweb, when i go to the http://IP
> address/serweb_2004-01-04/html/admin/index.php
>
> I got the page come out with the warning:
> Warning: virtual(): Unable to include '/prolog.html' - request execution
> failed in /var/www/html/serweb_2004-01-04/html/page.php on line 48
> localhost.localdomain User Management
> Warning: virtual(): Unable to include '/separator.html' - request execution
> failed in /var/www/html/serweb_2004-01-04/html/page.php on line 50
>
> seemed like it can not find those page. I searched those page on the
> installation machine, and find nothing, I wonder if those pages are built in
> the installations tar ball or I have to create my own page.
you should search the mailing list archive - this is a common problem
which was answered often.
>
> The second thing is can I log on by using the userID which is added to the
> MySQL subscriber database, I have tried to log on with the user/password in
> the ser.subscriber table, but stiil get the error like the attached file.
sorry, I couldn't read your attachment.
klaus
I guess it all depends on where you want the redirection to take place. If
you want to perform some type of call limitation to a specific network, then
you need the redirection to take place at the proxy and besides it's another
level of unnecessary signaling. Another thing is that it's easier to control
how the processing of multiple routes in handled. Some proxies will fork out
the request when no "Q" values are present and some will process them until
you either have success or run out of routes. By routing the 300 back to the
originating GW, each attempt to resolve the route would be considered as a
call.
-----Original Message-----
From: Juha Heinanen [mailto:jh@tutpro.com]
Sent: Monday, April 05, 2004 1:36 PM
To: Mike Morrison
Cc: 'serusers(a)lists.iptel.org'
Subject: [Serusers] 3xx Response Processig Issue
Mike Morrison writes:
> Is there any way for the proxy to reroute based on the 3xx response vs.
> passing the 3xx response back to the originating GW? Can this be done via
> the scripting or through a module? Is there any way for a module to trap
a
> response without sending it back to the originating GW?
i once wrote a function that did that, but then i started to think that
it's not a good idea for the proxy to turn a 3xx response into a new
invite. if the user has decided to redirect the call, it is best that
the redirection reply goes all the way to the calling party, which can
then decide if he/she wants to proceed with the new destination. the
proxy is not in the position to do that decision.
-- juha
Hi,
Before I try myself I would like to know if someone
has successfully configured Voice Mail on Solaris?
If possible can you post the instructions to ste it
up.
Ideally I would like to use mysql to store the
messages.
Thanks for your help.
Rao.
__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway
http://promotions.yahoo.com/design_giveaway/
Is there any way for the proxy to reroute based on the 3xx response vs.
passing the 3xx response back to the originating GW? Can this be done via
the scripting or through a module? Is there any way for a module to trap a
response without sending it back to the originating GW?
Thanks
Mike
I am seeing a strange error on registration.
My usrloc table looks/looked like this:
root@ser-1:~# serctl showdb
Online Accounts:
+-------------------+------------------------------+---------------------+
| username | contact | expires |
+-------------------+------------------------------+---------------------+
| alex(a)adomain.net | sip:alex@222.11.222.111:5060 | 2004-03-29 00:48:57 |
+-------------------+------------------------------+---------------------+
(note the entry has expired a long while ago, and is from the same
address at which I'm now trying to register).
When I try and register, I get:
->REGISTER sip:adomain.net
<-401 Unauthorized (fine, needs digest)
->REGISTER sip.adomain.net
<-500 Internal server error
The interesting component is:
"P-Registrar-Error: usrloc_contact_insert failed"
And in the logs I see:
Apr 3 18:31:26 ser-1 ser[1855]: submit_query(): Duplicate entry
'alex-adomain.net-sip:alex@222.11.222.111:5060' for key 1
Apr 3 18:31:26 ser-1 ser[1855]: insert_row(): Error while submitting query
Apr 3 18:31:26 ser-1 ser[1855]: db_insert_ucontact(): Error while
inserting contact
Apr 3 18:31:26 ser-1 ser[1855]: insert_ucontact(): Error while inserting
in database
Apr 3 18:31:26 ser-1 ser[1855]: insert(): Error while inserting contact
Apr 3 18:31:26 ser-1 ser[1855]: contacts(): Error while inserting record
Now I'd suspect a database problem, config problem, or similar, except
if I use another user, it works straight away:
root@ser-1:~# serctl showdb
Online Accounts:
+-------------------+------------------------------+---------------------+
| username | contact | expires |
+-------------------+------------------------------+---------------------+
| alex(a)adomain.net | sip:alex@222.11.222.111:5060 | 2004-03-29 00:48:57 |
| joel(a)adomain.net | sip:joel@222.11.222.111:5060 | 2004-04-03 19:09:43 |
+-------------------+------------------------------+---------------------+
It's almost as if ser is not overwriting expired usrloc table entries.
I could wipe the entry out the table, but that's hardly the point. It's
also as if ser is not cleaning the entry out the table even if it
expires.
I am running:
root@ser-1:~# ser -V
version: ser 0.8.12-tcp_nonb (i386/linux)
flags: STATS:Off, USE_IPV6, USE_TCP, DISABLE_NAGLE, DNS_IP_HACK, SHM_MEM,
SHM_MMAP, PKG_MALLOC, F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
MAX_URI_SIZE 1024, BUF_SIZE 65535
UA = X-Lite
Alex
Hi Guys,
I have been working on a number of different routines for call
forwarding/hunt groups and came across an interesting oudity.
When I use failure_route and exec_dset and then use rewritehost and
prefix the rewritehost and prefix do not work and my t_relay_to_udp
fails. (this assuming I need to change the host.
Configuration example follows
failure_route[1]
{
exec_dset('/somdirectory/somescript.pl'); #returns a proper URI
rewrite_host("host.com");
prefix(23423);
t_relay_to_udp("gateway.com","5060");
}
Assuming the exec_dset returns "sip:test@mydomain.com" the
t_relay_to_udp() will try contacting sip:test@mydomain.com" and not
sip:test@gateway.com
Any ideas of why this happens. As it is now, I have my script do the
rewrite_host and prefix job internally (assuming the call needs to go to
my gateway).
Steve
You have to run another tool to monitor ser, e.g. take a look at:
http://www.kernel.org/software/mon/
klaus
John LI wrote:
> 8.5080404(a)pernau.at>
> Subject: Re: About the ser daemon issue
> Date: Mon, 5 Apr 2004 09:11:22 -0700
> MIME-Version: 1.0
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: 7bit
> X-Priority: 3
> X-MSMail-Priority: Normal
> X-Mailer: Microsoft Outlook Express 6.00.2800.1158
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
>
> Hi Klaus,
>
> Do you mean that there is serveral process runing on the back ground
> monitoring the ser process, and will start ser when it is stoped, or I have
> to explicitly runing some tools to monitoring the ser?
>
> Thanks.
>
> John
>
> ----- Original Message -----
> From: "Klaus Darilion" <klaus.mailinglists(a)pernau.at>
> To: "John LI" <john(a)signalc.com>
> Cc: "Serusers" <serusers(a)lists.iptel.org>
> Sent: Sunday, April 04, 2004 11:35 AM
> Subject: Re: About the ser daemon issue
>
>
>
>>The normal way to start/sop ser is: using a startup script
>>
>>/etc/init.d/ser start
>>or
>>/etc/init.d/ser stop
>>
>>There are several tools which can be used to monitor ser and if ser
>>fails, they can restart ser. e.g. you can use 'mon'.
>>
>>regards,
>>klaus
>>
>>PS: cc to the mailinglist
>>
>>John LI wrote:
>>
>>>Hi Klaus,
>>>
>>>Is there any daemon which will keep the ser server living?
>>>
>>>BTW, what is the normal way to start and stop.
>>>
>>>Thanks
>>>
>>>John
>>>
>>>----- Original Message -----
>>>From: "Klaus Darilion" <klaus.mailinglists(a)pernau.at>
>>>To: "John LI" <john(a)signalc.com>
>>>Cc: "Jan Janak" <jan(a)iptel.org>; "Jiri Kuthan" <jiri(a)iptel.org>;
>
> "Serusers"
>
>>><serusers(a)lists.iptel.org>
>>>Sent: Friday, April 02, 2004 1:23 AM
>>>Subject: Re: [Serusers] CDR Issue
>>>
>>>
>>>
>>>
>>>>I guess you haven't installed all the mysql libraries, maybe some
>>>>php_mysql stuff is missing.
>>>>
>>>>$ php -v
>>>>will give you your version!
>>>>
>>>>
>>>>klaus
>>>>
>>>>John LI wrote:
>>>>
>>>>
>>>>
>>>>>Hi Klaus,
>>>>>
>>>>>I have tried to install the serweb on to the system, and after i try to
>>>
>>>go
>>>
>>>
>>>>>to the http://localhost/installed-folder/html/admin/index.php, I got
>
> the
>
>>>>>error message:
>>>>>Fatal error: Call to undefined function: mysql_pconnect() in
>>>>>/var/www/html/serweb_2004-01-04/phplib/db_mysql.inc on line 73
>>>>>
>>>>>It is becuase I need to install the PHP4 on the server, and if it is
>
> so,
>
>>>how
>>>
>>>
>>>>>can I to make sure the PHP4 I installed on the server support the Mysql
>>>>>feature?
>>>>>
>>>>>Thanks for your help.
>>>>>
>>>>>John
>>>>>
>>>>>----- Original Message -----
>>>>>From: "Klaus Darilion" <klaus.mailinglists(a)pernau.at>
>>>>>To: "John LI" <john(a)signalc.com>
>>>>>Cc: "Jan Janak" <jan(a)iptel.org>; "Jiri Kuthan" <jiri(a)iptel.org>;
>>>
>>>"Serusers"
>>>
>>>
>>>>><serusers(a)lists.iptel.org>
>>>>>Sent: Wednesday, March 31, 2004 5:54 AM
>>>>>Subject: Re: [Serusers] CDR Issue
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>missed_calls can be filled also by the acc module -> see the
>
> parameters
>
>>>>>>in the README file of the acc module.
>>>>>>
>>>>>>Klaus
>>>>>>
>>>>>>John LI wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Hi Jan,
>>>>>>>
>>>>>>>Thanks for you response, after I set the DB flag in the ser.cfg, all
>>>
>>>the
>>>
>>>
>>>>>>>action could be writen to the acc table. thanks for you help.
>>>>>>>
>>>>>>>In the ser db there is a bunch of tables there, I am now only using
>
> the
>
>>>>>acc
>>>>>
>>>>>
>>>>>
>>>>>>>, subscriber, location tables, I would like to know how to write the
>>>>>>>information into the missed_call table, active_action table etc.
>>>>>>>
>>>>>>>Thanks
>>>>>>>
>>>>>>>John
>>>>>>>
>>>>>>>----- Original Message -----
>>>>>>>From: "Jan Janak" <jan(a)iptel.org>
>>>>>>>To: "John LI" <john(a)signalc.com>
>>>>>>>Cc: "Klaus Darilion" <klaus.mailinglists(a)pernau.at>; "Jiri Kuthan"
>>>>>>><jiri(a)iptel.org>; "Serusers" <serusers(a)lists.iptel.org>
>>>>>>>Sent: Wednesday, March 31, 2004 5:20 AM
>>>>>>>Subject: Re: [Serusers] CDR Issue
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>On 30-03 11:52, John LI wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>Hi Jan,
>>>>>>>>>
>>>>>>>>>I get the tar ball from the Iptel, and untar it, and I untar the
>
> tar
>
>>>>>>>ball in
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>>the /home/alan/, then I changed the Makefile in
>>>>>>>>>/home/alan/ser-0.8.12/modules/acc, I wonder if it is the correct
>
> file
>
>>>>>>>you
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>>mentioned like sip_router/modules/acc/Makefile?
>>>>>>>>
>>>>>>>>Yes.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>The other issue is when you talk recomplie the Module, dose that
>
> mean
>
>>>>>>>>>recompile the acc.so module itself or recomplie the whole ser?
>>>
>>>Becuase
>>>
>>>
>>>>>>>when
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>>I tried to run the make in the /home/alan/ser-0.8.12/modules/acc,
>>>
>>>the
>>>
>>>
>>>>>>>>>system asked me to complie the the source in the main ser
>
> directory.
>
>>>>>>>>I would recommend to recompile the whole ser.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>The third issue is , if I just want the database accounting, no
>
> need
>
>>>>>for
>>>>>
>>>>>
>>>>>
>>>>>>>>>Radius Accounting, should I still uncomment the line concerened
>
> with
>
>>>>>>>Radius
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>>accounting, can I just uncomment line concerned with the database
>>>>>>>>>accounting?
>>>>>>>>
>>>>>>>>Uncomment just database related lines if you want database
>
> accounting
>
>>>>>>>>only.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>The fourth issue is, I have load the acc.so in in the ser.cfg, it
>>>>>>>
>>>>>>>supposed
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>>to use the syslog to write the cdr in the Syslog file, is that
>
> right?
>
>>>>>>>which
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>>file I should looking for the CDR information.
>>>>>>>>
>>>>>>>>/var/log/messages or /var/log/daemon.log (depending on the
>>>>>>>>distribution).
>>>>>>>>
>>>>>>>> Jan.
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>
>>
>
>
Hi, I'm not so sure...
Both are REFER based, but the signaling in the draft is:
Proxy --REFER--> A
A --INVITE--> B
and the signaling implemented with serweb is:
Proxy --INVITE--> A
Proxy --REFER--> A
A --INVITE--> B
I prefer the "REFER in session" serweb implementation, but I think the draft solution is different.
Best regards,
G.
----- Mensaje original -----
De: Jan Janak <jan(a)iptel.org>
Fecha: Domingo, Abril 4, 2004 9:00 pm
Asunto: Re: [Serusers] click to dial
> serweb implements exactly that (REFER based) scenario.
>
> Jan.
>
> On 01-04 17:40, Gustavo Garcia Bernardo wrote:
> > Hi,
> >
> > I'm testing click to dial service in serweb, and I there are some
> > differences with draft-ietf-sipping-service-examples-06, are there
> > intentioned changes?
> >
> > http://www.ietf.org/internet-drafts/draft-ietf-sipping-service-
> examples-06.t
> > xt
> >
> > I think the draft solution is simpler to implement in terminals and
> > application servers.
> >
> > G.
> >
> >
> > _______________________________________________
> > Serusers mailing list
> > serusers(a)lists.iptel.org
> > http://lists.iptel.org/mailman/listinfo/serusers
>
this is my config i can forward call to a gateway, but the accounting is not
working for the forwarded calls, when the callee hangs up the accounting
works, but when I hang up using a softphone like x-lite, i receive this:
-------------------------------------------
SEND >> 157.100.19.26:5060
BYE sip:2815@157.100.19.26:5060 SIP/2.0
Via: SIP/2.0/UDP
157.100.19.33:5060;rport;branch=z9hG4bK821BACD7B6D345B9B91ABF0415936C95
From: Roddy <sip:2815@linora.ecua.net.ec>;tag=1603393349
To: <sip:0059399719212@linora.ecua.net.ec>;tag=3290163180-508188
Contact: <sip:2815@157.100.19.33:5060>
Route:
<sip:0059399719212@69.20.61.218:5070;maddr=69.20.61.218>,<sip:0059399719212@
69.20.44.9:5060;maddr=69.20.44.9>,<sip:T-Telio-218@69.20.44.9:5070>
Call-ID: A65E0428-B4EC-4B0C-B7A8-5BE1B18C7849(a)157.100.19.33
CSeq: 27811 BYE
Max-Forwards: 70
User-Agent: X-PRO build 1101
Content-Length: 0
SEND >> 157.100.19.26:5060
BYE sip:2815@157.100.19.26:5060 SIP/2.0
Via: SIP/2.0/UDP
157.100.19.33:5060;rport;branch=z9hG4bK821BACD7B6D345B9B91ABF0415936C95
From: Roddy <sip:2815@linora.ecua.net.ec>;tag=1603393349
To: <sip:0059399719212@linora.ecua.net.ec>;tag=3290163180-508188
Contact: <sip:2815@157.100.19.33:5060>
Route:
<sip:0059399719212@69.20.61.218:5070;maddr=69.20.61.218>,<sip:0059399719212@
69.20.44.9:5060;maddr=69.20.44.9>,<sip:T-Telio-218@69.20.44.9:5070>
Call-ID: A65E0428-B4EC-4B0C-B7A8-5BE1B18C7849(a)157.100.19.33
CSeq: 27811 BYE
Max-Forwards: 70
User-Agent: X-PRO build 1101
Content-Length: 0
RECEIVE << 157.100.19.26:5060
SIP/2.0 408 Request Timeout
Via: SIP/2.0/UDP
157.100.19.33:5060;rport=5060;branch=z9hG4bK821BACD7B6D345B9B91ABF0415936C95
From: Roddy <sip:2815@linora.ecua.net.ec>;tag=1603393349
To: <sip:0059399719212@linora.ecua.net.ec>;tag=3290163180-508188
Call-ID: A65E0428-B4EC-4B0C-B7A8-5BE1B18C7849(a)157.100.19.33
CSeq: 27811 BYE
Server: Sip EXpress router (0.8.12 (i386/linux))
Content-Length: 0
Warning: 392 157.100.19.26:5060 "Noisy feedback tells: pid=2654
req_src_ip=157.100.19.33 req_src_port=5060
in_uri=sip:2815@157.100.19.26:5060
out_uri=sip:0059399719212@69.20.61.218:5070;maddr=69.20.61.218 via_cnt==0"
--------------------------------------
the calls end but there is no accounting to my server.
thanks
roddy
#
# $Id: ser.cfg,v 1.21 2003/06/04 13:47:36 jiri Exp $
#
# simple quick-start config script
#
# ----------- global configuration parameters ------------------------
#debug=3 # debug level (cmd line: -dddddddddd)
#fork=no
#log_stderror=no # (cmd line: -E)
# Uncomment these lines to enter debugging mode
/*
debug=7
fork=no
log_stderror=yes
*/
check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
port=5060
children=4
fifo="/tmp/ser_fifo"
fifo_mode=438
alias=linora.ecua.net.ec
# ------------------ module loading ----------------------------------
# Uncomment this if you want to use SQL database
loadmodule "/usr/local/lib/ser/modules/mysql.so"
loadmodule "/usr/local/lib/ser/modules/sl.so"
loadmodule "/usr/local/lib/ser/modules/tm.so"
loadmodule "/usr/local/lib/ser/modules/rr.so"
loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
loadmodule "/usr/local/lib/ser/modules/usrloc.so"
loadmodule "/usr/local/lib/ser/modules/registrar.so"
loadmodule "/usr/local/lib/ser/modules/textops.so"
#loadmodule "/usr/local/lib/ser/modules/msilo.so"
#loadmodule "/usr/local/lib/ser/modules/print.so"
loadmodule "/usr/local/lib/ser/modules/acc.so"
# Uncomment this if you want digest authentication
# mysql.so must be loaded !
loadmodule "/usr/local/lib/ser/modules/auth.so"
loadmodule "/usr/local/lib/ser/modules/auth_db.so"
#radius
#loadmodule "/usr/local/lib/ser/modules/auth_radius.so"
# load the voicemail module
#loadmodule "/usr/local/lib/ser/modules/vm.so"
# load the enum module
loadmodule "/usr/local/lib/ser/modules/enum.so"
# load the group module, to verify if a user forwards to voicemail
loadmodule "/usr/local/lib/ser/modules/group.so"
# load the nathelper module
loadmodule "/usr/local/lib/ser/modules/nathelper.so"
# ----------------- setting module-specific parameters ---------------
# -- registrar parameter
# special NAT flag indicates that a registered client is behind NAT
#modparam("registrar", "nat_flag", 6)
# -- acc params --
modparam("acc", "db_url", "sql://ser:xxxxxx@localhost/ser")
modparam("acc", "log_level", 1)
modparam("acc", "radius_flag", 1)
modparam("acc", "db_flag", 1)
modparam("acc", "db_missed_flag", 1)
modparam("acc",
"radius_config","/usr/local/etc/radiusclient/radiusclient.conf")
modparam("acc", "radius_missed_flag", 2)
modparam("acc", "service_type", 15)
modparam("acc", "log_flag", 1)
# -- usrloc params --
#modparam("usrloc", "db_mode", 0)
# Uncomment this if you want to use SQL database
# for persistent storage and comment the previous line
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "db_url", "mysql://ser:xxxxxx@localhost/ser")
# -- auth params --
# Uncomment if you are using auth module
#
modparam("auth_db", "calculate_ha1", yes)
#
# If you set "calculate_ha1" parameter to yes (which true in this config),
# uncomment also the following parameter)
#
modparam("auth_db", "password_column", "password")
modparam("auth_db", "db_url", "mysql://ser:xxxxxx@localhost/ser")
# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)
# -- voicemail params --
#modparam("voicemail", "db_url","mysql://ser:xxxxxx@localhost/ser")
# -- voicemail params --
modparam("group", "db_url","mysql://ser:xxxxxx@localhost/ser")
# -- nathelper params --
modparam("nathelper", "natping_interval", 60)
#modparam("nathelper", "ping_nated_only", 1)
# -- tm params --
#modparam("tm", "fr_inv_timer", 30 )
#modparam("tm", "fr_inv_timer", 18 )
#modparam("tm", "fr_timer", 10 )
modparam("tm", "fr_inv_timer", 15 )
#modparam("tm", "wt_timer", 10 )
# -- msilo params --
#modparam("msilo","db_url","mysql://user:xxxxxx@127.0.0.1/msilo")
#modparam("msilo","registrar","sip:registrar@mydomain.com")
# ------------------------- request routing logic -------------------
# main routing logic
route{
#setflag(1);
log(1, "-------------------------------------------\n");
log(1, "entering main loop\n");
if (method=="INVITE"){
record_route();
};
if (method=="INVITE" || method=="BYE" || method=="CANCEL"){
record_route();
setflag(1);
};
/*
if (method=="REGISTER")
log(1, "REGISTER message received\n");
if (method=="INVITE")
log(1, "INVITE message received\n");
if (method=="ACK")
log(1, "ACK message received\n");
if (method=="BYE")
log(1, "BYE message received\n");
if (method=="CANCEL")
log(1, "CANCEL message received\n");
if (method=="SUBSCRIBE")
log(1, "SUBSCRIBE message received\n");
if (method=="NOTIFY")
log(1, "NOTIFY message received\n");
if (method=="OPTIONS")
log(1, "OPTIONS message received\n");
if (method=="INFO")
log(1, "INFO message received\n");
if (method=="MESSAGE")
log(1, "MESSAGE message received\n");
if (method=="REFER")
log(1, "REFER message received\n");
*/
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
break;
};
if (msg:len > max_len) {
#if (len_gt( max_len )) {
sl_send_reply("513", "Message too big");
break;
};
# loose-route processing
if (loose_route()) {
log(1, "loose_route processing\n");
t_relay();
break;
};
# if the request is for other domain use UsrLoc
# (in case, it does not work, use the following command
# with proper names and addresses in it)
if (uri=~"linora.ecua.net.ec") {
if (method=="REGISTER") {
log(1, "analyzing REGISTER request\n");
record_route();
# Uncomment this if you want to use digest authentication
if (!www_authorize("linora.ecua.net.ec", "subscriber")) {
www_challenge("linora.ecua.net.ec", "0");
break;
};
if (!save("location")) {
log(1, "save location error\n");
sl_reply_error();
};
break;
};
lookup("aliases");
# check if number beginns with 00, then convert it into a +
if (uri=~"^sip:00[0-9]*@") {
log(1, "00 International number detected\n");
# strip booth leading "0"
if (is_user_in("From", "ld")){
strip(2);
log(1, "ruta 5");
route(5);
break;
};
sl_send_reply("403","No tiene autorizacion LD");
break;
};
#mark transaction for voicemail
if (is_user_in("Request-URI", "voicemail\n")) {
log(1, "requested user is in voicemail group");
setflag(4);
};
# native SIP destinations are handled using our USRLOC DB
if (!lookup("location")) {
# handle user which was not found
log(1, "requested user not found\n");
route(4);
break;
};
};
#add failure route which should be performed if response code >=300
if (method=="INVITE" && isflagset(4)) {
log(1, "invite for voicemail user->initiate failureroute[1]\n");
t_on_failure("1");
};
# forward to current uri now; use stateful forwarding; that
# works reliably even if we forward from TCP to UDP
if (!t_relay()) {
log(1, "t_relay error occured\n");
sl_reply_error();
};
}
# all incoming replies for t_onrepli-ed transactions enter here
route[4]{
log(1, "-------------------------------------------\n");
log(1, "entering route[4] = requested user not online\n");
# non-Voip -- just send "off-line"
if (!(method == "INVITE" || method == "ACK" || method == "CANCEL" || method
== "REFER" || method == "BYE")) {
log(1, "no invite,ack,cancel,refer->return 404\n");
sl_send_reply("404", "Not Found");
break;
};
# not voicemail subscriber and no echo/conference call
if ( isflagset(4)) {
log(1, "flag(4) active\n");
};
if (uri =~ "conference") {
log(1, "conference call\n");
};
if (uri =~ "echo") {
log(1, "echo call\n");
};
if ( !( isflagset(4) || (uri =~ "conference") || (uri =~ "echo") ) ) {
log(1, "no voicemail subscriber->return 404");
sl_send_reply("404", "Not Found and no voicemail turned on");
break;
};
# forward to voicemail now
#rewritehostport("linora.ecua.net.ec:5090");
log(1, "forward to voicemail\n");
t_relay_to_udp("linora.ecua.net.ec", "5090");
}
failure_route[1] {
/* XX: note: unsafe if preloaded routes without username used */
log(1, "-------------------------------------------\n");
log(1, "failureroute[1] entered\");
revert_uri();
rewritehostport("linora.ecua.net.ec:5090");
append_branch();
t_relay_to_udp("linora.ecua.net.ec", "5090");
}
route[5] {
log(1, "forward hacia host internacional");
rewritehostport("xxx.xxx.xxx.xxx:5060"); # this is our trusted server
consume_credentials();
if (!t_relay()) {
sl_reply_error();
break;
};
}