[SR-Users] ASYNC Module
Aaron Hamstra
ahamstra at carnegietechnologies.com
Fri Jun 12 23:03:18 CEST 2015
Alex,
We are using a pretty close to default configuration.
Below is the routing blocks above and below where async_route is
located(async_route actually is inside my route[REGISTRAR] block.
# Handle requests within SIP dialogs
route[WITHINDLG] {
if (has_totag()) {
# sequential request withing a dialog should
# take the path determined by record-routing
if (loose_route()) {
route(DLGURI);
if (is_method("BYE")) {
setflag(FLT_ACC); # do accounting ...
setflag(FLT_ACCFAILED); # ... even if
the transaction fails
}
else if ( is_method("ACK") ) {
# ACK is forwarded statelessy
route(NATMANAGE);
}
else if ( is_method("NOTIFY") ) {
# Add Record-Route for in-dialog NOTIFY
as per RFC 6665.
record_route();
}
route(RELAY);
} else {
if (is_method("SUBSCRIBE") && uri == myself) {
# in-dialog subscribe requests
route(PRESENCE);
exit;
}
if ( is_method("ACK") ) {
if ( t_check_trans() ) {
# no loose-route, but stateful
ACK;
# must be an ACK after a 487
# or e.g. 404 from upstream
server
route(RELAY);
exit;
} else {
# ACK without matching
transaction ... ignore and discard
exit;
}
}
xlog("SCRIPT: $TF Call to $rU but not currently
in usrloc db SIP/404\n");
sl_send_reply("404","Not here");
}
exit;
}
}
# Event Route for Expired Contact
event_route[usrloc:contact-expired] {
xlog("expired contact for $ulc(exp=>aor)\n");
}
# Handle SIP registrations
route[REGISTRAR] {
if (is_method("REGISTER"))
{
if(isflagset(FLT_NATS))
{
setbflag(FLB_NATB);
# uncomment next line to do SIP NAT pinging
##setbflag(FLB_NATSIPPING);
}
xlog("SCRIPT: $TF $au registered to usrloc db from $si
from useragent type of $ua\n");
if (!save("location", "0x4"))
sl_reply_error();
async_route("PUSHJOIN", "2");
exit;
}
}
# USER location service
route[LOCATION] {
#!ifdef WITH_SPEEDDIAL
# search for short dialing - 2-digit extension
if($rU=~"^[0-9][0-9]$")
if(sd_lookup("speed_dial"))
route(SIPOUT);
#!endif
#!ifdef WITH_ALIASDB
# search in DB-based aliases
if(alias_db_lookup("dbaliases"))
route(SIPOUT);
#!endif
$avp(oexten) = $rU;
if (!lookup("location")) {
$var(rc) = $rc;
route(TOVOICEMAIL);
t_newtran();
switch ($var(rc)) {
case -1:
case -3:
xlog("SCRIPT: $TF Call to $rU but not
currently in usrloc db SIP/404\n");
send_reply("404", "Not Found");
exit;
case -2:
send_reply("405", "Method Not Allowed");
exit;
}
}
# when routing via usrloc, log the missed calls also
if (is_method("INVITE"))
{
setflag(FLT_ACCMISSED);
}
route(RELAY);
exit;
}
Thanks!
-----Original Message-----
From: sr-users [mailto:sr-users-bounces at lists.sip-router.org] On Behalf
Of Alex Balashov
Sent: Friday, June 12, 2015 3:50 PM
To: sr-users at lists.sip-router.org
Subject: Re: [SR-Users] ASYNC Module
Aaron,
Where is the call to async_route() situated in the core request route?
That is, what is called before and after the async_route?
-- Alex
On 06/12/2015 03:38 PM, Aaron Hamstra wrote:
> We just updated our development environment from 4.2.2 to 4.2.5 and
> started noticing the server sending a 500 I'm terribly sorry, server
> error occurred (1/TM) error back as soon as the async_route block gets
> called. I have removed everything from our async route other than an
> xlog statement trying to determine if something in that route block
> was causing the 500 to occur. It still happens even with only the
xlog.
>
> If the async_route is not in the config, then the server does not send
> the 500 response.
>
> We rolled back to 4.2.2 and the problem no longer occurs.
>
> I have attached a sip trace of the messages. I believe the relevant
> parts of our config are below, please let me know if you need more
> from the config however.
>
> Any ideas?
>
> async_route("PUSHJOIN", "2");
>
> --------------------------
>
> route[PUSHJOIN] {
>
> xlog("L_INFO", "Does it get here?\n");
>
> exit;
>
> }
>
> Thanks in Advance,
>
> Aaron
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
> list sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
--
Alex Balashov | Principal | Evariste Systems LLC
303 Perimeter Center North, Suite 300
Atlanta, GA 30346
United States
Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users at lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
More information about the sr-users
mailing list