为什么新的Confbridge在拨号时创建并将新的uers合并到当前运行的Confbridge Asterisk-11.5.1中

时间:2014-04-21 10:59:47

标签: c++ asterisk

任务:

从当前正在运行的ConferenceBridge(例如:1010101)拨出并添加SIP用户(例如:我网络上的Sip / 7001)

问题:     当我在Dauncout与拨号应用程序的帮助func。 pbx_exec     用户不合并当前运行的ConferenceBridge(例如:1010101),但创建其他新的conferenceBridge。     (例如:姓名:conference_bridge->名称)

help:如何将conference_bridge->名称传递给Dial App字符串。?

so that new user merge place into current running Conferencebridge

   [macro-CONFDAILOUT]
    exten => s,1,Verbose("================== USER has PICKUPED OR ANSWERED so placed him/her into Conf no : ${ARG1} =================== ")
    ;same => n,Set(MEETME_ROOMNUM=1010101)
    ;same => n,ConfBridge(${MEETME_ROOMNUM},,,conf-admin-sub-dialout)
    same => n,ConfBridge(${ARG1},,,conf-admin-sub-dialout)
    same => n,macroexit()


struct ast_app *dialapp = pbx_findapp("Dial");
char dialstr[100];
char confnum[8];
ast_copy_string(confnum,conference_bridge->name,sizeof(confnum));
ast_verb(3,"\n *************Confnum :%s ************\n",confnum);
ast_verb(3,"\n *************&Confnum :%s ************\n",&confnum);

strcpy (dialstr,"SIP");
//strcpy (dialstr,"SIP");
strcat (dialstr,"/");
strcat (dialstr,Sphone);
strcat (dialstr,",");
strcat (dialstr,"30");
strcat (dialstr,",");
//for o/p:1
strcat (dialstr,"hgM(CONFDAILOUT^&confnum)");
//for o/p:2
//strcat (dialstr,"hgM(CONFDAILOUT^&conference_bridge->name)");

ast_verb(3,"\n=====Dialing string: '%s' =====\n", dialstr);

ast_log(LOG_NOTICE,"\n=====Dialing string: '%s' =====\n", dialstr);

res=pbx_exec(bridge_channel->chan,dialapp,dialstr);
//res=pbx_exec(bridge_channel->chan,Originate,dialstr);

ast_verb(3,"\n ========Return from pbx_exec '%i' \n",res);
ast_log(LOG_NOTICE,"\n ======Return from pbx_exec '%i'",res);

pbx_builtin_setvar_helper(bridge_channel->chan, "sourcemeetme",conference_bridge->name);
ast_verb(3,"\n ====Return from  Disposition: '%s'\n",pbx_builtin_getvar_helper(bridge_channel->chan, "DIALSTATUS"));

conference_bridge->name is [1010101]
and &conference_bridge->name:[1010101]
=====Dialing string: 'SIP/7001,30,hgM(CONFDAILOUT^conference_bridge->name)' =====
o/p:1
Conference Bridge Name           Users  Marked Locked?
================================ ====== ====== ========
conference_bridge->name               1      0 unlocked
1010101                               1      1 unlocked
o/p:2
Conference Bridge Name           Users  Marked Locked?
================================ ====== ====== ========
1010101                               1      1 unlocked
&confnum                              1      0 unlocked

1 个答案:

答案 0 :(得分:0)

                            strcat (dialstr,"CONFDAILOUT");
                            strcat (dialstr,"^");
                            strcat (dialstr,conference_bridge->name);
                            strcat (dialstr,")")

现在新用户Megre进入当前正在运行的会议。