@@ -4782,6 +4782,28 @@ typedef struct pjsua_acc_config
47824782 */
47834783 pj_bool_t use_shared_auth ;
47844784
4785+ /**
4786+ * Specify whether incoming SIP MESSAGE requests are responded
4787+ * automatically.
4788+ *
4789+ * If set to PJ_TRUE (automatic response), incoming MESSAGE requests
4790+ * will be responded to immediately with SIP 200 OK (legacy behavior).
4791+ *
4792+ * If set to PJ_FALSE, incoming MESSAGE requests will create UAS
4793+ * transactions supporting explicit responses and defering responses.
4794+ *
4795+ * The application may either respond immediately in the on_pager() or
4796+ * on_pager2() callbacks by using pjsua_acc_send_response(), or defer the
4797+ * response to later time. In the latter case, the application must clone the
4798+ * rx_data by calling pjsip_rx_data_clone() within on_pager() or on_pager2()
4799+ * callbacks. The cloned rx_data and the pointer to the transaction can then
4800+ * be used later for pjsua_acc_send_response().
4801+ *
4802+ * Default: PJ_TRUE (automatic response for backward compatibility)
4803+ */
4804+ pj_bool_t auto_repond_sip_message ;
4805+
4806+
47854807} pjsua_acc_config ;
47864808
47874809
@@ -5116,6 +5138,34 @@ PJ_DECL(pj_status_t) pjsua_acc_get_config(pjsua_acc_id acc_id,
51165138PJ_DECL (pj_status_t ) pjsua_acc_modify (pjsua_acc_id acc_id ,
51175139 const pjsua_acc_config * acc_cfg );
51185140
5141+ /**
5142+ * Send response to incoming request (e.g. SIP MESSAGE) that was
5143+ * processed by a UAS transaction.
5144+ *
5145+ * This function can be used when the application wants to defer a
5146+ * response to an incoming request that was processed by
5147+ * a UAS transaction.
5148+ *
5149+ * @param acc_id The account that will send the response.
5150+ * @param rdata The received request data.
5151+ * @param tsx The UAS transaction that was created for the incoming
5152+ * request.
5153+ * @param st_code Status code to be sent (e.g., 200 for OK, 400 for
5154+ * Bad Request, etc.).
5155+ * @param st_text Optional status text. If NULL, default status text for
5156+ * the status code will be used.
5157+ * @param msg_data Optional headers etc. to be added to the outgoing
5158+ * response, or NULL if no custom header is desired.
5159+ *
5160+ * @return PJ_SUCCESS on success, or the appropriate error code.
5161+ */
5162+ PJ_DECL (pj_status_t ) pjsua_acc_send_response (pjsua_acc_id acc_id ,
5163+ pjsip_rx_data * rdata ,
5164+ pjsip_transaction * tsx ,
5165+ int st_code ,
5166+ const pj_str_t * st_text ,
5167+ const pjsua_msg_data * msg_data );
5168+
51195169/**
51205170 * Send arbitrary out-of-dialog requests from an account, e.g. OPTIONS.
51215171 * The application should use the call or presence API to create
@@ -5125,7 +5175,8 @@ PJ_DECL(pj_status_t) pjsua_acc_modify(pjsua_acc_id acc_id,
51255175 * @param dest_uri URI to be put into the To header (normally is the same
51265176 * as the target URI).
51275177 * @param method The SIP method of the request.
5128- * @param options This is for future use (currently only NULL is supported).
5178+ * @param options This is for future use (currently only NULL is
5179+ * supported).
51295180 * @param token Arbitrary token (user data owned by the application)
51305181 * to be passed back to the application in callback
51315182 * on_acc_send_request().
@@ -7284,7 +7335,6 @@ PJ_DECL(pj_status_t) pjsua_im_typing(pjsua_acc_id acc_id,
72847335 const pjsua_msg_data * msg_data );
72857336
72867337
7287-
72887338/**
72897339 * @}
72907340 */
0 commit comments