Reject inbound call using last dialled outbound call end_code

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

Reject inbound call using last dialled outbound call end_code

Giorgio Bianchi
Hi,
I'm trying to reject an inbound call using the last dialled outbound call end_code.

This is the code example :

_status = dial _dialString
if _status.result == :answer
   hangup
else
   reject _status.calls.to_a.fetch(-1).end_code
end

This is the log :

[2014-07-28 10:33:02.103] ERROR Celluloid: Adhearsion::Call crashed!
ArgumentError: Invalid Reason (17), use: busy decline error
        /usr/local/rvm/gems/ruby-2.1.2/gems/punchblock-2.5.2/lib/punchblock/command/reject.rb:17:in `reason='
        /usr/local/rvm/gems/ruby-2.1.2/gems/virtus-1.0.2/lib/virtus/attribute_set.rb:173:in `block in set'
        /usr/local/rvm/gems/ruby-2.1.2/gems/virtus-1.0.2/lib/virtus/attribute_set.rb:170:in `each'
        /usr/local/rvm/gems/ruby-2.1.2/gems/virtus-1.0.2/lib/virtus/attribute_set.rb:170:in `set'
        /usr/local/rvm/gems/ruby-2.1.2/gems/virtus-1.0.2/lib/virtus/instance_methods.rb:17:in `initialize'
        /usr/local/rvm/gems/ruby-2.1.2/gems/state_machine-1.2.0/lib/state_machine/machine.rb:1993:in `block in initialize'
        /usr/local/rvm/gems/ruby-2.1.2/gems/state_machine-1.2.0/lib/state_machine/machine_collection.rb:34:in `initialize_states'
        /usr/local/rvm/gems/ruby-2.1.2/gems/state_machine-1.2.0/lib/state_machine/machine.rb:1993:in `initialize'
        /usr/local/rvm/gems/ruby-2.1.2/gems/punchblock-2.5.2/lib/punchblock/command_node.rb:10:in `initialize'
        /usr/local/rvm/gems/ruby-2.1.2/gems/adhearsion-2.5.3/lib/adhearsion/call.rb:305:in `new'
        /usr/local/rvm/gems/ruby-2.1.2/gems/adhearsion-2.5.3/lib/adhearsion/call.rb:305:in `reject'
        /usr/local/rvm/gems/ruby-2.1.2/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `public_send'
        /usr/local/rvm/gems/ruby-2.1.2/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `dispatch'
        /usr/local/rvm/gems/ruby-2.1.2/gems/celluloid-0.15.2/lib/celluloid/calls.rb:67:in `dispatch'
        /usr/local/rvm/gems/ruby-2.1.2/gems/celluloid-0.15.2/lib/celluloid/actor.rb:322:in `block in handle_message'
        /usr/local/rvm/gems/ruby-2.1.2/gems/celluloid-0.15.2/lib/celluloid/actor.rb:416:in `block in task'
        /usr/local/rvm/gems/ruby-2.1.2/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:55:in `block in initialize'
        /usr/local/rvm/gems/ruby-2.1.2/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:13:in `block in create'

Punchblock::Command::Reject allows only few values : is there a way to use the complete Q.850 hangup causes list?
Thanks!

--
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: Reject inbound call using last dialled outbound call end_code

Ben Langfeld-2
On 28 July 2014 06:23, Giorgio Bianchi <[hidden email]> wrote:
Hi,
I'm trying to reject an inbound call using the last dialled outbound call end_code.

This is the code example :

_status = dial _dialString
if _status.result == :answer
   hangup
else
   reject _status.calls.to_a.fetch(-1).end_code
end

This is the log :

[2014-07-28 10:33:02.103] ERROR Celluloid: Adhearsion::Call crashed!
ArgumentError: Invalid Reason (17), use: busy decline error
        /usr/local/rvm/gems/ruby-2.1.2/gems/punchblock-2.5.2/lib/punchblock/command/reject.rb:17:in `reason='
        /usr/local/rvm/gems/ruby-2.1.2/gems/virtus-1.0.2/lib/virtus/attribute_set.rb:173:in `block in set'
        /usr/local/rvm/gems/ruby-2.1.2/gems/virtus-1.0.2/lib/virtus/attribute_set.rb:170:in `each'
        /usr/local/rvm/gems/ruby-2.1.2/gems/virtus-1.0.2/lib/virtus/attribute_set.rb:170:in `set'
        /usr/local/rvm/gems/ruby-2.1.2/gems/virtus-1.0.2/lib/virtus/instance_methods.rb:17:in `initialize'
        /usr/local/rvm/gems/ruby-2.1.2/gems/state_machine-1.2.0/lib/state_machine/machine.rb:1993:in `block in initialize'
        /usr/local/rvm/gems/ruby-2.1.2/gems/state_machine-1.2.0/lib/state_machine/machine_collection.rb:34:in `initialize_states'
        /usr/local/rvm/gems/ruby-2.1.2/gems/state_machine-1.2.0/lib/state_machine/machine.rb:1993:in `initialize'
        /usr/local/rvm/gems/ruby-2.1.2/gems/punchblock-2.5.2/lib/punchblock/command_node.rb:10:in `initialize'
        /usr/local/rvm/gems/ruby-2.1.2/gems/adhearsion-2.5.3/lib/adhearsion/call.rb:305:in `new'
        /usr/local/rvm/gems/ruby-2.1.2/gems/adhearsion-2.5.3/lib/adhearsion/call.rb:305:in `reject'
        /usr/local/rvm/gems/ruby-2.1.2/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `public_send'
        /usr/local/rvm/gems/ruby-2.1.2/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `dispatch'
        /usr/local/rvm/gems/ruby-2.1.2/gems/celluloid-0.15.2/lib/celluloid/calls.rb:67:in `dispatch'
        /usr/local/rvm/gems/ruby-2.1.2/gems/celluloid-0.15.2/lib/celluloid/actor.rb:322:in `block in handle_message'
        /usr/local/rvm/gems/ruby-2.1.2/gems/celluloid-0.15.2/lib/celluloid/actor.rb:416:in `block in task'
        /usr/local/rvm/gems/ruby-2.1.2/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:55:in `block in initialize'
        /usr/local/rvm/gems/ruby-2.1.2/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:13:in `block in create'

Punchblock::Command::Reject allows only few values : is there a way to use the complete Q.850 hangup causes list?

There is not; this is a restriction of the Rayo specification: http://xmpp.org/extensions/xep-0327.html#def-reject
 
Thanks!

--
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.