Re: ARI Bridge and Dial

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I looked at the websocket transactions thru wireshark and noticed the websocket requests which were failing were getting broken up into 2 separate packets (a PlaybackFinished which has a relatively large payload actually came across as 2 separate packets). I moved the application out of my local environment off of a different vlan and onto the glassfish app server where it runs as a long-running application. The problem disappeared and the application functioned normally. 

I did not see that Illegal UTF-8 Sequence error coming from Asterisk which lead me to believe there was something in the received packets which my application (or the underlying java websocket lib) could not handle caused by a local network routing/switching issue.

Thanks for all the help - as you can imagine there isn't much info out there on ARI issues and really not much available about this specific web socket exception.

-Jim

On Mon, Jun 2, 2014 at 6:38 PM, <asterisk-app-dev-request@xxxxxxxxxxxxxxxx> wrote:
Send asterisk-app-dev mailing list submissions to
        asterisk-app-dev@xxxxxxxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev
or, via email, send a message with subject or body 'help' to
        asterisk-app-dev-request@xxxxxxxxxxxxxxxx

You can reach the person managing the list at
        asterisk-app-dev-owner@xxxxxxxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of asterisk-app-dev digest..."


Today's Topics:

   1. Re: ARI Bridge and Dial (Jim Black)
   2. Re: ARI Bridge and Dial (Matthew Jordan)
   3. Re: ARI Bridge and Dial (Samuel Galarneau)


----------------------------------------------------------------------

Message: 1
Date: Mon, 2 Jun 2014 16:28:35 -0400
From: Jim Black <jblack@xxxxxxxxx>
To: asterisk-app-dev@xxxxxxxxxxxxxxxx
Subject: Re: ARI Bridge and Dial
Message-ID:
        <CAMXHdJQfGmQCRHE6Pn14RbP-0AZ+YY0Dea2ccUoSYL13t9Zpww@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="utf-8"

Thanks again for the quick reply. I am using Java Websockets Java EE 7 JSR
356 - Tyrus part of the Oracle Glassfish package. I have retested on
various servers and am seeing the same behavior. The call itself is fine
but when one party hangs up I get the exception (onClose) from Asterisk. I
am not sending a corresponding ARI event - the Hangup or StasisEnd have not
yet fired.

The object I capture in the onClose has the following info:

 CloseReason object:
closeCode:
code:1007
Name:NOT_CONSISTENT
reasonPhrase:Illegal UTF-8 Sequence




On Sat, May 31, 2014 at 1:00 PM, <asterisk-app-dev-request@xxxxxxxxxxxxxxxx>
wrote:

