docs.rs failed to build pjsipua-win-0.1.3
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
PJSUA2 Test Library
A Rust library for testing PJSUA2 account creation functionality. This library provides a minimal wrapper around PJSUA2 to help diagnose and test account creation issues.
Prerequisites
- Windows with Visual Studio 2019 or 2022
- PJSIP/PJSUA2 built with
/MD(dynamic runtime) - Environment variable
PJSIP_ROOTset to your PJSIP installation (default:C:\pjsip)
Setup Instructions
-
Create a new directory for the project:
-
Create the project structure:
pjsua2-test/ ├── Cargo.toml ├── build.rs ├── README.md ├── src/ │ ├── lib.rs │ ├── ffi.rs │ ├── pjsua2_wrapper.cpp │ └── pjsua2_wrapper.h ├── tests/ │ └── integration_tests.rs └── examples/ └── basic_usage.rs -
Copy all the artifact files to their respective locations
-
Ensure PJSIP is properly installed:
- PJSIP should be built with
/MDflag - Libraries should be in
%PJSIP_ROOT%/pjproject/lib/
- PJSIP should be built with
Building the Library
# Build the library
# Run tests
# Run tests with output
# Run ignored tests (includes account creation)
# Run example
Usage
use *;
// Initialize PJSUA2
let endpoint = init?;
// Create an account
let config = new;
let account_id = endpoint.create_account?;
println!;
Running Tests
The library includes several test levels:
-
Basic tests - Always run:
-
Integration tests - Run serially:
-
Account creation tests - Marked as ignored, run explicitly:
Debugging
If account creation fails:
-
Check the build output:
-
Run diagnostics:
let results = run_diagnostics; println!; -
Check PJSIP build:
- Ensure PJSIP was built with
/MD(not/MT) - Verify all dependencies are present
- Ensure PJSIP was built with
-
Enable verbose logging:
let endpoint = init?; // Max log level
Troubleshooting
Access Violation (0xC0000005)
This usually indicates:
- Runtime library mismatch (check
/MDvs/MT) - ABI incompatibility
- Corrupted virtual function table
Missing DLLs
Ensure Visual C++ redistributables are installed.
Account Creation Fails
Try the simple account creation function first:
// Uses pjsua2_create_account_simple internally
let account_id = endpoint.create_account?;
License
MIT