小编S. *_*lam的帖子

不使用mjsip发送或接收RTP数据包

我正在使用mjsip sip堆栈进行软件电话项目.Mjsip仅支持g711或PCMA/PCMU编解码器.我已将G729添加到我的项目中.当我构建项目时,它没有显示错误.但是当手机连接时,呼叫建立,没有语音传输,实际上我的应用程序不生成任何rtp数据包.并在日志中显示错误

java.lang.NullPointerException
RtpStreamReceiver - run -> Terminated.
    at local.media.RtpStreamReceiver.run(RtpStreamReceiver.java:171)
Run Code Online (Sandbox Code Playgroud)

我没找到错误.

这是我的RtpStreamReceiver.java类.

package local.media;

import local.net.RtpPacket;
import local.net.RtpSocket;
import java.io.*;
import java.net.DatagramSocket;
import org.flamma.codec.SIPCodec;

/** RtpStreamReceiver is a generic stream receiver.
  * It receives packets from RTP and writes them into an OutputStream.
  */

public class RtpStreamReceiver extends Thread {

    public static int RTP_HEADER_SIZE = 12;
    private long start = System.currentTimeMillis();
    public static final int SO_TIMEOUT = 200;   // Maximum blocking time, spent waiting for reading new bytes [milliseconds]
    private …
Run Code Online (Sandbox Code Playgroud)

java sip rtp nullpointerexception mjsip

20
推荐指数
1
解决办法
1799
查看次数

为什么JMF没有使用Mjsip进行音频流传输?

我正在使用Mjsip来创建一个软电话.在代码中有三种类型的音频分层选项.

