Repository navigation
Added support for late SDP negotiation for INVITE and reINVITE. #5265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
5aefa0a
77ed514
3374357
1a9dd11
a6523ae
8fd39b2
6df1b8e
b57476e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -221,6 +221,11 @@ struct SdpSession | |
| void *pjSdpSession; | ||
|
|
||
| public: | ||
| /** | ||
| * Default constructor | ||
| */ | ||
| SdpSession() : pjSdpSession(nullptr) {} | ||
|
|
||
| /** | ||
| * Convert from pjsip | ||
| */ | ||
|
|
@@ -833,6 +838,36 @@ struct OnCallSdpCreatedParam | |
| SdpSession remSdp; | ||
| }; | ||
|
|
||
| /** | ||
| * This structure contains parameters for Call::onCallSendAck() callback. | ||
| */ | ||
| struct OnCallSendAckParam | ||
| { | ||
| /** | ||
| * The 2xx response for INVITE that triggered the need to send an ACK | ||
| * request. | ||
| */ | ||
| SipRxData rdata; | ||
|
|
||
| /** | ||
| * Output: application sets this to true if it has sent (or will send) | ||
| * the ACK itself, to suppress the automatic ACK sending. Default is false, | ||
| * i.e. the library sends the ACK after this callback returns. | ||
| */ | ||
| bool suppressSendAck; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 4. This documentation belongs to a different callback, and following it sends two ACKs. "suppress the automatic session termination and keep the call alive ... the library will terminate the call as per default behavior" is copy-pasted from a terminate-session parameter. The field actually suppresses the automatic ACK. The practical consequence: an application that reads this will call Suggest something like: "Output: application sets this to true if it has sent (or will send) the ACK itself, to suppress the automatic ACK sending. Default is false, i.e. the library sends the ACK after this callback returns."
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed comment |
||
|
|
||
| /** | ||
| * The CSeq of the 2xx response. | ||
| */ | ||
| pj_int32_t cseq; | ||
|
|
||
| /** | ||
| * Default constructor | ||
| */ | ||
| OnCallSendAckParam() : suppressSendAck(false), cseq(-1) | ||
| {} | ||
| }; | ||
|
|
||
| /** | ||
| * This structure contains parameters for Call::onStreamPreCreate() | ||
| * callback. | ||
|
|
@@ -1770,6 +1805,27 @@ class Call | |
| */ | ||
| void hangup(const CallOpParam &prm) PJSUA2_THROW(Error); | ||
|
|
||
| /** | ||
| * Create and send an ACK request for the 2xx response, optionally with | ||
| * an SDP answer \a sdp attached to it. Application would normally call | ||
| * this from within onCallSendAck(), to manually take over the ACK | ||
| * transmission, e.g. to attach an SDP answer to the ACK for a late | ||
| * SDP offer received in the 2xx response. | ||
| * When called synchronously from onCallSendAck(), this method may only | ||
| * be used on the Call whose ACK triggered the callback; another Call | ||
| * fails with PJ_EINVALIDOP. | ||
| * | ||
| * @param cseq CSeq of the 2xx response that triggered the need to | ||
| * send an ACK request; normally this is the CSeq of | ||
| * the \a rdata received in the onCallSendAck() | ||
| * callback. | ||
| * @param sdp Optional SDP answer to be attached to the ACK | ||
| * request. If its wholeSdp is empty, no SDP body | ||
| * will be attached. | ||
| */ | ||
| void sendAck(int cseq, const SdpSession &sdp = SdpSession()) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 9. The
((pjsip_rx_data*)prm.rdata.pjRxData)->msg_info.cseq->cseqThat's the one piece of raw PJSIP a pjsua2 user shouldn't need. Either add
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added cseq into
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3. Mirror the same-call-id restriction here.
A PJSUA2 application doing exactly the 3PCC bridging that the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added comment |
||
| PJSUA2_THROW(Error); | ||
|
|
||
| /** | ||
| * Put the specified call on hold. This will send re-INVITE with the | ||
| * appropriate SDP to inform remote that the call is being put on hold. | ||
|
|
@@ -2131,6 +2187,22 @@ class Call | |
| virtual void onCallSdpCreated(OnCallSdpCreatedParam &prm) | ||
| { PJ_UNUSED_ARG(prm); } | ||
|
|
||
| /** | ||
| * Notify application when the framework needs to send an ACK request | ||
| * after it receives an incoming 2xx response for INVITE (e.g. when the | ||
| * 2xx response carries a late SDP offer). The default implementation | ||
| * does nothing and lets the framework send the ACK. Application can | ||
| * set prm.suppressSendAck to true and then the application is responsible | ||
| * for sending the ACK. | ||
| * | ||
| * This callback is enabled only when | ||
| * UaConfig::enableCallSendAckCallback is set before Endpoint::libInit(). | ||
| * | ||
| * @param prm Callback parameter. | ||
| */ | ||
| virtual void onCallSendAck(OnCallSendAckParam &prm) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 4. The default implementation can throw through C frames.
This is reachable in normal operation:
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Default implementation does not throw.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 8. This description doesn't match the implementation. "The default implementation simply sends the ACK without any SDP answer, using The behaviour is right; only the text is wrong. Combined with comment 4, though, an application author reading this header can't work out who owns the ACK — and an override that calls the base implementation expecting it to send will get nothing.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed description |
||
| { PJ_UNUSED_ARG(prm); } | ||
|
|
||
| /** | ||
| * Notify application when an audio media session is about to be created | ||
| * (as opposed to onStreamCreated(), which is called *after* the session | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10.
--dummy-codecsisn't registered anywhere else.It's in the option table and parsed at line 1733, but absent from
usage()(where--custom-sdpappears, line 188) and from the settings serializer near line 2802.So it doesn't show up in
--help, and it's silently dropped across an app restart or a config dump-and-reload.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed