[asterisk-users] Call Hold / Transfer via AMI
Antony Stone
Antony.Stone at asterisk.open.source.it
Mon Jul 19 05:25:35 CDT 2021
On Monday 19 July 2021 at 11:59:34, Naveen Albert wrote:
> I'm not sure I fully understand the entire question.
> If you have full AMI access, why not send the ShowDialPlan AMI action to
> see the dial plan?
1. How would seeing the dial plan help me to put a call on hold?
2. The result is pretty much useless to me because it's all done via AGI.
Antony.
> On 7/19/2021 4:02 AM, Antony Stone wrote:
> > Hi.
> >
> > Nobody has any ideas?
> >
> > I have an AMI login to a proprietary PBX (ie: I can't see or modify the
> > dial plan). I can subscribe to all events, get channel numbers when
> > calls are set up, etc. I can issue AMI commands, originate calls...
> >
> > How can I use AMI to put a call on hold, and then either resume it, or
> > perform a transfer?
> >
> > On Thursday 15 July 2021 at 15:01:41, Antony Stone wrote:
> >> Hi.
> >>
> >> I have the following situation:
> >>
> >> An Asterisk 16 server on which I have complete control of the dialplan,
> >> and which has (a) a SIP trunk to a PSTN gateway provider, and (b)
> >> several SIP credentials for accounts (extensions) on another Asterisk
> >> server. For this example I have SIP username and password for
> >> extension 234 on that server.
> >>
> >> That "other Asterisk server" is also Asterisk 16, but is a proprietary
> >> PBX which I cannot even see the dialplan of, let alone modify it. I
> >> do, however, have full access to the AMI interface on that PBX, and I
> >> can write scripts (eg: in Perl) on my own server and connect to the
> >> PBX's AMI.
> >>
> >> I get an inbound call on my SIP trunk, and I need to dial it on to
> >> extension 456 on the PBX, from extension 234. So far, so good, I can do
> >> all this. The incoming call arrives, I use the SIP credentials for
> >> extension 234 to dial 456, and the call gets answered by 456, who sees
> >> Caller ID 234.
> >>
> >> Then I need to put 456 on hold, so that they get the hold music which is
> >> configured on the (proprietary) PBX, and perhaps I then need to dial to
> >> a different number from extension 234, and maybe ultimately transfer
> >> the call. Alternatively, I might simply want to resume the call that
> >> was put on hold.
> >>
> >> Putting a call on hold and then having the option to transfer it to
> >> another number is easy with a SIP phone, but I need to do it for the
> >> call which my Asterisk server (acting as a SIP client to the PBX) has
> >> initiated.
> >>
> >> I can't do the hold function on my own Asterisk server because that
> >> would not generate the correct hold music for the person on 456.
> >>
> >> Also, if I transfer the call (so that 456 is now speaking to some other
> >> number which I dialled whilst on hold) using my own Asterisk server, I
> >> would end up with two calls in progress between my server and the PBX,
> >> whereas I want the PBX to completely handle the transferred call, and
> >> mine (which took the original incoming call on the SIP trunk) to have
> >> nothing further to do with it.
> >>
> >> I can find AMI commands such as Atxfer, BlindTransfer, and Redirect.
> >> All of these are fine if I want to actually transfer a call, but how do
> >> I simply tell the proprietary PBX to put a call on hold and play the
> >> configured music?
> >>
> >> I hope this is clear - feel free to ask any questions if not.
> >>
> >> Thanks,
> >>
> >>
> >> Antony.
--
“If code doesn’t receive constant love, it turns to shit.”
- Brad Fitzpatrick, Google engineer
Please reply to the list;
please *don't* CC me.
More information about the asterisk-users
mailing list