如何为Xcode构建和编译PJSIP,使用示例代码IPJSUA进行测试? [英] How To Build and Compile PJSIP for Xcode, Using sample code IPJSUA to test?

查看:200
本文介绍了如何为Xcode构建和编译PJSIP,使用示例代码IPJSUA进行测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用xCode构建和编译PJSIP并运行示例代码IPJSUA?

How to build and compile PJSIP using xCode and run the sample code IPJSUA?

推荐答案

首先,您需要打开终奌站。终端可以在Applications-> Utilities->终端找到。
打开终端后,请确保指向桌面以便更容易获取数据文件夹。只需输入:

First, you need to open the terminal. Terminal can be found at Applications->Utilities->terminal. After you open the terminal, make sure you point to the desktop to make it easier to get the data folder. just type :


cd Desktop

cd Desktop

恭喜,您已经在桌面上了。现在继续输入这个。

Congrats, you already at your desktop. Now continue to type this.


svn co <​​a href=\"http://svn.pjsip.org/repos/pjproject/trunk\"> http:// svn.pjsip.org/repos/pjproject/trunk pjproject

svn co http://svn.pjsip.org/repos/pjproject/trunk pjproject

该代码表示​​您从网站下载pjproject你的桌面。下载完PJSIP后,需要添加config_site.h。老实说,我不应该做什么,而只是遵循它。 :D

That code means you download the pjproject from the website to your desktop. After you finish download the PJSIP, you need to add a config_site.h. Honestly, I don't what should we do that, but just follow it. :D

如何创建config_site.h?只需复制config_site_sample.h,粘贴,然后更改内容就像这样。

How to create a config_site.h? Just copy the config_site_sample.h, paste, and change the content become like this.

在此之后,我们需要更改configure-iphone。我想到了。如果您只想在模拟器上运行,则需要更改DevPath。如果你想在设备上进行测试,那就留下吧。

After this, we need to change the configure-iphone. I figured it out. If you just want to run at simulator you need to change the DevPath. If you want to test on device, just leave it be.

现在,我将举例说明在模拟器上运行。打开pjproject,你会发现configure-iphone。使用textfield打开文件。并更改DEVPATH并硬编码IPHONESDK。

Now, I will give example to run at simulator. Ppen the pjproject, you will find the configure-iphone. Ppen the file using textfield. and change the DEVPATH and hardcode the IPHONESDK.

devpath将如下所示。

The devpath will looks like this.


DEVPATH = / Applications / Xcode.app / Contents / Developer / Platforms / iPhoneSimulator.platform / Developer

DEVPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer

请记住,此引用你的Xcode。如果您想确定,请转到finder-> applications-> xcode-> show package contents。我还硬编码了IPHONESDK。

Remember, this refer to your Xcode. If you want to make sure, go to finder->applications->xcode->show package contents. I also hardcoded the IPHONESDK.


IPHONESDK = iPhoneSimulator5.1.sdk

IPHONESDK=iPhoneSimulator5.1.sdk

完成后,我们将返回终端。确保您已经在pjproject文件夹中。输入此内容。

After you're done with that, we will going back to the terminal. Make sure you already at the pjproject folder. Type this.


export CC = / Applications / Xcode.app / Contents / Developer / Platforms / iPhoneSimulator.platform / Developer / usr / bin / gcc

export CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc

export CFLAGS = - O2 -m32 -miphoneos-version-min = 5.0 -g -ggdb -g3 -DNDEBUG

export CFLAGS="-O2 -m32 -miphoneos-version-min=5.0 -g -ggdb -g3 -DNDEBUG"

export LDFLAGS = - O2 -m32

export LDFLAGS="-O2 -m32"

之后,您可以对其进行配置。只需在终端上单击此按钮。如果你想在你的设备上进行测试,你不需要更改configure-iphone,导出CC等,只需直接配置-phone。

After that, you can configure it. Just click this on terminal. If you want to test on your device, you don't need to change the configure-iphone, export CC, etc., just directly configure-iphone.


./ configure-iphone

./configure-iphone

完成后,继续使用此代码。

After you're done, continue with this code.


make dep&&使干净&& make

make dep && make clean && make

您会发现所有库都已编译。如果我们想要创建一个新项目,这个库可以帮助我们。 - >这就是我现在的想法。
你差不多完成了,只需要去pjsip-apps-> src-> ipjsua。您将找到Xcode项目,只需单击它即可在您的xcode上打开。单击构建并运行。你会发现这样的界面。

You will find that all the library already compile. This library can help us if we want to create a new project. -> this is what I'm thinking right now. And you almost finish, just go to the pjsip-apps->src->ipjsua. You will find the Xcode project, just click it to open at your xcode. Click build and run. You will find the interface like this.

如果要在设备上进行测试,则必须拥有证书和私钥链。我无法解释,因为我从公司获得了证书。他们提供它。

If you want to test on your device, you must have the certificate and private key chain. I can't explain that because I got that certificate from my company. They provide it.

如果您想尝试,您必须先创建一个SIP帐户。你可以使用sip2sip或ekiga。在这里,我尝试了ekiga。例如,我的SIP是12345678@ekiga.net和87654321@ekiga.net。

If you want to try, you must create a SIP account first. You can use sip2sip or ekiga. At here I tried ekiga. for example my SIP is 12345678@ekiga.net and 87654321@ekiga.net.

在模拟器之后我们输入+ a来添加新帐户。
接下来,您必须输入您的SIP名称。记得键入sip:。永远不要忘记。这是一个例子:sip:12345678@ekiga.net。

After the simulator we key in +a to add new account. Next you will have to type your SIP name. remember to type "sip:". dont ever forget. here is the example:sip:12345678@ekiga.net.

之后你必须输入URL地址,只需输入ekiga.net,因为那是我们的URL。此URL表示我们的服务器。例如,sip:ekiga.net。

After that you will have to type the URL address, just type ekiga.net since that is our URL. This URL means our server. Tor example, sip:ekiga.net.

接下来是auth领域。输入与URL地址相同的内容,sip:ekiga.net。
接下来是您的用户名。在这里,我的用户名是12345678.您不需要使用@ ekiga.net添加sip或类型。
最后是您的密码。注册后,它会自动添加到帐户。只需转到文本字段,然后按Enter键。它会为你刷新。

Next is the auth realm. Type the same as the URL address, sip:ekiga.net. Next is your username. In here my username is 12345678. You don't need to add sip or type with @ekiga.net. Last is your password. After you register, it will add automatically to the account. Just go to the textfield, and hit enter. It will refresh for you.

接下来,我们需要添加好友。键入 + b ,您必须输入URI地址。键入 sip:87654321@ekiga.net ,您就完成了。返回文本字段,它会自动添加到您的好友列表中。

Next, we need to add buddy. Type +b, and you must input the URI address. Type sip:87654321@ekiga.net and you are done. Back to the textfield, it will add automatically to your buddy list.

您会看到,您的帐户仍处于离线状态。您需要在拨打电话之前更改为在线模式。只需按类型t更改状态,然后按Enter键。

You will see, your account still in offline mode. You need to change into online mode before you make a call. Just change the status by type t, and hit enter.

之后,您可以通过类型M拨打电话并输入1.因为我们的好友不是1. 1是他们的ID。你可以打个电话。

After that you can make a call by type M. and type 1. because our buddy is no 1. 1 is their ID. and you can make a call.

这篇关于如何为Xcode构建和编译PJSIP,使用示例代码IPJSUA进行测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