mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
add sip query session api
This commit is contained in:
parent
1e0474e470
commit
f74a398c1b
1 changed files with 26 additions and 5 deletions
|
@ -1725,7 +1725,7 @@ srs_error_t SrsGoApiGb28181::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessa
|
|||
SrsJsonArray* arr = SrsJsonAny::array();
|
||||
data->set("channels", arr);
|
||||
|
||||
uint32_t code = _srs_gb28181->queue_stream_channel(id, arr);
|
||||
uint32_t code = _srs_gb28181->query_stream_channel(id, arr);
|
||||
if (code != ERROR_SUCCESS) {
|
||||
return srs_api_response_code(w, r, code);
|
||||
}
|
||||
|
@ -1733,7 +1733,8 @@ srs_error_t SrsGoApiGb28181::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessa
|
|||
return srs_api_response(w, r, obj->dumps());
|
||||
}
|
||||
else if(action == "sip_invite"){
|
||||
if (id.empty()){
|
||||
string chid = r->query_get("chid");
|
||||
if (id.empty() || chid.empty()){
|
||||
return srs_api_response_code(w, r, ERROR_GB28181_VALUE_EMPTY);
|
||||
}
|
||||
|
||||
|
@ -1746,15 +1747,16 @@ srs_error_t SrsGoApiGb28181::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessa
|
|||
|
||||
|
||||
|
||||
int code = _srs_gb28181->notify_sip_invite(id, ip, _port, _ssrc);
|
||||
int code = _srs_gb28181->notify_sip_invite(id, ip, _port, _ssrc, chid);
|
||||
return srs_api_response_code(w, r, code);
|
||||
}
|
||||
else if(action == "sip_bye"){
|
||||
if (id.empty()){
|
||||
string chid = r->query_get("chid");
|
||||
if (id.empty() || chid.empty()){
|
||||
return srs_api_response_code(w, r, ERROR_GB28181_VALUE_EMPTY);
|
||||
}
|
||||
|
||||
int code = _srs_gb28181->notify_sip_bye(id);
|
||||
int code = _srs_gb28181->notify_sip_bye(id, chid);
|
||||
return srs_api_response_code(w, r, code);
|
||||
}
|
||||
else if(action == "sip_raw_data"){
|
||||
|
@ -1775,6 +1777,25 @@ srs_error_t SrsGoApiGb28181::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessa
|
|||
int code = _srs_gb28181->notify_sip_unregister(id);
|
||||
return srs_api_response_code(w, r, code);
|
||||
}
|
||||
else if(action == "sip_query_catalog"){
|
||||
if (id.empty()){
|
||||
return srs_api_response_code(w, r, ERROR_GB28181_VALUE_EMPTY);
|
||||
}
|
||||
|
||||
int code = _srs_gb28181->notify_sip_query_catalog(id);
|
||||
return srs_api_response_code(w, r, code);
|
||||
}
|
||||
else if(action == "sip_query_session"){
|
||||
SrsJsonArray* arr = SrsJsonAny::array();
|
||||
data->set("sessions", arr);
|
||||
|
||||
uint32_t code = _srs_gb28181->query_sip_session(id, arr);
|
||||
if (code != ERROR_SUCCESS) {
|
||||
return srs_api_response_code(w, r, code);
|
||||
}
|
||||
|
||||
return srs_api_response(w, r, obj->dumps());
|
||||
}
|
||||
else
|
||||
{
|
||||
return srs_api_response_code(w, r, ERROR_GB28181_ACTION_INVALID);
|
||||
|
|
Loading…
Reference in a new issue