~singpolyma/sgx-jmp

66707180b5bffa9f8df2f5519b8c3dcbcbb9ca82 — Stephen Paul Weber 1 year, 5 months ago fe4c9e8
Reply to extdisco with sip server
2 files changed, 15 insertions(+), 0 deletions(-)

M config.dhall.sample
M sgx_jmp.rb
M config.dhall.sample => config.dhall.sample +1 -0
@@ 39,6 39,7 @@
	xep0157 = [
		{ var = "support-addresses", value = "xmpp:+14169938000@cheogram.com" }
	],
	sip_host = "sip.jmp.chat",
	plans = ./plans.dhall,
	electrum = ./electrum.dhall,
	oxr_app_id = "",

M sgx_jmp.rb => sgx_jmp.rb +14 -0
@@ 257,6 257,20 @@ disco_items node: "http://jabber.org/protocol/commands" do |iq|
	}.catch { |e| panic(e, sentry_hub) }
end

iq "/iq/ns:services", ns: "urn:xmpp:extdisco:2" do |iq|
	reply = iq.reply
	reply << Nokogiri::XML::Builder.new {
		services(xmlns: "urn:xmpp:extdisco:2") do
			service(
				type: "sip",
				host: CONFIG[:sip_host]
			)
		end
	}.doc.root

	self << reply
end

command :execute?, node: "jabber:iq:register", sessionid: nil do |iq|
	sentry_hub = new_sentry_hub(iq, name: iq.node)
	EMPromise.resolve(nil).then {