ruby_ami calling via context

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

ruby_ami calling via context

watcherspecial
Hello.

I'm working on automated outbound calling application. I try to initiate the call with ruby_ami library, however the call unexpectedly fails. There is nothing wrong with my context scenario and there is nothin wrong with my AMI task. If send the task manually through the AMI console evrything works like a charm. However if I send the SAME task with ruby_ami bizzarre stuff happens: the phone rings one time and Asterisk spawns an extension.

Here is my context it's pretty tiny:

[outgoing_test]
exten => _X.,1,NoOp(${STRFTIME(${EPOCH},,%Y-%m-%d-%H-%M)}-${CALLERID(number)}-${EXTEN})
        same => n,Set(CHANNEL(language)=ru)
same => n,Dial(${OUTBOUNDTRUNK}/${EXTEN},40)
        same => n,Wait(0.2)
        same => n,Background(en_US/silence/1)
        same => n,AMD(4000,1500,800,5000,100,50,3,256,5000)
        same => n,GotoIf($[${AMDSTATUS}=HUMAN]?humn:mach)
same => n(humn),Playback(${FILEPATH})
        same => n,Hangup
        same => n(mach),Playback(custom/not_human)
        same => n,Hangup

Here is my AMI task:

Action: Originate
Channel: Local/12345678@outgoing_test
Callerid: 87654321
Exten: 12345678
Timeout: 30000
MaxRetries: 10
RetryTime: 5
WaitTime: 20
Priority: 1
Context: outgoing_test
Variable: FILEPATH=/home/work/aster-call/uploads/d2dbad00-722a-0132-c9ce-001485ec6ab2

The same task in ruby:

stream.async.send_action 'Originate', {
'Channel' => 'Local/12345678@outgoing_test', 
'Callerid' => '87654321', 
'Exten' => '12345678', 
'Timeout' => '3000', 
'MaxRetries' => '10', 
'RetryTime' => '5', 
'WaitTime' => '20', 
'Context' => 'outgoing_test', 
'Priority' => '1', 
'Variable' => 'FILEPATH=/home/work/aster-call/uploads/d2dbad00-722a-0132-c9ce-001485ec6ab2'}

When I send the task manually to AMI, Asterisk waits until I pick up a phone. I can see the 3d step is in process (same => n,Dial(${OUTBOUNDTRUNK}/${EXTEN},40)). But when I send the same task with ruby_ami, the phone rings 1 time and I see "Spawn extension (outgoing_test, 12345678, 3) exited non-zero on 'Local/12345678@outgoing_test-00000009;2'"


--
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: ruby_ami calling via context

ik_5
The difference is sync vs async tasks imho.

async returns right away, and you have to look when something happened, while sync, is blocking until something is over.

ido

On Tue, Dec 30, 2014 at 3:53 PM, <[hidden email]> wrote:
Hello.

I'm working on automated outbound calling application. I try to initiate the call with ruby_ami library, however the call unexpectedly fails. There is nothing wrong with my context scenario and there is nothin wrong with my AMI task. If send the task manually through the AMI console evrything works like a charm. However if I send the SAME task with ruby_ami bizzarre stuff happens: the phone rings one time and Asterisk spawns an extension.

Here is my context it's pretty tiny:

[outgoing_test]
exten => _X.,1,NoOp(${STRFTIME(${EPOCH},,%Y-%m-%d-%H-%M)}-${CALLERID(number)}-${EXTEN})
        same => n,Set(CHANNEL(language)=ru)
same => n,Dial(${OUTBOUNDTRUNK}/${EXTEN},40)
        same => n,Wait(0.2)
        same => n,Background(en_US/silence/1)
        same => n,AMD(4000,1500,800,5000,100,50,3,256,5000)
        same => n,GotoIf($[${AMDSTATUS}=HUMAN]?humn:mach)
same => n(humn),Playback(${FILEPATH})
        same => n,Hangup
        same => n(mach),Playback(custom/not_human)
        same => n,Hangup

Here is my AMI task:

Action: Originate
Channel: Local/12345678@outgoing_test
Callerid: 87654321
Exten: 12345678
Timeout: 30000
MaxRetries: 10
RetryTime: 5
WaitTime: 20
Priority: 1
Context: outgoing_test
Variable: FILEPATH=/home/work/aster-call/uploads/d2dbad00-722a-0132-c9ce-001485ec6ab2

The same task in ruby:

stream.async.send_action 'Originate', {
'Channel' => 'Local/12345678@outgoing_test', 
'Callerid' => '87654321', 
'Exten' => '12345678', 
'Timeout' => '3000', 
'MaxRetries' => '10', 
'RetryTime' => '5', 
'WaitTime' => '20', 
'Context' => 'outgoing_test', 
'Priority' => '1', 
'Variable' => 'FILEPATH=/home/work/aster-call/uploads/d2dbad00-722a-0132-c9ce-001485ec6ab2'}

When I send the task manually to AMI, Asterisk waits until I pick up a phone. I can see the 3d step is in process (same => n,Dial(${OUTBOUNDTRUNK}/${EXTEN},40)). But when I send the same task with ruby_ami, the phone rings 1 time and I see "Spawn extension (outgoing_test, 12345678, 3) exited non-zero on 'Local/12345678@outgoing_test-00000009;2'"


--
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.
Reply | Threaded
Open this post in threaded view
|

Re: ruby_ami calling via context

Ben Langfeld
In reply to this post by watcherspecial
Please provide trace logs from ruby_ami or a packet capture to see if there's a difference over the wire. 

Sent from my iPhone

On 30 Dec 2014, at 13:53, [hidden email] wrote:

Hello.

