<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 20, 2021 at 2:25 PM Antony Stone <<a href="mailto:Antony.Stone@asterisk.open.source.it">Antony.Stone@asterisk.open.source.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Friday 20 August 2021 at 19:06:09, George Joseph wrote:<br>
<br>
> On Fri, Aug 20, 2021 at 8:33 AM Antony Stone wrote:<br>
> > <br>
> > So, if I have Asterisk registered as a SIP client to some remote server,<br>
> > how can I get Asterisk to tell that remote server to put the call on hold<br>
> > (which a standard SIP telephone would normally do by sending a ReINVITE<br>
> > with the SDP parameter 'sendonly')?<br>
> <br>
> On the outgoing pjsip endpoint, set "moh_passthrough = yes".   If you then<br>
> put incoming call on hold, a reinvite with sendonly will be sent to the<br>
> upstream server.<br>
<br>
So... how do I put the incoming call on hold, when the dumb client I'm <br>
starting from cannot do that bit?<br>
<br>
I already know (from this list) that Asterisk as a SIP client cannot do ore <br>
than (a) place a call, (b) answer a call, and (c) hang up a call.<br></blockquote><div><br></div><div>Yeah?  Who told you that? :) </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
So, I'm still intrigued as to how you think this might be possible.<br>
<br>
If it *is* possible, I'd be really interested, but all my researches so far <br>
suggest that Asterisk, acting in the middle like this, just cannot add the <br>
necessary "put call on hold" which the original client cannot do.<br></blockquote><div><br></div><div>Well, I can't tell you how you should do it but I can tell you how I might</div><div>attempt it based on what I know of your situation...</div><div><ul><li>Create an ARI application in whatever scripting language you like that<br>registers itself to Asterisk as "my3pcc" and also opens an HTTP listener<br>for incoming 3PCC commands from your web app.<br></li><li>In your dialplan, send all incoming calls to Stasis(my3pcc).</li><li>The event listener (web socket) in your app tells you of the incoming call.</li><li>You create an outgoing channel to the upstream SIP server and bridge<br>the two.</li><li>Your web app can get the channel id from your ARI app and tell your ARI<br>app to do something with it, say place it on hold.<br></li><li>Your ARI app calls the  /channels/{channelId}/hold REST api.</li></ul></div><div>It's actually a bit more complicated than that because you have to deal</div><div>with directionality.  You may have to create an intermediate local channel</div><div>to make sure the hold is sent in the correct direction.  You'd have to</div><div>experiment a bit.</div><div> <br></div></div></div>