confirmation controller not executed

classic Classic list List threaded Threaded
5 messages Options
lcx
Reply | Threaded
Open this post in threaded view
|

confirmation controller not executed

lcx
Hi, I have a issue with a confirmation controller within dial. 
I have this dial code

status = dial(destination, from:caller_id, :for=>v_timeout,
  headers: { 'SOMEVAR' => somevalue },
  pre_join: ->(_) { monitor_call(v_service) },
  confirm: Intro,
  confirm_metadata: {:media_file => intro_media}) if call.active?

and I'm expecting the Intro controller to be executed once the called number pics up. 
It somehow does seem to happen: 


[2014-11-13 22:37:17] INFO  Adhearsion::OutboundCall: 306cbcf8-fd74-4a57-ad1a-bf5a17d79e92@: Executing controller #<Ahnlcx::Intro call=306cbcf8-fd74-4a57-ad1a-bf5a17d79e92, metadata={:media_file=>"ffb3710bf612dc8eb2e036332eb45df5"}>

but in that controller the first line would already log something which doesn't happen, so it looks to me like the controller isn't executed after all. 
This already used to work some weeks ago. 
I'm running adhearsion 2.5.0 and punchblock 2.5.0

The intro controller looks like this: 

# encoding: utf-8

module Ahnlcx
  class Intro < ApplicationController
    def run
      mylogger "Intro: searching for intro_media #{metadata[:media_file]}"
      media_file = MediaFile.find(metadata[:media_file])
      return true if media_file.blank?
      mylogger "Found media #{media_file.name}"
      play media_file.play_path
      true
    end
  end
end

Cris

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: confirmation controller not executed

Ben Klang-2
Hi Cris,

Before we go any further, would you be able to check to see whether the issue exists on the latest Adhearsion/Punchblock?

Adhearsion is at 2.5.4
Punchblock is at 2.5.3

bundle update to get the latest.

/BAK/
-- 
Ben Klang
Principal/Technology Strategist, Mojo Lingo
+1.404.475.4841

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo

Il giorno Nov 13, 2014, alle ore 11:45 PM, lcx <[hidden email]> ha scritto:

Hi, I have a issue with a confirmation controller within dial. 
I have this dial code

status = dial(destination, from:caller_id, :for=>v_timeout,
  headers: { 'SOMEVAR' => somevalue },
  pre_join: ->(_) { monitor_call(v_service) },
  confirm: Intro,
  confirm_metadata: {:media_file => intro_media}) if call.active?

and I'm expecting the Intro controller to be executed once the called number pics up. 
It somehow does seem to happen: 


[2014-11-13 22:37:17] INFO  Adhearsion::OutboundCall: 306cbcf8-fd74-4a57-ad1a-bf5a17d79e92@: Executing controller #<Ahnlcx::Intro call=306cbcf8-fd74-4a57-ad1a-bf5a17d79e92, metadata={:media_file=>"ffb3710bf612dc8eb2e036332eb45df5"}>

but in that controller the first line would already log something which doesn't happen, so it looks to me like the controller isn't executed after all. 
This already used to work some weeks ago. 
I'm running adhearsion 2.5.0 and punchblock 2.5.0

The intro controller looks like this: 

# encoding: utf-8

module Ahnlcx
  class Intro < ApplicationController
    def run
      mylogger "Intro: searching for intro_media #{metadata[:media_file]}"
      media_file = MediaFile.find(metadata[:media_file])
      return true if media_file.blank?
      mylogger "Found media #{media_file.name}"
      play media_file.play_path
      true
    end
  end
end

Cris

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


signature.asc (858 bytes) Download Attachment
lcx
Reply | Threaded
Open this post in threaded view
|

Re: confirmation controller not executed

lcx
Hi, I tried a quick update yesterday. I would rather not upgrade yet. 
I did fix the argument error by using the punchblock version 2.5.3 but I still have some errors with requests to couchDB and it needs a bit more testing. 
I will try to reproduce the issue in dev and then also try to upgrade in dev and see if I can reproduce. The only thing that bothers me is, it worked like a charm and I don't understand why it stopped working and why it looks like it's not entering the controller and why the tests pass. 

Just setting up my dev environment to be able to receive inbound calls and see if I can reproduce in dev. 

Cris 

On Thu, Nov 13, 2014 at 11:21 PM, Ben Klang <[hidden email]> wrote:
Hi Cris,

Before we go any further, would you be able to check to see whether the issue exists on the latest Adhearsion/Punchblock?

Adhearsion is at 2.5.4
Punchblock is at 2.5.3

bundle update to get the latest.

