MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / l_siplua_isMyself

Function l_siplua_isMyself

modules/lua/sipapi.c:374–391  ·  view source on GitHub ↗

does not check user. See ENABLE_USER_CHECK in modules/rr/loose.c:is_myself() */ look into the aliases */

Source from the content-addressed store, hash-verified

372/* does not check user. See ENABLE_USER_CHECK in modules/rr/loose.c:is_myself() */
373/* look into the aliases */
374static int l_siplua_isMyself(lua_State *L)
375{
376 struct sip_uri puri;
377 size_t len;
378 int ret;
379
380 memset(&puri, '\0', sizeof(puri));
381 puri.host.s = (char *)luaL_checklstring(L, 1, &len);
382 puri.host.len = len;
383 puri.port_no = luaL_checkinteger(L, 2);
384 set_sip_defaults(puri.port_no, puri.proto);
385 ret = check_self(&puri.host, puri.port_no, puri.proto);
386 if (!ret)
387 lua_pushnil(L);
388 else
389 lua_pushboolean(L, 1);
390 return 1;
391}
392
393/* Similar to isMyself, but without taking a look into the aliases */
394static int l_siplua_grepSockInfo(lua_State *L)

Callers

nothing calls this directly

Calls 1

check_selfFunction · 0.85

Tested by

no test coverage detected