| Crates.io | pjsipua-win |
| lib.rs | pjsipua-win |
| version | 0.1.26 |
| created_at | 2025-07-16 19:38:25.90134+00 |
| updated_at | 2025-07-17 23:14:35.530832+00 |
| description | Rust library PJSUA2 |
| homepage | |
| repository | https://github.com/ajukes/pjsua2-win |
| max_upload_size | |
| id | 1756481 |
| size | 1,151,080 |
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.
/MD (dynamic runtime)PJSIP_ROOT set to your PJSIP installation (default: C:\pjsip)Create a new directory for the project:
mkdir pjsua2-test
cd pjsua2-test
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:
/MD flag%PJSIP_ROOT%/pjproject/lib/# Build the library
cargo build --release
# Run tests
cargo test
# Run tests with output
cargo test -- --nocapture
# Run ignored tests (includes account creation)
cargo test -- --ignored --nocapture
# Run example
cargo run --example basic_usage
use pjsua2_test::*;
// Initialize PJSUA2
let endpoint = Pjsua2Endpoint::init(4)?;
// Create an account
let config = AccountConfig::new("username", "domain.com", "password");
let account_id = endpoint.create_account(&config)?;
println!("Account created with ID: {}", account_id);
The library includes several test levels:
Basic tests - Always run:
cargo test
Integration tests - Run serially:
cargo test --test integration_tests
Account creation tests - Marked as ignored, run explicitly:
cargo test -- --ignored
If account creation fails:
Check the build output:
cargo build --release -vv
Run diagnostics:
let results = pjsua2_test::run_diagnostics();
println!("{:?}", results);
Check PJSIP build:
/MD (not /MT)Enable verbose logging:
let endpoint = Pjsua2Endpoint::init(5)?; // Max log level
This usually indicates:
/MD vs /MT)Ensure Visual C++ redistributables are installed.
Try the simple account creation function first:
// Uses pjsua2_create_account_simple internally
let account_id = endpoint.create_account(&config)?;
MIT