I'm working on automated outbound calling application. I try to initiate the call with ruby_ami library, however the call unexpectedly fails. There is nothing wrong with my context scenario and there is nothin wrong with my AMI task. If send the task manually through the AMI console evrything works like a charm. However if I send the SAME task with ruby_ami bizzarre stuff happens: the phone rings one time and Asterisk spawns an extension.

Here is my context it's pretty tiny:

[outgoing_test]
exten => _X.,1,NoOp(${STRFTIME(${EPOCH},,%Y-%m-%d-%H-%M)}-${CALLERID(number)}-${EXTEN})
        same => n,Set(CHANNEL(language)=ru)
same => n,Dial(${OUTBOUNDTRUNK}/${EXTEN},40)
        same => n,Wait(0.2)
        same => n,Background(en_US/silence/1)
        same => n,AMD(4000,1500,800,5000,100,50,3,256,5000)
        same => n,GotoIf($[${AMDSTATUS}=HUMAN]?humn:mach)
same => n(humn),Playback(${FILEPATH})
        same => n,Hangup
        same => n(mach),Playback(custom/not_human)
        same => n,Hangup

Here is my AMI task:

Action: Originate
Channel: Local/12345678@outgoing_test
Callerid: 87654321
Exten: 12345678
Timeout: 30000
MaxRetries: 10
RetryTime: 5
WaitTime: 20
Priority: 1
Context: outgoing_test
Variable: FILEPATH=/home/work/aster-call/uploads/d2dbad00-722a-0132-c9ce-001485ec6ab2

The same task in ruby:

stream.async.send_action 'Originate', {
'Channel' => 'Local/12345678@outgoing_test', 
'Callerid' => '87654321', 
'Exten' => '12345678', 
'Timeout' => '3000', 
'MaxRetries' => '10', 
'RetryTime' => '5', 
'WaitTime' => '20', 
'Context' => 'outgoing_test', 
'Priority' => '1', 
'Variable' => 'FILEPATH=/home/work/aster-call/uploads/d2dbad00-722a-0132-c9ce-001485ec6ab2'}

When I send the task manually to AMI, Asterisk waits until I pick up a phone. I can see the 3d step is in process (same => n,Dial(${OUTBOUNDTRUNK}/${EXTEN},40)). But when I send the same task with ruby_ami, the phone rings 1 time and I see "Spawn extension (outgoing_test, 12345678, 3) exited non-zero on 'Local/12345678@outgoing_test-00000009;2'"


--
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.
Reply | Threaded
Open this post in threaded view
|

Re: ruby_ami calling via context

watcherspecial
Here they are.

вторник, 30 декабря 2014 г., 16:10:09 UTC+2 пользователь Ben Langfeld написал:
Please provide trace logs from ruby_ami or a packet capture to see if there's a difference over the wire. 

Sent from my iPhone

On 30 Dec 2014, at 13:53, <a href="javascript:" target="_blank" gdf-obfuscated-mailto="zx896BE5kYsJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">watcher...@... wrote:

Hello.

I'm working on automated outbound calling application. I try to initiate the call with ruby_ami library, however the call unexpectedly fails. There is nothing wrong with my context scenario and there is nothin wrong with my AMI task. If send the task manually through the AMI console evrything works like a charm. However if I send the SAME task with ruby_ami bizzarre stuff happens: the phone rings one time and Asterisk spawns an extension.

Here is my context it's pretty tiny:

[outgoing_test]
exten => _X.,1,NoOp(${STRFTIME(${EPOCH},,%Y-%m-%d-%H-%M)}-${CALLERID(number)}-${EXTEN})
        same => n,Set(CHANNEL(language)=ru)
same => n,Dial(${OUTBOUNDTRUNK}/${EXTEN},40)
        same => n,Wait(0.2)
        same => n,Background(en_US/silence/1)
        same => n,AMD(4000,1500,800,5000,100,50,3,256,5000)
        same => n,GotoIf($[${AMDSTATUS}=HUMAN]?humn:mach)
same => n(humn),Playback(${FILEPATH})
        same => n,Hangup
        same => n(mach),Playback(custom/not_human)
        same => n,Hangup

Here is my AMI task:

Action: Originate
Channel: Local/12345678@outgoing_test
Callerid: 87654321
Exten: 12345678
Timeout: 30000
MaxRetries: 10
RetryTime: 5
WaitTime: 20
Priority: 1
Context: outgoing_test
Variable: FILEPATH=/home/work/aster-call/uploads/d2dbad00-722a-0132-c9ce-001485ec6ab2

The same task in ruby:

stream.async.send_action 'Originate', {
'Channel' => 'Local/12345678@outgoing_test'
'Callerid' => '87654321', 
'Exten' => '12345678', 
'Timeout' => '3000', 
'MaxRetries' => '10', 
'RetryTime' => '5', 
'WaitTime' => '20', 
'Context' => 'outgoing_test', 
'Priority' => '1', 
'Variable' => 'FILEPATH=/home/work/aster-call/uploads/d2dbad00-722a-0132-c9ce-001485ec6ab2'}

When I send the task manually to AMI, Asterisk waits until I pick up a phone. I can see the 3d step is in process (same => n,Dial(${OUTBOUNDTRUNK}/${EXTEN},40)). But when I send the same task with ruby_ami, the phone rings 1 time and I see "Spawn extension (outgoing_test, 12345678, 3) exited non-zero on 'Local/12345678@outgoing_test-00000009;2'"


--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="zx896BE5kYsJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">adhearsion+...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">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.

AMI_call.txt (49K) Download Attachment
ruby_ami_call.txt (16K) Download Attachment