• 大小: 313KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-08
  • 语言: 其他
  • 标签: exosip  语音  

资源简介

基于exosip的语音电话聊天,有助于exosip的开发

资源截图

代码片段和文件信息

/* This source has been formatted by an unregistered SourceFormatX */
/* If you want to remove this info please register this shareware */
/* Please visit http://www.textrush.com to get more information    */

/*
* josua - Jack‘s open sip User Agent
*
* Copyright (C) 20022003   Aymeric Moizard 
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2
* or (at your option) any later version.
*
* This is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with dpkg; if not write to the Free Software
* Foundation Inc. 675 Mass Ave Cambridge MA 02139 USA.
*/

#include “stdafx.h“
#include “sdptools.h“
#include “commands.h“

main_config_t cfg =
{
    “\0“ “\0“ “\0“ “\0“ 1 5060 “\0“ “\0“ “\0“ “\0“ 0 “\0“
};


static int _check_url(char *url);

static int _check_url(char *url)
{
    int i;
    osip_from_t *to;

    i = osip_from_init(&to);
    if (i != 0)
        return  - 1;
    i = osip_from_parse(to url);
    osip_from_free(to);
    if (i != 0)
        return  - 1;
    return 0;
}

int _josua_start_call(char *from char *to char *subject char *route char
  *port void *reference)
{
    osip_message_t *invite;
    int i;

    osip_clrspace(to);
    osip_clrspace(subject);
    osip_clrspace(from);
    osip_clrspace(route);

    OSIP_TRACE(osip_trace(__FILE__ __LINE__ OSIP_INFO2 NULL “To: |%s|\n“
        to));
    if (0 != _check_url(from))
        return  - 1;
    if (0 != _check_url(to))
        return  - 1;

    i = eXosip_call_build_initial_invite(&invite to from route subject);
    if (i != 0)
    {
        return  - 1;
    }

    osip_message_set_supported(invite “100rel“);

    /* add sdp body */
    {
        char tmp[4096];
        char localip[128];

        eXosip_guess_localip(AF_INET localip 128);
        _snprintf(tmp 4096 “v=0\r\n“
“o=josua 0 0 IN IP4 %s\r\n“
            “s=conversation\r\n“
“c=IN IP4 %s\r\n“
“t=0 0\r\n“
            “m=audio %s RTP/AVP 0 8 101\r\n“
“a=rtpmap:4 G729/8000\r\n“
“a=rtpmap:3 PCMU/8000\r\n“
            “a=rtpmap:3 PCMA/8000\r\n“
            “a=fmtp:101 0-11\r\n“ localip localip port);
        osip_message_set_body(invite tmp strlen(tmp));
        osip_message_set_content_type(invite “application/sdp“);
    }

    if (cfg.service_route[0] != ‘\0‘)
    {
        char *header = osip_strdup(“route“);

        osip_message_set_multiple_header(invite header cfg.service_route);
        osip_free(header);
        OSIP_TRACE(osip_trace(__FILE__ __LINE__ OS

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      15683  2007-01-12 15:47  exosip\commands.cpp

     文件       2508  2007-01-11 17:36  exosip\commands.h

     文件      22058  2007-01-04 15:56  exosip\exosip.lib

     文件     154298  2007-01-11 18:41  exosip\exosip2.lib

     文件      96396  2007-01-11 17:36  exosip\G729a.lib

     文件      14828  2007-01-16 13:42  exosip\gui.c

     文件       2342  2007-01-16 13:42  exosip\gui.h

     文件       9823  2007-01-16 13:36  exosip\gui_new_call.c

     文件       1124  2007-01-16 13:39  exosip\gui_new_call.h

     文件       6425  2007-01-16 13:48  exosip\gui_new_identity.c

     文件       1062  2007-01-16 13:48  exosip\gui_new_identity.h

     文件       3964  2007-01-16 13:47  exosip\gui_online.c

     文件       1115  2007-01-16 13:47  exosip\gui_online.h

     文件      11726  2007-01-16 13:41  exosip\gui_sessions_list.c

     文件       1070  2007-01-16 13:41  exosip\gui_sessions_list.h

     文件       1453  2007-01-16 13:52  exosip\gui_topline.c

     文件        952  2007-01-16 13:52  exosip\gui_topline.h

     文件      41185  2007-01-16 13:27  exosip\jcalls.c

     文件      40148  2007-01-15 17:31  exosip\jcalls.cpp

     文件       4469  2007-01-11 17:36  exosip\jcalls.h

     文件      19530  2007-01-11 17:36  exosip\jinsubscriptions.cpp

     文件       2071  2007-01-11 17:36  exosip\jinsubscriptions.h

     文件      14718  2007-01-11 17:36  exosip\jsubscriptions.cpp

     文件       2197  2007-01-11 17:36  exosip\jsubscriptions.h

     文件      27793  2007-01-16 13:31  exosip\main_ncurses.c

     文件      33096  2007-01-04 09:08  exosip\ortp.lib

     文件      35866  2007-01-06 14:04  exosip\osip2.lib

     文件     104382  2007-01-06 13:57  exosip\osipparser2.lib

     文件       1197  2007-01-11 17:36  exosip\ReadMe.txt

     文件       9520  2007-01-12 15:52  exosip\sdptools.cpp

............此处省略21个文件信息

评论

共有 条评论