check_subscriber_active_to_service_group
input msisdn, service_id
|
sql select service_id,id from mt_subscribers where msisdn=? and active='y' and service_id=?
|
if(!$subscriber_id) select service_id,id from mt_subscribers where msisdn=? and active='y' and service_id in(select id from services where service_group_id=?
|
return $already_sub_service_id,$subscriber_id
|
get_mo_shortcode_based_on_service_id
input service_id
|
sql select mo_short_code from keywords where service_id=? limit 1
|
return: $mo_short_code example: SyniverseNlg5
|
if (!$mo_short_code) select k.mo_short_code from keywords k,carrier_service_override cor where cor.override_service_id=? and cor.incoming_service_id=k.service_id limit 1
|
get_messages_based_on_service
input $service_id, $svc_msg_type_id
|
sql select smm.id, smm.billed, smm.tpoa, smm.msg_priority, smm.sc_id, smm.credit_value, m.msg, mt.type, smt.svc_type, smm.delay, smm.delay_minutes from service_msg_matrix smm, messages m, messages_type mt, service_msg_type smt where smm.service_id=? and smm.svc_msg_type_id in($svc_msg_type_id) and smm.msg_id=m.id and m.msg_type_id=mt.id and smm.svc_msg_type_id=smt.id order by smm.
|
return: $sth_msg statement to the sql command
|
checkcheck_shortcode_overide
purpose check if there's short code override
|
input $short_code_id
|
sql select c.incoming_short_code_id, g.id from carrier_shortcode_override c,short_codes sc,gateways g where c.incoming_short_code_id=? and c.incoming_short_code_id=sc.id and sc.gateway_id=g.id
|
return $shortcode_override_id, $gateway_id
|
|
|
get_service_group
input service_id
|
sql select service_group_id from services where id=?
|
return service_group_id
|
get_service_url
input |
service_id |
sql |
select c.sub_uri,s.wap_title,sc.short_code from services s,short_codes sc,company c where s.id=? and s.mt_short_code_id=sc.id and s.company_id=c.id |
return |
$uri,$title,$sc |
add_subscriber
sql insert into mt_subscribers ( msisdn, active, subscription_date, keyword, short_code, mobile_carrier_id, service_id, source, sub_short_code, user_ip, affiliate_uri, reference_service_id, email) values (?,'y',now(),?,?,?,?,?,?,?,?,?,?)
|
return $id
|
add_subscribers_tiny
input $mt_subscriber_id, $short_uri
|
sql insert into mt_subscribers_tiny_uri(mt_subscriber_id, shortend) values(?,?)
|
shortend random 6 characters string
|
return $shortend_uri short_uri . $shortend
|
|
|
get_application_settings
input app_name
|
sql select app_m.svc_msg_type_id,app_p.msg_priority_id,app.id from applications app,application_msgs app_m,application_priority app_p where app.name=? and app.id=app_m.app_id and app.id=app_p.app_id
|
return $msg_priority_id,$msg_type_id,$app_id
|
note $msg_type_id: list of ids separate by ','
|
set_customer_credit
input $subscriber_id, $credit_value
|
sql insert into customer_credit (mt_subscriber_id,credit) values (?,?)
|
return: $id id of record table customer_credit
|
insertSubscriberLog
input $s_id, $key_id, $billed, $kw, $short_code, $mobile_carrier_id
|
sql insert into mt_subscription_log (mt_subscriber_id, key_id, billed, request_date, keyword, short_code, mobile_carrier_id) values (?,?,?,now(),?,?,?)
|
return $billed_id
|
get_gatewayid_api_name
input short_code_id
|
sql select sc.gateway_id, g.api_name, sc.premium from short_codes sc, gateways g where sc.id=? and sc.gateway_id=g.id
|
return $gateway_id, $api_name, $premium
|
example 5, sybase, y
|
|