Hi Bogdan,
better late then never ;) The upload of CPL scripts via SIP works fine
with CPLEd but after changing the SER config file with the if statement
you mentioned below I cannot REGISTER my client any more. It is a normal
REGISTER without any payload in the SDP part. I try it with three different
SIP clients and they all get a 500 error every time. Why do normal REGISTER
messages run into the if statement, too? Many thanks for your help.
Regards,
Oliver
Bogdan-Andrei IANCU wrote
>Hi Oliver,
>
>Instead of using HTTP for upload/download (which requires more pieces
>and more complex senttings) I would recommend you to use directly SIP
>for transporting CPL scripts (via REGISTER). CPLEd supprts also this method.
>In order to separated normal REGISTERs from CPL transport REGISTERS,
> From the SER part you must do something like:
>
>if (method=="REGISTER") {
> if ( cpl_process_register() ) {
> sl_send_reply("500","Error");
> };
> # here you can do normal processing of a
> # REGISTER request or whatever you want
>};
>
>In CPLEd, in the upload/download window you have to fill in the address
>and port of SER and the user name for which you want to install/fetch
>the script.
>
>Regards,
>Bogdan
Brinker, Oliver wrote:
>Hi Daniel,
>when I try to upload a cpl script via http the status string of CPLEd
>displays the following error message:
>
>Error: Upload via HTTP: HTTP request failed: Invalid CPL script
>
>I've set the direct path to the cpl.dtd in the cpl.php and in the CPLEd
>settings. Although Java SDK 1.4.1 is installed on the machine I load
>crimson.jar and xalan.jar into the classpath. But what is checker.jar
>and where can I get it? Is jaxp.jar included in the Java SDK or should
>I download a separate version?
>
>Many thanks,
>Oliver
>
>
>Daniel-Constantin Mierla wrote
>
>
>
>>Hello,
>>if you use the CVS head version then you should change the format of
>>database url: Now it reflects the type of database used and for mysql
>>should be like:
>>
>>mysql://foo:bar@localhost/ser
>>
>>Try with this one when setting the "cpl_db" parameter.
>>
>>Daniel
>>
>>
>
>
>
>>On 11/26/2003 11:30 AM, Brinker, Oliver wrote:
>>
>>
>
>
>
>>Hi Bogdan,
>>
>>The mysql module is loaded before the cpl-c one. Please have a look into
>>my ser.cfg because I cannot find any misconfig. Could it be a problem
>>with the SQL connection string? MySQL should be running correct.
>>
>>I change the module name in the modparam declaration from cpl_c to cpl-c
>>because cpl_c like in your documentation doesn't work ;) Thanks
>>
>>Oliver
>>
>>#
>># $Id: ser.cfg,v 1.24 2003/11/11 15:32:36 andrei Exp $
>>#
>># simple quick-start config script
>>#
>>
>># ----------- global configuration parameters ------------------------
>>
>>#debug=3 # debug level (cmd line: -dddddddddd)
>>#fork=yes
>>#log_stderror=no # (cmd line: -E)
>>
>>/* Uncomment these lines to enter debugging mode
>>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"
>>
>># ------------------ 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/cpl-c.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"
>>
>># 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"
>>
>># ----------------- setting module-specific parameters ---------------
>>
>># -- 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)
>>
>># -- 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")
>>
>># -- rr params --
>># add value to ;lr param to make some broken UAs happy
>>modparam("rr", "enable_full_lr", 1)
>>
>># -- cpl-c module --
>>modparam("cpl-c","cpl_db","sql://foo:bar@localhost/ser")
>>modparam("cpl-c","cpl_table","cpl")
>>modparam("cpl-c","cpl_dtd_file","/usr/local/etc/ser/cpl-06.dtd")
>>modparam("cpl-c","log_dir","/var/log/ser/cpl")
>>modparam("cpl-c","proxy_recurse",0)
>>
>># ------------------------- request routing logic -------------------
>>
>># main routing logic
>>
>>route{
>>
>> # 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 ) {
>> sl_send_reply("513", "Message too big");
>> break;
>> };
>>
>> # we record-route all messages -- to make sure that
>> # subsequent messages will go through our proxy; that's
>> # particularly good if upstream and downstream entities
>> # use different transport protocol
>> if (!method=="REGISTER") record_route();
>>
>> # subsequent messages withing a dialog should take the
>> # path determined by record-routing
>> if (loose_route()) {
>> # mark routing logic in request
>> append_hf("P-hint: rr-enforced\r\n");
>> route(1);
>> break;
>> };
>>
>> if (!uri==myself) {
>> # mark routing logic in request
>> append_hf("P-hint: outbound\r\n");
>> route(1);
>> 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==myself) {
>>
>> if (method=="REGISTER") {
>>
>> # Uncomment this if you want to use digest authentication
>> if (!www_authorize("t-systems.com", "subscriber")) {
>> www_challenge("t-systems.com", "0");
>> break;
>> };
>>
>> save("location");
>> break;
>> };
>>
>> lookup("aliases");
>> if (!uri==myself) {
>> append_hf("P-hint: outbound alias\r\n");
>> route(1);
>> break;
>> };
>>
>> # native SIP destinations are handled using our USRLOC DB
>> if (!lookup("location")) {
>> sl_send_reply("404", "Not Found");
>> break;
>> };
>> };
>> append_hf("P-hint: usrloc applied\r\n");
>> route(1);
>>}
>>
>>route[1]
>>{
>> # send it out now; use stateful forwarding as it works reliably
>> # even for UDP2TCP
>> if (!t_relay()) {
>> sl_reply_error();
>> };
>>}
>>
>>
>>Bogdan-Andrei IANCU [mailto:iancu@fokus.fraunhofer.de] wrote
>>
>>
>>
>>
>>
>>>Hi Oliver,
>>>
>>>The mysql module must be loade before the cpl-c one. Make sure about
>>>this in your configuration file.
>>>
>>>Bogdan
>>>
>>>
>>>
>>>
>>Brinker, Oliver wrote:
>>
>>
>>
>>
>>
>>>Hi Bogdan,
>>>now I fetch the whole cvs tree and compile SER and the needed modules.
>>>Everything works fine until I put the cpl-c modparam values into ser.cfg.
>>>I get an error message on my xconsole that the cpl-c module cannot bind
>>>to the database. The mysql module is loaded because digest authentications
>>>works since a few days. Is there anything to mind regarding the order of
>>>loading modules or setting params in the ser.cfg? Many thanks.
>>>
>>>Regards,
>>>Oliver
>>>
>>>
>>>Bogdan-Andrei IANCU [mailto:iancu@fokus.fraunhofer.de] wrote
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>>Hi Oliver,
>>>>
>>>>what branch of cvs do you use? or you use the head of cvs?
>>>>on CVS head everything is fixed - but you have to get the whole tree,
>>>>not only the TM.
>>>>
>>>>Regards,
>>>>Bogdan
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>Brinker, Oliver wrote:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>>Hi Bogdan,
>>>>
>>>>I try to patch the TM module and get an error during patching t_reply.c:
>>>>
>>>>Hunk #2 FAILED at 375
>>>>Hunk #3 FAILED at 400
>>>>
>>>>I'm not sure but could the faked_env function be the problem (expect four params,
>>>>but receiving only two)? Should I use a new version of the TM module from the CVS?
>>>>Many thanks.
>>>>
>>>>Regards,
>>>>Olli
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>Hello,
>>>>>
>>>>>In order to compile the cpl-c module, you need to apply a patch to the
>>>>>tm_modulel you can finf this patch in modules/cpl-c/tm.patch.
>>>>>Please, use the patch from the same version of ser as the tm modules. Try to do
>>>>>so and let my know if it worked.
>>>>>
>>>>>Regards,
>>>>>Bogdan
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>_______________________________________________
>>Serusers mailing list
>>serusers(a)lists.iptel.org
>>http://lists.iptel.org/mailman/listinfo/serusers
>>
>>
>>
>>
>>
>
>
>
>
You have all the Requierd files I hope ?
OS79XX.TXT
SIPDefault.cnf
SIPMaxaddr.cnf
and.. remember.. you have to make the upgrade step by step..
- Atle
* Kuzlu <mkuzlu(a)hotmail.com> [040130 12:39]:
> I move SIP firmware to TFTT directory root .
> Then in 7960 write TFT server's IP address
> and I see "unprovison" on screen.
>
> Thanks
>
> Kuzlu
> ----- Original Message -----
> From: "Atle Samuelsen" <clona(a)camaro.no>
> To: "Kuzlu" <mkuzlu(a)hotmail.com>
> Cc: <serusers(a)lists.iptel.org>
> Sent: Friday, January 30, 2004 12:13 PM
> Subject: Re: [Serusers] download firmware
>
>
> >
> > make a call to neareast Cisco reseller, and tell them that you need all
> > the firmware updates from 3.X branch to 6.X
> >
> > Atleast , thats what I did.
> >
> > - Atle
> >
> >
> >
> > * Kuzlu <mkuzlu(a)hotmail.com> [040130 11:07]:
> > > How can I download a firmware file to 7960 ?
> >
> > > _______________________________________________
> > > Serusers mailing list
> > > serusers(a)lists.iptel.org
> > > http://lists.iptel.org/mailman/listinfo/serusers
> >
> >
>
Hi...
i got the p[oint of using domain table i am already using it..that is to
check for multiple domain verification only.....but for eg...if i add two
users with username 111 with domain as a.com and b.com....it does in
subscriber table with username as 111 and domains as a.com and b.com....this
all is fine....when 111(a)a.com tries to call like 111#...what will
happen...call only goes for last registration done...coz in location
structure , it doesn't add the latest entry of 111(a)b.com....
whenever u make a call it searches for the first record in location table
and call goes to it...so
111 a.com
111 b.com if the entries are like this....b.com can call a.com but not
vice-versa...
_________________________________________________________________
Play the prediction game on MEZ. Win Sehwags autographed T-shirts.
http://go.msnserver.com/IN/41491.asp Predict and win on myenjoyzone.com.
Hi List,
i tried on asterisk list as well, but any of you can give any idea abt SIP authenticatin problem with Asterisk and SIP UA (i tried SIPPS and X-Lite)
I could not properly get authenticated with my SIP UA to asterisk. i m using a username for UA "12321" and following are SIP.conf file user params
[12321]
type=friend
username=12321
host=dynamic
secret=ccarta
context=default
mailbox=1234,2345 ; Mailbox for message waiting indicator
[77777]
type=friend
username=77777
host=dynamic
secret=atracc
context=default
mailbox=1234,2345
m trying with SIPPS UA, that gets status "Acquired", not "Registered", Can anyone give any idea about it? I tried same with X-Lite, didnt work.
Sip debug messages are pasted below.
Best Regards,
JF
Sip read:
REGISTER sip:192.168.100.71 SIP/2.0
Via: SIP/2.0/UDP 192.168.100.66:5062;branch=z9hG4bKnp992800961-40de3e5f192.168.100.66
From: <sip:12321@192.168.100.71>;tag=3b2cf0ba
To: <sip:12321@192.168.100.71>
Call-ID: 990209125-415b5d61@990209122-415b5d5e
Contact: ccarta <sip:12321@192.168.100.66:5062>;expires=600;q=0.500
Expires: 600
CSeq: 1 REGISTER
Content-Length: 0
User-Agent: Ahead SIPPS IP Phone Version 2.0.42.13
10 headers, 0 lines
Using latest request as basis request
Sending to 192.168.100.66 : 5062 (non-NAT)
Transmitting (no NAT):
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.100.66:5062;branch=z9hG4bKnp992800961-40de3e5f192.168.100.66
From: <sip:12321@192.168.100.71>;tag=3b2cf0ba
To: <sip:12321@192.168.100.71>;tag=as648287fa
Call-ID: 990209125-415b5d61@990209122-415b5d5e
CSeq: 1 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: <sip:12321@192.168.100.71>
Content-Length: 0
to 192.168.100.66:5062
Transmitting (no NAT):
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 192.168.100.66:5062;branch=z9hG4bKnp992800961-40de3e5f192.168.100.66
From: <sip:12321@192.168.100.71>;tag=3b2cf0ba
To: <sip:12321@192.168.100.71>;tag=as648287fa
Call-ID: 990209125-415b5d61@990209122-415b5d5e
CSeq: 1 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: <sip:12321@192.168.100.71>
Proxy-Authenticate: Digest realm="asterisk", nonce="7c7fba4d"
Content-Length: 0
to 192.168.100.66:5062
Sip read:
REGISTER sip:192.168.100.71 SIP/2.0
Via: SIP/2.0/UDP 192.168.100.66:5062;branch=z9hG4bKnp992804895-411b471d192.168.100.66
From: <sip:12321@192.168.100.71>;tag=3b2d0018
To: <sip:12321@192.168.100.71>
Call-ID: 990209125-415b5d61@990209122-415b5d5e
Contact: ccarta <sip:12321@192.168.100.66:5062>;expires=600;q=0.500
Expires: 600
CSeq: 2 REGISTER
Content-Length: 0
Proxy-Authorization: Digest username="12321",realm="asterisk",uri="sip:192.168.100.66",nonce="7c7fba4d",nc="00000001",response="b8b1d7fc53eff354dfc31dfa3f800749"
User-Agent: Ahead SIPPS IP Phone Version 2.0.42.13
11 headers, 0 lines
Using latest request as basis request
Sending to 192.168.100.66 : 5062 (non-NAT)
Transmitting (no NAT):
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.100.66:5062;branch=z9hG4bKnp992804895-411b471d192.168.100.66
From: <sip:12321@192.168.100.71>;tag=3b2d0018
To: <sip:12321@192.168.100.71>;tag=as648287fa
Call-ID: 990209125-415b5d61@990209122-415b5d5e
CSeq: 2 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: <sip:12321@192.168.100.71>
Content-Length: 0
to 192.168.100.66:5062
Transmitting (no NAT):
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.100.66:5062;branch=z9hG4bKnp992804895-411b471d192.168.100.66
From: <sip:12321@192.168.100.71>;tag=3b2d0018
To: <sip:12321@192.168.100.71>;tag=as648287fa
Call-ID: 990209125-415b5d61@990209122-415b5d5e
CSeq: 2 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Expires: 600
Contact: <sip:12321@192.168.100.71>;expires=600
Date: Tue, 14 Oct 2003 13:46:14 GMT
Content-Length: 0
to 192.168.100.66:5062
11 headers, 2 lines
Reliably Transmitting:
NOTIFY sip:12321@192.168.100.66:5062 SIP/2.0
Via: SIP/2.0/UDP 192.168.100.71:5060;branch=z9hG4bK3ecb7a3b
From: "asterisk" <sip:asterisk@192.168.100.71>;tag=as3f6e8c0e
To: <sip:12321@192.168.100.66:5062>
Contact: <sip:asterisk@192.168.100.71>
Call-ID: 074dfadf24b95dd75e17b56c67ffcaf1(a)192.168.100.71
CSeq: 102 NOTIFY
User-Agent: Asterisk PBX
Event: message-summary
Content-Type: application/simple-message-summary
Content-Length: 36
Messages-Waiting: no
Voicemail: 0/0
(no NAT) to 192.168.100.66:5062
Sip read:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.100.71;branch=z9hG4bK3ecb7a3b
From: "asterisk" <sip:asterisk@192.168.100.71>;tag=as3f6e8c0e
To: <sip:12321@192.168.100.66:5062>;tag=3b302259
Call-ID: 074dfadf24b95dd75e17b56c67ffcaf1(a)192.168.100.71
CSeq: 102 NOTIFY
User-Agent: Ahead SIPPS IP Phone Version 2.0.42.13
Content-Length: 0
8 headers, 0 lines
---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
# lookup local SIP domains in domain table
modparam("domain", "db_mode", 1) # 0 do not use caching, 1 use caching
modparam("domain", "domain_table", "domain")
modparam("domain", "domain_col", "domain")
# -- usrloc params --
modparam("usrloc", "use_domain", 1)
if (is_from_local()) {
# this is one for our subscribers
etc....
};
create a mysql table called domain, see sample scripts from ser
installation
you can manage the domains with serctl command
> Message: 34
> Date: Fri, 30 Jan 2004 16:09:09 +0530
> From: "kapil dhawan" <oswriter(a)hotmail.com>
> Subject: [Serusers] Multiple Domain
> To: serusers(a)lists.iptel.org
> Cc: oswriter(a)hotmail.com
> Message-ID: <BAY2-F159HkfWWubeYz00013561(a)hotmail.com>
> Content-Type: text/plain; format=flowed
>
> Hi All.....
> I am not sure whether i am posting my query at right place...
>
>
> Well i am using ser-0.8.12. i want to allow mulpile domains....but i
> don't
> want to do changes in .cfg file whenever a new domain is added...and i
> even
> don't want to write script to add location to different location
> tables...depending upon the uri.....i want to use one subscriber and
> one
> location table.....How can this be done
>
Hi,
I downloaded the latest CVS tarball and installed it in our lab. Using
a LAN setup, where SER and 2 Sipura units are all in the same subnet, I
am unable to complete any calls. All I can tell is that SER is unable
to match the ACK to a current transaction. So when phone A makes a call
to phone B and it answers, phone B sends the STATUS 200 OK back. Phone
A then sends the ACK, but SER is unable to match it and is not forwarded
to phone B. So the call is not completed.
The syslog just shows a bunch of these messages:
Warning: sl_send_reply: I won't send a reply for ACK!!
I have tried this under RedHat 7.3 and Solaris 8 with the exact same
results.
I can send the Ethereal Trace of this event to whoever can help me.
The config file is extremely simple (listed below).
Any clues of what is going on?
Thanks.
--
Andres
Network Admin
http://www.telesip.net
route{
# 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 ) {
sl_send_reply("513", "Message too big");
break;
};
# we record-route all messages -- to make sure that
# subsequent messages will go through our proxy; that's
# particularly good if upstream and downstream entities
# use different transport protocol
record_route();
# loose-route processing
if (loose_route()) {
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==myself) {
if (method=="REGISTER") {
save("location");
break;
};
};
# native SIP destinations are handled using our USRLOC DB
if (!lookup("location")) {
sl_send_reply("404", "Not Found");
break;
};
# forward to current uri now; use stateful forwarding; that
# works reliably even if we forward from TCP to UDP
if (!t_relay()) {
sl_reply_error();
};
}
--
Andres
Network Admin
http://www.telesip.net
I'm trying to do failure route to voicemail (which is working) but this
error is logged:
ERROR: t_should_relay: status rewrite by UAS: stored: 408, received: 487
I googled this and see that this came up last in October
(http://lists.iptel.org/pipermail/serusers/2003-October/002921.html) but
I don't see any evidence of a solution in the thread.
I suspect mine is the same problem as I have two UAs registered so the
initial dset is two places and then the append_branch on timeout is just
the voicemail uri.
BTW, I am doing this with asterisk for the usual DTMF access reasons
(altough I haven't yet figured out how to map sip:alan@columbia.edu to
DTMF. Maybe I'll have to give up and do numeric mailboxes:-(
I am rewriting with a prefix of "vm*u" before punting over to asterisk
which has
exten => _vm*u.,1,Wait,1
exten => _vm*u.,2,Voicemail(${EXTEN:3})
exten => _vm*u.,3,Goto(#,1)
Any pointers would be appreciated. My not-yet-complete ser.cfg is
attached (not yet punting voicemail for unregistered subscribers; just
registered subscribers who time out the invite).
/a
#
# $Id: ser.cfg,v 1.21.2.1 2003/07/30 16:46:18 andrei Exp $
#
# simple quick-start config script
#
# ----------- global configuration parameters ------------------------
debug=2 # debug level (cmd line: -dddddddddd)
fork=yes
log_stderror=no # (cmd line: -E)
#listen=128.59.39.127
check_via=yes # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
port=5060
children=4
fifo="/tmp/ser_fifo"
alias="columbia.edu"
# ------------------ module loading ----------------------------------
# Uncomment this if you want to use SQL database
loadmodule "/usr/lib/ser/modules/mysql.so"
loadmodule "/usr/lib/ser/modules/acc.so"
loadmodule "/usr/lib/ser/modules/sl.so"
loadmodule "/usr/lib/ser/modules/tm.so"
loadmodule "/usr/lib/ser/modules/rr.so"
loadmodule "/usr/lib/ser/modules/maxfwd.so"
loadmodule "/usr/lib/ser/modules/usrloc.so"
loadmodule "/usr/lib/ser/modules/registrar.so"
# Uncomment this if you want digest authentication
# mysql.so must be loaded !
loadmodule "/usr/lib/ser/modules/auth.so"
loadmodule "/usr/lib/ser/modules/auth_db.so"
loadmodule "/usr/lib/ser/modules/exec.so"
# ----------------- setting module-specific parameters ---------------
# -- transaction timers --
modparam("tm", "fr_inv_timer", 15 )
modparam("tm", "fr_timer", 10 )
# -- usrloc params --
#
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "timer_interval", 10)
# -- auth params --
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
# -- rr params --
# add value to ;lr param to make some broken UAs happy
modparam("rr", "enable_full_lr", 1)
# -- acc params --
modparam("acc", "log_level", 1)
modparam("acc", "log_flag", 1 )
modparam("acc", "log_missed_flag", 2)
# ------------------------- request routing logic -------------------
# main routing logic
route{
/* ********* ROUTINE CHECKS ********************************** */
# 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 ) {
sl_send_reply("513", "Message too big");
break;
};
lookup("aliases");
# we record-route all messages -- to make sure that
# subsequent messages will go through our proxy; that's
# particularly good if upstream and downstream entities
# use different transport protocol
record_route();
# loose-route processing
if (loose_route()) {
t_relay();
break;
};
setflag(2);
# 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=~"^sip:(.+@)?columbia.edu") {
if (method=="REGISTER") {
log(1, "REGISTER received\n");
if (!www_authorize("columbia.edu", "subscriber")) {
www_challenge("columbia.edu", "0");
break;
};
save("location");
break;
};
/* ********** Dial out to PSTN logic ************* */
# 5 Digit dialing, interior calls
if (uri=~"^sip:[1347][0-9]{4}@columbia\.edu") {
rewritehostport("128.59.59.242:5060");
log(1,"5 digit expression match");
route(2);
break;
};
# 10 Digit dialing with outlide line
if (uri=~"^sip:931[0-9]{10}@columbia\.edu") {
if(!(src_ip=="128.59.59.242")
& !(proxy_authorize("columbia.edu","subscriber"))) {
proxy_challenge("columbia.edu", "1");
break;
} else {
rewritehostport("128.59.59.242:5060");
log(1," 93 Outside line with 10 digit expression match");
route(2);
break;
};
};
/* voicemail access */
if (uri=~"^sip:\*86@columbia\.edu"
|uri=~"^sip:vm@columbia\.edu"
|uri=~"^sip:voicemail@columbia\.edu") {
route(3);
break;
};
# native SIP destinations are handled using our USRLOC DB
if (!lookup("location")) {
if (!exec_dset("/etc/ser/sipldap")) {
sl_send_reply("404", "Not Found");
break;
} else {
log(1," sipldap call");
};
}; #!lookup
};
if (method == "INVITE") {
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()) {
sl_reply_error();
};
}
route[2] {
log(1,"route[2]:SIP-to-PSTN call routed");
if (!t_relay()) {
sl_reply_error();
};
}
# ---- voicemail user access ----
route[3] {
rewritehostport("127.0.0.1:5069");
log(1,"voicemail access");
if (!t_relay()) {
sl_reply_error();
};
}
# ------------- handling of unregistered user ------------------
route[4] {
log(1,"route[4]: user not registered");
# non-Voip -- just send "off-line"
if (!(method == "INVITE" || method == "ACK" || method == "CANCEL")) {
sl_send_reply("404", "Not Found");
break;
};
# not voicemail subscriber
# if (!isflagset(4)) {
# sl_send_reply("404", "Not Found and no voicemail turned on");
# break;
# };
# forward to voicemail now
prefix("vm*u");
rewritehostport("127.0.0.1:5069");
t_relay_to_udp("127.0.0.1", "5069");
}
failure_route[1] {
# transfer to asterisk voicemail with uMAILBOX for unavailable.
# sip:USER@columbia.edu -> sip:vm*uUSER@127.0.0.1:5069
t_on_failure("2");
prefix("vm*u");
rewritehostport("127.0.0.1:5069");
append_branch();
log(1,"redirection to voicemail\n");
t_relay();
}
failure_route[2] {
# forwarding failed (voicemail down?)
log(1,"voicemail failed\n");
t_reply("500","Weasels have eaten voicemail again");
}