Hi,

I’m currently attempting to take an INVITE from an Asterisk server that is 
requesting an extension number, perform dbalias lookups to have extensions 
turned into sip users (x1000 -> test_hardphone) and then do location lookups on 
those sip users.  There can be multiple sip users for each extension and 
multiple locations for each sip user.

Using the code below partially works but when there are no location entries for 
the requested sip user, OpenSIPS returns a 500 and prints out “ERROR:  
t_forward_nonack failed” how can I have OpenSIPS instead respond with a 404?

### CODE ###

modparam("alias_db",        "append_branches",          1)

route {
    if ( is_from_gw() ) {
        alias_db_lookup("dbaliases");
        t_on_branch("sip_user_branch");
    }
    route(relay);
    return(0);
}

branch_route[sip_user_branch] {
    route(lookup_sip_user);
}

route[lookup_sip_user] {
    if ( ! lookup("location")  ) {
        drop();
    }
}

route[relay] {
    if ( ! t_relay() ) {
        sl_reply_error();
        rtpproxy_unforce();
        return(0);
    }
}

### CODE ###

Any help would be appreciated, Thanks
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to