diff options
author | pescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7> | 2010-01-04 17:40:49 +0000 |
---|---|---|
committer | pescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7> | 2010-01-04 17:40:49 +0000 |
commit | 894989e1bd2885ef7d7c9a5c9df8c8d689d02fb8 (patch) | |
tree | 6a7499d9f709b3a4efdec4818da7cd7b5d86a6ea /Protocols | |
parent | 41fe0062de49bd68ce2da4d57d670789c958216a (diff) |
sip: 0.1.0.0
git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@203 c086bb3d-8645-0410-b8da-73a8550f86e7
Diffstat (limited to 'Protocols')
-rw-r--r-- | Protocols/SIP/Docs/sip_readme.txt | 6 | ||||
-rw-r--r-- | Protocols/SIP/SIPProto.cpp | 4 | ||||
-rw-r--r-- | Protocols/SIP/build/rakefile | 161 |
3 files changed, 144 insertions, 27 deletions
diff --git a/Protocols/SIP/Docs/sip_readme.txt b/Protocols/SIP/Docs/sip_readme.txt index d5887fd..ca10538 100644 --- a/Protocols/SIP/Docs/sip_readme.txt +++ b/Protocols/SIP/Docs/sip_readme.txt @@ -1,4 +1,4 @@ -SIP protocol
+SIP Protocol
------------
CAUTION: THIS IS A ALPHA STAGE PLUGIN. IT CAN DO VERY BAD THINGS. USE AT YOUR OWN RISK.
@@ -12,9 +12,11 @@ WARNING: You can create only one instance of the protocol. If you create the sec Known bugs:
- When you login, you will only show online the contacts that already are online (contacts that came online after that will stay offline)
+- Password is sent as plain text
Todo:
+- Add ssl
- More than one instance
- Protocol icons
- Use netlib to send/receive packages?
@@ -22,4 +24,4 @@ Todo: - Compile with VC6
-To report bugs/make suggestions, go to the forum thread: http://forums.miranda-im.org/showthread.php?p=
\ No newline at end of file +To report bugs/make suggestions, go to the forum thread: http://forums.miranda-im.org/showthread.php?t=23655
\ No newline at end of file diff --git a/Protocols/SIP/SIPProto.cpp b/Protocols/SIP/SIPProto.cpp index fb2559c..16ac82a 100644 --- a/Protocols/SIP/SIPProto.cpp +++ b/Protocols/SIP/SIPProto.cpp @@ -640,7 +640,7 @@ int SIPProto::Connect() pjsua_config cfg;
pjsua_config_default(&cfg);
- cfg.use_srtp = PJMEDIA_SRTP_OPTIONAL;
+ //cfg.use_srtp = PJMEDIA_SRTP_OPTIONAL;
cfg.cb.on_incoming_call = &static_on_incoming_call;
cfg.cb.on_call_media_state = &static_on_call_media_state;
cfg.cb.on_call_state = &static_on_call_state;
@@ -721,7 +721,7 @@ int SIPProto::Connect() pjsua_acc_config_default(&cfg);
cfg.user_data = this;
cfg.transport_id = transport_id;
- cfg.use_srtp = PJMEDIA_SRTP_OPTIONAL;
+ //cfg.use_srtp = PJMEDIA_SRTP_OPTIONAL;
BuildURI(tmp, MAX_REGS(tmp), opts.username, opts.domain);
TcharToSip id(tmp);
diff --git a/Protocols/SIP/build/rakefile b/Protocols/SIP/build/rakefile index 78a6c05..8028b57 100644 --- a/Protocols/SIP/build/rakefile +++ b/Protocols/SIP/build/rakefile @@ -2,6 +2,9 @@ require 'rake' require 'fileutils'
require 'rake/clean'
require 'google_code'
+require 'net/ftp'
+
+RakeFileUtils.verbose(false)
PROJECT="sip"
@@ -38,7 +41,8 @@ task :get_version do end
end
raise "Could not read version file" unless VERSION
- puts "Building version #{version} of #{PROJECT}"
+ puts
+ puts "Current #{PROJECT} version: #{version}"
end
@@ -57,6 +61,8 @@ PDB=[ "#{BUILD_RESULT_DIR[0]}/#{PROJECT}.pdb", "#{BUILD_RESULT_DIR[1]}/#{PROJECT desc "Build #{type} project"
task build do
+ puts
+ puts "Building #{type} #{PROJECT}"
chdir(SRC_DIR) do
sh "#{VC} #{SOLUTION} /Build \"#{CONFIG[i]}\"" do |ok, status|
ok or fail "Failed to compile #{type} dll (#{status.exitstatus})"
@@ -93,6 +99,11 @@ task :clean => :clean_package_src desc "Create source package"
task :package_src => :get_version do
+
+ zip = "#{SRC_ZIP}.#{version}.zip"
+ puts
+ puts "Packaging #{zip}"
+
rmtree SRC_ZIP_FOLDER
mkdir SRC_ZIP_FOLDER
@@ -100,7 +111,6 @@ task :package_src => :get_version do cp_relative(file, SRC_DIR, SRC_ZIP_FOLDER)
end
- zip = "#{SRC_ZIP}.#{version}.zip"
rm zip, :force => true
chdir(SRC_ZIP_FOLDER) do
sh "../zip -r -q ../#{zip} *"
@@ -119,6 +129,8 @@ CLOBBER.include("#{SRC_ZIP}.*.zip") ZIP_FOLDERS=['zip_ansi', 'zip_unicode']
ZIPS=[ "#{PROJECT}", "#{PROJECT}W" ]
+VOICE_SERVICE=[ "../../../bin/Release/Plugins/voiceservice.dll", "../../../bin/Release/Plugins/voiceserviceW.dll" ]
+
(0..1).each do |i|
type = TYPES[i]
@@ -132,7 +144,11 @@ ZIPS=[ "#{PROJECT}", "#{PROJECT}W" ] task :clean => clean
desc "Create #{type} package"
- task package => [ clean, :get_version, "build_#{type}".to_s ] do
+ task package => [ :get_version, "build_#{type}".to_s ] do
+ zip = "#{ZIPS[i]}.#{version}.zip"
+ puts
+ puts "Packaging #{zip}"
+
rmtree ZIP_FOLDERS[i]
mkdir ZIP_FOLDERS[i]
@@ -146,20 +162,24 @@ ZIPS=[ "#{PROJECT}", "#{PROJECT}W" ] target_dir = File.join(ZIP_FOLDERS[i], 'Plugins')
makedirs target_dir
cp DLL[i], target_dir
+ cp VOICE_SERVICE[i], target_dir
- zip = "#{ZIPS[i]}.#{version}.zip"
rm zip, :force => true
chdir(ZIP_FOLDERS[i]) do
sh "../zip -r -q ../#{zip} *"
end
rmtree ZIP_FOLDERS[i]
+ zip = "#{ZIPS[i]}.pdb.#{version}.zip"
+ puts
+ puts "Packaging #{zip}"
+
rmtree ZIP_FOLDERS[i] + '_pdb'
target_dir = ZIP_FOLDERS[i] + '_pdb/Plugins'
makedirs target_dir
cp PDB[i], target_dir
chdir(ZIP_FOLDERS[i] + '_pdb') do
- sh "../zip -r -q ../#{ZIPS[i]}.pdb.#{version}.zip *"
+ sh "../zip -r -q ../#{zip} *"
end
rmtree ZIP_FOLDERS[i] + '_pdb'
end
@@ -181,43 +201,138 @@ task :build # Upload #############################################################################
-desc "Rebuild and upload files"
-task :upload => [ :rebuild, :pack ]
+GC_NAME = "SIP"
+
+desc "Build and upload files"
+task :upload
def empty?(str)
return true unless str
- return str.strip.length > 0
+ return str.strip.length <= 0
+end
+
+def ask(name, val=nil)
+ if empty?(val)
+ puts
+ print "#{name}: "
+ return STDIN.gets.chomp
+ else
+ return val
+ end
end
desc "Upload to googlecode"
-task :upload_googlecode => [ :build, :pack ] do
+task :upload_googlecode => [ :package, :get_version ] do
+ files = [ "#{ZIPS[0]}.#{version}.zip", \
+ "#{ZIPS[0]}.pdb.#{version}.zip", \
+ "#{ZIPS[1]}.#{version}.zip", \
+ "#{ZIPS[1]}.pdb.#{version}.zip" \
+ ]
+ descriptions = [ "#{GC_NAME} #{version} - Ansi", \
+ "#{GC_NAME} PDB #{version} - Ansi", \
+ "#{GC_NAME} #{version} - Unicode", \
+ "#{GC_NAME} PDB #{version} - Unicode" \
+ ]
+ type = [ "Ansi", "Ansi", "Unicode", "Unicode" ]
+
+ files.each do |file|
+ raise "Google Code: File not found: #{file}" unless File.exists?(file)
+ end
+
project = nil
username = nil
password = nil
if File.exists?("googlecode.passwd")
File.open("googlecode.passwd", "r") do |file|
- project,username,password = file.gets.split(':')
+ line = file.gets
+ project,username,password = line.split(':')
end
end
- if empty?(project)
- puts "Project name: "
- project = gets.chomp
+ project = ask("Google Code Project", project)
+ username = ask("Google Code Username", username)
+ password = ask("Google Code Password", password)
+
+ raise "Google Code: Invalid data" if empty?(project) || empty?(username) || empty?(password)
+
+ gc = GoogleCode.new(project, username, password)
+
+ gc.current_files.each do |file|
+ if file.description.slice(0, GC_NAME.length + 1) == GC_NAME + ' '
+ file.labels.reject! { |label| label == GoogleCode::FEATURED }
+ file.labels << GoogleCode::DEPRECATED
+ gc.update(file)
+ end
end
- if empty?(username)
- puts "Username: "
- username = gets.chomp
+
+ puts
+ (0...files.length).each do |i|
+ puts "Google Code: uploading #{files[i]}"
+
+ file = GoogleCode::Download.new File.basename(files[i]) + file.description = descriptions[i]
+ file.labels << GoogleCode::FEATURED unless descriptions[i].match('PDB') + file.labels << 'Type-' + type[i] << 'Plugin-' + GC_NAME + file.local_file = files[i]
+ + gc.upload(file)
end
- if empty?(password)
- puts "Password: "
- password = gets.chomp
+
+end
+task :upload => :upload_googlecode
+
+
+desc "Upload to ftp"
+task :upload_ftp => [ :package, :get_version ] do
+ files = [ "#{ZIPS[0]}.#{version}.zip", \
+ "#{ZIPS[0]}.pdb.#{version}.zip", \
+ "#{ZIPS[1]}.#{version}.zip", \
+ "#{ZIPS[1]}.pdb.#{version}.zip", \
+ "#{SRC_ZIP}.#{version}.zip", \
+ "#{DOCS_DIR}/#{PROJECT}_changelog.txt", \
+ "#{DOCS_DIR}/#{PROJECT}_readme.txt", \
+ "#{DOCS_DIR}/#{PROJECT}_version.txt" \
+ ]
+
+ files.each do |file|
+ raise "FTP: File not found: #{file}" unless File.exists?(file)
end
- raise "Invalid googlecode data" if empty?(project) || empty?(username) || empty?(password)
+ server = nil
+ path = nil
+ username = nil
+ password = nil
- puts project + ' ' + username + ' ' + password
-
+ if File.exists?("ftp.passwd")
+ File.open("ftp.passwd", "r") do |file|
+ line = file.gets
+ server,path,username,password = line.split(':')
+ end
+ end
+
+ server = ask("FTP Server", server)
+ path = ask("FTP path", path)
+ username = ask("FTP Username", username)
+ password = ask("FTP Password", password)
+
+ raise "FTP: Invalid data" if empty?(server) || empty?(path) || empty?(username) || empty?(password)
+
+ puts
+ Net::FTP.open(server, username, password) do |ftp|
+ files.each do |file|
+ puts "FTP: Uploading #{File.basename(file)}"
+
+ remote = File.join(path, File.basename(file).gsub(/\.\d+\.\d+\.\d+\.\d+/, ''))
+
+ begin
+ ftp.delete remote
+ rescue
+ end
+
+ ftp.putbinaryfile(file, remote)
+ end
+ end
end
-task :upload => :upload_googlecode
\ No newline at end of file +task :upload => :upload_ftp
\ No newline at end of file |