  1. 使用JMF(Java Media Framework)
  2. 使用Java音频
  3. 使用RAT(强大的音频工具)

我没有使用RAT.它的价值被我自己弄错了.这是调用JMF的代码:

public JMFAudioLauncher(int local_port, String remote_addr, int remote_port, int direction, Log logger)
{  
    log=logger;
    localport=local_port;
    remoteport=remote_port;
    remoteaddr=remote_addr;
    // Patch for working with JMF with local streams
    if (remote_addr.startsWith("127."))
    {  
        printLog("Patch for JMF: replaced local destination address "+remote_addr+" with 255.255.255.255");
        remote_addr="255.255.255.255";
    }
    dir=direction;
    if (dir>=0) sender=new JMediaSender("audio",null,remote_addr,remote_port);
    if (dir<=0) receiver=new JMediaReceiver("audio",local_port,null);
}

/** Starts media application */
public boolean startMedia()
{  
    printLog("launching JMF-Audio...");
    String err1=null, err2=null;

    if (sender!=null) err1=sender.start();
    if (err1!=null) printLog("Error trying to send …
Run Code Online (Sandbox Code Playgroud)

java jmf rtp audio-streaming

18
推荐指数
1
解决办法
1051
查看次数

ClickOnce部署"激活失败"FileNotFoundException

我刚刚为clickonce应用程序部署了一个更新.我已经部署了几十个更新,没有任何问题.现在突然间,通过此更新,我的所有用户都报告此错误:

错误摘要

Below is a summary of the errors, details of these errors are listed later in the log.
    * Activation of C:\Users\XXX\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\XXX\XXX\XXX.appref-ms| resulted in exception. Following failure messages were detected:
        + Activation failed.
        + The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
Run Code Online (Sandbox Code Playgroud)

在此操作期间检测到以下错误.

* [3/15/2012 3:22:34 PM] System.Deployment.Application.DeploymentException (Activation)
        - Activation failed.
        - Source: System.Deployment
        - Stack trace:
            at System.Deployment.Application.ComponentStore.ActivateApplication(DefinitionAppId appId, String activationParameter, Boolean useActivationParameter)
            at System.Deployment.Application.SubscriptionStore.ActivateApplication(DefinitionAppId appId, String activationParameter, Boolean useActivationParameter)
            at System.Deployment.Application.ApplicationActivator.Activate(DefinitionAppId appId, …
Run Code Online (Sandbox Code Playgroud)

c# deployment clickonce filenotfoundexception

11
推荐指数
1
解决办法
1万
查看次数

为自定义格式的highcharts工具提示添加千位分隔符

我在我的应用程序中使用highcharts,并希望添加千位分隔符的工具提示,就像我在数据标签中所做的那样.我使用工具提示的自定义格式,所以我应该改变什么来实现这一点

highcharts中的工具提示选项

tooltip: {
                formatter: function () {
                    return (this.x + ':' + this.y);
                },
                shared: true,
                useHTML: true
            },
Run Code Online (Sandbox Code Playgroud)

JS FIDDLE

highcharts

6
推荐指数
2
解决办法
6978
查看次数

有条件的MYSQL where子句

我有一个查询,如果一个名为OrderBy的标志是1,那么它是一个日历事件,我需要检查两个日期时间字段之间的范围.而所有其他类型我们只是检查你正在查看的那一天.我研究if语句并看到很多帖子,其中建议使用一个案例,所以我试着将它实现到我的查询中.我的查询需要在哪里的条件.我知道我有语法问题,这就是为什么我在这里希望有人可以指出正确的方法来做到这一点.

感谢您的时间

我的查询目前

SELECT          activities.*, 
                activitytypes.orderby 
FROM            activities 
LEFT OUTER JOIN activitytypes 
ON              activities.typeid = activitytypes.typeid 
WHERE           activities.userid = 86 
AND             activities.typeid NOT IN ( 5, 
                                          10, 
                                          11, 
                                          12, 
                                          19 ) 
AND 
                CASE 
                                WHEN activities.orderby = 1 THEN activities.starttime >= '2013-08-26 04:00:00' 
                                AND             activities.endtime <= '2013-08-27 04:00:00' 
                                ELSE activities.activitydate = '2013-08-26' 
                                order BY        activitytypes.orderby, 
                                                activities.starttime
Run Code Online (Sandbox Code Playgroud)

mysql conditional case where

5
推荐指数
1
解决办法
2万
查看次数

使用jquery下载文件自定义名称

我使用jQuery 插件将HTML表导出到Excel.使用chrome的下载文件名总是download.xls使用mozilla firefox random-string.xls.我希望根据日期创建文件名.例如23-06-2014.xls.

下面是视图文件中的自定义JS块

$(document).ready(function () {
    $("#btnExport").click(function () {
        $("#account_table").btechco_excelexport({
            containerid: "account_table", 
            datatype: $datatype.Table
        });
    });
});
Run Code Online (Sandbox Code Playgroud)

jquery

4
推荐指数
2
解决办法
2万
查看次数

3
推荐指数
1
解决办法
883
查看次数

jquery Ajax调用Codeigniter控制器

在我的View页面中,jquery Ajax就是这样调用的

onclick: function() {
                        $.ajax({
                            type:'POST',
                            url:"<?PHP echo base_url('trand/report/checking'); ?>",
                            data: {nm:'vnky'},
                            success: function(){
                                  alert("success");
                              },
                              error: function(){
                                alert("error");
                              }
                        });
                        chart2.exportChart({
                            type: 'image/png', 
                            filename: dynmicfilename
                        });

                    }
Run Code Online (Sandbox Code Playgroud)

exportchart函数工作正常.内部ajax调用也工作警报很好,但url没有执行,通过使用firebug单击新选项卡中的URL,然后它工作正常.

如何在ajax调用中执行url.你可以帮忙吗?

ajax jquery controller codeigniter

3
推荐指数
1
解决办法
3万
查看次数

调用未定义的方法 Illuminate\Database\Eloquent\Collection::with()

我的路线代码

 return View::make('test')->with('foo', foo::all()->with('foos', 'bars'));
Run Code Online (Sandbox Code Playgroud)

为什么这是抛出这个异常?

laravel eloquent laravel-4

3
推荐指数
1
解决办法
6388
查看次数

在codeigniter中将值从单个表单传递给多个表

我有两个表usertreeview.从我的注册表中我想将数据传递给这些表.比如我想通过usernameuser表和sponsor IDtreeview表.对于单个表我使用以下约定.

public function add_user()
{
    $data=array(
        'user_name'=>$this->input->post('fullname'),
        'sponsor_id'=>$this->input->post('sponsor_id'),
    );
    $this->db->insert('user',$data);
}
Run Code Online (Sandbox Code Playgroud)

对于多表,我该怎么办?

codeigniter

1
推荐指数
1
解决办法
2747
查看次数

codeigniter中的自定义表单验证出错

我的自定义功能不起作用.我正在检查数据库中是否存在传递的值,它返回错误消息.我做错了什么?
控制器功能

function sp_exists($str)
        {
            $this->user_model->sp_exists($str);
            $this->form_validation->set_message('sp_exists', 'The %s field does not exists');
        }
Run Code Online (Sandbox Code Playgroud)

模型功能

function sp_exists($str)
    {
        $this->db->where('member_id',$str);
        $query = $this->db->get('user');
        if ($query->num_rows() > 0)
        {
            return false;
        }
        else
        {
            return true;
        }
    }
Run Code Online (Sandbox Code Playgroud)

回调函数

$this->form_validation->set_rules('sponsor_id', 'Sponsor ID', 'trim|required|xss_clean|callback_sp_exists');
Run Code Online (Sandbox Code Playgroud)

validation codeigniter

0
推荐指数
1
解决办法
174
查看次数