[asterisk-app-dev] Asterisk ARI, hangup crashes asterisk process

Edvin Vidmar edvinvidmar at hotmail.com
Wed Jul 30 09:02:12 CDT 2014


Hi,

I was playing with asterisk 12.2.0 and found that following ARI code crashes
asterisk process.

-          wait for call

-          create bridge

-          answer channel

-          add channel to bridge

-          play sound

 

Now before playing ends if I hang-up channel or execute hangup on channel in
code, asterisk will be crashed with following output:

 


cty-test*CLI> core show version

Asterisk 12.2.0 built by root @ cty-test on a x86_64 running Linux on
2014-05-21 07:13:29 UTC

  == WebSocket connection from '10.1.2.138:63254' for protocol '' accepted
using version '13'

Creating Stasis app 'crossty'

  == Using SIP RTP CoS mark 5

    -- Executing [100 at crossty-customers:1] NoOp("SIP/2001-00000000",
"starting...") in new stack

    -- Executing [100 at crossty-customers:2] Stasis("SIP/2001-00000000",
"crossty,testarg") in new stack

       > 0x7f823800f8d0 -- Probation passed - setting RTP source address to
10.1.2.138:50624

    -- Channel SIP/2001-00000000 joined 'simple_bridge' base-bridge
<07276367-5990-48c0-8be5-56e74301d29f>

    -- <SIP/2001-00000000> Playing 'demo-instruct.gsm' (language 'en')

[Jul 30 14:18:43] NOTICE[6089][C-00000000]: res_rtp_asterisk.c:3924
ast_rtp_read: Unknown RTP codec 126 received from '10.1.2.138:50624'

[Jul 30 14:19:01] WARNING[6089][C-00000000]: res_stasis_playback.c:247
playback_final_update: 1406722720.0: Playback failed for sound:demo-instruct

cty-test*CLI>

Disconnected from Asterisk server

Asterisk cleanly ending (0).

Executing last minute cleanups

edvin at cty-test:/var/log/asterisk$

 

 

And here is the trace of ARI rest and websocket communication.

Thanks, edvin

-           

 

debugger listening on port 5858

14:04:08: (1) [/asterisk/ari-events] Starting WebSocket at:
ws://edvin:a@10.1.1.5:8088/ari/events?app=crossty.

14:04:08: (2) [/asterisk/ari-events] WebSocket opened successfully.

14:04:18: (4) [/asterisk/ari-events] WebSocket message received.

.  {

.    "application": "crossty",

.    "type": "StasisStart",

.    "timestamp": "2014-07-30T14:04:16.453+0200",

.    "args": [

.      "testarg"

.    ],

.    "channel": {

.      "id": "1406721856.0",

.      "state": "Ring",

.      "name": "SIP/2001-00000000",

.      "caller": {

.        "name": "",

.        "number": "2001"

.      },

.      "connected": {

.        "name": "",

.        "number": ""

.      },

.      "accountcode": "",

.      "dialplan": {

.        "context": "crossty-customers",

.        "exten": "100",

.        "priority": 2

.      },

.      "creationtime": "2014-07-30T14:04:16.452+0200"

.    }

.  }

14:04:18: (6) [/asterisk/ari/request] POST /ari/bridges HTTP/1.1

14:04:18: (6) [/asterisk/ari/response] HTTP/1.1 200 OK

.  {

.    "id": "7c4759e8-d8c3-4485-8789-f290f8212f5f",

.    "channels": [],

.    "name": "",

.    "technology": "simple_bridge",

.    "bridge_class": "base",

.    "creator": "Stasis",

.    "bridge_type": "mixing"

.  }

14:04:18: (8) [/asterisk/ari/request] POST /ari/channels/1406721856.0/answer
HTTP/1.1

14:04:19: (9) [/asterisk/ari-events] WebSocket message received.

.  {

.    "application": "crossty",

.    "type": "ChannelStateChange",

.    "timestamp": "2014-07-30T14:04:16.653+0200",

.    "channel": {

.      "id": "1406721856.0",

.      "state": "Up",

.      "name": "SIP/2001-00000000",

.      "caller": {

.        "name": "",

.        "number": "2001"

.      },

.      "connected": {

.        "name": "",

.        "number": ""

.      },

.      "accountcode": "",

.      "dialplan": {

.        "context": "crossty-customers",

.        "exten": "100",

.        "priority": 2

.      },

.      "creationtime": "2014-07-30T14:04:16.452+0200"

.    }

.  }

14:04:19: (8) [/asterisk/ari/response] HTTP/1.1 204 No Content

.  null

