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

isReserved : 0 


SELECT id FROM `voice_gateways` WHERE FIND_IN_SET ('15', `voice_plan_id`) AND isDedicated=0 AND isReserve=0 AND status=1 AND isDeleted=0 AND api_owner_id='admin' ORDER BY todays_credits/channels plan gateways
Array
(
    [0] => 9
    [1] => 7
    [2] => 22
    [3] => 21
)

1
Array
(
    [0] => 8645312376
    [1] => 8645312369
    [2] => 8645312374
    [3] => 8645312375
    [4] => 8645312378
    [5] => 8645312377
    [6] => 8645312379
)
match gateway according cli 

Array
(
    [22] => Array
        (
            [0] => 8645312376
            [1] => 8645312369
            [2] => 8645312374
            [3] => 8645312375
            [4] => 8645312378
            [5] => 8645312377
            [6] => 8645312379
        )

    [21] => Array
        (
            [0] => 8645312376
            [1] => 8645312369
            [2] => 8645312374
            [3] => 8645312375
            [4] => 8645312378
            [5] => 8645312377
            [6] => 8645312379
        )

)
find gateway 

Array
(
    [8645312376] => 22
    [8645312369] => 22
    [8645312374] => 22
    [8645312375] => 22
    [8645312378] => 22
    [8645312377] => 22
    [8645312379] => 22
)


 XXXXXXXXXXXXXXXXXXX-----------BELOW GATEWAY DETAIL xxxxxxxxxxxxxxxxxxxxxxxx
Array
(
    [22] => Array
        (
            [id] => 22
            [gateway_id] => 22
            [owner_id] => 100001
            [token] => luroekngnkvsaguut7t09439
            [post_url] => http://36.255.253.142/sarvApi/
            [speed_per_minute] => 70000
            [rabitmq_host] => 36.255.253.142
            [rabitmq_port] => 5672
            [rabitmq_user] => noderabbit
            [rabitmq_pass] => saf8777JJKk76KK
            [rabitmq_sending_queue] => QCall_vOBD40_22
            [rabitmq_reporting_queue] => QReport_vOBD40_22
            [rabitmq_queue_status] => 1
            [create_date] => 1697788389
            [create_by] => admin
            [update_date] => 1697788434
            [update_by] => admin
        )

)


 XXXXXXXXXXXXXXXXXXX-----------BELOW GATEWAY INFO xxxxxxxxxxxxxxxxxxxxxxxx
Array
(
    [22] => Array
        (
            [id] => 22
            [name] => V142-Dedicated Plan-02
            [voice_plan_id] => 5,8,12,14,15,18,19,20,21,22,26,30,31,32,33,34,37,38,41,42,45
            [gateway_cli] => +918645312234
            [cli_prefix] => +91
            [channels] => 500
            [gateway_pulse] => 30
            [gateway_ring_time] => 30
            [max_cron] => 10
            [gateway_type] => si
            [isReserve] => 0
            [isDedicated] => 0
            [create_date] => 1697788389
            [create_by] => admin
            [status] => 1
            [isDeleted] => 0
            [update_date] => 1698928591
            [update_by] => admin1
            [api_owner_id] => admin
            [total_credits] => 1186210
            [total_contacts] => 1165825
            [total_compaigns] => 142
            [active_credits] => 1165825
            [todays_credits] => 54641
            [todays_time] => 1700591400
        )

)
 

i am here 


 IN SI 

Array
(
    [post_url] => http://36.255.253.142/sarvApi/
    [announcement_path] => https://obd40.sarv.com/raws/inboxcart_nfsserver/voice_files/1700625212_u16_voice.wav
    [owner_id] => 100001
    [token] => luroekngnkvsaguut7t09439
)
Array
(
    [post_url] => http://36.255.253.142/sarvApi/
    [announcement_path] => https://obd40.sarv.com/raws/inboxcart_nfsserver/voice_files/1700625212_u16_voice.wav
    [owner_id] => 100001
    [token] => luroekngnkvsaguut7t09439
)


 http://36.255.253.142/sarvApi//upload_announcement.php 

Array
(
    [announcement_path] => https://obd40.sarv.com/raws/inboxcart_nfsserver/voice_files/1700625212_u16_voice.wav
    [owner_id] => 100001
    [token] => luroekngnkvsaguut7t09439
)


 {"status":"success","code":"000","desc":"Announcement Uploaded Successfully","data":{"announcement_name":"1700625212_u16_voice.wav"}} 



 upload annuncment response : {"status":"success","code":"000","desc":"Announcement Uploaded Successfully","data":{"announcement_name":"1700625212_u16_voice.wav"}}

gateway size : 1

1338/1


update voice_compaign_summary set alloted_apis='[{"cli":8645312376,"g_id":22},{"cli":8645312369,"g_id":22},{"cli":8645312374,"g_id":22},{"cli":8645312375,"g_id":22},{"cli":8645312378,"g_id":22},{"cli":8645312377,"g_id":22},{"cli":8645312379,"g_id":22}]', api_type='S', api_channels='500', action_time='{"api_allot_time":1700645250}', common_name='u16_862_22112023_025730PM_226',`duplicate_sms`='0',`remote_group_id`='0',`remote_recording_id`='0', credits_per_sms='1' WHERE compaign_id='862' LIMIT 1