/BAK/
-- 
Ben Klang
Principal/Technology Strategist, Mojo Lingo
<a href="tel:%2B1.404.475.4841" value="+14044754841" target="_blank">+1.404.475.4841

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo

Il giorno Nov 13, 2014, alle ore 11:45 PM, lcx <[hidden email]> ha scritto:

Hi, I have a issue with a confirmation controller within dial. 
I have this dial code

status = dial(destination, from:caller_id, :for=>v_timeout,
  headers: { 'SOMEVAR' => somevalue },
  pre_join: ->(_) { monitor_call(v_service) },
  confirm: Intro,
  confirm_metadata: {:media_file => intro_media}) if call.active?

and I'm expecting the Intro controller to be executed once the called number pics up. 
It somehow does seem to happen: 


[2014-11-13 22:37:17] INFO  Adhearsion::OutboundCall: 306cbcf8-fd74-4a57-ad1a-bf5a17d79e92@: Executing controller #<Ahnlcx::Intro call=306cbcf8-fd74-4a57-ad1a-bf5a17d79e92, metadata={:media_file=>"ffb3710bf612dc8eb2e036332eb45df5"}>

but in that controller the first line would already log something which doesn't happen, so it looks to me like the controller isn't executed after all. 
This already used to work some weeks ago. 
I'm running adhearsion 2.5.0 and punchblock 2.5.0

The intro controller looks like this: 

# encoding: utf-8

module Ahnlcx
  class Intro < ApplicationController
    def run
      mylogger "Intro: searching for intro_media #{metadata[:media_file]}"
      media_file = MediaFile.find(metadata[:media_file])
      return true if media_file.blank?
      mylogger "Found media #{media_file.name}"
      play media_file.play_path
      true
    end
  end
end

Cris

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
lcx
Reply | Threaded
Open this post in threaded view
|

Re: confirmation controller not executed

lcx
I think I might have found the issue. 
for some reason it's executing the before_call on the outbound leg before entering the confirmation controller. 
Here I check for the called number and if it's not found I raise an exception. The Problem is that the call.to is the dialed number, but I can't find the dialed number in our database that's why the exception. 

The question is, should the before_call be triggered for outbound calls as well? 

Cris

On Fri, Nov 14, 2014 at 9:32 AM, Cristian Livadaru <[hidden email]> wrote:
Hi, I tried a quick update yesterday. I would rather not upgrade yet. 
I did fix the argument error by using the punchblock version 2.5.3 but I still have some errors with requests to couchDB and it needs a bit more testing. 
I will try to reproduce the issue in dev and then also try to upgrade in dev and see if I can reproduce. The only thing that bothers me is, it worked like a charm and I don't understand why it stopped working and why it looks like it's not entering the controller and why the tests pass. 

Just setting up my dev environment to be able to receive inbound calls and see if I can reproduce in dev. 

Cris 

On Thu, Nov 13, 2014 at 11:21 PM, Ben Klang <[hidden email]> wrote:
Hi Cris,

Before we go any further, would you be able to check to see whether the issue exists on the latest Adhearsion/Punchblock?

Adhearsion is at 2.5.4
Punchblock is at 2.5.3

bundle update to get the latest.

/BAK/
-- 
Ben Klang
Principal/Technology Strategist, Mojo Lingo
<a href="tel:%2B1.404.475.4841" value="+14044754841" target="_blank">+1.404.475.4841

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo

Il giorno Nov 13, 2014, alle ore 11:45 PM, lcx <[hidden email]> ha scritto:

Hi, I have a issue with a confirmation controller within dial. 
I have this dial code

status = dial(destination, from:caller_id, :for=>v_timeout,
  headers: { 'SOMEVAR' => somevalue },
  pre_join: ->(_) { monitor_call(v_service) },
  confirm: Intro,
  confirm_metadata: {:media_file => intro_media}) if call.active?

and I'm expecting the Intro controller to be executed once the called number pics up. 
It somehow does seem to happen: 


[2014-11-13 22:37:17] INFO  Adhearsion::OutboundCall: 306cbcf8-fd74-4a57-ad1a-bf5a17d79e92@: Executing controller #<Ahnlcx::Intro call=306cbcf8-fd74-4a57-ad1a-bf5a17d79e92, metadata={:media_file=>"ffb3710bf612dc8eb2e036332eb45df5"}>

but in that controller the first line would already log something which doesn't happen, so it looks to me like the controller isn't executed after all. 
This already used to work some weeks ago. 
I'm running adhearsion 2.5.0 and punchblock 2.5.0

The intro controller looks like this: 

# encoding: utf-8

module Ahnlcx
  class Intro < ApplicationController
    def run
      mylogger "Intro: searching for intro_media #{metadata[:media_file]}"
      media_file = MediaFile.find(metadata[:media_file])
      return true if media_file.blank?
      mylogger "Found media #{media_file.name}"
      play media_file.play_path
      true
    end
  end