14:04:19: (B) [/asterisk/ari/request] POST
/ari/bridges/7c4759e8-d8c3-4485-8789-f290f8212f5f/addChannel?channel=1406721
856.0 HTTP/1.1

14:04:19: (B) [/asterisk/ari/response] HTTP/1.1 204 No Content

.  null

14:04:19: (C) [/asterisk/ari/request] POST
/ari/channels/1406721856.0/play?media=sound%3Ademo-instruct HTTP/1.1

14:04:19: (C) [/asterisk/ari/response] HTTP/1.1 201 Created

.  {

.    "id": "616e6722-4837-4b2a-9036-e8f01f7ce097",

.    "media_uri": "sound:demo-instruct",

.    "target_uri": "channel:1406721856.0",

.    "language": "en",

.    "state": "queued"

.  }

14:04:19: (D) [/asterisk/ari-events] WebSocket message received.

.  {

.    "application": "crossty",

.    "type": "ChannelEnteredBridge",

.    "bridge": {

.      "id": "7c4759e8-d8c3-4485-8789-f290f8212f5f",

.      "channels": [

.        "1406721856.0"

.      ],

.      "name": "",

.      "technology": "simple_bridge",

.      "bridge_class": "base",

.      "creator": "Stasis",

.      "bridge_type": "mixing"

.    },

.    "timestamp": "2014-07-30T14:04:16.869+0200",

.    "channel": {

.      "id": "1406721856.0",

.      "state": "Up",

.      "name": "SIP/2001-00000000",

.      "caller": {

.        "name": "",

.        "number": "2001"

.      },

.      "connected": {

.        "name": "",

.        "number": ""

.      },

.      "accountcode": "",

.      "dialplan": {

.        "context": "crossty-customers",

.        "exten": "100",

.        "priority": 2

.      },

.      "creationtime": "2014-07-30T14:04:16.452+0200"

.    }

.  }

14:04:19: (E) [/asterisk/ari-events] WebSocket message received.

.  {

.    "application": "crossty",

.    "type": "PlaybackStarted",

.    "playback": {

.      "id": "616e6722-4837-4b2a-9036-e8f01f7ce097",

.      "media_uri": "sound:demo-instruct",

.      "target_uri": "channel:1406721856.0",

.      "language": "en",

.      "state": "playing"

.    }

.  }

14:04:21: (10) [/asterisk/ari/request] DELETE /ari/channels/1406721856.0
HTTP/1.1

14:04:21: (10) [/asterisk/ari/response] HTTP/1.1 204 No Content

.  null

14:04:21: (11) [/asterisk/ari-events] WebSocket message received.

.  {

.    "channel": {

.      "id": "1406721856.0",

.      "state": "Up",

.      "name": "SIP/2001-00000000",

.      "caller": {

.        "name": "",

.        "number": "2001"

.      },

.      "connected": {

.        "name": "",

.        "number": ""

.      },

.      "accountcode": "",

.      "dialplan": {

.        "context": "crossty-customers",

.        "exten": "100",

.        "priority": 2

.      },

.      "creationtime": "2014-07-30T14:04:16.452+0200"

.    },

.    "cause": 32,

.    "timestamp": "2014-07-30T14:04:18.885+0200",

.    "soft": true,

.    "type": "ChannelHangupRequest",

.    "application": "crossty"

.  }

14:04:21: (12) [/asterisk/ari-events] WebSocket message received.

.  {

.    "application": "crossty",

.    "type": "PlaybackFinished",

.    "playback": {

.      "id": "616e6722-4837-4b2a-9036-e8f01f7ce097",

.      "media_uri": "sound:demo-instruct",

.      "target_uri": "channel:1406721856.0",

.      "language": "en",

.      "state": "done"

.    }

.  }

14:04:21: (14) [/asterisk/ari-events] WebSocket message received.

.  {

.    "application": "crossty",

.    "type": "StasisEnd",

.    "timestamp": "2014-07-30T14:04:18.886+0200",

.    "channel": {

.      "id": "1406721856.0",

.      "state": "Up",

.      "name": "SIP/2001-00000000",

.      "caller": {

.        "name": "",

.        "number": "2001"

.      },

.      "connected": {

.        "name": "",

.        "number": ""

.      },

.      "accountcode": "",

.      "dialplan": {

.        "context": "crossty-customers",

.        "exten": "100",

.        "priority": 2

.      },

.      "creationtime": "2014-07-30T14:04:16.452+0200"

.    }

.  }

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-app-dev/attachments/20140730/901778d7/attachment-0001.html>


More information about the asterisk-app-dev mailing list