| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 732 人关注过本帖
标题:急问:请教高人
只看楼主 加入收藏
zlotus
Rank: 1
等 级:新手上路
帖 子:30
专家分:0
注 册:2006-5-26
收藏
 问题点数:0 回复次数:11 
急问:请教高人

请教:以下代码是用什么语言实现的,谢谢^_^

MegacoStack stack;


MegacoEntity mgcTcp, mgcUdp;


Priority priority;


MegacoEntityAddress mgcAddr;


/* Initialize system */


MegacoSystemInit();


/* The MEGACO Stack has embedded logging messages which can


be used for debugging purposes. The logging messages can be


turned on or off. */


/* Start-up standard I/O listener */


stdioListener =


(LogListener*)MemAlloc(sizeof(LogListener));


LogListenerConstruct(stdioListener, LOGMASK_ERROR,
....

搜索更多相关主题的帖子: 高人 
2006-05-26 11:45
★王者至尊★
Rank: 1
等 级:新手上路
帖 子:528
专家分:0
注 册:2006-3-28
收藏
得分:0 
这是什么东东啊?

------Java 爱好者,论坛小混混,学习中------
2006-05-26 12:42
千里冰封
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:灌水之王
等 级:版主
威 望:155
帖 子:28477
专家分:59
注 册:2006-2-26
收藏
得分:0 
一看就是C++

可惜不是你,陪我到最后
2006-05-26 13:12
zlotus
Rank: 1
等 级:新手上路
帖 子:30
专家分:0
注 册:2006-5-26
收藏
得分:0 

用到数据库了吗?


詠遠不會上線┈隱身已成習慣
2006-05-26 13:35
千里冰封
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:灌水之王
等 级:版主
威 望:155
帖 子:28477
专家分:59
注 册:2006-2-26
收藏
得分:0 
代码片段里面没有

可惜不是你,陪我到最后
2006-05-26 14:25
zlotus
Rank: 1
等 级:新手上路
帖 子:30
专家分:0
注 册:2006-5-26
收藏
得分:0 

协议栈初始化:

MegacoStack stack;

MegacoEntity mgcTcp, mgcUdp;

Priority priority;

MegacoEntityAddress mgcAddr;

/* Initialize system */

MegacoSystemInit();

/* The MEGACO Stack has embedded logging messages which can

be used for debugging purposes. The logging messages can be

turned on or off. */

/* Start-up standard I/O listener */

stdioListener =

(LogListener*)MemAlloc(sizeof(LogListener));

LogListenerConstruct(stdioListener, LOGMASK_ERROR,

LogStdio, stderr);

LogRegisterListener(&Log, stdioListener);

/* Start-up file listener */

fileListener =

(LogListener*)MemAlloc(sizeof(LogListener));

LogListenerConstruct(fileListener, LOGMASK_NONE,

LogFile, (void*)LOG_FILEDEPTH);

LogRegisterListener(&Log, fileListener);

/* Construct stack */

PriorityConstruct(&priority, PRIORITYCLASS_LOW,

priorityValue);

MegacoStackConstruct(&stack, numThreads, &priority);

/* Register stack callbacks */

MegacoStackRegisterSecurityKeyCB(&stack, getKey,

userData);

MegacoStackRegisterAuthenticationCB(&stack, HmacMd5,

MD5_HASHLENGTH);

MegacoStackRegisterRawRecvCB(&stack, rawRecvCallback,

userData);

MegacoStackRegisterRawSendCB(&stack, rawSendCallback,

userData);

/* Construct entity address */

MegacoEntityAddressConstruct(&mgcAddr, "88.42.39.56", 0 /*

use default port */);

/* Construct entities */

MegacoEntityConstructLocal(&mgcTcp, &mgcAddr, True,

MEGACOENTITYTYPE_MGC, TRANSPORTTYPE_TCP,

MEGACOENCODING_TEXT, &stack);

MegacoEntityConstructLocal(&mgcUdp, &mgcAddr, True,

MEGACOENTITYTYPE_MGC, TRANSPORTTYPE_UDP,

MEGACOENCODING_TEXT, &stack);

/* Register callbacks for local entities */

MegacoEntityRegisterRecvRequestCB(&mgcTcp, processRequest,

userData);

MegacoEntityRegisterRecvRequestCB(&mgcUdp, processRequest,

userData);

MegacoEntityRegisterRecvErrorMsgCB(&mgcTcp, processError,

userData);

MegacoEntityRegisterRecvErrorMsgCB(&mgcUdp, processError,

userData);

/* Destroy temporary objects */

MegacoEntityAddressDestruct(&mgcAddr);

PriorityDestruct(&priority);

/* Register stack with the system */

MegacoSystemRegisterStack(&stack);

/* ... */

/* Unregister stack */

MegacoSystemUnregisterStack(&stack);

/* Destroy objects */

MegacoEntityDestruct(&mgcUdp);

MegacoEntityDestruct(&mgcTcp);

MegacoStackDestruct(&stack);

/* System cleanup */

MegacoSystemEnd();


詠遠不會上線┈隱身已成習慣
2006-05-26 15:16
zlotus
Rank: 1
等 级:新手上路
帖 子:30
专家分:0
注 册:2006-5-26
收藏
得分:0 

创建和发送H.248事务

MegacoServiceChangeDescriptor services;

MegacoServiceChangeCommand command;

MegacoContextId contextId;

MegacoAction action;

MegacoTransaction transaction;

/* Construct termination ID. (ROOT requires special constructor) */

MegacoTerminationIdConstructRoot(&terminationId);

/* Construct required descriptors */

MegacoServiceChangeDescriptorConstruct(&services);

/* Set desired fields */

MegacoServiceChangeDescriptorSetMethod(&services,

MEGACOSERVICECHANGEMETHOD_RESTART);

/* Construct command */

MegacoServiceChangeCommandConstruct(&command,&terminationId, &services);

/* Construct context ID. (NULL requires special constructor)*/

MegacoContextIdConstructSpecial(&contextId,

MEGACOCONTEXTID_NULL);

/* Construct action */

MegacoActionConstruct(&action, &contextId);

/* Add command to action */

MegacoActionAddCommand(&action, &command);

/* Construct transaction */

MegacoTransactionConstruct(&transaction);

/* Add action to transaction */

MegacoTransactionAddAction(&transaction, &action);

/* Send transaction */

MegacoEntitySendRequest(&remoteEntity, &transaction,

processReply, userData);

/* Destroy objects */

MegacoTransactionDestruct(&transaction);

MegacoActionDestruct(&action);

MegacoContextIdDestruct(&contextId);

MegacoServiceChangeCommandDestruct(&command);

MegacoServiceChangeDescriptorDestruct(&services);

MegacoTerminationIdDestruct(&terminationId);


詠遠不會上線┈隱身已成習慣
2006-05-26 15:16
zlotus
Rank: 1
等 级:新手上路
帖 子:30
专家分:0
注 册:2006-5-26
收藏
得分:0 

创建和发送H.248事务响应

void processRequest(MegacoTcb *tcb, const

MegacoTransaction *transaction, void *data)

{

MegacoTransactionReply transReply;

size_t i;

/* Construct transaction reply */

MegacoTransactionReplyConstruct(&transReply, transaction);

for(i=0; i<MegacoTransactionGetNumActions(transaction);

++i)

{

const MegacoAction *action =

MegacoTransactionGetAction(transaction, i);

MegacoActionReply actionReply;

size_t j;

/* Construct action reply for each action */

MegacoActionReplyConstruct(&actionReply, action);

for(j=0; j<MegacoActionGetNumCommands(action); ++j)

{

const MegacoCommand *command =

MegacoActionGetCommand(action, j);

MegacoCommandReply commandReply;

/* Construct command reply for each command */

MegacoCommandReplyConstruct(&commandReply, command);

/* Add descriptors to command reply as necessary */

/* ... */

/* Add command reply to action reply */

MegacoActionReplyAddReply(&actionReply, &commandReply);

/* Destruct command reply */

MegacoCommandReplyDestruct(&commandReply);

"ServiceChange = ROOT {\n"

"Services { Method = Restart } } } }";

if(MegacoTransactionConstructParse(&transaction, text,

NULL) != NULL)

{

MegacoEntitySendRequest(&remoteEntity, &transaction,

processReply, userData);

MegacoTransactionDestruct(&transaction);

}

"ServiceChange = ROOT {\n"

"Services { Method = Restart } } } }";

if(MegacoTransactionConstructParse(&transaction, text,

NULL) != NULL)

{

MegacoEntitySendRequest(&remoteEntity, &transaction,

processReply, userData);

MegacoTransactionDestruct(&transaction);

}


詠遠不會上線┈隱身已成習慣
2006-05-26 15:17
zlotus
Rank: 1
等 级:新手上路
帖 子:30
专家分:0
注 册:2006-5-26
收藏
得分:0 
具体代码如上,谢谢了帮我看看怎么实现的,我是菜鸟^_^

詠遠不會上線┈隱身已成習慣
2006-05-26 15:18
千里冰封
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:灌水之王
等 级:版主
威 望:155
帖 子:28477
专家分:59
注 册:2006-2-26
收藏
得分:0 
这个帖子发错地方了,应该发到C++论坛里面

可惜不是你,陪我到最后
2006-05-26 15:56
快速回复:急问:请教高人
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022584 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved