Antony Stone
2021-Aug-20 20:24 UTC
[asterisk-users] Between a dumb client and a capable server...
On Friday 20 August 2021 at 19:06:09, George Joseph wrote:> On Fri, Aug 20, 2021 at 8:33 AM Antony Stone wrote: > > > > So, if I have Asterisk registered as a SIP client to some remote server, > > how can I get Asterisk to tell that remote server to put the call on hold > > (which a standard SIP telephone would normally do by sending a ReINVITE > > with the SDP parameter 'sendonly')? > > On the outgoing pjsip endpoint, set "moh_passthrough = yes". If you then > put incoming call on hold, a reinvite with sendonly will be sent to the > upstream server.So... how do I put the incoming call on hold, when the dumb client I'm starting from cannot do that bit? I already know (from this list) that Asterisk as a SIP client cannot do ore than (a) place a call, (b) answer a call, and (c) hang up a call. So, I'm still intrigued as to how you think this might be possible. If it *is* possible, I'd be really interested, but all my researches so far suggest that Asterisk, acting in the middle like this, just cannot add the necessary "put call on hold" which the original client cannot do. Antony. -- Some things the German language doesn't easily distinguish between: - slugs and snails - cucumbers and gherkins - snakes and queues - wearing something, or carrying it - mothers and nuts - driving a car, riding a bicycle, or travelling by train - a man and a husband - a woman and a wife - changing clothes and moving house - pockets and bags Please reply to the list; please *don't* CC me.
Eric Wieling
2021-Aug-20 20:32 UTC
[asterisk-users] Between a dumb client and a capable server...
On 8/20/21 4:24 PM, Antony Stone wrote:> On Friday 20 August 2021 at 19:06:09, George Joseph wrote: > >> On Fri, Aug 20, 2021 at 8:33 AM Antony Stone wrote: >>> >>> So, if I have Asterisk registered as a SIP client to some remote server, >>> how can I get Asterisk to tell that remote server to put the call on hold >>> (which a standard SIP telephone would normally do by sending a ReINVITE >>> with the SDP parameter 'sendonly')? >> >> On the outgoing pjsip endpoint, set "moh_passthrough = yes". If you then >> put incoming call on hold, a reinvite with sendonly will be sent to the >> upstream server. > > So... how do I put the incoming call on hold, when the dumb client I'm > starting from cannot do that bit? > > I already know (from this list) that Asterisk as a SIP client cannot do ore > than (a) place a call, (b) answer a call, and (c) hang up a call. > > So, I'm still intrigued as to how you think this might be possible. > > If it *is* possible, I'd be really interested, but all my researches so far > suggest that Asterisk, acting in the middle like this, just cannot add the > necessary "put call on hold" which the original client cannot do. >With Asterisk, keep Asterisk in the media path with direct_media=yes and use DTMF to hold, transfer, and other features using features.conf. Asterisk has to stay in the media path when NAT is involved anyway. I doubt anything except Asterisk or other B2BUA software can do what you want. -- http://help.nyigc.net/
George Joseph
2021-Aug-21 00:35 UTC
[asterisk-users] Between a dumb client and a capable server...
On Fri, Aug 20, 2021 at 2:25 PM Antony Stone < Antony.Stone at asterisk.open.source.it> wrote:> On Friday 20 August 2021 at 19:06:09, George Joseph wrote: > > > On Fri, Aug 20, 2021 at 8:33 AM Antony Stone wrote: > > > > > > So, if I have Asterisk registered as a SIP client to some remote > server, > > > how can I get Asterisk to tell that remote server to put the call on > hold > > > (which a standard SIP telephone would normally do by sending a ReINVITE > > > with the SDP parameter 'sendonly')? > > > > On the outgoing pjsip endpoint, set "moh_passthrough = yes". If you > then > > put incoming call on hold, a reinvite with sendonly will be sent to the > > upstream server. > > So... how do I put the incoming call on hold, when the dumb client I'm > starting from cannot do that bit? > > I already know (from this list) that Asterisk as a SIP client cannot do > ore > than (a) place a call, (b) answer a call, and (c) hang up a call. >Yeah? Who told you that? :)> > So, I'm still intrigued as to how you think this might be possible. > > If it *is* possible, I'd be really interested, but all my researches so > far > suggest that Asterisk, acting in the middle like this, just cannot add the > necessary "put call on hold" which the original client cannot do. >Well, I can't tell you how you should do it but I can tell you how I might attempt it based on what I know of your situation... - Create an ARI application in whatever scripting language you like that registers itself to Asterisk as "my3pcc" and also opens an HTTP listener for incoming 3PCC commands from your web app. - In your dialplan, send all incoming calls to Stasis(my3pcc). - The event listener (web socket) in your app tells you of the incoming call. - You create an outgoing channel to the upstream SIP server and bridge the two. - Your web app can get the channel id from your ARI app and tell your ARI app to do something with it, say place it on hold. - Your ARI app calls the /channels/{channelId}/hold REST api. It's actually a bit more complicated than that because you have to deal with directionality. You may have to create an intermediate local channel to make sure the hold is sent in the correct direction. You'd have to experiment a bit. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20210820/7da3962c/attachment.html>