2016-11-12 3 views
2

こんにちは、私はtwilioをアプリケーションに統合しました。 twilioではすべてのことが私にとってうまくいっています。しかし、いったん呼び出しが終了したら、Error - 11750 TwiML response body too largeが得られます。ここで私は私の最後から何をしたのですか?エラー - 11750 TwiMLレスポンスボディが大きすぎます

def connect 
twiml1 = Twilio::TwiML::Response.new do |r| 
    r.Say "You have joined the conference." 
    r.Dial do |d| 
    d.Conference "#{conference_title} #{call.id}", 
    waitUrl: " ", 
    muted: "false", 
    startConferenceOnEnter: "true", 
    endConferenceOnExit: "true", 
    maxParticipants: 5 
    end 
    end 
    render xml: twiml1.to_xml 
end 

会議が終了したら、申請要件に関連した支払いが行われます。

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 

エンド

私は私がこの中に間違っていたきたのか分かりません。助けてください。

答えて

0

処理が分散されているシステムの性質上、通話の料金と所要時間を計算するのに少し時間がかかるので、通話が完了した後、特にピーク時に少なくとも30シークン大量の

サポートでは、TwiMLでこれを行うのではなく、REST APIへのGET要求を使用してこの情報をシステムに取り込むことをお勧めします。サイズの制限に遭遇することはなく、価格、期間、ステータスなどの処理が必要なフィールドにはnull値を設定しません。

+0

こんにちはMegan Speir、再生に感謝します。しかし問題は私の側からです。私が与えたURLは間違っています。私はその問題を抱えていました。 –

関連する問題