-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update openSIPS IMS configuration files
Co-authored-by: Razvan Crainea <[email protected]>
- Loading branch information
1 parent
2dc170e
commit 5ae69db
Showing
3 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,9 @@ mpath="/usr/lib/x86_64-linux-gnu/opensips/modules" | |
|
||
####### Modules Section ######## | ||
|
||
#### MYSQL module | ||
loadmodule "db_mysql.so" | ||
|
||
#### SIGNALING module | ||
loadmodule "signaling.so" | ||
|
||
|
@@ -135,6 +138,18 @@ modparam("rtpengine", "rtpengine_sock", "udp:RTPENGINE_IP:2223") | |
loadmodule "event_route.so" | ||
loadmodule "json.so" | ||
|
||
#### PRESENCE modules | ||
loadmodule "presence.so" | ||
loadmodule "presence_reginfo.so" | ||
loadmodule "pua.so" | ||
modparam("pua","db_url", "mysql://opensips_pcscf:heslo@MYSQL_IP/opensips_pcscf") | ||
|
||
loadmodule "pua_reginfo.so" | ||
|
||
modparam("pua_reginfo", "ul_domain", "location") | ||
modparam("pua_reginfo", "ul_identities_key", "identities") | ||
modparam("pua_reginfo", "default_domain", "IMS_DOMAIN") | ||
modparam("pua_reginfo", "server_address", "sip:[email protected]_DOMAIN") | ||
|
||
|
||
####### Routing Logic ######## | ||
|
@@ -180,6 +195,11 @@ route{ | |
t_on_reply("rtpengine_answer"); | ||
} | ||
|
||
if (is_method("SUBSCRIBE|NOTIFY") && is_myself($rd)) { | ||
route(handle_presence); | ||
exit; | ||
} | ||
|
||
# route it out to whatever destination was set by loose_route() | ||
# in $du (destination URI). | ||
route(relay); | ||
|
@@ -208,6 +228,10 @@ route{ | |
t_on_reply("register_reply"); | ||
route(relay); | ||
exit; | ||
} else if (is_method("SUBSCRIBE|PUBLISH")) { | ||
xlog("L_INFO", "[$ci] Received $rm for $tu - handling\n"); | ||
route(handle_presence); | ||
exit; | ||
} else if (is_method("INVITE")) { | ||
if (loose_route()) { | ||
xlog("L_INFO", "[$ci] Received INVITE for $tu - relaying to S-CSCF ($ru/$du)\n"); | ||
|
@@ -436,3 +460,20 @@ event_route[E_DM_REQUEST] { | |
|
||
} | ||
} | ||
|
||
route[handle_presence] { | ||
if (!t_newtran()){ | ||
sl_reply_error(); | ||
exit; | ||
} | ||
if ($hdr(Event) != "reg") { | ||
xlog("L_ERR", "[$ci] Unhandled event $hdr(Event)\n"); | ||
send_reply(489, "Bad Event"); | ||
exit; | ||
} | ||
|
||
if (is_method("PUBLISH")) | ||
handle_publish(); | ||
if (is_method("SUBSCRIBE")) | ||
handle_subscribe(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters