Replies: 3 comments
-
|
A trace of the asterisk cli would help
…On Thu., 23 May 2019, 7:43 am Nelson García, ***@***.***> wrote:
Hello. Asterisk-Java is such and amazing piece of code!! Thank you for the
hard work. I'm building a voice bot. A batch/API initiated process starts a
call to a user's mobile phone, for example, to confirm an schedule or an
order reception. As soon as the user answers the phone, the bot starts
talking and they get into a normal conversation.
I'm using asteriskPBX.dial(...) to start the call (in an independent app
called "dialer") and when the user answers the call, the call is attended
by another independent app ("controller") which exposes a class extending
Asterisk-Java's BaseAgiScript. So far, so good: the call gets done, the
BaseAgiScript class receives the call control and I can send Agi
actions/commands to the call via Asterisk.
However, when I used asteriskPBX.dial(...), after some seconds the call
is hang up by the asterisk-java lib in dialer app with this log, so I can
not continue sending commands in the controller app:
2019-05-22T16:10:23,723 DEBUG [http-nio-8080-exec-3] c.s.b.c.CallerService$CallEventCallback: ===> activity.cancelledByOperator: false
2019-05-22T16:10:23,725 DEBUG [http-nio-8080-exec-3] c.s.b.c.CallerService$CallEventCallback: ===> activity.isSuccess: false
2019-05-22T16:10:23,726 DEBUG [http-nio-8080-exec-3] c.s.b.c.CallerService$CallEventCallback: ===> activity.getLastException: {}
2019-05-22T16:10:23,727 DEBUG [http-nio-8080-exec-3] c.s.b.c.CallerService$CallEventCallback: ===> activity.getOriginatingChannel: null
2019-05-22T16:10:23,727 DEBUG [http-nio-8080-exec-3] c.s.b.c.CallerService$CallEventCallback: ===> activity.getAcceptingChannel: null
2019-05-22T16:10:23,728 DEBUG [http-nio-8080-exec-3] c.s.b.c.CallerService$CallEventCallback: ===> activity.getOriginatingEndPoint: PJSIP/101
2019-05-22T16:10:23,730 DEBUG [http-nio-8080-exec-3] c.s.b.c.CallerService$CallEventCallback: ===> activity.getAcceptingEndpoint: LOCAL/102
2019-05-22T16:10:23,733 INFO [Dial] o.a.p.i.a.DialActivityImpl: *********** begin dial out **************** [{}]
2019-05-22T16:10:23,734 INFO [Dial] o.a.p.i.a.DialActivityImpl: *********** LOCAL/102 **************** [{}]
2019-05-22T16:10:23,743 INFO [pool-3-thread-1] o.a.p.i.m.OriginateBaseClass: new channel name (proxy=2) PJSIP/101-00000011:1558559423.AJ2 [{}]
2019-05-22T16:10:23,743 DEBUG [pool-3-thread-1] c.s.b.c.CallerService$CallEventCallback: status=PROGRESS, message=Channel for PJSIP/101 is now up. [{}]
2019-05-22T16:10:23,743 DEBUG [pool-3-thread-1] c.s.b.c.CallerService$CallEventCallback: ===> activity.cancelledByOperator: false [{}]
2019-05-22T16:10:23,743 DEBUG [pool-3-thread-1] c.s.b.c.CallerService$CallEventCallback: ===> activity.isSuccess: false [{}]
2019-05-22T16:10:23,744 DEBUG [pool-3-thread-1] c.s.b.c.CallerService$CallEventCallback: ===> activity.getLastException: {} [{}]
2019-05-22T16:10:23,744 DEBUG [pool-3-thread-1] c.s.b.c.CallerService$CallEventCallback: ===> activity.getOriginatingChannel: (proxy=2) PJSIP/101-00000011:1558559423.AJ2 [{}]
2019-05-22T16:10:23,744 DEBUG [pool-3-thread-1] c.s.b.c.CallerService$CallEventCallback: ===> activity.getAcceptingChannel: null [{}]
2019-05-22T16:10:23,744 DEBUG [pool-3-thread-1] c.s.b.c.CallerService$CallEventCallback: ===> activity.getOriginatingEndPoint: PJSIP/101 [{}]
2019-05-22T16:10:23,744 DEBUG [pool-3-thread-1] c.s.b.c.CallerService$CallEventCallback: ===> activity.getAcceptingEndpoint: LOCAL/102 [{}]
2019-05-22T16:10:31,709 INFO [pool-3-thread-1] o.a.p.i.m.OriginateBaseClass: notify originate response event true [{}]
2019-05-22T16:11:01,710 ERROR [Dial] o.a.p.i.a.DialActivityImpl: dialout to LOCAL/102 failed. [{}]
2019-05-22T16:11:01,710 WARN [Dial] o.a.p.i.a.DialActivityImpl: Hanging up [{}]
2019-05-22T16:11:01,710 INFO [Dial] o.a.p.i.c.AsteriskPBX: Sending hangup action for channel: (proxy=2) PJSIP/101-00000011:1558559423.AJ2 [{}]
2019-05-22T16:11:01,715 DEBUG [Dial] c.s.b.c.CallerService$CallEventCallback: status=FAILURE, message=Failure [{}]
2019-05-22T16:11:01,715 DEBUG [Dial] c.s.b.c.CallerService$CallEventCallback: ===> activity.cancelledByOperator: false [{}]
2019-05-22T16:11:01,715 DEBUG [Dial] c.s.b.c.CallerService$CallEventCallback: ===> activity.isSuccess: false [{}]
2019-05-22T16:11:01,715 DEBUG [Dial] c.s.b.c.CallerService$CallEventCallback: ===> activity.getLastException: {} [{}]
org.asteriskjava.pbx.PBXException: OperatorEndedCall
at org.asteriskjava.pbx.internal.activity.DialActivityImpl.doActivity(DialActivityImpl.java:97)
at org.asteriskjava.pbx.internal.activity.ActivityHelper.run(ActivityHelper.java:113)
at java.lang.Thread.run(Thread.java:748)
2019-05-22T16:11:01,716 DEBUG [Dial] c.s.b.c.CallerService$CallEventCallback: ===> activity.getOriginatingChannel: (proxy=2) PJSIP/101-00000011:1558559423.AJ2 [{}]
2019-05-22T16:11:01,716 DEBUG [Dial] c.s.b.c.CallerService$CallEventCallback: ===> activity.getAcceptingChannel: null [{}]
2019-05-22T16:11:01,716 DEBUG [Dial] c.s.b.c.CallerService$CallEventCallback: ===> activity.getOriginatingEndPoint: PJSIP/101 [{}]
2019-05-22T16:11:01,716 DEBUG [Dial] c.s.b.c.CallerService$CallEventCallback: ===> activity.getAcceptingEndpoint: LOCAL/102 [{}]
I found asteriskPBX.dialToAgi and asteriskPBX.dialLocalToAgi methods, so
I thought maybe I should use one of these. Using
asteriskPBX.dialLocalToAgi allows me to continue the call (no hang up by
the dialer app), however I'm still receiving an error log as follows:
2019-05-22T15:59:54,471 INFO [Dial SIP/((TRUNK NAME))/((HIDDEN MOBILE NUMBER)) to AGI] o.a.p.i.c.DialLocalToAgiActivity: [ ] *********** begin dial local to AGI **************** [{}]
2019-05-22T15:59:59,494 ERROR [Dial SIP/((TRUNK NAME))/((HIDDEN MOBILE NUMBER)) to AGI] o.a.p.i.c.DialLocalToAgiActivity: [ ] org.asteriskjava.manager.TimeoutException: Timeout waiting for response to Originate (actionId: 6) [{}]
org.asteriskjava.manager.TimeoutException: Timeout waiting for response to Originate (actionId: 6)
at org.asteriskjava.manager.internal.ManagerConnectionImpl.sendAction(ManagerConnectionImpl.java:862)
at org.asteriskjava.manager.DefaultManagerConnection.sendAction(DefaultManagerConnection.java:332)
at org.asteriskjava.pbx.internal.core.CoherentManagerConnection.sendAction(CoherentManagerConnection.java:340)
at org.asteriskjava.pbx.internal.core.AsteriskPBX.sendAction(AsteriskPBX.java:664)
at org.asteriskjava.pbx.internal.core.DialLocalToAgiActivity.run(DialLocalToAgiActivity.java:97)
at java.lang.Thread.run(Thread.java:748)
What's the right way to achieve my goal? (outgoing automated call attended
by a bot) How should I use dialLocalToAgi or dialToAgi or dial in the
right way so I don't get errors? Could you provide examples similar to this
case in the Wiki? If you teach me how, I'll be glad to document that in
your Wiki.
This is my extensions_custom.conf:
[bizbo-inbound]
exten => s,1,Answer()
same => n,Verbose(1,${CONTEXT}: Recibiendo llamada desde "${DID}")
same => n,Noop(Running miscapp 4: MiscApp para asterisk-java)
same => s,DumpChan()
same => n,AGI(agi://((CONTROLLER APP HOST IP))/inboundAgi)
Thanks a lot!!
PS:
When dialing over a trunk to and outside number (not an extension) the
call could no be hang up by the dialer maybe because it is controlled by
the remote trunk. Besides, I don't have any issue in the case the call is
and inbound call, but that's another totally different use case.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#297?email_source=notifications&email_token=AAG32OAGNV7WFNNPVDOYB3TPWW5AZA5CNFSM4HOYHFX2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GVKD5OQ>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAG32ODRRN5EL7YQFRUELZDPWW5AZANCNFSM4HOYHFXQ>
.
|
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the fast reply!. Here you have the asterisk's log output and asterisk cli messages. They are basically the same. These are for the case in which asterisk-java hangs up the conversation; as you can see, a Playback was attempted after hanging up. Also, PFA an pdf file with the full trace (-rddddd) and a txt with the same content but no formatting. BTW, 101 is the extension I'm dialing to and 102 is just an extension I pass to dial method in order to fulfill the method's signature. In the txt file, the hangup happens in line 3261: : |
Beta Was this translation helpful? Give feedback.
-
|
Have you traced where this message is coming from?
Manager 'asterisk-java' from 192.168.122.1, hanging up channel:
PJSIP/101-00000003
This where I would start.
If 102 is just filling out the api signature then why do I see:
dialout to LOCAL/102 failed. [{}]
Post you code so we can see what you are doing.
Also remove the playback, just in case the audio file is corrupt.
…On Fri, 24 May 2019 at 03:02, Nelson García ***@***.***> wrote:
Thank you for the fast reply!. Here you have the asterisk's log output and
asterisk cli messages. They are basically the same. These are for the case
in which asterisk-java hangs up the conversation; as you can see, a
Playback was attempted after hanging up. Also, PFA an pdf file with the
full trace (-rddddd) and a txt with the same content but no formatting.
BTW, 101 is the extension I'm dialing to and 102 is just an extension I
pass to dial method in order to fulfill the method's signature
full-5d-cli.pdf
<https://github.com/asterisk-java/asterisk-java/files/3213334/full-5d-cli.pdf>
full-5d-cli.txt
<https://github.com/asterisk-java/asterisk-java/files/3213337/full-5d-cli.txt>
:
[2019-05-23 16:29:22] VERBOSE[21929] dial.c: Called 101
[2019-05-23 16:29:22] VERBOSE[2029] netsock2.c: Using SIP RTP Audio TOS bits 184
[2019-05-23 16:29:22] VERBOSE[2029] netsock2.c: Using SIP RTP Audio TOS bits 184 in TCLASS field.
[2019-05-23 16:29:22] VERBOSE[2029] netsock2.c: Using SIP RTP Audio CoS mark 5
[2019-05-23 16:29:22] VERBOSE[2029] netsock2.c: Using SIP RTP Video TOS bits 136
[2019-05-23 16:29:22] VERBOSE[2029] netsock2.c: Using SIP RTP Video TOS bits 136 in TCLASS field.
[2019-05-23 16:29:22] VERBOSE[2029] netsock2.c: Using SIP RTP Video CoS mark 4
[2019-05-23 16:29:22] VERBOSE[21929] dial.c: PJSIP/101-00000003 is ringing
[2019-05-23 16:29:25] VERBOSE[21929] dial.c: PJSIP/101-00000003 answered
[2019-05-23 16:29:25] VERBOSE[21929][C-00000002] pbx.c: Executing ***@***.***:1] AGI("PJSIP/101-00000003", "agi://192.168.122.1/activityAgi") in new stack
[2019-05-23 16:29:26] VERBOSE[21929][C-00000002] res_agi.c: AGI Script Executing Application: (Playback) Options: (bizbo/tts-0a536a6f-1ee9-48e6-a4d3-18078a5ac7b2-IUx8PLHh9UDHKBxL0D_nfA==)
[2019-05-23 16:29:26] VERBOSE[21929][C-00000002] file.c: <PJSIP/101-00000003> Playing 'bizbo/tts-0a536a6f-1ee9-48e6-a4d3-18078a5ac7b2-IUx8PLHh9UDHKBxL0D_nfA==.slin' (language 'es')
[2019-05-23 16:29:40] VERBOSE[21929][C-00000002] file.c: <PJSIP/101-00000003> Playing 'beep.ulaw' (language 'es')
[2019-05-23 16:29:48] VERBOSE[21929][C-00000002] res_agi.c: AGI Script Executing Application: (Playback) Options: (bizbo/tts-0a536a6f-1ee9-48e6-a4d3-18078a5ac7b2-QtkPF0l6GAghngjUonUYNA==)
[2019-05-23 16:29:48] VERBOSE[21929][C-00000002] file.c: <PJSIP/101-00000003> Playing 'bizbo/tts-0a536a6f-1ee9-48e6-a4d3-18078a5ac7b2-QtkPF0l6GAghngjUonUYNA==.slin' (language 'es')
[2019-05-23 16:29:50] VERBOSE[21929][C-00000002] file.c: <PJSIP/101-00000003> Playing 'beep.ulaw' (language 'es')
[2019-05-23 16:29:56] VERBOSE[21628] manager.c: Manager 'asterisk-java' from 192.168.122.1, hanging up channel: PJSIP/101-00000003
[2019-05-23 16:29:57] VERBOSE[21929][C-00000002] res_agi.c: AGI Script Executing Application: (Playback) Options: (bizbo/tts-0a536a6f-1ee9-48e6-a4d3-18078a5ac7b2-QtkPF0l6GAghngjUonUYNA==)
[2019-05-23 16:29:57] VERBOSE[21929][C-00000002] file.c: <PJSIP/101-00000003> Playing 'bizbo/tts-0a536a6f-1ee9-48e6-a4d3-18078a5ac7b2-QtkPF0l6GAghngjUonUYNA==.slin' (language 'es')
[2019-05-23 16:29:57] VERBOSE[21929][C-00000002] res_agi.c: <PJSIP/101-00000003>AGI Script agi://192.168.122.1/activityAgi completed, returning 4
[2019-05-23 16:29:57] VERBOSE[21929][C-00000002] pbx.c: Spawn extension (asteriskjava, asterisk-java-agi, 1) exited non-zero on 'PJSIP/101-00000003'
-- Called 101
== Using SIP RTP Audio TOS bits 184
== Using SIP RTP Audio TOS bits 184 in TCLASS field.
== Using SIP RTP Audio CoS mark 5
== Using SIP RTP Video TOS bits 136
== Using SIP RTP Video TOS bits 136 in TCLASS field.
== Using SIP RTP Video CoS mark 4
-- PJSIP/101-00000003 is ringing
> 0x7fce4c0461d0 -- Strict RTP learning after remote address set to: 192.168.122.1:8000
-- PJSIP/101-00000003 answered
-- Executing ***@***.***:1] AGI("PJSIP/101-00000003", "agi://192.168.122.1/activityAgi") in new stack
> 0x7fce4c0461d0 -- Strict RTP switching to RTP target address 192.168.122.1:8000 as source
-- AGI Script Executing Application: (Playback) Options: (bizbo/tts-0a536a6f-1ee9-48e6-a4d3-18078a5ac7b2-IUx8PLHh9UDHKBxL0D_nfA==)
-- <PJSIP/101-00000003> Playing 'bizbo/tts-0a536a6f-1ee9-48e6-a4d3-18078a5ac7b2-IUx8PLHh9UDHKBxL0D_nfA==.slin' (language 'es')
> 0x7fce4c0461d0 -- Strict RTP learning complete - Locking on source address 192.168.122.1:8000
-- <PJSIP/101-00000003> Playing 'beep.ulaw' (language 'es')
-- AGI Script Executing Application: (Playback) Options: (bizbo/tts-0a536a6f-1ee9-48e6-a4d3-18078a5ac7b2-QtkPF0l6GAghngjUonUYNA==)
-- <PJSIP/101-00000003> Playing 'bizbo/tts-0a536a6f-1ee9-48e6-a4d3-18078a5ac7b2-QtkPF0l6GAghngjUonUYNA==.slin' (language 'es')
-- <PJSIP/101-00000003> Playing 'beep.ulaw' (language 'es')
-- Manager 'asterisk-java' from 192.168.122.1, hanging up channel: PJSIP/101-00000003
-- AGI Script Executing Application: (Playback) Options: (bizbo/tts-0a536a6f-1ee9-48e6-a4d3-18078a5ac7b2-QtkPF0l6GAghngjUonUYNA==)
-- <PJSIP/101-00000003> Playing 'bizbo/tts-0a536a6f-1ee9-48e6-a4d3-18078a5ac7b2-QtkPF0l6GAghngjUonUYNA==.slin' (language 'es')
-- <PJSIP/101-00000003>AGI Script agi://192.168.122.1/activityAgi completed, returning 4
== Spawn extension (asteriskjava, asterisk-java-agi, 1) exited non-zero on 'PJSIP/101-00000003'
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#297?email_source=notifications&email_token=AAG32ODWVHIB6M5WAOMA2ILPW3E4FA5CNFSM4HOYHFX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWC3OHY#issuecomment-495302431>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAG32OFGAI2CVR7P5BEMJK3PW3E4FANCNFSM4HOYHFXQ>
.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello. Asterisk-Java is such and amazing piece of code!! Thank you for the hard work. I'm building a voice bot. A batch/API initiated process starts a call to a user's mobile phone, for example, to confirm an schedule or an order reception. As soon as the user answers the phone, the bot starts talking and they get into a normal conversation.
I'm using
asteriskPBX.dial(...)to start the call (in an independent app called "dialer") and when the user answers the call, the call is attended by another independent app ("controller") which exposes a class extending Asterisk-Java's BaseAgiScript. So far, so good: the call gets done, the BaseAgiScript class receives the call control and I can send Agi actions/commands to the call via Asterisk.However, when I used
asteriskPBX.dial(...), after some seconds the call is hang up by the asterisk-java lib in dialer app with this log, so I can not continue sending commands in the controller app:I found
asteriskPBX.dialToAgiandasteriskPBX.dialLocalToAgimethods, so I thought maybe I should use one of these. UsingasteriskPBX.dialLocalToAgiallows me to continue the call (no hang up by the dialer app), however I'm still receiving an error log as follows:What's the right way to achieve my goal? (outgoing automated call attended by a bot) How should I use
dialLocalToAgiordialToAgiordialin the right way so I don't get errors? Could you provide examples similar to this case in the Wiki? If you teach me how, I'll be glad to document that in your Wiki.This is my extensions_custom.conf:
This is how I try to use
dialXXXmethods:Thanks a lot!!
PS:
When dialing over a trunk to and outside number (not an extension) the call could no be hang up by the dialer maybe because it is controlled by the remote trunk. Besides, I don't have any issue in the case the call is and inbound call, but that's another totally different use case.
Beta Was this translation helpful? Give feedback.
All reactions