[asterisk-app-dev] [asterisk-dev] Endpoints vs Extensions
Chris Bestall
chris.bestall at gmail.com
Sat Aug 23 15:57:39 CDT 2014
Thanks, that almost worked. This is what I get:
When calling from ARI (btw, I'm using Node ARI client)
Activating Stasis app 'hello'
-- Called 15555551212 at flowroute
-- Executing [15555551212 at flowroute:1]
Dial("Local/15555551212 at flowroute-00000004;2",
"PJSIP/123456789*15555551212 at flowroute") in new stack
-- Called PJSIP/123456789*15555551212 at flowroute
== Spawn extension (flowroute, 15555551212, 1) exited non-zero on
'Local/15555551212 at flowroute-00000004;2'
The number dialed never rings. Though when I do everything from CLI like
so:
sip*CLI> channel originate LOCAL/15555551212 application Noop()
-- Called 15555551212
-- Executing [15555551212 at default:1]
NoOp("Local/15555551212 at default-00000005;2", "") in new stack
-- Executing [15555551212 at default:2]
Dial("Local/15555551212 at default-00000005;2",
"PJSIP/123456789*15555551212 at flowroute") in new stack
-- Called PJSIP/123456789*15555551212 at flowroute
-- PJSIP/flowroute-00000003 is ringing
-- Local/15555551212 at default-00000005;1 is ringing
-- PJSIP/flowroute-00000003 answered Local/15555551212 at default-00000005
;2
-- Channel Local/15555551212 at default-00000005;2 joined 'simple_bridge'
basic-bridge <492c9d82-5140-40d2-aa5e-80ea9a9c5f6c>
-- Local/15555551212 at default-00000005;1 answered
[Aug 23 20:52:47] WARNING[2455]: pbx.c:10173 pbx_outgoing_exec: No such
application 'Noop()'
-- Channel Local/15555551212 at default-00000005;2 left 'simple_bridge'
basic-bridge <492c9d82-5140-40d2-aa5e-80ea9a9c5f6c>
== Spawn extension (default, 15555551212, 2) exited non-zero on
'Local/15555551212 at default-00000005;2'
the number rings.
Any ideas as to why the CLI works and ARI doesnt.
I can include my code if needed but it's basically just trying to execute
this:
newChan.originate(
{ endpoint: "LOCAL/15555551212 at flowroute", app : "hello" },
function (err, channel) {
}
})
On Fri, Aug 22, 2014 at 2:57 PM, Paul Belanger <paul.belanger at polybeacon.com
> wrote:
> On Fri, Aug 22, 2014 at 1:26 PM, Chris Bestall <chris.bestall at gmail.com>
> wrote:
> >
> > Matt, Thank you for the detailed response. I have replied to the correct
> > mailing list (asterisk-app-dev).
> >
> > I have read the ARI portion of the wiki many times, though looks like a
> lot
> > of new information is up at the URL you posted since I last visited:
> >
> https://wiki.asterisk.org/wiki/display/AST/Introduction+to+ARI+and+Channels
> >
> > I will take what you posted and read the new information and do some
> > testing.
> >
> >> What do you mean by prefix? An example of what flowroute is looking for
> >> would help here.
> >
> > Flowroute supports IP based authentication for outgoing calls, but I also
> > need to prepend a prefix before any number when sending an outgoing call.
> > The old extension looked like this:
> >
> > exten => _1NXXXXXXXXX,1,Dial(SIP/123456789*${EXTEN}@flowroute)
> >
> > Assuming 123456789 is my prefix.
> >
> > How does this translate to an endpoint? Do I need to manually prepend
> the
> > prefix when POSTing to URL. Like
> >
> > POST
> > /channels?endpoint=PJSIP/123456789*5555551212 at flowroute
> &app=my_awesome_app
> >
> If it was me, I would use a local channel endpoint, then manipulate
> the dialstring as needed. So it would look something like:
>
> /channels?endpoint=Local/5555551212 at flowroute&app=my_awesome_app
>
> Then in extensions.conf
>
> [flowroute]
> exten => _NXXNXXXXXX,1,Dial((SIP/123456789*${EXTEN}@flowroute)
>
>
> --
> Paul Belanger | PolyBeacon, Inc.
> Jabber: paul.belanger at polybeacon.com | IRC: pabelanger (Freenode)
> Github: https://github.com/pabelanger | Twitter:
> https://twitter.com/pabelanger
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-app-dev/attachments/20140823/26510dac/attachment.html>
More information about the asterisk-app-dev
mailing list