end

Cris

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
lcx
Reply | Threaded
Open this post in threaded view
|

Re: confirmation controller not executed

lcx
ok, so it looks like my tests for the intro controller suck! 
The issue was brought in with a merge where a new before_call was added. 

so I need to fix my tests but I'm kind of having some difficulties here. 
My current test looks like this: 

it "calls confirm controller if intro is present" do
  mf = FactoryGirl.create(:media_file,customer_id:FactoryGirl.create(:customer).id)

  Ahnlcx::Dial.any_instance.should_receive(:hangup)
  Ahnlcx::Dial.any_instance.should_receive(:dial).with("SIP/[hidden email]",
    {:from=>"43123123123",:for=>60,
      :headers=>{"FOO"=>nil},
      :pre_join=>anything(),
      confirm:Ahnlcx::Intro,
      confirm_metadata: {:media_file => mf.id} }).once.and_return(DialSpecStatus.new)
  mock_call.should_receive(:on_end)

  subject.run.should==true
end

the problem here is that the confirm controller isn't actually called. 
If I say Ahnlcx::Dial.any_instance.should_receive .... and_call_original
Then I get a lot more then I asked for, I don't really want to call the original dial. I just want it to trigger the confirmation controller so that I can test if it actually get's called. 

Cris 


On Fri, Nov 14, 2014 at 9:51 AM, Cristian Livadaru <[hidden email]> wrote:
I think I might have found the issue. 
for some reason it's executing the before_call on the outbound leg before entering the confirmation controller. 
Here I check for the called number and if it's not found I raise an exception. The Problem is that the call.to is the dialed number, but I can't find the dialed number in our database that's why the exception. 

The question is, should the before_call be triggered for outbound calls as well? 

Cris

On Fri, Nov 14, 2014 at 9:32 AM, Cristian Livadaru <[hidden email]> wrote:
Hi, I tried a quick update yesterday. I would rather not upgrade yet. 
I did fix the argument error by using the punchblock version 2.5.3 but I still have some errors with requests to couchDB and it needs a bit more testing. 
I will try to reproduce the issue in dev and then also try to upgrade in dev and see if I can reproduce. The only thing that bothers me is, it worked like a charm and I don't understand why it stopped working and why it looks like it's not entering the controller and why the tests pass. 

Just setting up my dev environment to be able to receive inbound calls and see if I can reproduce in dev. 

Cris 

On Thu, Nov 13, 2014 at 11:21 PM, Ben Klang <[hidden email]> wrote:
Hi Cris,

Before we go any further, would you be able to check to see whether the issue exists on the latest Adhearsion/Punchblock?

Adhearsion is at 2.5.4
Punchblock is at 2.5.3

bundle update to get the latest.

/BAK/
-- 
Ben Klang
Principal/Technology Strategist, Mojo Lingo
<a href="tel:%2B1.404.475.4841" value="+14044754841" target="_blank">+1.404.475.4841

Mojo Lingo -- Voice applications that work like magic
Twitter: @MojoLingo

Il giorno Nov 13, 2014, alle ore 11:45 PM, lcx <[hidden email]> ha scritto:

Hi, I have a issue with a confirmation controller within dial. 
I have this dial code

status = dial(destination, from:caller_id, :for=>v_timeout,
  headers: { 'SOMEVAR' => somevalue },
  pre_join: ->(_) { monitor_call(v_service) },
  confirm: Intro,
  confirm_metadata: {:media_file => intro_media}) if call.active?

and I'm expecting the Intro controller to be executed once the called number pics up. 
It somehow does seem to happen: 


[2014-11-13 22:37:17] INFO  Adhearsion::OutboundCall: 306cbcf8-fd74-4a57-ad1a-bf5a17d79e92@: Executing controller #<Ahnlcx::Intro call=306cbcf8-fd74-4a57-ad1a-bf5a17d79e92, metadata={:media_file=>"ffb3710bf612dc8eb2e036332eb45df5"}>

but in that controller the first line would already log something which doesn't happen, so it looks to me like the controller isn't executed after all. 
This already used to work some weeks ago. 
I'm running adhearsion 2.5.0 and punchblock 2.5.0

The intro controller looks like this: 

# encoding: utf-8

module Ahnlcx
  class Intro < ApplicationController
    def run
      mylogger "Intro: searching for intro_media #{metadata[:media_file]}"
      media_file = MediaFile.find(metadata[:media_file])
      return true if media_file.blank?
      mylogger "Found media #{media_file.name}"
      play media_file.play_path
      true
    end
  end
end

Cris

--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.




--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.