2016-11-12 3 views
2

Hallo ich habe Twilio in der Anwendung integriert. In Twilio funktioniert alles gut für mich. Aber sobald der Anruf beendet ist, bekomme ich Error - 11750 TwiML response body too large. Hier, was ich von meinem Ende gemacht habe.Fehler - 11750 TwiML Antwort Körper zu groß

Sobald die Konferenz endete, eine Zahlung in Bezug auf die Anwendung erforderlich.

def call_status 
if params["CallStatus"] == "completed" 
    request_call = RequestCall.find { |c| c.caller_sids.include?(params["CallSid"])} 
    if request_call.present? 
    #save call logs 
    call_log = CallLog.new(called: params[:Called], tostate: params[:CallerCountry], callercountry: params[:CallerCountry], callerzip: params[:CallerZip], 
     direction: params[:Direction], timestamp: params[:Timestamp], callbacksource: params[:CallbackSource], callerstate: params[:CallerState], 
     tozip: params[:ToZip], sequencenumber: params[:SequenceNumber], callsid: params[:CallSid], to: params[:To], calledzip: params[:CalledZip], 
     calledcity: params[:CalledCity], tocountry: params[:ToCountry], apiversion: params[:ApiVersion], callstatus: params[:CallStatus], duration: params[:Duration], 
     from: params[:From], callduration: params[:CallDuration], accountsid: params[:AccountSid], calledcountry: params[:CalledCountry], callercity: params[:CallerCity], 
     caller: params[:Caller], fromcountry: params[:FromCountry], tocity: params[:ToCity], fromcity: params[:FromCity], calledstate: params[:CalledState], fromzip: params[:FromZip], 
     fromstate: [:FromState], user_id: request_call.user_id, expert_id: request_call.expert_id, request_call_id: request_call.id) 
     call_log.save 
    #check caller length 
    if request_call.call_ended == false && request_call.call_id_length == true 
     # Check estimate time with total duration 
     if request_call.estimated_time.to_i == call_log.duration.to_i 
     release_payment = request_call.release_full_payment 
     elsif request_call.estimated_time.to_i < call_log.duration.to_i 
     make_payment = request_call.release_full_payment 
     express_item_id = request_call.express_item_id 
     extra_time = call_log.duration.to_i - request_call.estimated_time.to_i 
     pending_amount = request_call.price_to_pay(extra_time) 
     second_item = request_call.express_item(pending_amount) 
     if second_item.code == 200 
      express_payment = request_call.release_express_payment 
     end 
     render json: {status: true} 
     elsif request_call.estimated_time.to_i > call_log.duration.to_i 
     remaining_duration = request_call.estimated_time.to_i - call_log.duration.to_i 
     refund_amount = request_call.price_to_pay(remaining_duration) 
     refund = request_call.refund_partial_amount(refund_amount) 
     release_fund = request_call.release_full_payment 
     render json: {status: true} 
     end 
     request_call.transition_to!(:completed) 
     request_call.update(twilio_allocated_number: nil, twilio_access_code: nil, call_ended: true) 
    elsif request_call.call_ended == true && request_call.call_id_length == true 
     render json: {status: true} 
    elsif request_call.call_ended == false && request_call.call_id_length == false 
     #make payment 
     request_call.transition_to!(:completed) 
     request_call.update(twilio_allocated_number: nil, twilio_access_code: nil, call_ended: true, single_user: true) 
     render json: {status: true} 
    end 
    else 
    render json: {status: false} 
    end 
else 
    render json: {status: false} 
end 

Ende

Ich weiß nicht, was ich in diesem falsch gemacht haben. Bitte berate mich.

Antwort

0

Aufgrund der Natur unseres Systems, wo die Verarbeitung so verteilt ist, wird es etwas länger dauern, um Preis und Dauer für Anrufe zu berechnen, also würde ich für mindestens 30 Sekunden nach dem Anruf warten, besonders während Spitzen von hohem Volumen.

Support empfiehlt die Verwendung von GET-Anforderungen an die REST-API, um diese Informationen in Ihr System zu übertragen, anstatt dies in TwiML zu versuchen. Sie werden nicht in Größenbeschränkung laufen und Sie werden keine Nullwerte für die Felder, die Verarbeitung benötigen wie Preis, Dauer, Status usw.

+0

Hallo Megan Speir, danke für Ihre Wiederholung. Aber das Problem ist von meiner Seite. Die URL, die ich angegeben habe, ist falsch. damit ich dieses Problem habe. –

Verwandte Themen