[Serusers] Re: routing and accounting in SER
Giovanni Balasso
giaso at yahoo.it
Mon May 30 13:38:27 CEST 2005
Alle 13:03, lunedì 30 maggio 2005, Ozan Blotter ha scritto:
> Dear Giovanni Balasso,
>
> Thanks for you reply, but some parts i'm confused... Because i have two
> setflag(1) in my ser.cfg, which one i need to remove or add, if i delete
> the one on top of route, BYE messages are not recorded into database. Can
> you please tell me how can i ?
>
You should use one setflag when the call starts (on INVITE) and one when the
call ends (BYE or CANCEL), so I suggest
- remove setflag on top of route, then add
if ((method=="BYE" || method=="CANCEL") && !(uri=~"^sip:833*@WHATEVER")) {
setflag(1);
}
between record route and loose route sections (as you record_route your calls,
BYEs or CANCELs are relayed in loose_route section, so you need to set acc
flag before relaying BYE in loose_route)
- you can safely remove || method=="BYE" || method=="CANCEL" and keep only
method=="INVITE" in uri==myself section (remember BYE and CANCEL hit
loose_route!), and add uri check as above to the following setflag
So your routing logic now should work like this
INVITE --> call for 833* ? --> if not: flag 1 (call started) --> call relayed
--> BYE --> call for 833*? --> if not: flag 1 (call ended) --> SIP session
closed
ciao
--
Giovanni Balasso
giaso at yahoo.it
More information about the sr-users
mailing list