mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-17 07:20:23 +00:00
Add definitions for Kamailio KEMI Framework
This commit is contained in:
Vendored
+1294
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,33 @@
|
||||
import * as KSR from "kamailio-kemi";
|
||||
|
||||
function ksr_request_route() {
|
||||
if (KSR.maxfwd.process_maxfwd(16) < 0) {
|
||||
KSR.sl.send_reply(483, "Too Many Hops");
|
||||
return;
|
||||
}
|
||||
const reqURI = KSR.pv.get('$ru');
|
||||
const reqMethod = KSR.pv.get('$rm');
|
||||
|
||||
if (KSR.isflagset(31)) {
|
||||
KSR.hdr.append_to_reply("Retry-After: 60");
|
||||
KSR.sl.send_reply(503, "Service Unavailable");
|
||||
return;
|
||||
}
|
||||
|
||||
if (KSR.is_OPTIONS()) {
|
||||
KSR.sl.send_reply(200, "OK");
|
||||
return;
|
||||
}
|
||||
|
||||
KSR.dbg(`IN ksr_request_route(): ${reqMethod} ${reqURI}`);
|
||||
|
||||
KSR.pv.sets('$du', "sip:127.0.0.1:5080;transport=tcp");
|
||||
|
||||
KSR.tm.t_on_branch("ksr_branch_route");
|
||||
KSR.tm.t_on_reply("ksr_onreply_route");
|
||||
KSR.tm.t_on_failure("ksr_failure_route");
|
||||
|
||||
if (KSR.tm.t_relay() < 0) {
|
||||
KSR.sl.send_reply(500, "Server error");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"kamailio-kemi-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user