summaryrefslogtreecommitdiff
path: root/pjsip-apps
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2012-03-30 07:10:13 +0000
committerBenny Prijono <bennylp@teluu.com>2012-03-30 07:10:13 +0000
commit6b4964727bffb379aca9601e1cf69051ccbf600c (patch)
tree1d9739ea8b3b5e0421f1d99b39e798b1514fb644 /pjsip-apps
parent85ac546acb235df62169c4ad317da74a62e56a88 (diff)
Re #1474: Merged all changes from 1.12 - HEAD (from the 1.x branch)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3999 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps')
-rwxr-xr-xpjsip-apps/src/ipjsystest/ipjsystest.xcodeproj/project.pbxproj11
-rw-r--r--pjsip-apps/src/pjsua/pjsua_app.c85
-rw-r--r--pjsip-apps/src/python/_pjsua.c2
-rw-r--r--pjsip-apps/src/python/setup.py6
-rw-r--r--pjsip-apps/src/symbian_ua/ua.cpp4
5 files changed, 73 insertions, 35 deletions
diff --git a/pjsip-apps/src/ipjsystest/ipjsystest.xcodeproj/project.pbxproj b/pjsip-apps/src/ipjsystest/ipjsystest.xcodeproj/project.pbxproj
index 7fb2ff1f..2709d610 100755
--- a/pjsip-apps/src/ipjsystest/ipjsystest.xcodeproj/project.pbxproj
+++ b/pjsip-apps/src/ipjsystest/ipjsystest.xcodeproj/project.pbxproj
@@ -31,6 +31,7 @@
3A3479871154EC4E00D51880 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A3479861154EC4E00D51880 /* AudioToolbox.framework */; };
3A34799A1154ECA300D51880 /* libgsmcodec-arm-apple-darwin9.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A3479991154ECA300D51880 /* libgsmcodec-arm-apple-darwin9.a */; };
3A34799C1154ECB100D51880 /* libresample-arm-apple-darwin9.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A34799B1154ECB100D51880 /* libresample-arm-apple-darwin9.a */; };
+ 3ABE0507147CA00B00A57A62 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3ABE0506147CA00B00A57A62 /* CFNetwork.framework */; };
3AC6435E1162192900B7A751 /* tock8.wav in Resources */ = {isa = PBXBuildFile; fileRef = 3AC6435D1162192900B7A751 /* tock8.wav */; };
3ADA4AB911572300008D95FE /* input.8.wav in Resources */ = {isa = PBXBuildFile; fileRef = 3ADA4AB811572300008D95FE /* input.8.wav */; };
3AE90E9B115F7A4F00FAEAA5 /* libg7221codec-arm-apple-darwin9.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3AE90E95115F7A4E00FAEAA5 /* libg7221codec-arm-apple-darwin9.a */; };
@@ -73,8 +74,9 @@
3A3479861154EC4E00D51880 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
3A3479991154ECA300D51880 /* libgsmcodec-arm-apple-darwin9.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libgsmcodec-arm-apple-darwin9.a"; path = "../../../third_party/lib/libgsmcodec-arm-apple-darwin9.a"; sourceTree = SOURCE_ROOT; };
3A34799B1154ECB100D51880 /* libresample-arm-apple-darwin9.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libresample-arm-apple-darwin9.a"; path = "../../../third_party/lib/libresample-arm-apple-darwin9.a"; sourceTree = SOURCE_ROOT; };
+ 3ABE0506147CA00B00A57A62 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
3AC6435D1162192900B7A751 /* tock8.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = tock8.wav; path = ../../../tests/pjsua/wavs/tock8.wav; sourceTree = SOURCE_ROOT; };
- 3ADA4AB811572300008D95FE /* input.8.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = input.8.wav; path = ../../../../../tests/pjsua/wavs/input.8.wav; sourceTree = BUILT_PRODUCTS_DIR; };
+ 3ADA4AB811572300008D95FE /* input.8.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = input.8.wav; path = "../../../../../../../../teluu/pjproject-new-iphone/tests/pjsua/wavs/input.8.wav"; sourceTree = BUILT_PRODUCTS_DIR; };
3AE90E95115F7A4E00FAEAA5 /* libg7221codec-arm-apple-darwin9.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libg7221codec-arm-apple-darwin9.a"; path = "../../../third_party/lib/libg7221codec-arm-apple-darwin9.a"; sourceTree = SOURCE_ROOT; };
3AE90E96115F7A4F00FAEAA5 /* libilbccodec-arm-apple-darwin9.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libilbccodec-arm-apple-darwin9.a"; path = "../../../third_party/lib/libilbccodec-arm-apple-darwin9.a"; sourceTree = SOURCE_ROOT; };
3AE90E97115F7A4F00FAEAA5 /* libmilenage-arm-apple-darwin9.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libmilenage-arm-apple-darwin9.a"; path = "../../../third_party/lib/libmilenage-arm-apple-darwin9.a"; sourceTree = SOURCE_ROOT; };
@@ -111,6 +113,7 @@
3AE90E9E115F7A4F00FAEAA5 /* libpjsdp-arm-apple-darwin9.a in Frameworks */,
3AE90E9F115F7A4F00FAEAA5 /* libspeex-arm-apple-darwin9.a in Frameworks */,
3AE90EA0115F7A4F00FAEAA5 /* libsrtp-arm-apple-darwin9.a in Frameworks */,
+ 3ABE0507147CA00B00A57A62 /* CFNetwork.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -177,6 +180,7 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 3ABE0506147CA00B00A57A62 /* CFNetwork.framework */,
3A3479861154EC4E00D51880 /* AudioToolbox.framework */,
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */,
1D30AB110D05D00D00671497 /* Foundation.framework */,
@@ -250,6 +254,7 @@
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ipjsystest" */;
compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
@@ -307,6 +312,7 @@
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = ipjsystest_Prefix.pch;
+ GCC_PREPROCESSOR_DEFINITIONS = "PJ_AUTOCONF=1";
INFOPLIST_FILE = "ipjsystest-Info.plist";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
@@ -318,6 +324,7 @@
"\"$(SRCROOT)/../../../third_party/lib\"",
);
PRODUCT_NAME = ipjsystest;
+ SDKROOT = iphoneos;
};
name = Debug;
};
@@ -328,6 +335,7 @@
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = ipjsystest_Prefix.pch;
+ GCC_PREPROCESSOR_DEFINITIONS = "PJ_AUTOCONF=1";
INFOPLIST_FILE = "ipjsystest-Info.plist";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
@@ -339,6 +347,7 @@
"\"$(SRCROOT)/../../../third_party/lib\"",
);
PRODUCT_NAME = ipjsystest;
+ SDKROOT = iphoneos;
};
name = Release;
};
diff --git a/pjsip-apps/src/pjsua/pjsua_app.c b/pjsip-apps/src/pjsua/pjsua_app.c
index fe0be4c1..ee2c64ed 100644
--- a/pjsip-apps/src/pjsua/pjsua_app.c
+++ b/pjsip-apps/src/pjsua/pjsua_app.c
@@ -269,6 +269,8 @@ static void usage(void)
puts (" May be specified multiple times");
puts (" --stun-srv=FORMAT Set STUN server host or domain. This option may be");
puts (" specified more than once. FORMAT is hostdom[:PORT]");
+
+#if defined(PJSIP_HAS_TLS_TRANSPORT) && (PJSIP_HAS_TLS_TRANSPORT != 0)
puts ("");
puts ("TLS Options:");
puts (" --use-tls Enable TLS transport (default=no)");
@@ -280,6 +282,9 @@ static void usage(void)
puts (" --tls-verify-client Verify client's certificate (default=no)");
puts (" --tls-neg-timeout Specify TLS negotiation timeout (default=no)");
puts (" --tls-srv-name Specify TLS server name for multihosting server");
+ puts (" --tls-cipher Specify prefered TLS cipher (optional).");
+ puts (" May be specified multiple times");
+#endif
puts ("");
puts ("Audio Options:");
@@ -560,7 +565,7 @@ static pj_status_t parse_args(int argc, char *argv[],
OPT_NOREFERSUB, OPT_ACCEPT_REDIRECT,
OPT_USE_TLS, OPT_TLS_CA_FILE, OPT_TLS_CERT_FILE, OPT_TLS_PRIV_FILE,
OPT_TLS_PASSWORD, OPT_TLS_VERIFY_SERVER, OPT_TLS_VERIFY_CLIENT,
- OPT_TLS_NEG_TIMEOUT, OPT_TLS_SRV_NAME,
+ OPT_TLS_NEG_TIMEOUT, OPT_TLS_CIPHER,
OPT_CAPTURE_DEV, OPT_PLAYBACK_DEV,
OPT_CAPTURE_LAT, OPT_PLAYBACK_LAT, OPT_NO_TONES, OPT_JB_MAX_SIZE,
OPT_STDOUT_REFRESH, OPT_STDOUT_REFRESH_TEXT, OPT_IPV6, OPT_QOS,
@@ -662,6 +667,7 @@ static pj_status_t parse_args(int argc, char *argv[],
{ "max-calls", 1, 0, OPT_MAX_CALLS},
{ "duration", 1, 0, OPT_DURATION},
{ "thread-cnt", 1, 0, OPT_THREAD_CNT},
+#if defined(PJSIP_HAS_TLS_TRANSPORT) && (PJSIP_HAS_TLS_TRANSPORT != 0)
{ "use-tls", 0, 0, OPT_USE_TLS},
{ "tls-ca-file",1, 0, OPT_TLS_CA_FILE},
{ "tls-cert-file",1,0, OPT_TLS_CERT_FILE},
@@ -670,7 +676,8 @@ static pj_status_t parse_args(int argc, char *argv[],
{ "tls-verify-server", 0, 0, OPT_TLS_VERIFY_SERVER},
{ "tls-verify-client", 0, 0, OPT_TLS_VERIFY_CLIENT},
{ "tls-neg-timeout", 1, 0, OPT_TLS_NEG_TIMEOUT},
- { "tls-srv-name", 1, 0, OPT_TLS_SRV_NAME},
+ { "tls-cipher", 1, 0, OPT_TLS_CIPHER},
+#endif
{ "capture-dev", 1, 0, OPT_CAPTURE_DEV},
{ "playback-dev", 1, 0, OPT_PLAYBACK_DEV},
{ "capture-lat", 1, 0, OPT_CAPTURE_LAT},
@@ -1345,28 +1352,17 @@ static pj_status_t parse_args(int argc, char *argv[],
}
break;
+#if defined(PJSIP_HAS_TLS_TRANSPORT) && (PJSIP_HAS_TLS_TRANSPORT != 0)
case OPT_USE_TLS:
cfg->use_tls = PJ_TRUE;
-#if !defined(PJSIP_HAS_TLS_TRANSPORT) || PJSIP_HAS_TLS_TRANSPORT==0
- PJ_LOG(1,(THIS_FILE, "Error: TLS support is not configured"));
- return -1;
-#endif
break;
case OPT_TLS_CA_FILE:
cfg->udp_cfg.tls_setting.ca_list_file = pj_str(pj_optarg);
-#if !defined(PJSIP_HAS_TLS_TRANSPORT) || PJSIP_HAS_TLS_TRANSPORT==0
- PJ_LOG(1,(THIS_FILE, "Error: TLS support is not configured"));
- return -1;
-#endif
break;
case OPT_TLS_CERT_FILE:
cfg->udp_cfg.tls_setting.cert_file = pj_str(pj_optarg);
-#if !defined(PJSIP_HAS_TLS_TRANSPORT) || PJSIP_HAS_TLS_TRANSPORT==0
- PJ_LOG(1,(THIS_FILE, "Error: TLS support is not configured"));
- return -1;
-#endif
break;
case OPT_TLS_PRIV_FILE:
@@ -1375,10 +1371,6 @@ static pj_status_t parse_args(int argc, char *argv[],
case OPT_TLS_PASSWORD:
cfg->udp_cfg.tls_setting.password = pj_str(pj_optarg);
-#if !defined(PJSIP_HAS_TLS_TRANSPORT) || PJSIP_HAS_TLS_TRANSPORT==0
- PJ_LOG(1,(THIS_FILE, "Error: TLS support is not configured"));
- return -1;
-#endif
break;
case OPT_TLS_VERIFY_SERVER:
@@ -1394,9 +1386,39 @@ static pj_status_t parse_args(int argc, char *argv[],
cfg->udp_cfg.tls_setting.timeout.sec = atoi(pj_optarg);
break;
- case OPT_TLS_SRV_NAME:
- cfg->udp_cfg.tls_setting.server_name = pj_str(pj_optarg);
- break;
+ case OPT_TLS_CIPHER:
+ {
+ pj_ssl_cipher cipher;
+
+ if (pj_ansi_strnicmp(pj_optarg, "0x", 2) == 0) {
+ pj_str_t cipher_st = pj_str(pj_optarg + 2);
+ cipher = pj_strtoul2(&cipher_st, NULL, 16);
+ } else {
+ cipher = atoi(pj_optarg);
+ }
+
+ if (pj_ssl_cipher_is_supported(cipher)) {
+ static pj_ssl_cipher tls_ciphers[128];
+
+ tls_ciphers[cfg->udp_cfg.tls_setting.ciphers_num++] = cipher;
+ cfg->udp_cfg.tls_setting.ciphers = tls_ciphers;
+ } else {
+ pj_ssl_cipher ciphers[128];
+ unsigned j, ciphers_cnt;
+
+ ciphers_cnt = PJ_ARRAY_SIZE(ciphers);
+ pj_ssl_cipher_get_availables(ciphers, &ciphers_cnt);
+
+ PJ_LOG(1,(THIS_FILE, "Cipher \"%s\" is not supported by "
+ "TLS/SSL backend.", pj_optarg));
+ printf("Available TLS/SSL ciphers (%d):\n", ciphers_cnt);
+ for (j=0; j<ciphers_cnt; ++j)
+ printf("- 0x%06X: %s\n", ciphers[j], pj_ssl_cipher_name(ciphers[j]));
+ return -1;
+ }
+ }
+ break;
+#endif /* PJSIP_HAS_TLS_TRANSPORT */
case OPT_CAPTURE_DEV:
cfg->vid.vcapture_dev = atoi(pj_optarg);
@@ -1834,6 +1856,7 @@ static int write_settings(const struct app_config *config,
pj_strcat2(&cfg, line);
}
+#if defined(PJSIP_HAS_TLS_TRANSPORT) && (PJSIP_HAS_TLS_TRANSPORT != 0)
/* TLS */
if (config->use_tls)
pj_strcat2(&cfg, "--use-tls\n");
@@ -1863,13 +1886,6 @@ static int write_settings(const struct app_config *config,
pj_strcat2(&cfg, line);
}
- if (config->udp_cfg.tls_setting.server_name.slen) {
- pj_ansi_sprintf(line, "--tls-srv-name %.*s\n",
- (int)config->udp_cfg.tls_setting.server_name.slen,
- config->udp_cfg.tls_setting.server_name.ptr);
- pj_strcat2(&cfg, line);
- }
-
if (config->udp_cfg.tls_setting.verify_server)
pj_strcat2(&cfg, "--tls-verify-server\n");
@@ -1882,6 +1898,14 @@ static int write_settings(const struct app_config *config,
pj_strcat2(&cfg, line);
}
+ for (i=0; i<config->udp_cfg.tls_setting.ciphers_num; ++i) {
+ pj_ansi_sprintf(line, "--tls-cipher 0x%06X # %s\n",
+ config->udp_cfg.tls_setting.ciphers[i],
+ pj_ssl_cipher_name(config->udp_cfg.tls_setting.ciphers[i]));
+ pj_strcat2(&cfg, line);
+ }
+#endif
+
pj_strcat2(&cfg, "\n#\n# Media settings:\n#\n");
/* Video & extra audio */
@@ -3211,6 +3235,11 @@ static void on_transport_state(pjsip_transport *tp,
const char *verif_msgs[32];
unsigned verif_msg_cnt;
+ /* Dump server TLS cipher */
+ PJ_LOG(4,(THIS_FILE, "TLS cipher used: 0x%06X/%s",
+ ssl_sock_info->cipher,
+ pj_ssl_cipher_name(ssl_sock_info->cipher) ));
+
/* Dump server TLS certificate */
pj_ssl_cert_info_dump(ssl_sock_info->remote_cert_info, " ",
buf, sizeof(buf));
diff --git a/pjsip-apps/src/python/_pjsua.c b/pjsip-apps/src/python/_pjsua.c
index 9267434c..bb5d91f1 100644
--- a/pjsip-apps/src/python/_pjsua.c
+++ b/pjsip-apps/src/python/_pjsua.c
@@ -2347,7 +2347,7 @@ static PyObject *py_pjsua_conf_get_port_info(PyObject *pSelf, PyObject *pArgs)
ret = (PyObj_pjsua_conf_port_info *)
conf_port_info_new(&PyTyp_pjsua_conf_port_info, NULL, NULL);
ret->bits_per_sample = info.bits_per_sample;
- ret->channel_count = info.bits_per_sample;
+ ret->channel_count = info.channel_count;
ret->clock_rate = info.clock_rate;
ret->name = PyString_FromPJ(&info.name);
ret->samples_per_frame = info.samples_per_frame;
diff --git a/pjsip-apps/src/python/setup.py b/pjsip-apps/src/python/setup.py
index 98b2d786..43e4ef7e 100644
--- a/pjsip-apps/src/python/setup.py
+++ b/pjsip-apps/src/python/setup.py
@@ -21,6 +21,7 @@
from distutils.core import setup, Extension
import os
import sys
+import platform
# find pjsip version
pj_version=""
@@ -58,9 +59,12 @@ for line in f:
f.close()
# Mac OS X depedencies
-if sys.platform == 'darwin':
+if platform.system() == 'Darwin':
extra_link_args = ["-framework", "CoreFoundation",
"-framework", "AudioToolbox"]
+ # OS X Lion support
+ if platform.mac_ver()[0].startswith("10.7"):
+ extra_link_args += ["-framework", "AudioUnit"]
else:
extra_link_args = []
diff --git a/pjsip-apps/src/symbian_ua/ua.cpp b/pjsip-apps/src/symbian_ua/ua.cpp
index 4543fad6..51e0c050 100644
--- a/pjsip-apps/src/symbian_ua/ua.cpp
+++ b/pjsip-apps/src/symbian_ua/ua.cpp
@@ -58,9 +58,6 @@
#define ENABLE_SIP_TCP 0 // experimental
#define ENABLE_SIP_TLS 0 // experimental
-#define TLS_SRV_NAME "pjsip.org" // TLS servername (required for
- // TLS transport)
-
//
// Configure nameserver if DNS SRV is to be used with both SIP
// or STUN (for STUN see other settings below)
@@ -490,7 +487,6 @@ static pj_status_t app_startup()
tcfg.qos_params.dscp_val = SIP_QOS_DSCP;
tcfg.tls_setting.qos_params = tcfg.qos_params;
}
- tcfg.tls_setting.server_name = pj_str(TLS_SRV_NAME);
status = pjsua_transport_create(PJSIP_TRANSPORT_TLS, &tcfg, &tid);
if (status != PJ_SUCCESS) {
pjsua_perror(THIS_FILE, "Error creating TLS transport", status);