> Send asterisk-app-dev mailing list submissions to
>         asterisk-app-dev@xxxxxxxxxxxxxxxx
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev
> or, via email, send a message with subject or body 'help' to
>         asterisk-app-dev-request@xxxxxxxxxxxxxxxx
>
> You can reach the person managing the list at
>         asterisk-app-dev-owner@xxxxxxxxxxxxxxxx
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of asterisk-app-dev digest..."
>
>
> Today's Topics:
>
>    1. Re: ARI Bridge and Dial (Jim Black)
>    2. Re: ARI Bridge and Dial (Matthew Jordan)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 30 May 2014 17:45:06 -0400
> From: Jim Black <jblack@xxxxxxxxx>
> To: asterisk-app-dev@xxxxxxxxxxxxxxxx
> Subject: Re: ARI Bridge and Dial
> Message-ID:
>         <CAMXHdJSjrKmhRdf41sWiMOXfY6kmDNvLiUMmACdz72Oat7=
> crQ@xxxxxxxxxxxxxx>
> Content-Type: text/plain; charset="utf-8"
>
> The example you gave really helped and I am able to complete a call.
> However, when the call-ee hangs-up my websocket listener gets an OnClose
> message with a 1007 - Illegal UTF-8 Sequence. I don't understand why it
> would be throwing this since I am not sending anything back from the
> websocket listener. Sometimes I get the ChannelHangupRequest and StasisEnd
> events before it closes... other times it just closes immediately after the
> hangup.
>
> I just moved servers and it wasn't exhibiting this type of behavior prior
> to the move. Any ideas are appreciated!!
>
> -Jim
>
>
>
> On Wed, May 14, 2014 at 4:46 PM, Jim Black <jblack@xxxxxxxxx> wrote:
>
> > Thanks for the quick response. I mistakenly assumed the create bridge
> > command took a list of types. After taking a look at the swagger UI I
> > figured out it was merely a list of acceptable values. I had an issue
> with
> > de-serializing the json response which confused the matter. I wrote a
> > custom deserializer and it works fine now.
> >
> > Thanks for the example from your python code. I followed that example and
> > it worked fine. Considering a bridge needs to be created for a simple
> dial
> > application - do you see any pitfalls of creating a pool of bridges for
> the
> > application to share - assuming I take care of the bridge-state
> internally?
> >
> > Also... with ARI, I see no hooks into provisioning devices, I assume I
> > need to use AMI *updateconfig*? Thanks!!!
> >
> >
> >> ------------------------------
> >>
> >> Message: 2
> >> Date: Thu, 8 May 2014 14:43:17 -0500
> >> From: Samuel Galarneau <sgalarneau@xxxxxxxxxx>
> >> To: Asterisk Application Development discussion
> >>         <asterisk-app-dev@xxxxxxxxxxxxxxxx>
> >> Subject: Re: ARI Bridge and Dial
> >> Message-ID:
> >>         <CAGZGSQ7Z8AeP7VBvT1o_aRRJJDS+8zY2J=
> >> ubAqn-1hBDMLmOXA@xxxxxxxxxxxxxx>
> >> Content-Type: text/plain; charset="utf-8"
> >>
> >> Jim, please see my responses in line.
> >>
> >>
> >> > Hi,
> >> >
> >> > I have a few questions regarding ARI after experimenting with it for a
> >> > while.
> >> >
> >> > Bridging. When I create a bridge, I provide a single type ('mixing') I
> >> get
> >> > a '200' OK back but when I retrieve details on the bridge, the type
> >> 'list'
> >> > is NULL. The bridge seems to work - but I wanted to make sure there
> >> wasn't
> >> > an issue.
> >> >
> >>
> >> What do you mean by type 'list'? What ARI operation are you using to get
> >> details for the bridge?
> >>
> >>
> >> >
> >> > Let's say I want to create a simple Dial application. By trial and
> >> error,
> >> > what seems to work is a call comes into my dial plan and off to my
> app.
> >> I
> >> > answer, create a bridge and add this channel to the bridge. I then
> >> create a
> >> > channel for the destination SIP when it picks-up and add this to the
> >> > bridge. I should now have 2 connected phones. Thanks!!
> >> >
> >>
> >> This sounds about right. After the first channel enters your
> application,
> >> you need to originate a call to the second channel and then put them
> both
> >> in the bridge. Once that is done, getting the details of that bridge
> will
> >> show both channels under the channels property, which will be an array
> of
> >> channel ids. Please see
> >>
> >>
> https://github.com/asterisk/ari-py/blob/master/examples/originate_example.pyfor
> >> an example of how to do this using ari-py. The same functionality
> >> could
> >> be accomplished by making direct calls to ARI of course.
> >>
> >>
> >> Samuel Fortier-Galarneau
> >> -------------- next part --------------
> >> An HTML attachment was scrubbed...
> >> URL: <
> >>
> http://lists.digium.com/pipermail/asterisk-app-dev/attachments/20140508/f4902357/attachment-0001.html
> >> >
> >>
> >> ------------------------------
> >>
> >> _______________________________________________
> >> asterisk-app-dev mailing list
> >> asterisk-app-dev@xxxxxxxxxxxxxxxx
> >> http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev
> >>
> >>
> >> End of asterisk-app-dev Digest, Vol 8, Issue 3
> >> **********************************************
> >>
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.digium.com/pipermail/asterisk-app-dev/attachments/20140530/57c40393/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Fri, 30 May 2014 17:57:03 -0500
> From: Matthew Jordan <mjordan@xxxxxxxxxx>
> To: Asterisk Application Development discussion
>         <asterisk-app-dev@xxxxxxxxxxxxxxxx>
> Subject: Re: ARI Bridge and Dial
> Message-ID:
>         <
> CAN2PU+4jpRLkwq4Ys6D6uLaNVeu61nqviT+6bNn3Mepmw_t_Sw@xxxxxxxxxxxxxx>
> Content-Type: text/plain; charset=UTF-8
>
> On Fri, May 30, 2014 at 4:45 PM, Jim Black <jblack@xxxxxxxxx> wrote:
> > The example you gave really helped and I am able to complete a call.
> > However, when the call-ee hangs-up my websocket listener gets an OnClose
> > message with a 1007 - Illegal UTF-8 Sequence. I don't understand why it
> > would be throwing this since I am not sending anything back from the
> > websocket listener. Sometimes I get the ChannelHangupRequest and
> StasisEnd
> > events before it closes... other times it just closes immediately after
> the
> > hangup.
> >
> > I just moved servers and it wasn't exhibiting this type of behavior
> prior to
> > the move. Any ideas are appreciated!!
> >
> > -Jim
> >
>
> What WebSocket library are you using?
>
> Can you provide a dump of what the WebSocket receives?
>
>
>
> ------------------------------
>
> _______________________________________________
> asterisk-app-dev mailing list
> asterisk-app-dev@xxxxxxxxxxxxxxxx
> http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev
>
>
> End of asterisk-app-dev Digest, Vol 8, Issue 8
> **********************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-app-dev/attachments/20140602/6f5154b1/attachment-0001.html>

