Idefisk
Tools
Tutorials
Reviews
VoIP Providers
Archives
AsteriskGuru Archives
Mailing List Archives
FAQ
Search
Memberlist
Usergroups
Register
Profile
Log in to check your private messages
Log in
[Asterisk-cvs] asterisk/channels chan_h323.c,1.2,1.3
AsteriskGuru Archives Forum Index
->
Asterisk-CVS
View previous topic
::
View next topic
Author
Message
jeremy at lists.digium.co
Guest
Posted: Sat Sep 06, 2003 8:28 pm
Post subject: [Asterisk-cvs] asterisk/channels chan_h323.c,1.2,1.3
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv20457
Modified Files:
chan_h323.c
Log Message:
implement transfer and call forwarding. Bug #221
Index: chan_h323.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_h323.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** chan_h323.c 25 Aug 2003 09:54:36 -0000 1.2
--- chan_h323.c 6 Sep 2003 20:29:25 -0000 1.3
***************
*** 1089,1092 ****
--- 1089,1147 ----
}
#endif
+
+
+ /* Call-back function that gets called on transfer
+ *
+ * Returns 1 on success
+ */
+ int setup_transfer_call(unsigned call_reference, const char *extension)
+ {
+ struct oh323_pvt *p;
+ struct ast_channel *c = NULL;
+ char exten[AST_MAX_EXTENSION];
+ char *context;
+
+ p = find_call(call_reference);
+
+ if (!p) {
+ ast_log(LOG_WARNING, "No such call %d.\n", call_reference);
+ return -1;
+ }
+
+ if (!p->owner) {
+ ast_log(LOG_WARNING, "Call %d has no owner.\n", call_reference);
+ return -1;
+ }
+
+ memcpy(exten, extension, sizeof(exten));
+
+ c = p->owner;
+ if (c && c->bridge) {
+ strncpy(exten, extension, sizeof(exten) - 1);
+ context = strchr(exten, '@');
+ if (context) {
+ *context = '\0';
+ context++;
+ } else
+ context = c->context;
+ if (!strlen(context))
+ context = c->bridge->context;
+ if (ast_exists_extension(c->bridge, context, exten, 1, c->bridge->callerid)) {
+
+ ast_log(LOG_NOTICE, "Transfering call %s to %s@%s.\n", c->bridge->name, exten, context);
+
+ if (!ast_async_goto(c->bridge, context, exten, 1, 1))
+ return 1;
+
+ ast_log(LOG_WARNING, "Failed to transfer.\n");
+ } else {
+ ast_log(LOG_WARNING, "No such extension '%s' exists.\n", exten);
+ }
+ } else {
+ ast_log(LOG_WARNING, "There is no call to transfer\n");
+ }
+ return 0;
+ }
+
/**
***************
*** 1715,1723 ****
h323_callback_register(setup_incoming_call,
setup_outgoing_call,
create_connection,
setup_rtp_connection,
cleanup_connection,
connection_made, send_digit);
!
/* start the h.323 listener */
if (h323_start_listener(port, bindaddr)) {
--- 1770,1780 ----
h323_callback_register(setup_incoming_call,
setup_outgoing_call,
+ setup_transfer_call,
create_connection,
setup_rtp_connection,
cleanup_connection,
connection_made, send_digit);
!
!
/* start the h.323 listener */
if (h323_start_listener(port, bindaddr)) {
Back to top
Display posts from previous:
All Posts
1 Day
7 Days
2 Weeks
1 Month
3 Months
6 Months
1 Year
Oldest First
Newest First
AsteriskGuru Archives Forum Index
->
Asterisk-CVS
All times are GMT
Page
1
of
1
Jump to:
Select a forum
Asterisk Mailing Lists
----------------
Asterisk-Users
Asterisk-Dev
Asterisk-CVS
Asterisk-Biz
Asterisk-Doc
Asterisk-BSD
Asterisk-Announce
Asterisk Call Centers
Asterisk-Video
Asterisk-Speech-Rec
Bristuff-Users
You
cannot
post new topics in this forum
You
cannot
reply to topics in this forum
You
cannot
edit your posts in this forum
You
cannot
delete your posts in this forum
You
cannot
vote in polls in this forum
Powered by
phpBB
© 2001, 2005 phpBB Group