SELECT * FROM `voice_compaign_summary` WHERE status='V' AND alloted_apis='' AND occupied=0 AND compaign_id='13549' LIMIT 1 user dedicated gateway
Array
(
)
 user gatway is empty 

isReserved : 1 


SELECT id FROM `voice_gateways` WHERE FIND_IN_SET ('8', `voice_plan_id`) AND isDedicated=0 AND isReserve=1 AND status=1 AND isReserve=1 AND isDeleted=0 AND api_owner_id='admin' ORDER BY todays_credits/channels plan gateways
Array
(
    [0] => 20
    [1] => 85
)

1
Array
(
    [0] => 8645313654
)
no gateway found for this campaign