more prep for jmp-fwdcalls compat: V1-provided arg

Denver Gingerich created

This is a continuation of the work started in 90a21bc, which prepares
the SGX for integration with jmp-fwdcalls and its V1 dependence.  Left
out from that previous commit was a mention of where we first did the
V1->V2 switch in this SGX.  For the URL code of important to the
call_catapult() method, this was in a9237ee.

Back to this commit, we have paved the way for jmp-fwdcalls to pass us
a config file containing the V1 credentials, which we can then use
when we detect a V1 path in call_catapult() and convert accordingly.

Change summary

sgx-bwmsgsv2.rb | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Detailed changes

sgx-bwmsgsv2.rb 🔗

@@ -92,6 +92,7 @@ module SGXbwmsgsv2
 	]
 
 	def self.run
+		# TODO: read/save ARGV[7] creds to local variables
 		client.run
 	end
 
@@ -213,6 +214,7 @@ module SGXbwmsgsv2
 			# begin hack for running V2 messages along with V1 voice
 			url_prefix = 'https://api.catapult.inetwork.com/'
 			# TODO: set token and secret to vals provided at startup
+			# TODO: replace pth's user_id with user_id from ARGV[7]
 		else
 			# TODO: error
 		end
@@ -1036,11 +1038,11 @@ at_exit do
 	puts "Soprani.ca/SMS Gateway for XMPP - Bandwidth API V2\n"\
 		"==>> last commit of this version is " + `git rev-parse HEAD` + "\n"
 
-	if ARGV.size != 7
+	if ARGV.size != 7 and ARGV.size != 8
 		puts "Usage: sgx-bwmsgsv2.rb <component_jid> "\
 			"<component_password> <server_hostname> "\
 			"<server_port> <application_id> "\
-			"<http_listen_port> <mms_proxy_prefix_url>"
+			"<http_listen_port> <mms_proxy_prefix_url> [V1_creds_file]"
 		exit 0
 	end