- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在开发一个iOS应用程序,其功能是使用PJSUA调用电话。同时,我的同事正在使用 PJSUA 2 为 Android 制作相同的应用程序。当我们从 Android 到 iOS 或从 Android 到 Android 进行调用时,一切正常。但是当我们尝试从 iOS 调用 Android 或从 iOS 调用 iOS 时,我们会收到错误:
18:51:46.959 pjsua_media.c .....Call 0: updating media..
18:51:46.959 pjsua_media.c .......Media stream call00:0 is destroyed
18:51:46.959 pjsua_media.c ......pjmedia_transport_media_start() failed for call_id 0 media 0: SRTP crypto-suite name not match the offerer tag (PJMEDIA_SRTP_ECRYPTONOTMATCH)
18:51:46.959 pjsua_media.c .......Media stream call00:0 is destroyed
18:51:46.960 pjsua_media.c ......Error updating media call00:0: SRTP crypto-suite name not match the offerer tag (PJMEDIA_SRTP_ECRYPTONOTMATCH)
18:51:46.960 pjsua_core.c .....TX 362 bytes Request msg ACK/cseq=19029 (tdta0x1200c1600) to TLS 95.213.169.231:1605:
ACK sip:s2@95.213.169.231:1605;transport=tls SIP/2.0
这是我的类(class),它正在使用 PJSUA:
#import <Foundation/Foundation.h>
#import "SIPConnection.h"
#import <pjlib.h>
#import <pjsua.h>
#import <pj/log.h>
#import <pjmedia-codec.h>
#import <pjmedia.h>
@interface SIPConnection ()
@end
@implementation SIPConnection
pjsua_acc_id acc_id = -1;
pjsua_call_id current_call_id = -1;
bool registration_status_is_ok = false;
bool is_making_call = false;
-(void) registerAccount {
registerAccount();
}
-(void) makeCall {
is_making_call = true;
registerAccount();
}
void registerAccount() {
pjsua_create();
pjsua_config ua_cfg;
pjsua_logging_config log_cfg;
pjsua_media_config media_cfg;
char* user_agent_string = "XChat";
pj_str_t user_agent = pj_str(user_agent_string);
ua_cfg.user_agent = user_agent;
pjsua_config_default(&ua_cfg);
pjsua_logging_config_default(&log_cfg);
pjsua_media_config_default(&media_cfg);
ua_cfg.cb.on_reg_state = &sip_reg_state_changed;
ua_cfg.cb.on_call_state = &sip_call_state_changed;
ua_cfg.cb.on_call_media_state = &sip_call_media_state_changed;
ua_cfg.cb.on_incoming_call = &sip_incoming_call;
media_cfg.ec_options = 3;
media_cfg.ec_tail_len = 1000;
pjsua_init(&ua_cfg, &log_cfg, &media_cfg);
pjsua_transport_config transport_cfg;
pjsua_transport_config_default(&transport_cfg);
transport_cfg.port = 1605;
pjsua_transport_id trasport_id;
pjsua_transport_create(PJSIP_TRANSPORT_TLS, &transport_cfg, &trasport_id);
pjsua_acc_config acc_cfg;
pjsua_acc_config_default(&acc_cfg);
acc_cfg.register_on_acc_add = YES;
acc_cfg.priority = 100;
acc_cfg.reg_retry_interval = 3;
acc_cfg.reg_retry_random_interval = 3;
acc_cfg.publish_enabled = NO;
acc_cfg.unreg_timeout = 1500;
acc_cfg.reg_first_retry_interval = 5;
acc_cfg.reg_delay_before_refresh = 0;
char* reg_uri_string = "sip:95.213.169.231:1605;transport=TLS";
char* acc_uri_string = "sip:s2@95.213.169.231:1605";
pj_str_t reg_uri = pj_str(reg_uri_string);
pj_str_t acc_uri = pj_str(acc_uri_string);
acc_cfg.reg_uri = reg_uri;
acc_cfg.cred_info[0].scheme=pj_str("digest");
acc_cfg.cred_info[0].data_type=0;
acc_cfg.cred_info[0].username=pj_str("s2");
acc_cfg.cred_info[0].realm=pj_str("*");
acc_cfg.cred_info[0].data=pj_str("LHillKkF4Aflc3rR");
acc_cfg.cred_count = 1;
acc_cfg.use_srtp = PJMEDIA_SRTP_MANDATORY;
acc_cfg.srtp_secure_signaling = 1;
acc_cfg.allow_sdp_nat_rewrite = 1;
acc_cfg.allow_contact_rewrite = 1;
acc_cfg.id = acc_uri;
pjsua_acc_add(&acc_cfg, YES, &acc_id);
pjsua_start();
}
static void sip_reg_state_changed(pjsua_acc_id acc_id) {
pjsua_acc_info acc_info;
pj_status_t status = pjsua_acc_get_info(acc_id, &acc_info);
if (status != PJ_SUCCESS) {
NSLog(@"Couldn't get account status");
registration_status_is_ok = false;
return;
}
if (acc_info.status == 200) {
NSLog(@"Account is registered!");
registration_status_is_ok = true;
make_call();
}
}
static void sip_call_state_changed(pjsua_call_id call_id, pjsip_event* event) {
}
static void sip_call_media_state_changed(pjsua_call_id call_id) {
pjsua_call_info call_info;
unsigned mi;
pj_bool_t has_error = PJ_FALSE;
pjsua_call_get_info(call_id, &call_info);
current_call_id = call_id;
mi=0;
//for (mi=0; mi<call_info.media_cnt; ++mi) {
on_call_generic_media_state(&call_info, mi, &has_error);
switch (call_info.media[mi].type) {
case PJMEDIA_TYPE_AUDIO:
on_call_audio_state(&call_info, mi, &has_error);
break;
}
//}
}
static void on_call_audio_state(pjsua_call_info *ci, unsigned mi, pj_bool_t *has_error)
{
PJ_UNUSED_ARG(has_error);
/* Stop ringback */
//ring_stop(ci->id);
/* Connect ports appropriately when media status is ACTIVE or REMOTE HOLD,
457 * otherwise we should NOT connect the ports.
458 */
if (ci->media[mi].status == PJSUA_CALL_MEDIA_ACTIVE || ci->media[mi].status == PJSUA_CALL_MEDIA_REMOTE_HOLD)
{
pj_bool_t connect_sound = PJ_TRUE;
pj_bool_t disconnect_mic = PJ_FALSE;
pjsua_conf_port_id call_conf_slot;
call_conf_slot = ci->media[mi].stream.aud.conf_slot;
if (connect_sound) {
pj_status_t res = pjsua_conf_connect(call_conf_slot, 0);
if (!disconnect_mic)
{
res = pjsua_conf_connect(0, call_conf_slot);
}
}
}
}
static void on_call_generic_media_state(pjsua_call_info *ci, unsigned mi, pj_bool_t *has_error)
{
const char *status_name[] = {
"None",
"Active",
"Local hold",
"Remote hold",
"Error"
};
PJ_UNUSED_ARG(has_error);
pj_assert(ci->media[mi].status <= PJ_ARRAY_SIZE(status_name));
pj_assert(PJSUA_CALL_MEDIA_ERROR == 4);
}
static void sip_incoming_call(pjsua_acc_id acc_id, pjsua_call_id call_id, pjsip_rx_data *rdata)
{
pjsua_call_info call_info;
pjsua_call_get_info(call_id, &call_info);
pjsua_call_answer(call_id, 200, NULL, NULL);
}
static void make_call()
{
if ((registration_status_is_ok) && (is_making_call))
{
pjsua_call_setting call_stg;
pjsua_call_setting_default(&call_stg);
call_stg.aud_cnt = 1;
call_stg.vid_cnt = 0;
// pjsua_call_id call_id;
pj_str_t dst_uri = pj_str("sip:s3@95.213.169.231:1605;transport=TLS");
pjsua_call_make_call(acc_id, &dst_uri, &call_stg, NULL, NULL, NULL);
}
}
static void end_call()
{
/*if (current_call_id != -1)
{
pjsua_call_dump(current_call_id, YES, NULL, 8, NULL);
}*/
if (acc_id != -1)
{
pjsua_acc_del(acc_id);
}
pjsua_destroy();
}
- (void)endCall
{
end_call();
}
@end
有人可以帮忙吗?我实在是没主意了。
最佳答案
似乎您在调用电话时还需要发送 callID,
pjsua_call_id call_id;
pj_str_t dst_uri = pj_str("sip:s3@95.213.169.231:1605;transport=TLS");
pjsua_call_make_call(acc_id, &dst_uri, &call_stg, NULL, NULL, &call_id);
关于c - PJSip 拨出电话不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46533727/
我们正在为一些还没有任何音频设备的嵌入式硬件开发应用程序。目前,我们只是在评估 PJSIP 是否在硬件上运行良好,是否可以通过网络发送音频数据。 为此,我们有一个客户端需要从文件中读取音频数据,通过
pjsua 在 openwrt 中运行,我们使用 USB SoundCard。 接电话的时候总是很卡,抓拍和回放都不好用! 提示:我们已经使用auddemo测试了我的声卡,录音/播放都很好,捕获id为
任何人都可以指导我一个 API,我可以告诉 pjsip 使用我自己的 本地端口 (UDP) 用于媒体? 在SDP谈判的时候,我读到可以了解一下 通过调用 pjmedia_sdp_neg_get_act
我正在使用 PJSIP 开发适用于 Android、iOS 等的软电话拨号器应用程序。我需要知道如何将 G.729 编解码器与项目集成。我在 PJSIP 网站本身中看到了有关使用 Intel IPP
我正在使用 Pjsip 库实现SIP 视频通话。 我的 View 已成功传输给其他人,但我想要的是在我的屏幕上显示我的相机 View (类似于 WhatsApp)。 我发现Pjsip 正在使用摄像头
我正在开发一个iOS应用程序,其功能是使用PJSUA调用电话。同时,我的同事正在使用 PJSUA 2 为 Android 制作相同的应用程序。当我们从 Android 到 iOS 或从 Android
我正在做一个项目,以使 iOS 应用程序像 Viber/Skype 一样工作使用 VoIP 协议(protocol)。为此,我使用 pjsip SDK但我得到一些错误:( 文件未找到, 未知类型名称等
我发现有两个本地帐户,ID 为 0(IPv4 地址)和 ID 为 1(IPv6 地址)。因此,当我注册时,该用户帐户使用 id 2 注册。我想知道这些本地帐户的目的是什么。在我注册之前,用户 id 1
我正在尝试为 eclipse 使用 pjsip-jni wrapper 来制作基于 Android sip 的客户端。 我一直在努力研究如何在 eclipse 中编译和使用它,但还没有找到正确的轨道。
我想开发一个简单的 VoIP 系统。我想用同一个 sip 库实现客户端和服务器(代理服务器、注册服务器……)。 PJSIP 可以实现服务器吗? 我在客户端使用 PJSIP,没问题。 PJSIP 适合实
我已经构建了视频支持库,它显示找到了 2 个编解码器 h263 和 h264。 但是当我运行 ipjsua 视频流时没有发生,我尝试启用视频,启用 autorx 和 autotx 但没有积极的结果。
我正在使用 PjSIP 进行 SIP 调用。我已经按照说明集成了 PjSIP 项目 https://code.google.com/p/siphon/wiki/Compilation & How To
我正在使用 PJSUA/PJSIP 在 Ubuntu 16.04 上编写应用程序。 我需要检测调用何时挂断。是否有一个排序 call_state() 函数? 谢谢! 最佳答案 找到解决方案 here和
我想在通过 rtp 发送之前用 pjsip 库中的 Bouncy CaSTLe 加密数据。谁用过 pjsip,请帮助我,我对 C 不友好,所以我应该在哪里做。在对 pjsip lib 文件进行一些研究
最近我必须使用 voip 实现后台工作应用程序。为此,我使用 PJSip。现在我已经完成了在应用程序运行时完美运行的注册和处理调用。 当应用进入后台时,前 10 分钟工作正常 -> 新的来电被捕获并作
我正在尝试将 PJSip 添加到我正在处理的项目中。我有这种方法来注册我的帐户,但每次都会出现“致命信号 11”错误。 这是方法 public int setRegistration() {
环境:OS X 10.9.3、Xcode 5.1、PJSIP-2.2.1我想构建简单的 PJSIP,shell 脚本如下: #!/bin/bash SOURCE="pjproject-2.2.1" C
所以我有一个已编译并正在运行的 Siphon 应用程序,但它就是无法进行调用。我得到: 注册错误 - 默认错误消息。 完整的错误是这样的: 15:04:02.032 pjsua_call.c 使用 a
对于 iOS 应用程序,我需要知道当远程方停止其现有调用的视频时。是否有任何由 pjsip 库触发的 API 或事件? 在此先感谢您的帮助。 最佳答案 pjsua_call_vid_stream_is
我正在尝试从 call 音频媒体中获取音频流,以便将其发送到语音转文本引擎(从流输入中转录音频)。关于如何实现这一点的任何想法? 版本信息:POSIX的pjlib 2.8-svn 先感谢您。 最佳答案
我是一名优秀的程序员,十分优秀!