[asterisk-commits] file: branch file/gulp_connected_line r389948 - /team/file/gulp_connected_lin...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue May 28 13:39:26 CDT 2013
Author: file
Date: Tue May 28 13:39:22 2013
New Revision: 389948
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=389948
Log:
Add initial stab at connected line updates. It's not configurable yet for method but it works with what is there.
Modified:
team/file/gulp_connected_line/channels/chan_gulp.c
Modified: team/file/gulp_connected_line/channels/chan_gulp.c
URL: http://svnview.digium.com/svn/asterisk/team/file/gulp_connected_line/channels/chan_gulp.c?view=diff&rev=389948&r1=389947&r2=389948
==============================================================================
--- team/file/gulp_connected_line/channels/chan_gulp.c (original)
+++ team/file/gulp_connected_line/channels/chan_gulp.c Tue May 28 13:39:22 2013
@@ -851,6 +851,26 @@
static int update_connected_line_information(void *data)
{
RAII_VAR(struct ast_sip_session *, session, data, ao2_cleanup);
+
+ if ((ast_channel_state(session->channel) != AST_STATE_UP) && (session->inv_session->role) == PJSIP_UAS_ROLE) {
+ int response_code = 0;
+
+ if (ast_channel_state(session->channel) == AST_STATE_RING) {
+ response_code = !session->endpoint->inband_progress ? 180 : 183;
+ } else if (ast_channel_state(session->channel) == AST_STATE_RINGING) {
+ response_code = 183;
+ }
+
+ if (response_code) {
+ struct pjsip_tx_data *packet = NULL;
+
+ if (pjsip_inv_answer(session->inv_session, response_code, NULL, NULL, &packet) == PJ_SUCCESS) {
+ ast_sip_session_send_response(session, packet);
+ }
+ }
+ } else {
+ ast_sip_session_refresh(session, NULL, NULL, AST_SIP_SESSION_REFRESH_METHOD_INVITE, 0);
+ }
return 0;
}
More information about the asterisk-commits
mailing list