=======
1.suspend music on hold when user press DTMF .
2.pass/Send DTMF
3.Get/Recieve DTMF
current issue :
current issue : 1: frametype 5 means :NULL Frame . 2: how to detect DTMF break or end char .? 3.ast_bridge_dtmf_stream did not worked . 4.funtion : struct ast_frame* bridge_handle_dtmf struct ast_bridge *bridge,struct ast_bridge_channel *bridge_channel,struct ast_frame *frame) not wokred .` 5.bridge_channel_dtmf_stream(&bridge_channel->bridge,&bridge_channel). did not worked . how to do it .how to use them in batter way to receive DTMF from user during Conference –
===
Dailplan
exten => 5006005,1,answer()
;same=>n,Set(CONFBRIDGE(user,music_on_hold_when_empty)=no)
same=>n,Set(myconference=4000)
same=>n,Set(TMP_CONF_COUNT=${CONFBRIDGE_INFO(parties,myconference)})
same=>n,verbose(3,"sabse 4000 has users:${TMP_CONF_COUNT})
same=>n,Set(TMP_CONF_LOCKED=${CONFBRIDGE_INFO(locked,myconference)})
same=>n,verbose(3,“sasbse 4000 has users:${TMP_CONF_COUNT} and lock or unlock:${TMP_CONF_LOCKED}”)
;same=>n,Set(TMP_CONF_COUNT=${CONFBRIDGE_INFO(parties,myconference)})
;remove , in confbridge
same=>n,Set(FRAME_TRACE(white)=DTMF_BEGIN,DTMF_END,NULL,IAX,TEXT)
same=>n(Press5MuteAll),ConfBridge(4000,6016adminuser)
same=>n,Set(FRAME_TRACE(black)=DTMF_BEGIN,DTMF_END,NULL,IAX,TEXT)
same=>n,Set(TMP_CONF_COUNT=${CONFBRIDGE_INFO(parties,myconference)})
same=>n,Set(TMP_CONF_LOCKED=${CONFBRIDGE_INFO(locked,myconference)})
same=>n,verbose(3,“sasbse 4000 has users:${TMP_CONF_COUNT} and lock or unlock:${TMP_CONF_LOCKED}”)
same=>n(showpart),Set(CONFBRIDGE_INFO(parties,4000)=yes)
*CLI> <–Read on Channel SIP/6016-00000000
FrameType: NULL
Src: NOT PRESENT
<–Read on Channel SIP/6016-00000000
FrameType: DTMF BEGIN
Digit: 50
Src: RTP
[2014-01-01 17:36:56] DTMF[26445][C-00000000]: channel.c:4170 __ast_read: DTMF begin ‘2’ received on SIP/6016-00000000
[2014-01-01 17:36:56] DTMF[26445][C-00000000]: channel.c:4181 __ast_read: DTMF begin passthrough ‘2’ on SIP/6016-00000000
<–Read on Channel SIP/6016-00000000
FrameType: NULL
Src: NOT PRESENT
<–Read on Channel SIP/6016-00000000
FrameType: DTMF END
Digit: 50
Src: RTP
=======DTMF CHAR==============
0 to 9 : 48 to 57
: 35
-
: 42
A to D :65 to 58
===code =========
int confbridge_run(struct ast_channel *chan,struct conference_bridge *bridge,struct conference_bridge_user *participant,struct ast_flags64 *confflags,char *optargs[]
){//conf life
while(bridge->activeusers + bridge->waitingusers){if(ast_test_flag(&participant->u_profile, USER_OPT_MONITOR)){ strcpy( Srole, "LISTEN" ); }else if( ast_test_flag(&participant->u_profile,USER_OPT_TALKER ) ){ strcpy( Srole, "TALK" ); }else if( ast_test_flag(&participant->u_profile,USER_OPT_ADMIN)||ast_test_flag(&participant->u_profile,USER_OPT_MARKEDUSER)){ strcpy( Susertype, "LEADER" ); ast_verb(3,"\n User is Admin/Marked \n "); //adminmenudtmf: int pmenu=0; int inconf=0; int testdtmf; playmenu: if (!pmenu&&!ast_app_getdata(participant->chan,"conf-adminmenu",tmp,3,-1) >= 0) { ast_verb(3,"\nstarmenu fplay user input tmp:[%s] 0[%s] 1[%s] 2[%s]\n",&tmp,&userinput[0],&userinput[1],&userinput[2]); } struct ast_frame *f=NULL; //user life //while (ast_read(participant->chan)) { //AST_FRAME_DTMF_BEGIN 12 f = ast_read(participant->chan); //below is undefine symbole; //queue_dtmf_readq(chan,f); if(f){ if ( f->frametype == AST_FRAME_DTMF_BEGIN || f->frametype == AST_FRAME_DTMF_END ) { ast_verb(3," f->frametype == AST_FRAME_DTMF_BEGIN or f->frametype == AST_FRAME_DTMF_END"); // continue; } ast_verb(3,"\n fr->subclass.integer :%d and (f->frametype:%d) \n ",f->subclass.integer,f->frametype); if(ast_test_flag(ast_channel_flags(participant->chan),AST_FLAG_IN_DTMF)){ ast_verb(3, "\nAST_FLAG_IN_DTMF\n ");
====Output======
starmenu fplay user input tmp:[w??] 0[] 1[?$] 2[$]
–
fr->subclass.integer :0 and (f->frametype:5)
– now pmenu 0
–
Now userinput &tmp []
– other 0 and *[0] strlen(tmp):0
– val switch [0]
–
User is Admin/Marked
– <SIP/6016-00000003> Playing ‘conf-adminmenu.alaw’ (language ‘en’)
[2014-01-01 16:44:16] DTMF[18504][C-00000004]: channel.c:4170 __ast_read: DTMF begin ‘1’ received on SIP/6016-00000003
[2014-01-01 16:44:16] DTMF[18504][C-00000004]: channel.c:4174 __ast_read: DTMF begin ignored ‘1’ on SIP/6016-00000003
[2014-01-01 16:44:16] DTMF[18504][C-00000004]: channel.c:4084 __ast_read: DTMF end ‘1’ received on SIP/6016-00000003, duration 200 ms
[2014-01-01 16:44:16] DTMF[18504][C-00000004]: channel.c:4154 __ast_read: DTMF end passthrough ‘1’ on SIP/6016-00000003
[2014-01-01 16:44:16] DTMF[18504][C-00000004]: channel.c:4170 __ast_read: DTMF begin ‘#’ received on SIP/6016-00000003
[2014-01-01 16:44:16] DTMF[18504][C-00000004]: channel.c:4174 __ast_read: DTMF begin ignored ‘#’ on SIP/6016-00000003
[2014-01-01 16:44:17] DTMF[18504][C-00000004]: channel.c:4084 __ast_read: DTMF end ‘#’ received on SIP/6016-00000003, duration 200 ms
[2014-01-01 16:44:17] DTMF[18504][C-00000004]: channel.c:4154 __ast_read: DTMF end passthrough ‘#’ on SIP/6016-00000003
–
starmenu fplay user input tmp:[w??] 0[1] 1[] 2[$]
–
fr->subclass.integer :0 and (f->frametype:5)
– now pmenu 0
–
Now userinput &tmp [1]
– other 1 and *[0] strlen(tmp):1
– val switch [1]
– <SIP/6016-00000003> Playing ‘conf-now-muted.alaw’ (language ‘en’)
– <Bridge/0xb74288bc-input> Playing ‘conf-now-muted.slin’ (language ‘en’)
*CLI>
*CLI> con
confbridge config
*CLI> confbridge list 4000
Channel User Profile Bridge Profile Menu CallerID
============================= ================ ================ ================ ================
SIP/6016-00000003 6016adminuser default_bridge 6016