------------------------------

Message: 2
Date: Mon, 2 Jun 2014 16:45:02 -0500
From: Matthew Jordan <mjordan@xxxxxxxxxx>
To: Asterisk Application Development discussion
        <asterisk-app-dev@xxxxxxxxxxxxxxxx>
Subject: Re: ARI Bridge and Dial
Message-ID:
        <CAN2PU+6uVcwMHrAC_twtNmLZfWLNnD3FWdL62LisgP1jDgoGaA@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset=UTF-8

On Mon, Jun 2, 2014 at 3:28 PM, Jim Black <jblack@xxxxxxxxx> wrote:
> Thanks again for the quick reply. I am using Java Websockets Java EE 7 JSR
> 356 - Tyrus part of the Oracle Glassfish package. I have retested on various
> servers and am seeing the same behavior. The call itself is fine but when
> one party hangs up I get the exception (onClose) from Asterisk. I am not
> sending a corresponding ARI event - the Hangup or StasisEnd have not yet
> fired.
>
> The object I capture in the onClose has the following info:
>
>  CloseReason object:
> closeCode:
> code:1007
> Name:NOT_CONSISTENT
> reasonPhrase:Illegal UTF-8 Sequence
>
>
>

The only way we'll know what is causing this is if we figure out what
Asterisk sent to your client over the WebSocket connection. Wireshark
should show that; hopefully, the client library also contains
debugging capabilities allowing you to dump out the bytes received.

--
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org



------------------------------

Message: 3
Date: Mon, 2 Jun 2014 17:39:02 -0500
From: Samuel Galarneau <sgalarneau@xxxxxxxxxx>
To: Asterisk Application Development discussion
        <asterisk-app-dev@xxxxxxxxxxxxxxxx>
Subject: Re: ARI Bridge and Dial
Message-ID:
        <CAGZGSQ6PrWs-4i4Qc768AXH66vLRN=M+t0j7yqd-YJy+f_FexQ@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="utf-8"

On Mon, Jun 2, 2014 at 4:45 PM, Matthew Jordan <mjordan@xxxxxxxxxx> wrote:

> On Mon, Jun 2, 2014 at 3:28 PM, Jim Black <jblack@xxxxxxxxx> wrote:
> > Thanks again for the quick reply. I am using Java Websockets Java EE 7
> JSR
> > 356 - Tyrus part of the Oracle Glassfish package. I have retested on
> various
> > servers and am seeing the same behavior. The call itself is fine but when
> > one party hangs up I get the exception (onClose) from Asterisk. I am not
> > sending a corresponding ARI event - the Hangup or StasisEnd have not yet
> > fired.
> >
> > The object I capture in the onClose has the following info:
> >
> >  CloseReason object:
> > closeCode:
> > code:1007
> > Name:NOT_CONSISTENT
> > reasonPhrase:Illegal UTF-8 Sequence
> >
> >
> >
>
> The only way we'll know what is causing this is if we figure out what
> Asterisk sent to your client over the WebSocket connection. Wireshark
> should show that; hopefully, the client library also contains
> debugging capabilities allowing you to dump out the bytes received.


A Wireshark capture would be very helpful here. I was able to connect to a
local instance of Asterisk running ARI using version 1.6 of the Tyrus
standalone client and was able to consistently get StasisStart and
StasisEnd messages when originating calls using ARI.

--

Samuel Fortier-Galarneau
Digium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at:  www.digium.com  & www.asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-app-dev/attachments/20140602/fedea33a/attachment.html>

------------------------------

_______________________________________________
asterisk-app-dev mailing list
asterisk-app-dev@xxxxxxxxxxxxxxxx
http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev


End of asterisk-app-dev Digest, Vol 9, Issue 1
**********************************************

_______________________________________________
asterisk-app-dev mailing list
asterisk-app-dev@xxxxxxxxxxxxxxxx
http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev

[Index of Archives]     [Asterisk SS7]     [Asterisk Announcements]     [Asterisk Users]     [PJ SIP]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Linux API]

  Powered by Linux