OPERATOR A VS B – 2:1- ASTERISK DIALPLAN + MYSQL


PERBANDINGAN CALL OPERATOR_A && OPERATOR_B

[ecentrix-agents]
exten => _08[125][123]X.,1,NoOp(TELKOMSEL)
exten => _08[125][123]X.,n,MYSQL(Connect connid localhost dbuser dbpassword operator_counter)
exten => _08[125][123]X.,n,MYSQL(Query resultid ${connid} update t_counter set counter = counter + 1 where id=’0′)
exten => _08[125][123]X.,n,MYSQL(Query resultid ${connid} select IF(MOD(counter,3)=0,’OPERATOR_A’,’commsol’) as curr_operator from t_counter)
exten => _08[125][123]X.,n,MYSQL(Fetch foundrow ${resultid} curr_operator)
exten => _08[125][123]X.,n,MYSQL(Disconnect ${connid})
exten => _08[125][123]X.,n,NoOp(CURR_OPERATOR: ${curr_operator})
exten => _08[125][123]X.,n,GotoIf($[ “${curr_operator}” = “OPERATOR_A” ]?dlpn-OPERATOR_A,${EXTEN},1:dlpn-OPEARTOR_B,${EXTEN},1)

 

[dlpn-OPERATOR_B]
exten => _XXXXXXX.,1,NoOp(OPERATOR_A)
exten => _XXXXXXX.,n,Set(GROUP()=OPERATOR_A)
exten => _XXXXXXX.,n,NoOp(COUNT OPERATOR_A = ${GROUP_COUNT(OPERATOR_A)})
exten => _XXXXXXX.,n,Set(A_NUMBER=62${FILTER(0-9,${EXTEN:1})})
exten => _XXXXXXX.,n,Dial(SIP/73626${A_NUMBER}@OPERATOR_A,,tT)
exten => _XXXXXXX.,n,NoOp(HANGUPCAUSE OPERATOR_A=${HANGUPCAUSE} DAN DIALSTATUS OPERATOR_A =${DIALSTATUS})
exten => _XXXXXXX.,n,Hangup()

[dlpn-OPERATOR_A]
exten => _XXXXXXX.,1,NoOp(OPERATOR_A)
exten => _XXXXXXX.,n,Set(GROUP()=OPERATOR_A)
exten => _XXXXXXX.,n,NoOp(COUNT OPERATOR_A = ${GROUP_COUNT(OPERATOR_A)})
exten => _XXXXXXX.,n,Set(CALLERID(all)=8899 <8899>)
exten => _XXXXXXX.,n,Dial(SIP/${FILTER(0-9,${EXTEN})}@192.168.0.1,,tT)
exten => _XXXXXXX.,n,NoOp(HANGUPCAUSE OPERATOR_A=${HANGUPCAUSE} DAN DIALSTATUS OPERATOR_A =${DIALSTATUS})
exten => _XXXXXXX.,n,Hangup()
db operator_counter

t_counter CREATE TABLE `t_counter` (
`id` int(1) NOT NULL,
`counter` int(11) DEFAULT ‘1’,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

shisdew

Listens until think alike

moses.spaceku@yahoo.com / voip ipbx

Hosted PBX, IP-PBX SOHO/ CALL CENTER, VOICE GATEWAY, VOICE CARD, COST EFECTIVE SOLUTIONS (LCR), GSM/CDMA GATEWAY

%d bloggers like this: