ddd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with display large amount of data with DDD


From: Sohan Shetty
Subject: Problem with display large amount of data with DDD
Date: Fri, 06 Jun 2003 18:23:17 -0400

Hello,

I am using DDD for debugging my application.

When i attempt to display the contents of this data DDD is unable
display and it just hangs (using graph display command).
I used GDB instead and found that gdb could print the data correctly al
though it was huge.
Also DDD crashes some times.

The size of the data was > 20000 bytes.

Is there any workaround (some command line option to overide the display
cache size ) or is there a workaround for this.

The console output is as shown below. Also i am attaching the log file
generated during this time.

Please let me know if there is any workaround for this problem.
--------------------------------------------

address@hidden bin]$ X Error of failed request:  BadWindow
(invalid Window
 parameter)
  Major opcode of failed request:  10 (X_UnmapWindow)
  Resource id in failed request:  0x0
  Serial number of failed request:  131140
  Current serial number in output stream:  131143
gnuplot -bg 'grey96' -font
'-*-lucidatypewriter-medium-r-*-*-*-120-*-*-*-*-iso88
59-*' -name 'dddplot1' -geometry +5000+5000 [30284]: Exit 127
gnuplot -bg 'grey96' -font
'-*-lucidatypewriter-medium-r-*-*-*-120-*-*-*-*-iso88
59-*' -name 'dddplot2' -geometry +5000+5000 [30333]: write failed:
Broken pipe
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  10 (X_UnmapWindow)
  Resource id in failed request:  0x0
  Serial number of failed request:  158525
  Current serial number in output stream:  158528
gnuplot -bg 'grey96' -font
'-*-lucidatypewriter-medium-r-*-*-*-120-*-*-*-*-iso88
59-*' -name 'dddplot2' -geometry +5000+5000 [30333]: Exit 127
Segmentation fault (core dumped)
294     oldfileops.c: No such file or directory.
-------------------------------------------------


best regards
sohan
GNU DDD 3.3 (i386-redhat-linux-gnu)
Copyright (C) 1995-1999 Technische Universit�t Braunschweig, Germany.
Copyright (C) 1999-2001 Universit�t Passau, Germany.

Compiled with GCC 2.96 20000731 (Red Hat Linux 7.0), GNU libc 2.2
Requires X11R6, Xt11R6, Motif 2.1.30 (Motif Version 2.1.30)
Includes XPM 3.4.11, Athena Panner, DDD core
Built 2001-02-03 by prospector <address@hidden>.
$  ddd
+  /bin/sh -c 'exec gdb -q -fullname'
#  Hello, world!
#  Starting GDB...
#  Raising core file size limit from 1024000000 to -1 bytes...
#  Raising core file size limit from 1024000000 to -1 bytes...done.
#  Running GDB (pid 30135, tty /dev/pts/2)...
<- "(gdb) "
-> "set prompt (gdb) \n"
#  Current language: C/C++
#  Searching "vsllib/ddd.vsl"...
#  Trying "/voice_app/home/.ddd/vsllib/ddd.vsl"
#  Trying "/usr/share/ddd-3.3/vsllib/ddd.vsl"
#  Searching "vsllib/ddd.vsl"..."/usr/share/ddd-3.3/vsllib/ddd.vsl".
<- "(gdb) "
-> "set height 0\n"
<- "(gdb) "
-> "set width 0\n"
<- "(gdb) "
-> "set annotate 1\n"
<- "(gdb) "
-> " set verbose off\n"
<- "(gdb) "
-> "info line\n"
<- "No line number information available.\n"
   "(gdb) "
-> "list\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info line\n"
<- "No line number information available.\n"
   "(gdb) "
-> "output 4711\n"
<- "4711(gdb) "
-> "show language\n"
<- "The current source language is \"auto; currently c\".\n"
   "(gdb) "
-> "show version\n"
<- "GNU gdb 5.0rh-5 Red Hat Linux 7.1\n"
   "Copyright 2001 Free Software Foundation, Inc.\n"
   "GDB is free software, covered by the GNU General Public License, and you 
are\n"
   "welcome to change it and/or distribute copies of it under certain 
conditions.\n"
   "Type \"show copying\" to see the conditions.\n"
   "There is absolutely no warranty for GDB.  Type \"show warranty\" for 
details.\n"
   "This GDB was configured as \"i386-redhat-linux\".\n"
   "(gdb) "
-> "pwd\n"
<- "Working directory /voice_app/bin.\n"
   "(gdb) "
-> "info breakpoints\n"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "show history filename\n"
<- "The filename in which to record the command history is 
\"/voice_app/bin/.gdb_history\".\n"
   "(gdb) "
-> "show history size\n"
<- "The size of the command history is 1000.\n"
   "(gdb) "
-> "info source\n"
<- "No current source file.\n"
   "(gdb) "
-> "info sources\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info line main\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info source\n"
<- "No current source file.\n"
   "(gdb) "
-> "info line MAIN\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info files\n"
<- "(gdb) "
-> "info line main_\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
   "(gdb) "
-> "info line MAIN_\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info source\n"
<- "No current source file.\n"
   "(gdb) "
-> "info line main__\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info source\n"
<- "No current source file.\n"
   "(gdb) "
-> "info line MAIN__\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info source\n"
<- "No current source file.\n"
   "(gdb) "
-> "info line _main\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info source\n"
<- "No current source file.\n"
   "(gdb) "
-> "info line _MAIN\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info source\n"
<- "No current source file.\n"
   "(gdb) "
-> "info line __main\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info source\n"
<- "No current source file.\n"
   "(gdb) "
-> "info line __MAIN\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info source\n"
<- "No current source file.\n"
   "(gdb) "
-> "info line my_main\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info source\n"
<- "No current source file.\n"
   "(gdb) "
-> "info line the_main\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info source\n"
<- "No current source file.\n"
   "(gdb) "
-> "info line vxworks_main\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "info source\n"
<- "No current source file.\n"
   "(gdb) "
-> "info line main_vxworks\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
   "(gdb) "
-> "set confirm off\n"
<- "(gdb) "
-> "source /tmp/filePOnvoO\n"
<- "(gdb) "
-> "info breakpoints\n"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "info source\n"
<- "No current source file.\n"
   "(gdb) "
-> "# reset\n"
<- "(gdb) "
-> "info breakpoints\n"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "display\n"
<- "(gdb) "
-> "info display\n"
<- "There are no auto-display expressions now.\n"
   "(gdb) "
-> "set environment TERM dumb\n"
<- "(gdb) "
-> "info source\n"
<- "No current source file.\n"
   "(gdb) "
-> "info files\n"
<- "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
   "(gdb) "
-> "help detach\n"
<- "Detach a process or file previously attached.\n"
   "If a process, it is no longer traced, and it continues its execution.  If\n"
   "you were debugging a file, the file is closed and gdb no longer accesses 
it.\n"
   "(gdb) "
#  Starting GDB...done.
#  Welcome to DDD 3.3 "Blues by Night" (i386-redhat-linux-gnu)
-> "help run\n"
<- "Start debugged program.  You may specify arguments to give it.\n"
   "Args may include \"*\", or \"[...]\"; they are expanded using \"sh\".\n"
   "Input and output redirection with \">\", \"<\", or \">>\" are also 
allowed.\n"
   "\n"
   "With no arguments, uses arguments last specified (with \"run\" or \"set 
args\").\n"
   "To cancel previous arguments and run with no arguments,\n"
   "use \"set args\" without arguments.\n"
   "(gdb) "
-> "help step\n"
<- "Step program until it reaches a different source line.\n"
   "Argument N means do this N times (or till program stops for another 
reason).\n"
   "(gdb) "
-> "help stepi\n"
<- "Step one instruction exactly.\n"
   "Argument N means do this N times (or till program stops for another 
reason).\n"
   "(gdb) "
-> "help next\n"
<- "Step program, proceeding through subroutine calls.\n"
   "Like the \"step\" command as long as subroutine calls do not happen;\n"
   "when they do, the call is treated as one instruction.\n"
   "Argument N means do this N times (or till program stops for another 
reason).\n"
   "(gdb) "
-> "help nexti\n"
<- "Step one instruction, but proceed through subroutine calls.\n"
   "Argument N means do this N times (or till program stops for another 
reason).\n"
   "(gdb) "
-> "help until\n"
<- "Execute until the program reaches a source line greater than the current\n"
   "or a specified line or address or function (same args as break command).\n"
   "Execution will also stop upon exit from the current stack frame.\n"
   "(gdb) "
-> "help finish\n"
<- "Execute until selected stack frame returns.\n"
   "Upon return, the value returned is printed and put in the value history.\n"
   "(gdb) "
-> "help cont\n"
<- "Continue program being debugged, after signal or breakpoint.\n"
   "If proceeding from breakpoint, a number N may be used as an argument,\n"
   "which means to set the ignore count of that breakpoint to N - 1 (so that\n"
   "the breakpoint won\'t break until the Nth time it is reached).\n"
   "(gdb) "
-> "help signal\n"
<- "Continue program giving it signal specified by the argument.\n"
   "An argument of \"0\" means continue program without giving it a signal.\n"
   "(gdb) "
-> "help kill\n"
<- "Kill execution of program being debugged.\n"
   "(gdb) "
-> "help up\n"
<- "Select and print stack frame that called this one.\n"
   "An argument says how many frames up to go.\n"
   "(gdb) "
-> "help down\n"
<- "Select and print stack frame called by this one.\n"
   "An argument says how many frames down to go.\n"
   "(gdb) "
#  Retrieving GDB Settings...
#  Retrieving GDB Settings...
-> "help set\n"
<- "Evaluate expression EXP and assign result to variable VAR, using 
assignment\n"
   "syntax appropriate for the current language (VAR = EXP or VAR := EXP for\n"
   "example).  VAR may be a debugger \"convenience\" variable (names starting\n"
   "with $), a register (a few standard names starting with $), or an actual\n"
   "variable in the program being debugged.  EXP is any valid expression.\n"
   "Use \"set variable\" for variables with names identical to set 
subcommands.\n"
   "\n"
   "With a subcommand, this command modifies parts of the gdb environment.\n"
   "You can see these environment settings with the \"show\" command.\n"
   "\n"
   "List of set subcommands:\n"
   "\n"
   "set annotate -- Set annotation_level\n"
   "set archdebug -- Set architecture debugging\n"
   "set architecture -- Set architecture of target\n"
   "set args -- Set argument list to give program being debugged when it is 
started\n"
   "set auto-solib-add -- Set autoloading of shared library symbols\n"
   "set can-use-hw-watchpoints -- Set debugger\'s willingness to use watchpoint 
hardware\n"
   "set case-sensitive -- Set case sensitivity in name search\n"
   "set check -- Set the status of the type/range checker\n"
   "set complaints -- Set max number of complaints about incorrect symbols\n"
   "set confirm -- Set whether to confirm potentially dangerous operations\n"
   "set debug -- Generic command for setting gdb debugging flags\n"
   "set debugvarobj -- Set varobj debugging\n"
   "set demangle-style -- Set the current C++ demangling style\n"
   "set disassembly-flavor -- Set the disassembly flavor\n"
   "set download-write-size -- Set the write size used when downloading a 
program\n"
   "set editing -- Set editing of command lines as they are typed\n"
   "set endian -- Set endianness of target\n"
   "set environment -- Set environment variable value to give the program\n"
   "set eventdebug -- Set event debugging\n"
   "set exec-done-display -- Set notification of completion for asynchronous 
execution commands\n"
   "set extension-language -- Set mapping between filename extension and source 
language\n"
   "set follow-fork-mode -- Set debugger response to a program call of fork or 
vfork\n"
   "set gnutarget -- Set the current BFD target\n"
   "set height -- Set number of lines gdb thinks are in a page\n"
   "set history -- Generic command for setting command history parameters\n"
   "set input-radix -- Set default input radix for entering numbers\n"
   "set language -- Set the current source language\n"
   "set listsize -- Set number of source lines gdb will list by default\n"
   "set opaque-type-resolution -- Set resolution of opaque struct/class/union 
types (if set before loading symbols)\n"
   "set os -- Set operating system\n"
   "set output-radix -- Set default output radix for printing of values\n"
   "set overload-resolution -- Set overload resolution in evaluating C++ 
functions\n"
   "set pagination -- Set state of pagination\n"
   "set print -- Generic command for setting how things print\n"
   "set prompt -- Set gdb\'s prompt\n"
   "set prompt-escape-char -- Set escape character for formatting of gdb\'s 
prompt\n"
   "set radix -- Set default input and output number radices\n"
   "set remote -- Remote protocol specific variables\n"
   "set remoteaddresssize -- Set the maximum size of the address (in bits) in a 
memory packet\n"
   "set remotebaud -- Set baud rate for remote serial I/O\n"
   "set remotebreak -- Set whether to send break if interrupted\n"
   "set remotecache -- Set cache use for remote targets\n"
   "set remotedebug -- Set debugging of remote protocol\n"
   "set remotedevice -- Set device for remote serial I/O\n"
   "set remotelogbase -- Set numerical base for remote session logging\n"
   "set remotelogfile -- Set filename for remote session recording\n"
   "set remotetimeout -- Set timeout limit to wait for target to respond\n"
   "set remotewritesize -- Set the maximum number of bytes per memory write 
packet (deprecated)\n"
   "set scheduler-locking -- Set mode for locking scheduler during execution\n"
   "set solib-absolute-prefix -- Set prefix for loading absolute shared library 
symbol files\n"
   "set solib-search-path -- Set the search path for loading non-absolute 
shared library symbol files\n"
   "set step-mode -- Set mode of the step operation\n"
   "set stop-on-solib-events -- Set stopping for shared library events\n"
   "set symbol-reloading -- Set dynamic symbol table reloading multiple times 
in one run\n"
   "set unwindonsignal -- Set unwinding of stack if a signal is received while 
in a call dummy\n"
   "set variable -- Evaluate expression EXP and assign result to variable VAR\n"
   "set verbose -- Set verbosity\n"
   "set watchdog -- Set watchdog timer\n"
   "set width -- Set number of characters gdb thinks are in a line\n"
   "set write -- Set writing into executable and core files\n"
   "\n"
   "Type \"help set\" followed by set subcommand name for full documentation.\n"
   "Command name abbreviations are allowed if unambiguous.\n"
   "(gdb) "
-> "show annotate\n"
<- "Annotation_level is 1.\n"
   "(gdb) "
-> "show archdebug\n"
<- "Warning: command \'show archdebug\' is deprecated.\n"
   "Use \'show debug arch\'.\n"
   "\n"
   "Architecture debugging is 0.\n"
   "(gdb) "
-> "help set archdebug\n"
<- "Set architecture debugging.\n"
   "When non-zero, architecture debugging is enabled.\n"
   "(gdb) "
-> "show architecture\n"
<- "The target architecture is assumed to be i386\n"
   "(gdb) "
-> "show auto-solib-add\n"
<- "Autoloading of shared library symbols is 1.\n"
   "(gdb) "
-> "show can-use-hw-watchpoints\n"
<- "Debugger\'s willingness to use watchpoint hardware is 1.\n"
   "(gdb) "
-> "show case-sensitive\n"
<- "Case sensitivity in name search is \"auto; currently on\".\n"
   "(gdb) "
-> "show check\n"
<- "range:  Range checking is \"auto; currently off\".\n"
   "type:  Type checking is \"auto; currently off\".\n"
   "(gdb) "
-> "help set check\n"
<- "Set the status of the type/range checker\n"
   "\n"
   "List of set check subcommands:\n"
   "\n"
   "set check range -- Set range checking\n"
   "set check type -- Set type checking\n"
   "\n"
   "Type \"help set check\" followed by set check subcommand name for full 
documentation.\n"
   "Command name abbreviations are allowed if unambiguous.\n"
   "(gdb) "
-> "show check range\n"
<- "Range checking is \"auto; currently off\".\n"
   "(gdb) "
-> "show check type\n"
<- "Type checking is \"auto; currently off\".\n"
   "(gdb) "
-> "show complaints\n"
<- "Max number of complaints about incorrect symbols is 0.\n"
   "(gdb) "
-> "show confirm\n"
<- "Whether to confirm potentially dangerous operations is off.\n"
   "(gdb) "
-> "help set debug\n"
<- "Generic command for setting gdb debugging flags\n"
   "\n"
   "List of set debug subcommands:\n"
   "\n"
   "set debug arch -- Set architecture debugging\n"
   "set debug event -- Set event debugging\n"
   "set debug expression -- Set expression debugging\n"
   "set debug overload -- Set debugging of C++ overloading\n"
   "set debug remote -- Set debugging of remote protocol\n"
   "set debug serial -- Set serial debugging\n"
   "set debug target -- Set target debugging\n"
   "\n"
   "Type \"help set debug\" followed by set debug subcommand name for full 
documentation.\n"
   "Command name abbreviations are allowed if unambiguous.\n"
   "(gdb) "
-> "show debug arch\n"
<- "Architecture debugging is 0.\n"
   "(gdb) "
-> "show debug event\n"
<- "Event debugging is 0.\n"
   "(gdb) "
-> "show debug expression\n"
<- "Expression debugging is 0.\n"
   "(gdb) "
-> "show debug overload\n"
<- "Debugging of C++ overloading is 0.\n"
   "(gdb) "
-> "show debug remote\n"
<- "Debugging of remote protocol is 0.\n"
   "(gdb) "
-> "show debug serial\n"
<- "Serial debugging is 0.\n"
   "(gdb) "
-> "show debug target\n"
<- "Target debugging is 0.\n"
   "(gdb) "
-> "show debugvarobj\n"
<- "Varobj debugging is 0.\n"
   "(gdb) "
-> "show demangle-style\n"
<- "The current C++ demangling style is \"auto\".\n"
   "(gdb) "
-> "show disassembly-flavor\n"
<- "The disassembly flavor is \"att\".\n"
   "(gdb) "
-> "show download-write-size\n"
<- "The write size used when downloading a program is 512.\n"
   "(gdb) "
-> "show editing\n"
<- "Editing of command lines as they are typed is on.\n"
   "(gdb) "
-> "show endian\n"
<- "The target endianness is set automatically (currently little endian)\n"
   "(gdb) "
-> "show environment\n"
<- "PWD=/voice_app/bin\n"
   "WINDOWID=4194318\n"
   "PAGER=cat\n"
   "HOSTNAME=lab2_mc20\n"
   "CL_START_DIR=/voice_app/startup\n"
   "CL_HOST_NAME=lab2_mc20\n"
   "CL_ADMIN_STATION=0\n"
   "KDEDIR=/usr\n"
   "CL_BIN_DIR=/voice_app/bin\n"
   "USER=voice_app\n"
   
"LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:\n"
   "CL_BASE_DIR=/voice_app\n"
   "MACHTYPE=i386-redhat-linux-gnu\n"
   "XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB\n"
   "EXTERNAL_JARDIR=/voice_app/java/external_jars\n"
   "MAIL=/var/spool/mail/voice_app\n"
   "INPUTRC=/etc/inputrc\n"
   "BASH_ENV=/voice_app/home/.bashrc\n"
   "CL_SNMP_ADMIN_STATION_IP=192.168.11.80\n"
   "CL_ADMIN_STATION_IP=192.168.11.80\n"
   "CL_NTP_ADMIN_STATION_IP=192.168.11.80\n"
   "MIBFILE=/voice_app/config/mib.txt\n"
   "TERMCAP=\n"
   "LANG=en_US\n"
   "JAVA_HOME=/usr/java/j2sdk1.4.1_01\n"
   "DISPLAY=192.168.10.81:0.0\n"
   "SHLVL=2\n"
   "LOGNAME=voice_app\n"
   "CL_NTP_ADMIN_STATION_NAME=lab2_md11\n"
   "CL_SNMP_ADMIN_STATION_NAME=lab2_md11\n"
   "CL_ADMIN_STATION_NAME=lab2_md11\n"
   "_=/bin/sh\n"
   "SHELL=/bin/bash\n"
   "HOSTTYPE=i386\n"
   "OSTYPE=linux-gnu\n"
   "HISTSIZE=1000\n"
   "HOME=/voice_app/home\n"
   "TERM=dumb\n"
   "SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass\n"
   
"PATH=/gvd/bin/:/voice_app/bin:/usr/java/j2sdk1.4.1_01/bin:/gvd/bin/:/usr/bin:/bin:/usr/X11R6/bin:/voice_app/home/bin\n"
   "CL_HOST_TYPE=2\n"
   "DDD=ddd-3.3-i386-redhat-linux-gnu\n"
   "(gdb) "
-> "help set environment\n"
<- "Set environment variable value to give the program.\n"
   "Arguments are VAR VALUE where VAR is variable name and VALUE is value.\n"
   "VALUES of environment variables are uninterpreted strings.\n"
   "This does not affect the program until the next \"run\" command.\n"
   "(gdb) "
-> "show eventdebug\n"
<- "Warning: command \'show eventdebug\' is deprecated.\n"
   "Use \'show debug event\'.\n"
   "\n"
   "Event debugging is 0.\n"
   "(gdb) "
-> "help set eventdebug\n"
<- "Set event debugging.\n"
   "When non-zero, event/notify debugging is enabled.\n"
   "(gdb) "
-> "show exec-done-display\n"
<- "Notification of completion for asynchronous execution commands is off.\n"
   "(gdb) "
-> "show follow-fork-mode\n"
<- "Debugger response to a program call of fork or vfork is \"parent\".\n"
   "(gdb) "
-> "show gnutarget\n"
<- "The current BFD target is \"auto\".\n"
   "(gdb) "
-> "show height\n"
<- "Number of lines gdb thinks are in a page is unlimited.\n"
   "(gdb) "
-> "help set history\n"
<- "Generic command for setting command history parameters.\n"
   "\n"
   "List of set history subcommands:\n"
   "\n"
   "set history expansion -- Set history expansion on command input\n"
   "set history filename -- Set the filename in which to record the command 
history\n"
   "set history save -- Set saving of the history record on exit\n"
   "set history size -- Set the size of the command history\n"
   "\n"
   "Type \"help set history\" followed by set history subcommand name for full 
documentation.\n"
   "Command name abbreviations are allowed if unambiguous.\n"
   "(gdb) "
-> "show history expansion\n"
<- "History expansion on command input is off.\n"
   "(gdb) "
-> "show history filename\n"
<- "The filename in which to record the command history is 
\"/voice_app/bin/.gdb_history\".\n"
   "(gdb) "
-> "show history save\n"
<- "Saving of the history record on exit is off.\n"
   "(gdb) "
-> "show history size\n"
<- "The size of the command history is 1000.\n"
   "(gdb) "
-> "show input-radix\n"
<- "Default input radix for entering numbers is 10.\n"
   "(gdb) "
-> "show language\n"
<- "The current source language is \"auto; currently c\".\n"
   "(gdb) "
-> "show listsize\n"
<- "Number of source lines gdb will list by default is 10.\n"
   "(gdb) "
-> "show opaque-type-resolution\n"
<- "Resolution of opaque struct/class/union types (if set before loading 
symbols) is on.\n"
   "(gdb) "
-> "show os\n"
<- "Operating system is \"\".\n"
   "(gdb) "
-> "show output-radix\n"
<- "Default output radix for printing of values is 10.\n"
   "(gdb) "
-> "show overload-resolution\n"
<- "Overload resolution in evaluating C++ functions is on.\n"
   "(gdb) "
-> "show pagination\n"
<- "State of pagination is on.\n"
   "(gdb) "
-> "help set print\n"
<- "Generic command for setting how things print.\n"
   "\n"
   "List of set print subcommands:\n"
   "\n"
   "set print address -- Set printing of addresses\n"
   "set print array -- Set prettyprinting of arrays\n"
   "set print asm-demangle -- Set demangling of C++ names in disassembly 
listings\n"
   "set print demangle -- Set demangling of encoded C++ names when displaying 
symbols\n"
   "set print elements -- Set limit on string chars or array elements to 
print\n"
   "set print max-symbolic-offset -- Set the largest offset that will be 
printed in <symbol+1234> form\n"
   "set print null-stop -- Set printing of char arrays to stop at first null 
char\n"
   "set print object -- Set printing of object\'s derived type based on vtable 
info\n"
   "set print pascal_static-members -- Set printing of pascal static members\n"
   "set print pretty -- Set prettyprinting of structures\n"
   "set print repeats -- Set threshold for repeated print elements\n"
   "set print sevenbit-strings -- Set printing of 8-bit characters in strings 
as \\n"
   "nn\n"
   "set print static-members -- Set printing of C++ static members\n"
   "set print symbol-filename -- Set printing of source filename and line 
number with <symbol>\n"
   "set print union -- Set printing of unions interior to structures\n"
   "set print vtbl -- Set printing of C++ virtual function tables\n"
   "\n"
   "Type \"help set print\" followed by set print subcommand name for full 
documentation.\n"
   "Command name abbreviations are allowed if unambiguous.\n"
   "(gdb) "
-> "show print address\n"
<- "Printing of addresses is on.\n"
   "(gdb) "
-> "show print array\n"
<- "Prettyprinting of arrays is off.\n"
   "(gdb) "
-> "show print asm-demangle\n"
<- "Demangling of C++ names in disassembly listings is on.\n"
   "(gdb) "
-> "show print demangle\n"
<- "Demangling of encoded C++ names when displaying symbols is on.\n"
   "(gdb) "
-> "show print elements\n"
<- "Limit on string chars or array elements to print is 200.\n"
   "(gdb) "
-> "show print max-symbolic-offset\n"
<- "The largest offset that will be printed in <symbol+1234> form is 
unlimited.\n"
   "(gdb) "
-> "show print null-stop\n"
<- "Printing of char arrays to stop at first null char is off.\n"
   "(gdb) "
-> "show print object\n"
<- "Printing of object\'s derived type based on vtable info is off.\n"
   "(gdb) "
-> "show print pascal_static-members\n"
<- "Printing of pascal static members is on.\n"
   "(gdb) "
-> "show print pretty\n"
<- "Prettyprinting of structures is off.\n"
   "(gdb) "
-> "show print repeats\n"
<- "Threshold for repeated print elements is 10.\n"
   "(gdb) "
-> "show print sevenbit-strings\n"
<- "Printing of 8-bit characters in strings as \\n"
   "nn is off.\n"
   "(gdb) "
-> "show print static-members\n"
<- "Printing of C++ static members is on.\n"
   "(gdb) "
-> "show print symbol-filename\n"
<- "Printing of source filename and line number with <symbol> is off.\n"
   "(gdb) "
-> "show print union\n"
<- "Printing of unions interior to structures is on.\n"
   "(gdb) "
-> "show print vtbl\n"
<- "Printing of C++ virtual function tables is off.\n"
   "(gdb) "
-> "show prompt\n"
<- "Gdb\'s prompt is \"(gdb) \".\n"
   "(gdb) "
-> "show prompt-escape-char\n"
<- "Escape character for formatting of gdb\'s prompt is 0.\n"
   "(gdb) "
-> "help set remote\n"
<- "Remote protocol specific variables\n"
   "Configure various remote-protocol specific variables such as\n"
   "the packets being used\n"
   "\n"
   "List of set remote subcommands:\n"
   "\n"
   "set remote P-packet -- Set use of remote protocol `P\' (set-register) 
packet\n"
   "set remote X-packet -- Set use of remote protocol `X\' (binary-download) 
packet\n"
   "set remote Z-packet -- Set use of remote protocol `Z\' packets\n"
   "set remote access-watchpoint-packet -- Set use of remote protocol `Z4\' 
(access-watchpoint) packet\n"
   "set remote binary-download-packet -- Set use of remote protocol `X\' 
(binary-download) packet\n"
   "set remote hardware-breakpoint-packet -- Set use of remote protocol `Z1\' 
(hardware-breakpoint) packet\n"
   "set remote memory-read-packet-size -- Set the maximum number of bytes per 
memory-read packet\n"
   "set remote memory-write-packet-size -- Set the maximum number of bytes per 
memory-write packet\n"
   "set remote read-watchpoint-packet -- Set use of remote protocol `Z3\' 
(read-watchpoint) packet\n"
   "set remote set-register-packet -- Set use of remote protocol `P\' 
(set-register) packet\n"
   "set remote software-breakpoint-packet -- Set use of remote protocol `Z0\' 
(software-breakpoint) packet\n"
   "set remote write-watchpoint-packet -- Set use of remote protocol `Z2\' 
(write-watchpoint) packet\n"
   "\n"
   "Type \"help set remote\" followed by set remote subcommand name for full 
documentation.\n"
   "Command name abbreviations are allowed if unambiguous.\n"
   "(gdb) "
-> "show remote P-packet\n"
<- "Support for remote protocol `P\' (set-register) packet is auto-detected, 
currently unknown.\n"
   "(gdb) "
-> "show remote X-packet\n"
<- "Support for remote protocol `X\' (binary-download) packet is auto-detected, 
currently unknown.\n"
   "(gdb) "
-> "show remote Z-packet\n"
<- "Support for remote protocol `Z0\' (software-breakpoint) packet is 
auto-detected, currently unknown.\n"
   "Support for remote protocol `Z1\' (hardware-breakpoint) packet is 
auto-detected, currently unknown.\n"
   "Support for remote protocol `Z2\' (write-watchpoint) packet is 
auto-detected, currently unknown.\n"
   "Support for remote protocol `Z3\' (read-watchpoint) packet is 
auto-detected, currently unknown.\n"
   "Support for remote protocol `Z4\' (access-watchpoint) packet is 
auto-detected, currently unknown.\n"
   "(gdb) "
-> "help set remote Z-packet\n"
<- "Set use of remote protocol `Z\' packets\n"
   "(gdb) "
-> "show remote access-watchpoint-packet\n"
<- "Support for remote protocol `Z4\' (access-watchpoint) packet is 
auto-detected, currently unknown.\n"
   "(gdb) "
-> "show remote binary-download-packet\n"
<- "Support for remote protocol `X\' (binary-download) packet is auto-detected, 
currently unknown.\n"
   "(gdb) "
-> "show remote hardware-breakpoint-packet\n"
<- "Support for remote protocol `Z1\' (hardware-breakpoint) packet is 
auto-detected, currently unknown.\n"
   "(gdb) "
-> "show remote memory-read-packet-size\n"
<- "The memory-read-packet-size is 0. Packets are limited to 399 bytes.\n"
   "(gdb) "
-> "show remote memory-write-packet-size\n"
<- "The memory-write-packet-size is 0. Packets are limited to 399 bytes.\n"
   "(gdb) "
-> "show remote read-watchpoint-packet\n"
<- "Support for remote protocol `Z3\' (read-watchpoint) packet is 
auto-detected, currently unknown.\n"
   "(gdb) "
-> "show remote set-register-packet\n"
<- "Support for remote protocol `P\' (set-register) packet is auto-detected, 
currently unknown.\n"
   "(gdb) "
-> "show remote software-breakpoint-packet\n"
<- "Support for remote protocol `Z0\' (software-breakpoint) packet is 
auto-detected, currently unknown.\n"
   "(gdb) "
-> "show remote write-watchpoint-packet\n"
<- "Support for remote protocol `Z2\' (write-watchpoint) packet is 
auto-detected, currently unknown.\n"
   "(gdb) "
-> "show remoteaddresssize\n"
<- "The maximum size of the address (in bits) in a memory packet is 32.\n"
   "(gdb) "
-> "show remotebaud\n"
<- "Baud rate for remote serial I/O is 4294967295.\n"
   "(gdb) "
-> "show remotebreak\n"
<- "Whether to send break if interrupted is off.\n"
   "(gdb) "
-> "show remotecache\n"
<- "Cache use for remote targets is off.\n"
   "(gdb) "
-> "show remotedebug\n"
<- "Warning: command \'show remotedebug\' is deprecated.\n"
   "Use \'show debug remote\'.\n"
   "\n"
   "Debugging of remote protocol is 0.\n"
   "(gdb) "
-> "help set remotedebug\n"
<- "Set debugging of remote protocol.\n"
   "When enabled, each packet sent or received with the remote target\n"
   "is displayed.\n"
   "(gdb) "
-> "show remotedevice\n"
<- "Device for remote serial I/O is \"\".\n"
   "(gdb) "
-> "show remotelogbase\n"
<- "Numerical base for remote session logging is \"ascii\".\n"
   "(gdb) "
-> "show remotelogfile\n"
<- "Filename for remote session recording is \"\".\n"
   "(gdb) "
-> "show remotetimeout\n"
<- "Timeout limit to wait for target to respond is 2.\n"
   "(gdb) "
-> "show scheduler-locking\n"
<- "Mode for locking scheduler during execution is \"off\".\n"
   "(gdb) "
-> "show solib-absolute-prefix\n"
<- "Prefix for loading absolute shared library symbol files is \"\".\n"
   "(gdb) "
-> "show solib-search-path\n"
<- "The search path for loading non-absolute shared library symbol files is 
\"\".\n"
   "(gdb) "
-> "show step-mode\n"
<- "Mode of the step operation is off.\n"
   "(gdb) "
-> "show stop-on-solib-events\n"
<- "Stopping for shared library events is 0.\n"
   "(gdb) "
-> "show symbol-reloading\n"
<- "Dynamic symbol table reloading multiple times in one run is off.\n"
   "(gdb) "
-> "show unwindonsignal\n"
<- "Unwinding of stack if a signal is received while in a call dummy is off.\n"
   "(gdb) "
-> "help set variable\n"
<- "Evaluate expression EXP and assign result to variable VAR, using 
assignment\n"
   "syntax appropriate for the current language (VAR = EXP or VAR := EXP for\n"
   "example).  VAR may be a debugger \"convenience\" variable (names starting\n"
   "with $), a register (a few standard names starting with $), or an actual\n"
   "variable in the program being debugged.  EXP is any valid expression.\n"
   "This may usually be abbreviated to simply \"set\".\n"
   "(gdb) "
-> "show verbose\n"
<- "Verbosity is off.\n"
   "(gdb) "
-> "show watchdog\n"
<- "Watchdog timer is 0.\n"
   "(gdb) "
-> "show width\n"
<- "Number of characters gdb thinks are in a line is unlimited.\n"
   "(gdb) "
-> "show write\n"
<- "Writing into executable and core files is off.\n"
   "(gdb) "
-> "info architecture\n"
<- "Warning: command \'info architecture\' is deprecated.\n"
   "Use \'set architecture\'.\n"
   "\n"
   "Available architectures are:\n"
#  Running GDB (pid 30135, tty /dev/pts/2)...Segmentation fault.
#  Retrieving GDB Settings...done.
#  Retrieving Command Definitions...
#  Retrieving Command Definitions...done.
#  Retrieving GDB Settings...done.
#  Set: waiting until GDB gets ready
#  Set: waiting until GDB gets ready
#  Set: waiting until GDB gets ready
#  Set: waiting until GDB gets ready
#  Set: waiting until GDB gets ready
#  Set: waiting until GDB gets ready
#  Set: waiting until GDB gets ready
#  Set: waiting until GDB gets ready
#  Set: waiting until GDB gets ready
#  Running GDB (pid 30137, tty /dev/pts/2)...
<- "(gdb) "
-> "set prompt (gdb) \n"
#  Current language: C/C++
<- "(gdb) "
-> "set height 0\n"
<- "(gdb) "
-> "set width 0\n"
<- "(gdb) "
-> "set annotate 1\n"
<- "(gdb) "
-> " set verbose off\n"
<- "(gdb) "
-> "info line\n"
<- "No line number information available.\n"
<- "(gdb) "
-> "list\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
<- "(gdb) "
-> "info line\n"
<- "No line number information available.\n"
<- "(gdb) "
-> "output 4711\n"
<- "4711"
<- "(gdb) "
-> "show language\n"
<- "The current source language is \"auto; currently c\".\n"
<- "(gdb) "
-> "show version\n"
<- "GNU gdb 5.0rh-5 Red Hat Linux 7.1\n"
<- "Copyright 2001 Free Software Foundation, Inc.\n"
<- "GDB is free software, covered by the GNU General Public License, and you 
are\n"
   "welcome to change it and/or distribute copies of it under certain 
conditions.\n"
   "Type \"show copying\" to see the conditions.\n"
   "There is absolutely no warranty for GDB.  Type \"show warranty\" for 
details.\n"
<- "This GDB was configured as \"i386-redhat-linux\".\n"
<- "(gdb) "
-> "pwd\n"
<- "Working directory /voice_app/bin.\n"
<- "(gdb) "
-> "info breakpoints\n"
<- "No breakpoints or watchpoints.\n"
<- "(gdb) "
-> "show history filename\n"
<- "The filename in which to record the command history is 
\"/voice_app/bin/.gdb_history\".\n"
<- "(gdb) "
-> "show history size\n"
<- "The size of the command history is 1000.\n"
<- "(gdb) "
-> "info source\n"
<- "No current source file.\n"
<- "(gdb) "
-> "info sources\n"
<- "No symbol table is loaded.  Use the \"file\" command."
<- "\n"
<- "(gdb) "
-> "info line main\n"
<- "No symbol table is loaded.  Use the \"file\" command."
<- "\n"
<- "(gdb) "
-> "info source\n"
<- "No current source file.\n"
<- "(gdb) "
-> "info line MAIN\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
<- "(gdb) "
-> "info files\n"
<- "(gdb) "
-> "info line main_\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
<- "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
<- "(gdb) "
-> "info line MAIN_\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
<- "(gdb) "
-> "info source\n"
<- "No current source file.\n"
<- "(gdb) "
-> "info line main__\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
<- "(gdb) "
-> "info source\n"
<- "No current source file.\n"
<- "(gdb) "
-> "info line MAIN__\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
<- "(gdb) "
-> "info source\n"
<- "No current source file.\n"
<- "(gdb) "
-> "info line _main\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
<- "(gdb) "
-> "info source\n"
<- "No current source file.\n"
<- "(gdb) "
-> "info line _MAIN\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
<- "(gdb) "
-> "info source\n"
<- "No current source file.\n"
<- "(gdb) "
-> "info line __main\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
<- "(gdb) "
-> "info source\n"
<- "No current source file.\n"
<- "(gdb) "
-> "info line __MAIN\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
<- "(gdb) "
-> "info source\n"
<- "No current source file.\n"
<- "(gdb) "
-> "info line my_main\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
<- "(gdb) "
-> "info source\n"
<- "No current source file.\n"
<- "(gdb) "
-> "info line the_main\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
<- "(gdb) "
-> "info source\n"
<- "No current source file.\n"
<- "(gdb) "
-> "info line vxworks_main\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
<- "(gdb) "
-> "info source\n"
<- "No current source file.\n"
<- "(gdb) "
-> "info line main_vxworks\n"
<- "No symbol table is loaded.  Use the \"file\" command.\n"
<- "(gdb) "
-> "set confirm off\n"
<- "(gdb) "
-> "source /tmp/fileScBUsz\n"
<- "No line number information available.\n"
   "The target architecture is assumed to be i386\n"
   "Byte order is not selectable.The target endianness is set automatically 
(currently little endian)\n"
<- "(gdb) "
-> "info breakpoints\n"
<- "No breakpoints or watchpoints.\n"
<- "(gdb) "
-> "info source\n"
<- "No current source file.\n"
<- "(gdb) "
-> "# reset\n"
<- "(gdb) "
-> "info breakpoints\n"
<- "No breakpoints or watchpoints.\n"
<- "(gdb) "
-> "display\n"
<- "(gdb) "
-> "info display\n"
<- "There are no auto-display expressions now.\n"
<- "(gdb) "
-> "set environment TERM dumb\n"
<- "(gdb) "
-> "info source\n"
<- "No current source file.\n"
   "(gdb) "
-> "info files\n"
<- "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
   "(gdb) "
-> "set history expansion on\n"
<- "(gdb) "
-> "display\n"
<- "(gdb) "
-> "show history filename\n"
<- "The filename in which to record the command history is 
\"/voice_app/bin/.gdb_history\".\n"
   "(gdb) "
-> "show history size\n"
<- "The size of the command history is 1000.\n"
   "(gdb) "
-> "show history expansion\n"
<- "History expansion on command input is on.\n"
   "(gdb) "
#  History expansion on command input is on.
-> "set history expansion off\n"
<- "(gdb) "
-> "display\n"
<- "(gdb) "
-> "show history filename\n"
<- "The filename in which to record the command history is 
\"/voice_app/bin/.gdb_history\".\n"
   "(gdb) "
-> "show history size\n"
<- "The size of the command history is 1000.\n"
   "(gdb) "
-> "show history expansion\n"
<- "History expansion on command input is off.\n"
   "(gdb) "
#  History expansion on command input is off.
-> "set print null-stop on\n"
<- "(gdb) "
-> "display\n"
<- "(gdb) "
-> "show print null-stop\n"
<- "Printing of char arrays to stop at first null char is on.\n"
   "(gdb) "
#  Printing of char arrays to stop at first null char is on.
-> "info files\n"
<- "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
   "(gdb) "
#  Saving options in "/voice_app/home/.ddd/init"...
#  Retrieving Command Definitions...
-> "help user-defined\n"
<- "User-defined commands.\n"
   "The commands in this class are those defined by the user.\n"
   "Use the \"define\" command to define a command.\n"
   "\n"
   "List of commands:\n"
   "\n"
   "\n"
   "Type \"help\" followed by command name for full documentation.\n"
   "Command name abbreviations are allowed if unambiguous.\n"
   "(gdb) "
#  Retrieving Command Definitions...done.
#  Saving options in "/voice_app/home/.ddd/init"...done.
#  Grid size set to 40.
#  Automatic layout on.
-> "info files\n"
<- "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
   "(gdb) "
#  Saving options in "/voice_app/home/.ddd/init"...
#  Saving options in "/voice_app/home/.ddd/init"...done.
#  Retrieving Themes...
#  Retrieving Themes...done.
#  Retrieving Themes...
#  Retrieving Themes...done.
#  Current session is "RVGK".
#  Opening session "RVGK"...
-> "info files\n"
<- "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
   "(gdb) "
-> "set confirm off\n"
#  File: waiting until GDB gets ready
<- "(gdb) "
-> "kill\n"
<- "The program is not being run.\n"
   "(gdb) "
-> "file\n"
<- "(gdb) "
-> "core\n"
<- "(gdb) "
-> "set confirm off\n"
<- "(gdb) "
-> "file /voice_app/bin/RVGK\n"
<- "(gdb) "
-> "info line\n"
<- "No line number information available.\n"
<- "(gdb) "
-> "list\n"
<- "274\tsamapp.c: No such file or directory.\n"
<- "\tin samapp.c\n"
<- "(gdb) "
-> "info line\n"
<- "Line number 0 is out of range for \"samapp.c\".\n"
<- "(gdb) "
-> "info breakpoints\n"
<- "No breakpoints or watchpoints.\n"
<- "(gdb) "
-> "display\n"
<- "(gdb) "
-> "info display\n"
<- "There are no auto-display expressions now.\n"
<- "(gdb) "
#  Reading file "/voice_app/bin/samapp.c"...
#  Reading file "/voice_app/bin/samapp.c"...No such file or directory.
-> "info source\n"
<- "Current source file is samapp.c\n"
<- "Compilation directory is /home2/sohan/rel4/build/loads/mrc/voice/samapp/\n"
<- "Source language is c.\n"
<- "Compiled with stabs debugging format.\n"
<- "(gdb) "
#  Reading file "samapp.c" from GDB...
-> "list samapp.c:1,1000000\n"
<- "1\tin samapp.c\n"
<- "(gdb) "
#  Reading file "samapp.c" from GDB...failed.
#  Reading file "/voice_app/bin/samapp.c"...
!  /voice_app/bin/samapp.c: No such file or directory
#  Reading file "/voice_app/bin/samapp.c"...No such file or directory.
-> "info source\n"
<- "Current source file is samapp.c\n"
<- "Compilation directory is /home2/sohan/rel4/build/loads/mrc/voice/samapp/\n"
<- "Source language is c.\n"
<- "Compiled with stabs debugging format.\n"
<- "(gdb) "
-> "info sources\n"
<- "Source files for which symbols have been read in:\n"
   "\n"
<- "samapp.c, /usr/include/sys/utsname.h, ../gkapi/gkcdri.h, ../gkapi/gkrgi.h, 
../h323/export/cm.h, ../h323/export/pvaltree.h, ../h323/export/psyntree.h, 
../h323/export/cmctrl.h, ../h323/export/transpcap.h, 
../h323/export/faststart.h, ../h323/export/redencod.h, 
../h323/export/userinput.h, ../h323/export/cmhook.h, ../h323/export/ci.h, 
../gkapi/cfgapi.h, ../gkapi/gkdpi.h, ../h323/export/h450.h, ../gkapi/gkmain.h, 
../gkapi/gkpli.h, ../h323/export/seli.h, ../h323/export/mei.h, apptypes.h, 
services.h, ../mcapi/mci_report.h, ../mcapi/mci_types.h, ../mcapi/mci_call.h, 
../mcapi/gkmc.h, ../mcapi/gkmci.h, /usr/include/signal.h, 
/usr/include/bits/sigset.h, /usr/include/bits/signum.h, /usr/include/time.h, 
/usr/include/bits/siginfo.h, /usr/include/bits/sigaction.h, 
/usr/include/bits/sigcontext.h, /usr/include/asm/sigcontext.h, 
/usr/include/bits/sigstack.h, 
/home2/sohan/rel4/build/loads/mrc/voice/../../../common/include/media_router.h, 
/usr/include/sys/time.h, /usr/include/bits/time.h, 
/home2/sohan/rel4/build/loads/mrc/voice/."
<- "./../../common/include/commonInc.h, 
/home2/sohan/rel4/build/loads/mrc/voice/../../../common/include/data_mgr.h, 
/home2/sohan/rel4/build/loads/mrc/voice/../../../common/include/mgrMsg.h, 
/home2/sohan/rel4/build/loads/mrc/voice/../../../common/include/connInfo.h, 
h245.c, h245.h, commands.c, commands.h, appcalls.c, appcalls.h, applrq.c, 
applrq.h, apprrq.c, apprrq.h, appgrq.c, appgrq.h, endpoints.c, 
../gkapi/gksvci.h, endpoints.h, islands.c, islands.h, neighbors.c, neighbors.h, 
parameters.c, parameters.h, dialplan.c, dialplan.h, ../h323/export/cmras.h, 
../gkapi/rvstd.h, ../gkapi/gkTypes.h, ../gkapi/gkadd.h, ../gkapi/gklrqi.h, 
cdr.c, /usr/include/stdio.h, 
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stdarg.h, 
/usr/include/stdlib.h, /usr/include/sys/types.h, cdr.h, ../gkapi/rvcommon.h, 
../gkapi/gkcci.h, ../gkapi/gkcdri_Types.h, allocations.c, 
/home2/sohan/rel4/build/loads/mrc/voice/../../../common/include/our_tools_space.h,
 /usr/include/features.h, /usr/include/sys/cdefs.h, /usr/include/gnu/stubs.h, 
/usr"
<- "/include/bits/types.h, /usr/include/endian.h, /usr/include/bits/endian.h, 
/usr/include/sys/select.h, /usr/include/bits/select.h, 
/usr/include/sys/sysmacros.h, /usr/include/bits/utsname.h, 
/usr/include/sys/socket.h, /usr/include/bits/socket.h, 
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/limits.h, 
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/syslimits.h, 
/usr/include/limits.h, /usr/include/bits/posix1_lim.h, 
/usr/include/bits/local_lim.h, /usr/include/linux/limits.h, 
/usr/include/bits/posix2_lim.h, /usr/include/bits/sockaddr.h, 
/usr/include/asm/socket.h, /usr/include/asm/sockios.h, /usr/include/sys/ipc.h, 
/usr/include/bits/ipc.h, /usr/include/netinet/ip.h, /usr/include/netinet/in.h, 
/usr/include/stdint.h, /usr/include/bits/wordsize.h, /usr/include/bits/in.h, 
/usr/include/bits/byteswap.h, /usr/include/libio.h, /usr/include/_G_config.h, 
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h, 
/usr/include/bits/stdio_lim.h, /usr/include/netdb.h, /usr/include/rpc/netdb.h, 
/usr/includ"
<- "e/alloca.h, /usr/include/unistd.h, /usr/include/bits/posix_opt.h, 
/usr/include/bits/confname.h, /usr/include/getopt.h, /usr/include/string.h, 
/usr/include/memory.h, utilities.h, allocations.h, init.c, 
../include/libc-symbols.h, 
/usr/src/bs/BUILD/glibc-2.1.3/build-i386-linux/config.h, ../include/libintl.h, 
../intl/libintl.h, ../include/features.h, ../include/sys/cdefs.h, 
../misc/sys/cdefs.h, ../include/locale.h, ../locale/locale.h, 
../include/xlocale.h, ../locale/xlocale.h, 
../sysdeps/unix/sysv/linux/_G_config.h, 
../sysdeps/unix/sysv/linux/bits/types.h, 
../linuxthreads/sysdeps/pthread/bits/pthreadtypes.h, 
../sysdeps/unix/sysv/linux/bits/sched.h\n"
   "\n"
<- "Source files for which symbols will be read in on demand:\n"
   "\n"
<- "../sysdeps/unix/sysv/linux/bits/stat.h, ../time/time.h, ../include/time.h, 
../io/sys/stat.h, ../include/sys/stat.h, stat.c, md5.c, asn1.c, snmp_auth.c, 
mib.h, snmp.c, snmpdump.c, md5.h, usec.c, /usr/include/bits/string2.h, 
/usr/include/stdlib.h, /usr/include/bits/socket.h, /usr/include/sys/types.h, 
snmp_api.c, snmp_api.h, /usr/include/time.h, /usr/include/asm/param.h, 
/usr/include/linux/param.h, /usr/include/sys/param.h, snmp_client.c, 
../../../include/our_tools_space.h, snmp_client.h, snmp_impl.h, asn1.h, snmp.h, 
/usr/include/bits/string.h, /usr/include/bits/stdio.h, voice_app_snmp_trap.c, 
/users/sohan/rel4/build/common/include/our_tools_space.h, 
/users/sohan/rel4/build/common/include/commonInc.h, /usr/include/sys/un.h, 
/usr/include/bits/uio.h, /usr/include/sys/uio.h, our_utilities.c, 
../../include/sqltypes.h, ../../include/timerStuf.h, 
/usr/include/bits/sigstack.h, /usr/include/asm/sigcontext.h, 
/usr/include/bits/sigaction.h, /usr/include/bits/siginfo.h, 
/usr/include/signal.h, /usr/lib/gcc-lib/i386-redhat-l"
<- "inux/egcs-2.91.66/include/stdarg.h, 
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/stddef.h, 
/usr/include/netinet/in.h, /usr/include/sys/socket.h, log_dbase.c, 
../../include/log_dbase.h, ../../include/log_message.h, ../../include/sqlext.h, 
../../include/odbcInit.h, ../../include/sql.h, ../../include/logs.h, 
/usr/include/rpc/netdb.h, /usr/include/netdb.h, 
../../include/our_tools_space.h, ../../include/commonInc.h, 
/usr/include/bits/in.h, /usr/include/netinet/ip.h, /usr/include/sys/utsname.h, 
../../include/media_router.h, /usr/include/malloc.h, /usr/include/bits/fcntl.h, 
/usr/include/fcntl.h, /usr/include/ctype.h, /usr/include/libio.h, 
/usr/include/bits/shm.h, /usr/include/bits/confname.h, /usr/include/bits/ipc.h, 
/usr/include/bits/stat.h, /usr/include/sys/stat.h, /usr/include/bits/time.h, 
/usr/include/bits/sigset.h, /usr/include/sys/select.h, 
/usr/include/bits/types.h, /usr/include/sys/time.h, log_message.c, lhash.h, 
lhash.c, iannexe.c, iannetmr.c, ianneses.c, iannerw.c, ../lowunix/mei.h, 
../config/ci"
<- ".h, channels.h, pdlproc.h, config.c, bheap.h, bheap.c, ../lowunix/mti.h, 
llist.h, iannexe.h, annexe.h, annexe.c, ../cm/cmintr.h, tunnCB.c, ms.h, 
../annexe/annexe.h, tpkt.h, ../asn/syntree.h, transport.h, ../cm/cmhook.h, 
../cm/userinput.h, ../cm/redencod.h, ../cm/faststart.h, ../cm/transpcap.h, 
../cm/cmctrl.h, ../cm/cmras.h, ../asn/pvaltree.h, ../cm/cm.h, transport.c, 
randfunc.c, ra.h, ra.c, pdlscre.h, pdlldscr.h, pdlldscr.c, ohash.h, ohash.c, 
object.h, object.c, mlist.h, mlist.c, mei.h, mei.c, intutils.h, intutils.c, 
hashfunc.c, getcid.c, ../asn/psyntree.h, pdlapi.h, ../pdl/pdlscre.h, 
../ads/rid.h, function.c, etimer.h, rlist.h, etimer.c, emanag.c, copybits.c, 
cisupp.h, ci.h, cifile.c, chutils.c, chash.h, chash.c, ../ads/rlist.h, 
channels.c, ../ads/shdic.h, ../ads/ohash.h, ../ads/pool.h, ../ads/ra.h, 
../ads/rtree.h, cdfinternal.h, cdfdic.h, cdf.h, cdffile.h, cdfexefile.h, 
cdfload.h, cdfload.c, ../pdlproc/pdlapi.h, catdebprn.c, cat.h, catintr.h, 
cat.c, cmhook.h, userinput.h, redencod.h, faststart.h, transpcap."
<- "h, cmctrl.h, cmras.h, cm.h, caputils.c, callobj.c, bb.h, bb.c, syntree.h, 
../ads/token.h, asntoken.c, ../cdf/cdffile.h, ../cdf/cdf.h, ../ads/bb.h, 
../ads/rpool.h, valstruct.h, valtree.h, valtree.c, eventH.h, 
../pdlproc/pdlproc.h, tunneling.c, ts.h, ts.c, chutils.h, ../mib/cmmib.h, 
../tunneling/tunneling.h, ../q931/emanag.h, ../middle/transport.h, 
../asn/valtree.h, transportchan.c, transpcap.c, ../lowunix/li.h, tpkt.c, 
token.h, token.c, ../cdf/cdfload.h, ../cdf/cdfexefile.h, asntoken.h, syntree.c, 
strutils.h, strutils.c, stkutils.c, cmmib.h, statistic.h, statistic.c, 
sigcatch.c, ../utils/convert2c.h, hashfunc.h, shdic.h, shdic.c, ti.h, mti.h, 
../ads/etimer.h, ../ads/ts.h, 
/home2/sohan/rel4/build/loads/mrc/voice/h323/include/rvcommon.h, 
/usr/include/sys/times.h, seli.c, rtree.h, rtree.c, rpool.h, rpool.c, rlist.c, 
copybits.h, rid.h, rid.c, rasoutdb.h, rasoutdb.c, ../mib/statistic.h, 
../pdlproc/channels.h, ../rasdb/rasoutdb.h, rasout.c, efrm.h, rasmux.c, 
raslow.c, rasirrdb.h, ../newras/ras.h, rasirrdb.c, ../cat/"
<- "cat.h, ../rasdb/rasirrdb.h, rasirr.c, rasindb.h, rasindb.c, raserr.c, 
../rasdb/rasindb.h, rasIn.c, netlow.h, ras.h, rasmux.h, ras.c, radvbig.h, 
radvh323.c, emanag.h, q931.h, q931.c, pvaltree.h, pvaltree.c, psyntree.h, 
psyntree.c, prnutils.h, prnutils.c, pool.h, pool.c, persimpl.h, persimpl.c, 
perseqof.c, perseq.c, peroid.c, peroctst.c, perchrst.c, perchoic.c, per.h, 
perintr.h, perBitString.c, ../asn/asntoken.h, ../ads/sra.h, peroid.h, 
perBitString.h, peroctst.h, perchrst.h, perchoic.h, perseqof.h, perseq.h, 
../ads/copybits.h, per.c, pdlscre.c, pdlraw.h, ../utils/object.h, pdlraw.c, 
../pdl/pdlldscr.h, pdlproc.c, ../lowunix/pdlraw.h, function.h, ../per/per.h, 
../q931/q931.h, transportchan.h, pdlapiin.h, pdlapi.c, oidutils.h, oidutils.c, 
netutl.h, netutl.c, ../lowunix/ti.h, msprint.c, ../ads/chash.h, msg.h, msg.c, 
memfunc.h, memfunc.c, lm.h, lm.c, sigcatch.h, semi.h, seli.h, li.h, 
/usr/include/sys/ttydefaults.h, /usr/include/bits/ioctl-types.h, 
/usr/include/asm/ioctl.h, /usr/include/asm/ioctls.h, /usr/include/bi"
<- "ts/ioctls.h, /usr/include/sys/ioctl.h, /usr/include/netinet/tcp.h, li.c, 
../cm/q931asn1.h, tunneling.h, tunnintr.h, incomingSM.c, ../utils/prnutils.h, 
faststart.c, ../middle/ms.h, ../per/persimpl.h, ../per/perintr.h, efrm.c, 
../utils/intutils.h, conf.c, cmutils.c, cmsize.c, ../ads/hashfunc.h, 
../ads/mlist.h, ../newras/netlow.h, ../newras/rasmux.h, ../newras/efrm.h, 
cmrasmodule.c, cmintr.h, cmras.c, ../pdlproc/transportchan.h, cmhook.c, 
cmdebprn.c, ../utils/oidutils.h, cmctrl.c, h245.h, cmchan.h, caputils.h, 
cmchan.c, q931asn1.h, stkutils.h, conf.h, ../pdlproc/chutils.h, cmutils.h, 
../utils/strutils.h, ../lowunix/msg.h, cm.c, cisupp.c, cibuf.h, 
../utils/netutl.h, cibuf.c, ci.c, CDRField.cpp, BooleanField.cpp, 
Bandwidth.cpp, AliasAddress.cpp, Version.cpp, UniqueIdentifier.cpp, 
TimeDifference.cpp, String.cpp, Port.cpp, Ip.cpp, GeneratorType.cpp, 
GKIdentifier.cpp, FileOutputStream.cpp, FieldFormat.cpp, EnumerationField.cpp, 
DateAndTime.cpp, CDRList.h, CDRList.cpp, String.h, BooleanField.h, 
EnumerationField.h, Gen"
<- "eratorType.h, Bandwidth.h, TimeDifference.h, DateAndTime.h, GKIdentifier.h, 
Version.h, UniqueIdentifier.h, AliasAddress.h, Port.h, Ip.h, 
CDRGeneratorInternal.cpp, CDRField.h, CDRGeneratorInternal.h, CDRGenerator.cpp, 
CDRFormatInternal.cpp, CDRFormatInternal.h, CDRFormat.cpp, 
CDRFileOutputStream.cpp, CDR.cpp, ../gkapi/gkmain.h, NetworkOutputStream.cpp, 
CDRQueue.cpp, ../h323/export/mti.h, ../h323/export/mei.h, 
../h323/export/tpkt.h, CDRNetworkOutputStream.cpp, CDRManager.cpp, 
CDRAdapter.cpp, FileOutputStream.h, CDRFileOutputStream.h, 
NetworkOutputStream.h, CDRNetworkOutputStream.h, CDRQueue.h, FieldFormat.h, 
CDRFormat.h, CDR.h, CDRGenerator.h, CDRManager.h, CDRAdapter.h, gkinclude.h, 
gkcdri.cpp, gkdputil.c, gkdpcevh.c, dpTable.c, gkdp.h, ../gkapi/gklrqi.h, 
../gkapi/cfgapi.h, ../gkapi/gkadd.h, ../h323/export/h450.h, ../gkapi/gkdpi.h, 
gkdpi.c, memoryrv.h, reghash.c, heap.c, cmutil.c, callh.h, bw.c, activity.c, 
thincci.c, service.c, ../gkapi/gkrgi.h, ../gkapi/gkstorage.h, semUtil.c, 
regutil.c, heap.h, ../gkapi/gkT"
<- "ypes.h, regtable.c, regsearch.c, ../gkapi/gkpli.h, regsearch.h, regtable.h, 
service.h, regras.c, netphys.c, net323.c, memoryrv.c, thincci.h, 
../h323/export/faststart.h, ../h323/export/transpcap.h, 
../h323/export/cmctrl.h, ../h323/export/cmras.h, ../h323/export/cm.h, 
lrqtable.c, linehunt.c, iutil.c, ../h323/export/ti.h, gkTi.c, cmutil.h, 
gkcfg.h, gksvci.c, gkstorage.c, reghash.h, gkrgi.c, gkplc.c, ../gkapi/gkcci.h, 
gkpli.c, gkNVMem.c, ../h323/export/cmsize.h, gkmain.c, lrqtable.h, gklrqi.c, 
gkhash.c, gkcfg.c, ../h323/export/ci.h, ../h323/export/cmhook.h, 
../h323/export/userinput.h, ../h323/export/redencod.h, 
../h323/export/psyntree.h, ../h323/export/pvaltree.h, ../gkapi/rvcommon.h, 
gkcci.c, gkadd.c, ../h323/export/msg.h, general.c, facility.c, dispatch.h, 
../h323/export/cibuf.h, activity.h, dispatch.c, ../gkapi/mib.h, sat.h, 
cfgapi.c, ../mcapi/gkmci.h, ../mcapi/gkmc.h, ../mcapi/mci_mc.h, 
../mcapi/mci_conf.h, ../mcapi/mci_call.h, ../mcapi/mci_general.h, 
../mcapi/mci_report.h, ../mcapi/mci_types.h, /home2/sohan/"
<- "rel4/build/loads/mrc/voice/../../../common/include/connInfo.h, 
/home2/sohan/rel4/build/loads/mrc/voice/../../../common/include/mgrMsg.h, 
/home2/sohan/rel4/build/loads/mrc/voice/../../../common/include/data_mgr.h, 
/home2/sohan/rel4/build/loads/mrc/voice/../../../common/include/commonInc.h, 
/home2/sohan/rel4/build/loads/mrc/voice/../../../common/include/media_router.h, 
gkhash.h, linehunt.h, facility.h, bw.h, netphys.h, calls.h, regras.h, iutil.h, 
regutil.h, net323.h, gkTi.h, ../h323/export/stkutils.h, calls.c, address.h, 
gkNVMem.h, general.h, platform.h, address.c, util.c, ../h323/export/li.h, 
/usr/include/stdint.h, gkconnectmc.c, gkmcevh.c, gkconnectmc.h, util.h, 
../gkapi/semUtil.h, /usr/include/arpa/inet.h, gkmci.c, gkNonstandard.c, 
gkCall.c, gkLocation.c, gkHook.c, gkNonstandard.h, gkHook.h, gkCall.h, 
gkLocation.h, gkStack.h, gkStack.c, gkApp.h, 
/home2/sohan/rel4/build/loads/mrc/voice/../../../common/include/our_tools_space.h,
 ../h323/export/seli.h, /usr/include/sys/shm.h, /usr/include/asm/errno.h, 
/usr/incl"
<- "ude/linux/errno.h, /usr/include/bits/errno.h, /usr/include/errno.h, 
apptypes.h, /usr/include/unistd.h, ../gkapi/gkcdri.h, gkApp.c, utilities.c, 
services.c, security.c, samappDns.c, /usr/include/bits/sigcontext.h, 
/usr/include/bits/signum.h, services.h, parameters.h, neighbors.h, ldapcfg.c, 
islands.h, h450pcfg.c, h450icfg.c, endpoints.h, ../gkapi/gksvci.h, 
../gkapi/rvstd.h, dialplan.h, databaseInterface.c, commands.h, 
../gkapi/gkcdri_Types.h, cdr.h, /usr/include/stdio.h, apptypes.c, apprrq.h, 
applrq.h, appgrq.h, appcalls.h, allocations.h, utilities.h, 
/usr/include/memory.h, /usr/include/string.h, /usr/include/getopt.h, 
/usr/include/bits/posix_opt.h, /usr/include/alloca.h, 
/usr/include/bits/stdio_lim.h, /usr/include/_G_config.h, 
/usr/include/bits/byteswap.h, /usr/include/bits/wordsize.h, 
/usr/include/sys/ipc.h, /usr/include/asm/sockios.h, /usr/include/asm/socket.h, 
/usr/include/bits/sockaddr.h, /usr/include/bits/posix2_lim.h, 
/usr/include/linux/limits.h, /usr/include/bits/local_lim.h, 
/usr/include/bits/posix1_l"
<- "im.h, /usr/include/limits.h, 
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/syslimits.h, 
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/include/limits.h, 
/usr/include/bits/utsname.h, /usr/include/sys/sysmacros.h, 
/usr/include/bits/select.h, /usr/include/bits/endian.h, /usr/include/endian.h, 
/usr/include/gnu/stubs.h, /usr/include/sys/cdefs.h, /usr/include/features.h, 
../sysdeps/unix/sysv/linux/bits/sched.h, 
../linuxthreads/sysdeps/pthread/bits/pthreadtypes.h, 
../sysdeps/unix/sysv/linux/bits/types.h, 
../sysdeps/unix/sysv/linux/_G_config.h, ../locale/xlocale.h, 
../include/xlocale.h, ../locale/locale.h, ../include/locale.h, 
../misc/sys/cdefs.h, ../include/sys/cdefs.h, ../include/features.h, 
../intl/libintl.h, ../include/libintl.h, 
/usr/src/bs/BUILD/glibc-2.1.3/build-i386-linux/config.h, 
../include/libc-symbols.h\n"
<- "(gdb) "
-> "info line main\n"
<- "Line 252 of \"samapp.c\" starts at address 0x8050520 <main> and ends at 
0x8050523 <main+3>.\n"
<- "(gdb) "
#  Reading file "/voice_app/bin/samapp.c"...
#  Reading file "/voice_app/bin/samapp.c"...No such file or directory.
#  Reading file "samapp.c" from GDB...
#  Reading file "samapp.c" from GDB...failed.
#  Reading file "/voice_app/bin/samapp.c"...
#  Reading file "/voice_app/bin/samapp.c"...No such file or directory.
-> "info source\n"
<- "Current source file is samapp.c\n"
<- "Compilation directory is /home2/sohan/rel4/build/loads/mrc/voice/samapp/\n"
<- "Source language is c.\n"
<- "Compiled with stabs debugging format.\n"
<- "(gdb) "
-> "info line MAIN\n"
<- "Function \"MAIN\" not defined."
<- "\n"
<- "(gdb) "
-> "info files\n"
<- "Symbols from \"/voice_app/bin/RVGK\".\n"
<- "Local exec file:\n"
<- "\t`/voice_app/bin/RVGK\', file type elf32-i386.\n"
<- "\tEntry point: 0x8049d70\n"
<- "\t0x080480f4 - 0x08048107 is .interp\n"
<- "\t0x08048108 - 0x08048128 is .note.ABI-tag\n"
<- "\t0x08048128 - 0x080484b4 is .hash\n"
<- "\t0x080484b4 - 0x08048cb4 is .dynsym\n"
<- "\t0x08048cb4 - 0x08049161 is .dynstr\n"
<- "\t0x08049162 - 0x08049262 is .gnu.version\n"
<- "\t0x08049264 - 0x080492b4 is .gnu.version_r\n"
<- "\t0x080492b4 - 0x080492bc is .rel.got\n"
<- "\t0x080492bc - 0x080492ec is .rel.bss\n"
<- "\t0x080492ec - 0x08049654 is .rel.plt\n"
<- "\t0x08049654 - 0x08049683 is .init\n"
<- "\t0x08049684 - 0x08049d64 is .plt\n"
<- "\t0x08049d70 - 0x08157ce8 is .text\n"
<- "\t0x08157ce8 - 0x08157d02 is .fini\n"
<- "\t0x08157d20 - 0x0819b150 is .rodata\n"
<- "\t0x0819c160 - 0x08226120 is .data\n"
<- "\t0x08226120 - 0x0824da50 is .eh_frame\n"
<- "\t0x0824da50 - 0x0824dc28 is .gcc_except_table\n"
<- "\t0x0824dc28 - 0x0824dc30 is .ctors\n"
<- "\t0x0824dc30 - 0x0824dc38 is .dtors\n"
<- "\t0x0824dc38 - 0x0824ddfc is .got\n"
<- "\t0x0824ddfc - 0x0824deb4 is .dynamic\n"
<- "\t0x0824dec0 - 0x082624c4 is .bss\n"
<- "(gdb) "
-> "info line main_\n"
<- "Function \"main_\" not defined."
<- "\n"
<- "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
<- "(gdb) "
-> "info line MAIN_\n"
<- "Function \"MAIN_\" not defined."
<- "\n"
<- "(gdb) "
-> "info source\n"
<- "Current source file is samapp.c\n"
<- "Compilation directory is /home2/sohan/rel4/build/loads/mrc/voice/samapp/\n"
<- "Source language is c.\n"
<- "Compiled with stabs debugging format.\n"
<- "(gdb) "
-> "info line main__\n"
<- "Function \"main__\" not defined."
<- "\n"
<- "(gdb) "
-> "info source\n"
<- "Current source file is samapp.c\n"
<- "Compilation directory is /home2/sohan/rel4/build/loads/mrc/voice/samapp/\n"
<- "Source language is c.\n"
<- "Compiled with stabs debugging format.\n"
<- "(gdb) "
-> "info line MAIN__\n"
<- "Function \"MAIN__\" not defined."
<- "\n"
<- "(gdb) "
-> "info source\n"
<- "Current source file is samapp.c\n"
<- "Compilation directory is /home2/sohan/rel4/build/loads/mrc/voice/samapp/\n"
<- "Source language is c.\n"
<- "Compiled with stabs debugging format.\n"
<- "(gdb) "
-> "info line _main\n"
<- "Function \"_main\" not defined."
<- "\n"
<- "(gdb) "
-> "info source\n"
<- "Current source file is samapp.c\n"
<- "Compilation directory is /home2/sohan/rel4/build/loads/mrc/voice/samapp/\n"
<- "Source language is c.\n"
<- "Compiled with stabs debugging format.\n"
<- "(gdb) "
-> "info line _MAIN\n"
<- "Function \"_MAIN\" not defined."
<- "\n"
<- "(gdb) "
-> "info source\n"
<- "Current source file is samapp.c\n"
<- "Compilation directory is /home2/sohan/rel4/build/loads/mrc/voice/samapp/\n"
<- "Source language is c.\n"
<- "Compiled with stabs debugging format.\n"
<- "(gdb) "
-> "info line __main\n"
<- "Function \"__main\" not defined."
<- "\n"
<- "(gdb) "
-> "info source\n"
<- "Current source file is samapp.c\n"
<- "Compilation directory is /home2/sohan/rel4/build/loads/mrc/voice/samapp/\n"
<- "Source language is c.\n"
<- "Compiled with stabs debugging format.\n"
<- "(gdb) "
-> "info line __MAIN\n"
<- "Function \"__MAIN\" not defined."
<- "\n"
<- "(gdb) "
-> "info source\n"
<- "Current source file is samapp.c\n"
<- "Compilation directory is /home2/sohan/rel4/build/loads/mrc/voice/samapp/\n"
<- "Source language is c.\n"
<- "Compiled with stabs debugging format.\n"
<- "(gdb) "
-> "info line my_main\n"
<- "Function \"my_main\" not defined."
<- "\n"
<- "(gdb) "
-> "info source\n"
<- "Current source file is samapp.c\n"
<- "Compilation directory is /home2/sohan/rel4/build/loads/mrc/voice/samapp/\n"
<- "Source language is c.\n"
<- "Compiled with stabs debugging format.\n"
<- "(gdb) "
-> "info line the_main\n"
<- "Function \"the_main\" not defined."
<- "\n"
<- "(gdb) "
-> "info source\n"
<- "Current source file is samapp.c\n"
<- "Compilation directory is /home2/sohan/rel4/build/loads/mrc/voice/samapp/\n"
<- "Source language is c.\n"
<- "Compiled with stabs debugging format.\n"
<- "(gdb) "
-> "info line vxworks_main\n"
<- "Function \"vxworks_main\" not defined."
<- "\n"
<- "(gdb) "
-> "info source\n"
<- "Current source file is samapp.c\n"
<- "Compilation directory is /home2/sohan/rel4/build/loads/mrc/voice/samapp/\n"
<- "Source language is c.\n"
<- "Compiled with stabs debugging format.\n"
<- "(gdb) "
-> "info line main_vxworks\n"
<- "Function \"main_vxworks\" not defined."
<- "\n"
<- "(gdb) "
-> "source /tmp/filee9iT3b\n"
<- "Line 2 of \"calls.c\" is at address 0x8056d90 <calInit> but contains no 
code.\n"
<- "The target architecture is assumed to be i386\n"
<- "Byte order is not selectable.The target endianness is set automatically 
(currently little endian)\n"
<- "(gdb) "
-> "info breakpoints\n"
<- "No breakpoints or watchpoints.\n"
<- "(gdb) "
#  Reading file "/voice_app/bin/calls.c"...
#  Reading file "/voice_app/bin/calls.c"...No such file or directory.
-> "info source\n"
<- "Current source file is samapp.c\n"
<- "Compilation directory is /home2/sohan/rel4/build/loads/mrc/voice/samapp/\n"
<- "Source language is c.\n"
<- "Compiled with stabs debugging format.\n"
<- "(gdb) "
#  Reading file "calls.c" from GDB...
-> "list calls.c:1,1000000\n"
<- "1\tcalls.c: No such file or directory.\n"
<- "\tin calls.c\n"
<- "(gdb) "
!  in calls.c
#  Reading file "calls.c" from GDB...done.
#  Source "calls.c" (from GDB) 1 line, 36 characters
#  Setting buttons...
#  Setting buttons...done.
-> "# reset\n"
<- "(gdb) "
-> "info breakpoints\n"
<- "No breakpoints or watchpoints.\n"
<- "(gdb) "
-> "display\n"
<- "(gdb) "
-> "info display\n"
<- "There are no auto-display expressions now.\n"
<- "(gdb) "
-> "info source\n"
<- "Current source file is calls.c\n"
   "Compilation directory is 
/home2/sohan/rel4/build/loads/mrc/voice/gatekeeper/\n"
   "Source language is c.\n"
   "Compiled with stabs debugging format.\n"
<- "(gdb) "
-> "info files\n"
<- "Symbols from \"/voice_app/bin/RVGK\".\n"
   "Local exec file:\n"
   "\t`/voice_app/bin/RVGK\', file type elf32-i386.\n"
   "\tEntry point: 0x8049d70\n"
   "\t0x080480f4 - 0x08048107 is .interp\n"
   "\t0x08048108 - 0x08048128 is .note.ABI-tag\n"
   "\t0x08048128 - 0x080484b4 is .hash\n"
   "\t0x080484b4 - 0x08048cb4 is .dynsym\n"
   "\t0x08048cb4 - 0x08049161 is .dynstr\n"
   "\t0x08049162 - 0x08049262 is .gnu.version\n"
   "\t0x08049264 - 0x080492b4 is .gnu.version_r\n"
   "\t0x080492b4 - 0x080492bc is .rel.got\n"
   "\t0x080492bc - 0x080492ec is .rel.bss\n"
   "\t0x080492ec - 0x08049654 is .rel.plt\n"
   "\t0x08049654 - 0x08049683 is .init\n"
   "\t0x08049684 - 0x08049d64 is .plt\n"
   "\t0x08049d70 - 0x08157ce8 is .text\n"
   "\t0x08157ce8 - 0x08157d02 is .fini\n"
   "\t0x08157d20 - 0x0819b150 is .rodata\n"
   "\t0x0819c160 - 0x08226120 is .data\n"
   "\t0x08226120 - 0x0824da50 is .eh_frame\n"
   "\t0x0824da50 - 0x0824dc28 is .gcc_except_table\n"
   "\t0x0824dc28 - 0x0824dc30 is .ctors\n"
   "\t0x0824dc30 - 0x0824dc38 is .dtors\n"
   "\t0x0824dc38 - 0x0824ddfc is .got\n"
   "\t0x0824ddfc - 0x0824deb4 is .dynamic\n"
   "\t0x0824dec0 - 0x082624c4 is .bss\n"
   "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
   "(gdb) "
#  Opening session "RVGK"...done.
-> "show confirm\n"
<- "Whether to confirm potentially dangerous operations is off.\n"
   "(gdb) "
-> "show editing\n"
<- "Editing of command lines as they are typed is on.\n"
   "(gdb) "
-> "show exec-done-display\n"
<- "Notification of completion for asynchronous execution commands is off.\n"
   "(gdb) "
-> "show history expansion\n"
<- "History expansion on command input is off.\n"
   "(gdb) "
-> "show history save\n"
<- "Saving of the history record on exit is off.\n"
   "(gdb) "
-> "show opaque-type-resolution\n"
<- "Resolution of opaque struct/class/union types (if set before loading 
symbols) is on.\n"
   "(gdb) "
-> "show overload-resolution\n"
<- "Overload resolution in evaluating C++ functions is on.\n"
   "(gdb) "
-> "show pagination\n"
<- "State of pagination is on.\n"
   "(gdb) "
-> "show print address\n"
<- "Printing of addresses is on.\n"
   "(gdb) "
-> "show print array\n"
<- "Prettyprinting of arrays is off.\n"
   "(gdb) "
-> "show print asm-demangle\n"
<- "Demangling of C++ names in disassembly listings is on.\n"
   "(gdb) "
-> "show print demangle\n"
<- "Demangling of encoded C++ names when displaying symbols is on.\n"
   "(gdb) "
-> "show print null-stop\n"
<- "Printing of char arrays to stop at first null char is off.\n"
   "(gdb) "
-> "show print object\n"
<- "Printing of object\'s derived type based on vtable info is off.\n"
   "(gdb) "
-> "show print pascal_static-members\n"
<- "Printing of pascal static members is on.\n"
   "(gdb) "
-> "show print pretty\n"
<- "Prettyprinting of structures is off.\n"
   "(gdb) "
-> "show print sevenbit-strings\n"
<- "Printing of 8-bit characters in strings as \\n"
   "nn is off.\n"
   "(gdb) "
-> "show print static-members\n"
<- "Printing of C++ static members is on.\n"
   "(gdb) "
-> "show print symbol-filename\n"
<- "Printing of source filename and line number with <symbol> is off.\n"
   "(gdb) "
-> "show print union\n"
<- "Printing of unions interior to structures is on.\n"
   "(gdb) "
-> "show print vtbl\n"
<- "Printing of C++ virtual function tables is off.\n"
   "(gdb) "
-> "show remotebreak\n"
<- "Whether to send break if interrupted is off.\n"
   "(gdb) "
-> "show remotecache\n"
<- "Cache use for remote targets is off.\n"
   "(gdb) "
-> "show step-mode\n"
<- "Mode of the step operation is off.\n"
   "(gdb) "
-> "show symbol-reloading\n"
<- "Dynamic symbol table reloading multiple times in one run is off.\n"
   "(gdb) "
-> "show unwindonsignal\n"
<- "Unwinding of stack if a signal is received while in a call dummy is off.\n"
   "(gdb) "
-> "show verbose\n"
<- "Verbosity is off.\n"
   "(gdb) "
-> "show write\n"
<- "Writing into executable and core files is off.\n"
   "(gdb) "
-> "show auto-solib-add\n"
<- "Autoloading of shared library symbols is 1.\n"
   "(gdb) "
-> "show can-use-hw-watchpoints\n"
<- "Debugger\'s willingness to use watchpoint hardware is 1.\n"
   "(gdb) "
-> "show debug arch\n"
<- "Architecture debugging is 0.\n"
   "(gdb) "
-> "show debug event\n"
<- "Event debugging is 0.\n"
   "(gdb) "
-> "show debug expression\n"
<- "Expression debugging is 0.\n"
   "(gdb) "
-> "show debug overload\n"
<- "Debugging of C++ overloading is 0.\n"
   "(gdb) "
-> "show debug remote\n"
<- "Debugging of remote protocol is 0.\n"
   "(gdb) "
-> "show debug serial\n"
<- "Serial debugging is 0.\n"
   "(gdb) "
-> "show debug target\n"
<- "Target debugging is 0.\n"
   "(gdb) "
-> "show debugvarobj\n"
<- "Varobj debugging is 0.\n"
   "(gdb) "
-> "show stop-on-solib-events\n"
<- "Stopping for shared library events is 0.\n"
   "(gdb) "
-> "show architecture\n"
<- "The target architecture is assumed to be i386\n"
   "(gdb) "
-> "show endian\n"
<- "The target endianness is set automatically (currently little endian)\n"
   "(gdb) "
-> "show demangle-style\n"
<- "The current C++ demangling style is \"auto\".\n"
   "(gdb) "
-> "show language\n"
<- "The current source language is \"auto\".\n"
   "(gdb) "
-> "show disassembly-flavor\n"
<- "The disassembly flavor is \"att\".\n"
   "(gdb) "
-> "show follow-fork-mode\n"
<- "Debugger response to a program call of fork or vfork is \"parent\".\n"
   "(gdb) "
-> "show scheduler-locking\n"
<- "Mode for locking scheduler during execution is \"off\".\n"
   "(gdb) "
-> "show check range\n"
<- "Range checking is \"auto; currently off\".\n"
   "(gdb) "
-> "show check type\n"
<- "Type checking is \"auto; currently off\".\n"
   "(gdb) "
-> "show annotate\n"
<- "Annotation_level is 1.\n"
   "(gdb) "
-> "show case-sensitive\n"
<- "Case sensitivity in name search is \"auto; currently on\".\n"
   "(gdb) "
-> "show complaints\n"
<- "Max number of complaints about incorrect symbols is 0.\n"
   "(gdb) "
-> "show download-write-size\n"
<- "The write size used when downloading a program is 512.\n"
   "(gdb) "
-> "show gnutarget\n"
<- "The current BFD target is \"auto\".\n"
   "(gdb) "
-> "show height\n"
<- "Number of lines gdb thinks are in a page is unlimited.\n"
   "(gdb) "
-> "show history filename\n"
<- "The filename in which to record the command history is 
\"/voice_app/bin/.gdb_history\".\n"
   "(gdb) "
-> "show history size\n"
<- "The size of the command history is 1000.\n"
   "(gdb) "
-> "show input-radix\n"
<- "Default input radix for entering numbers is 10.\n"
   "(gdb) "
-> "show listsize\n"
<- "Number of source lines gdb will list by default is 10.\n"
   "(gdb) "
-> "show os\n"
<- "Operating system is \"\".\n"
   "(gdb) "
-> "show output-radix\n"
<- "Default output radix for printing of values is 10.\n"
   "(gdb) "
-> "show print elements\n"
<- "Limit on string chars or array elements to print is 200.\n"
   "(gdb) "
-> "show print max-symbolic-offset\n"
<- "The largest offset that will be printed in <symbol+1234> form is 
unlimited.\n"
   "(gdb) "
-> "show print repeats\n"
<- "Threshold for repeated print elements is 10.\n"
   "(gdb) "
-> "show prompt\n"
<- "Gdb\'s prompt is \"(gdb) \".\n"
   "(gdb) "
-> "show prompt-escape-char\n"
<- "Escape character for formatting of gdb\'s prompt is 0.\n"
   "(gdb) "
-> "show remote P-packet\n"
<- "Support for remote protocol `P\' (set-register) packet is auto-detected, 
currently unknown.\n"
   "(gdb) "
-> "show remote X-packet\n"
<- "Support for remote protocol `X\' (binary-download) packet is auto-detected, 
currently unknown.\n"
   "(gdb) "
-> "show remote access-watchpoint-packet\n"
<- "Support for remote protocol `Z4\' (access-watchpoint) packet is 
auto-detected, currently unknown.\n"
   "(gdb) "
-> "show remote binary-download-packet\n"
<- "Support for remote protocol `X\' (binary-download) packet is auto-detected, 
currently unknown.\n"
   "(gdb) "
-> "show remote hardware-breakpoint-packet\n"
<- "Support for remote protocol `Z1\' (hardware-breakpoint) packet is 
auto-detected, currently unknown.\n"
   "(gdb) "
-> "show remote memory-read-packet-size\n"
<- "The memory-read-packet-size is 0. Packets are limited to 399 bytes.\n"
   "(gdb) "
-> "show remote memory-write-packet-size\n"
<- "The memory-write-packet-size is 0. Packets are limited to 399 bytes.\n"
   "(gdb) "
-> "show remote read-watchpoint-packet\n"
<- "Support for remote protocol `Z3\' (read-watchpoint) packet is 
auto-detected, currently unknown.\n"
   "(gdb) "
-> "show remote set-register-packet\n"
<- "Support for remote protocol `P\' (set-register) packet is auto-detected, 
currently unknown.\n"
   "(gdb) "
-> "show remote software-breakpoint-packet\n"
<- "Support for remote protocol `Z0\' (software-breakpoint) packet is 
auto-detected, currently unknown.\n"
   "(gdb) "
-> "show remote write-watchpoint-packet\n"
<- "Support for remote protocol `Z2\' (write-watchpoint) packet is 
auto-detected, currently unknown.\n"
   "(gdb) "
-> "show remoteaddresssize\n"
<- "The maximum size of the address (in bits) in a memory packet is 32.\n"
   "(gdb) "
-> "show remotebaud\n"
<- "Baud rate for remote serial I/O is 4294967295.\n"
   "(gdb) "
-> "show remotedevice\n"
<- "Device for remote serial I/O is \"\".\n"
   "(gdb) "
-> "show remotelogbase\n"
<- "Numerical base for remote session logging is \"ascii\".\n"
   "(gdb) "
-> "show remotelogfile\n"
<- "Filename for remote session recording is \"\".\n"
   "(gdb) "
-> "show remotetimeout\n"
<- "Timeout limit to wait for target to respond is 2.\n"
   "(gdb) "
-> "show solib-absolute-prefix\n"
<- "Prefix for loading absolute shared library symbol files is \"\".\n"
   "(gdb) "
-> "show solib-search-path\n"
<- "The search path for loading non-absolute shared library symbol files is 
\"\".\n"
   "(gdb) "
-> "show watchdog\n"
<- "Watchdog timer is 0.\n"
   "(gdb) "
-> "show width\n"
<- "Number of characters gdb thinks are in a line is unlimited.\n"
   "(gdb) "
-> "dir /users/sohan/rel4/build/loads/mrc/voice/gatekeeper\n"
<- "(gdb) "
-> "display\n"
<- "(gdb) "
-> "show dir\n"
<- "Source directories searched: 
/users/sohan/rel4/build/loads/mrc/voice/gatekeeper:$cdir:$cwd\n"
   "(gdb) "
#  Source directories searched: 
/users/sohan/rel4/build/loads/mrc/voice/gatekeeper:$cdir:$cwd
-> "dir /users/sohan/rel4/build/loads/mrc/voice/samapp\n"
<- "(gdb) "
-> "display\n"
<- "(gdb) "
-> "show dir\n"
<- "Source directories searched: 
/users/sohan/rel4/build/loads/mrc/voice/samapp:/users/sohan/rel4/build/loads/mrc/voice/gatekeeper:$cdir:$cwd\n"
   "(gdb) "
#  Source directories searched: 
/users/sohan/rel4/build/loads/mrc/voice/samapp:/users/sohan/rel4/build/loads/mrc/voice/gatekeeper:$cdir:$cwd
-> "info line calls.c:1\n"
<- "Line 1 of \"calls.c\" is at address 0x8056d90 <calInit> but contains no 
code.\n"
   
"\032\032/users/sohan/rel4/build/loads/mrc/voice/gatekeeper/calls.c:1:0:beg:0x8056d90\n"
   "(gdb) "
#  Reading file "/users/sohan/rel4/build/loads/mrc/voice/gatekeeper/calls.c"...
#  Reading file 
"/users/sohan/rel4/build/loads/mrc/voice/gatekeeper/calls.c"...done.
#  File "/users/sohan/rel4/build/loads/mrc/voice/gatekeeper/calls.c" 14089 
lines, 539470 characters
-> "output is\n"
<- "No symbol \"is\" in current context.\n"
   "(gdb) "
#  Enabling line numbers...
-> "info source\n"
<- "Current source file is calls.c\n"
   "Compilation directory is 
/home2/sohan/rel4/build/loads/mrc/voice/gatekeeper/\n"
   "Located in /users/sohan/rel4/build/loads/mrc/voice/gatekeeper/calls.c\n"
   "Contains 14089 lines.\n"
   "Source language is c.\n"
   "Compiled with stabs debugging format.\n"
   "(gdb) "
#  Reading file "/users/sohan/rel4/build/loads/mrc/voice/gatekeeper/calls.c"...
#  Reading file 
"/users/sohan/rel4/build/loads/mrc/voice/gatekeeper/calls.c"...done.
#  File "/users/sohan/rel4/build/loads/mrc/voice/gatekeeper/calls.c" 14089 
lines, 650659 characters
#  Enabling line numbers...done.
-> "x /i 0x8056d90\n"
<- "0x8056d90 <calInit>:\tpush   %ebp\n"
   "(gdb) "
-> "x /i 0x8056e90\n"
<- "0x8056e90 <calInit+256>:\ttest   %edx,%edx\n"
   "(gdb) "
#  Disassembling location 0x8056d90 to 0x8056e90...
-> "disassemble 0x8056d90 0x8056e90\n"
<- "Dump of assembler code from 0x8056d90 to 0x8056e90:\n"
   "0x8056d90 <calInit>:\tpush   %ebp\n"
   "0x8056d91 <calInit+1>:\tmov    %esp,%ebp\n"
   "0x8056d93 <calInit+3>:\tsub    $0x10,%esp\n"
   "0x8056d96 <calInit+6>:\tmov    0x8(%ebp),%eax\n"
   "0x8056d99 <calInit+9>:\tmov    %eax,0xfffffff0(%ebp)\n"
   "0x8056d9c <calInit+12>:\tmov    0xfffffff0(%ebp),%eax\n"
   "0x8056d9f <calInit+15>:\tmov    %eax,0x825746c\n"
   "0x8056da4 <calInit+20>:\tcmpl   $0x9,0x8(%ebp)\n"
   "0x8056da8 <calInit+24>:\tjg     0x8056db6 <calInit+38>\n"
   "0x8056daa <calInit+26>:\tmovl   $0x2,0x8257468\n"
   "0x8056db4 <calInit+36>:\tjmp    0x8056de0 <calInit+80>\n"
   "0x8056db6 <calInit+38>:\tmov    0x8(%ebp),%eax\n"
   "0x8056db9 <calInit+41>:\tmov    %eax,0xfffffff0(%ebp)\n"
   "0x8056dbc <calInit+44>:\tmov    $0x66666667,%ecx\n"
   "0x8056dc1 <calInit+49>:\tmov    0xfffffff0(%ebp),%eax\n"
   "0x8056dc4 <calInit+52>:\timul   %ecx,%eax\n"
   "0x8056dc6 <calInit+54>:\tmov    %edx,%ecx\n"
   "0x8056dc8 <calInit+56>:\tsar    $0x1,%ecx\n"
   "0x8056dcb <calInit+59>:\tmov    0xfffffff0(%ebp),%edx\n"
   "0x8056dce <calInit+62>:\tsar    $0x1f,%edx\n"
   "0x8056dd1 <calInit+65>:\tmov    %ecx,%eax\n"
   "0x8056dd3 <calInit+67>:\tsub    %edx,%eax\n"
   "0x8056dd5 <calInit+69>:\tmov    %eax,0xfffffff0(%ebp)\n"
   "0x8056dd8 <calInit+72>:\tmov    0xfffffff0(%ebp),%eax\n"
   "0x8056ddb <calInit+75>:\tmov    %eax,0x8257468\n"
   "0x8056de0 <calInit+80>:\tmov    0x8257468,%eax\n"
   "0x8056de5 <calInit+85>:\tinc    %eax\n"
   "0x8056de6 <calInit+86>:\tmov    %eax,0xfffffff0(%ebp)\n"
   "0x8056de9 <calInit+89>:\tmov    0xfffffff0(%ebp),%eax\n"
   "0x8056dec <calInit+92>:\tadd    0x8(%ebp),%eax\n"
   "0x8056def <calInit+95>:\tmov    %eax,0x8257464\n"
   "0x8056df4 <calInit+100>:\tmov    0x8257464,%eax\n"
   "0x8056df9 <calInit+105>:\tmov    %eax,0xfffffff0(%ebp)\n"
   "0x8056dfc <calInit+108>:\tmov    0xfffffff0(%ebp),%eax\n"
   "0x8056dff <calInit+111>:\tpush   %eax\n"
   "0x8056e00 <calInit+112>:\tcall   0x80c95d0 <cmuInit>\n"
   "0x8056e05 <calInit+117>:\tadd    $0x4,%esp\n"
   "0x8056e08 <calInit+120>:\tmov    %eax,0xfffffff0(%ebp)\n"
   "0x8056e0b <calInit+123>:\tcmpl   $0x0,0xfffffff0(%ebp)\n"
   "0x8056e0f <calInit+127>:\tjne    0x8056e30 <calInit+160>\n"
   "0x8056e11 <calInit+129>:\tpush   $0x815bea0\n"
   "0x8056e16 <calInit+134>:\tpush   $0xffffffff\n"
   "0x8056e18 <calInit+136>:\tpush   $0x21fc\n"
   "0x8056e1d <calInit+141>:\tpush   $0x0\n"
   "0x8056e1f <calInit+143>:\tpush   $0x5\n"
   "0x8056e21 <calInit+145>:\tcall   0x807d514 <callException>\n"
   "0x8056e26 <calInit+150>:\tadd    $0x14,%esp\n"
   "0x8056e29 <calInit+153>:\txor    %eax,%eax\n"
   "0x8056e2b <calInit+155>:\tjmp    0x8057105 <calInit+885>\n"
   "0x8056e30 <calInit+160>:\tpush   $0xa\n"
   "0x8056e32 <calInit+162>:\tpush   $0xfffe\n"
   "0x8056e37 <calInit+167>:\tpush   $0x815bec5\n"
   "0x8056e3c <calInit+172>:\tcall   0x808faf4 <genNotify>\n"
   "0x8056e41 <calInit+177>:\tadd    $0xc,%esp\n"
   "0x8056e44 <calInit+180>:\tpush   $0x430\n"
   "0x8056e49 <calInit+185>:\tpush   $0x815becd\n"
   "0x8056e4e <calInit+190>:\tmov    0x8257464,%edx\n"
   "0x8056e54 <calInit+196>:\tmov    %edx,0xfffffff0(%ebp)\n"
   "0x8056e57 <calInit+199>:\tshll   $0x2,0xfffffff0(%ebp)\n"
   "0x8056e5b <calInit+203>:\tadd    %edx,0xfffffff0(%ebp)\n"
   "0x8056e5e <calInit+206>:\tshll   $0x1,0xfffffff0(%ebp)\n"
   "0x8056e62 <calInit+210>:\tadd    %edx,0xfffffff0(%ebp)\n"
   "0x8056e65 <calInit+213>:\tmov    0xfffffff0(%ebp),%edx\n"
   "0x8056e68 <calInit+216>:\tshl    $0x8,%edx\n"
   "0x8056e6b <calInit+219>:\tsub    0xfffffff0(%ebp),%edx\n"
   "0x8056e6e <calInit+222>:\tlea    0x0(,%edx,8),%eax\n"
   "0x8056e75 <calInit+229>:\tmov    %eax,0xfffffff0(%ebp)\n"
   "0x8056e78 <calInit+232>:\tmov    0xfffffff0(%ebp),%eax\n"
   "0x8056e7b <calInit+235>:\tpush   %eax\n"
   "0x8056e7c <calInit+236>:\tcall   0x80fcc14 <memfAlloc>\n"
   "0x8056e81 <calInit+241>:\tadd    $0xc,%esp\n"
   "0x8056e84 <calInit+244>:\tmov    %eax,0xfffffff0(%ebp)\n"
   "0x8056e87 <calInit+247>:\tmov    0xfffffff0(%ebp),%edx\n"
   "0x8056e8a <calInit+250>:\tmov    %edx,0x8257460\n"
   "End of assembler dump.\n"
<- "(gdb) "
#  Disassembling location 0x8056d90 to 0x8056e90...done.
#  Aligning displays...
#  Aligning displays...done.
-> "output $Author$\n"
<- "void(gdb) "
-> "output eax\n"
<- "No symbol \"eax\" in current context.\n"
   "(gdb) "
-> "output $eax\n"
<- "No registers.\n"
   "(gdb) "
-> "output calls\n"
<- "(callInfo_t *) 0x0(gdb) "
-> "info files\n"
<- "Symbols from \"/voice_app/bin/RVGK\".\n"
   "Local exec file:\n"
   "\t`/voice_app/bin/RVGK\', file type elf32-i386.\n"
   "\tEntry point: 0x8049d70\n"
   "\t0x080480f4 - 0x08048107 is .interp\n"
   "\t0x08048108 - 0x08048128 is .note.ABI-tag\n"
   "\t0x08048128 - 0x080484b4 is .hash\n"
   "\t0x080484b4 - 0x08048cb4 is .dynsym\n"
   "\t0x08048cb4 - 0x08049161 is .dynstr\n"
   "\t0x08049162 - 0x08049262 is .gnu.version\n"
   "\t0x08049264 - 0x080492b4 is .gnu.version_r\n"
   "\t0x080492b4 - 0x080492bc is .rel.got\n"
   "\t0x080492bc - 0x080492ec is .rel.bss\n"
   "\t0x080492ec - 0x08049654 is .rel.plt\n"
   "\t0x08049654 - 0x08049683 is .init\n"
   "\t0x08049684 - 0x08049d64 is .plt\n"
   "\t0x08049d70 - 0x08157ce8 is .text\n"
   "\t0x08157ce8 - 0x08157d02 is .fini\n"
   "\t0x08157d20 - 0x0819b150 is .rodata\n"
   "\t0x0819c160 - 0x08226120 is .data\n"
   "\t0x08226120 - 0x0824da50 is .eh_frame\n"
   "\t0x0824da50 - 0x0824dc28 is .gcc_except_table\n"
   "\t0x0824dc28 - 0x0824dc30 is .ctors\n"
   "\t0x0824dc30 - 0x0824dc38 is .dtors\n"
   "\t0x0824dc38 - 0x0824ddfc is .got\n"
   "\t0x0824ddfc - 0x0824deb4 is .dynamic\n"
   "\t0x0824dec0 - 0x082624c4 is .bss\n"
   "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
   "(gdb) "
#  Current session is "RVGK".
-> "info files\n"
<- "Symbols from \"/voice_app/bin/RVGK\".\n"
   "Local exec file:\n"
   "\t`/voice_app/bin/RVGK\', file type elf32-i386.\n"
   "\tEntry point: 0x8049d70\n"
   "\t0x080480f4 - 0x08048107 is .interp\n"
   "\t0x08048108 - 0x08048128 is .note.ABI-tag\n"
   "\t0x08048128 - 0x080484b4 is .hash\n"
   "\t0x080484b4 - 0x08048cb4 is .dynsym\n"
   "\t0x08048cb4 - 0x08049161 is .dynstr\n"
   "\t0x08049162 - 0x08049262 is .gnu.version\n"
   "\t0x08049264 - 0x080492b4 is .gnu.version_r\n"
   "\t0x080492b4 - 0x080492bc is .rel.got\n"
   "\t0x080492bc - 0x080492ec is .rel.bss\n"
   "\t0x080492ec - 0x08049654 is .rel.plt\n"
   "\t0x08049654 - 0x08049683 is .init\n"
   "\t0x08049684 - 0x08049d64 is .plt\n"
   "\t0x08049d70 - 0x08157ce8 is .text\n"
   "\t0x08157ce8 - 0x08157d02 is .fini\n"
   "\t0x08157d20 - 0x0819b150 is .rodata\n"
   "\t0x0819c160 - 0x08226120 is .data\n"
   "\t0x08226120 - 0x0824da50 is .eh_frame\n"
   "\t0x0824da50 - 0x0824dc28 is .gcc_except_table\n"
   "\t0x0824dc28 - 0x0824dc30 is .ctors\n"
   "\t0x0824dc30 - 0x0824dc38 is .dtors\n"
   "\t0x0824dc38 - 0x0824ddfc is .got\n"
   "\t0x0824ddfc - 0x0824deb4 is .dynamic\n"
   "\t0x0824dec0 - 0x082624c4 is .bss\n"
   "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
   "(gdb) "
#  Saving session in "/voice_app/home/.ddd/sessions/RVGK/init"...
-> "info files\n"
<- "Symbols from \"/voice_app/bin/RVGK\".\n"
   "Local exec file:\n"
   "\t`/voice_app/bin/RVGK\', file type elf32-i386.\n"
   "\tEntry point: 0x8049d70\n"
   "\t0x080480f4 - 0x08048107 is .interp\n"
   "\t0x08048108 - 0x08048128 is .note.ABI-tag\n"
   "\t0x08048128 - 0x080484b4 is .hash\n"
   "\t0x080484b4 - 0x08048cb4 is .dynsym\n"
   "\t0x08048cb4 - 0x08049161 is .dynstr\n"
   "\t0x08049162 - 0x08049262 is .gnu.version\n"
   "\t0x08049264 - 0x080492b4 is .gnu.version_r\n"
   "\t0x080492b4 - 0x080492bc is .rel.got\n"
   "\t0x080492bc - 0x080492ec is .rel.bss\n"
   "\t0x080492ec - 0x08049654 is .rel.plt\n"
   "\t0x08049654 - 0x08049683 is .init\n"
   "\t0x08049684 - 0x08049d64 is .plt\n"
   "\t0x08049d70 - 0x08157ce8 is .text\n"
   "\t0x08157ce8 - 0x08157d02 is .fini\n"
   "\t0x08157d20 - 0x0819b150 is .rodata\n"
   "\t0x0819c160 - 0x08226120 is .data\n"
   "\t0x08226120 - 0x0824da50 is .eh_frame\n"
   "\t0x0824da50 - 0x0824dc28 is .gcc_except_table\n"
   "\t0x0824dc28 - 0x0824dc30 is .ctors\n"
   "\t0x0824dc30 - 0x0824dc38 is .dtors\n"
   "\t0x0824dc38 - 0x0824ddfc is .got\n"
   "\t0x0824ddfc - 0x0824deb4 is .dynamic\n"
   "\t0x0824dec0 - 0x082624c4 is .bss\n"
   "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
   "(gdb) "
#  Retrieving GDB Signal Handling...
-> "info handle\n"
<- "Signal        Stop\tPrint\tPass to program\tDescription\n"
   "\n"
   "SIGHUP        Yes\tYes\tYes\t\tHangup\n"
   "SIGINT        Yes\tYes\tNo\t\tInterrupt\n"
   "SIGQUIT       Yes\tYes\tYes\t\tQuit\n"
   "SIGILL        Yes\tYes\tYes\t\tIllegal instruction\n"
   "SIGTRAP       Yes\tYes\tNo\t\tTrace/breakpoint trap\n"
   "SIGABRT       Yes\tYes\tYes\t\tAborted\n"
   "SIGEMT        Yes\tYes\tYes\t\tEmulation trap\n"
   "SIGFPE        Yes\tYes\tYes\t\tArithmetic exception\n"
   "SIGKILL       Yes\tYes\tYes\t\tKilled\n"
   "SIGBUS        Yes\tYes\tYes\t\tBus error\n"
   "SIGSEGV       Yes\tYes\tYes\t\tSegmentation fault\n"
   "SIGSYS        Yes\tYes\tYes\t\tBad system call\n"
   "SIGPIPE       Yes\tYes\tYes\t\tBroken pipe\n"
   "SIGALRM       No\tNo\tYes\t\tAlarm clock\n"
   "SIGTERM       Yes\tYes\tYes\t\tTerminated\n"
   "SIGURG        No\tNo\tYes\t\tUrgent I/O condition\n"
   "SIGSTOP       Yes\tYes\tYes\t\tStopped (signal)\n"
   "SIGTSTP       Yes\tYes\tYes\t\tStopped (user)\n"
   "SIGCONT       Yes\tYes\tYes\t\tContinued\n"
   "SIGCHLD       No\tNo\tYes\t\tChild status changed\n"
   "SIGTTIN       Yes\tYes\tYes\t\tStopped (tty input)\n"
   "SIGTTOU       Yes\tYes\tYes\t\tStopped (tty output)\n"
   "SIGIO         No\tNo\tYes\t\tI/O possible\n"
   "SIGXCPU       Yes\tYes\tYes\t\tCPU time limit exceeded\n"
   "SIGXFSZ       Yes\tYes\tYes\t\tFile size limit exceeded\n"
   "SIGVTALRM     No\tNo\tYes\t\tVirtual timer expired\n"
   "SIGPROF       No\tNo\tYes\t\tProfiling timer expired\n"
   "SIGWINCH      No\tNo\tYes\t\tWindow size changed\n"
   "SIGLOST       Yes\tYes\tYes\t\tResource lost\n"
   "SIGUSR1       Yes\tYes\tYes\t\tUser defined signal 1\n"
   "SIGUSR2       Yes\tYes\tYes\t\tUser defined signal 2\n"
   "SIGPWR        Yes\tYes\tYes\t\tPower fail/restart\n"
   "SIGPOLL       No\tNo\tYes\t\tPollable event occurred\n"
   "SIGWIND       Yes\tYes\tYes\t\tSIGWIND\n"
   "SIGPHONE      Yes\tYes\tYes\t\tSIGPHONE\n"
   "SIGWAITING    No\tNo\tYes\t\tProcess\'s LWPs are blocked\n"
   "SIGLWP        No\tNo\tYes\t\tSignal LWP\n"
   "SIGDANGER     Yes\tYes\tYes\t\tSwap space dangerously low\n"
   "SIGGRANT      Yes\tYes\tYes\t\tMonitor mode granted\n"
   "SIGRETRACT    Yes\tYes\tYes\t\tNeed to relinquish monitor mode\n"
   "SIGMSG        Yes\tYes\tYes\t\tMonitor mode data available\n"
   "SIGSOUND      Yes\tYes\tYes\t\tSound completed\n"
   "SIGSAK        Yes\tYes\tYes\t\tSecure attention\n"
   "SIGPRIO       Yes\tYes\tYes\t\tSIGPRIO\n"
   "SIG33         Yes\tYes\tYes\t\tReal-time event 33\n"
   "SIG34         Yes\tYes\tYes\t\tReal-time event 34\n"
   "SIG35         Yes\tYes\tYes\t\tReal-time event 35\n"
   "SIG36         Yes\tYes\tYes\t\tReal-time event 36\n"
   "SIG37         Yes\tYes\tYes\t\tReal-time event 37\n"
   "SIG38         Yes\tYes\tYes\t\tReal-time event 38\n"
   "SIG39         Yes\tYes\tYes\t\tReal-time event 39\n"
   "SIG40         Yes\tYes\tYes\t\tReal-time event 40\n"
   "SIG41         Yes\tYes\tYes\t\tReal-time event 41\n"
   "SIG42         Yes\tYes\tYes\t\tReal-time event 42\n"
   "SIG43         Yes\tYes\tYes\t\tReal-time event 43\n"
   "SIG44         Yes\tYes\tYes\t\tReal-time event 44\n"
   "SIG45         Yes\tYes\tYes\t\tReal-time event 45\n"
   "SIG46         Yes\tYes\tYes\t\tReal-time event 46\n"
   "SIG47         Yes\tYes\tYes\t\tReal-time event 47\n"
   "SIG48         Yes\tYes\tYes\t\tReal-time event 48\n"
   "SIG49         Yes\tYes\tYes\t\tReal-time event 49\n"
   "SIG50         Yes\tYes\tYes\t\tReal-time event 50\n"
   "SIG51         Yes\tYes\tYes\t\tReal-time event 51\n"
   "SIG52         Yes\tYes\tYes\t\tReal-time event 52\n"
   "SIG53         Yes\tYes\tYes\t\tReal-time event 53\n"
   "SIG54         Yes\tYes\tYes\t\tReal-time event 54\n"
   "SIG55         Yes\tYes\tYes\t\tReal-time event 55\n"
   "SIG56         Yes\tYes\tYes\t\tReal-time event 56\n"
   "SIG57         Yes\tYes\tYes\t\tReal-time event 57\n"
   "SIG58         Yes\tYes\tYes\t\tReal-time event 58\n"
   "SIG59         Yes\tYes\tYes\t\tReal-time event 59\n"
   "SIG60         Yes\tYes\tYes\t\tReal-time event 60\n"
   "SIG61         Yes\tYes\tYes\t\tReal-time event 61\n"
   "SIG62         Yes\tYes\tYes\t\tReal-time event 62\n"
   "SIG63         Yes\tYes\tYes\t\tReal-time event 63\n"
   "SIGCANCEL     No\tNo\tYes\t\tLWP internal signal\n"
   "SIG32         Yes\tYes\tYes\t\tReal-time event 32\n"
   "SIG64         Yes\tYes\tYes\t\tReal-time event 64\n"
   "SIGINFO       Yes\tYes\tYes\t\tInformation request\n"
   "\n"
   "Use the \"handle\" command to change these tables.\n"
   "(gdb) "
#  Retrieving GDB Signal Handling...done.
#  Saving session in "/voice_app/home/.ddd/sessions/RVGK/init"...done.
#  Current session is "RVGK".
#  Opening session "RVGK"...
-> "info files\n"
<- "Symbols from \"/voice_app/bin/RVGK\".\n"
   "Local exec file:\n"
   "\t`/voice_app/bin/RVGK\', file type elf32-i386.\n"
   "\tEntry point: 0x8049d70\n"
   "\t0x080480f4 - 0x08048107 is .interp\n"
   "\t0x08048108 - 0x08048128 is .note.ABI-tag\n"
   "\t0x08048128 - 0x080484b4 is .hash\n"
   "\t0x080484b4 - 0x08048cb4 is .dynsym\n"
   "\t0x08048cb4 - 0x08049161 is .dynstr\n"
   "\t0x08049162 - 0x08049262 is .gnu.version\n"
   "\t0x08049264 - 0x080492b4 is .gnu.version_r\n"
   "\t0x080492b4 - 0x080492bc is .rel.got\n"
   "\t0x080492bc - 0x080492ec is .rel.bss\n"
   "\t0x080492ec - 0x08049654 is .rel.plt\n"
   "\t0x08049654 - 0x08049683 is .init\n"
   "\t0x08049684 - 0x08049d64 is .plt\n"
   "\t0x08049d70 - 0x08157ce8 is .text\n"
   "\t0x08157ce8 - 0x08157d02 is .fini\n"
   "\t0x08157d20 - 0x0819b150 is .rodata\n"
   "\t0x0819c160 - 0x08226120 is .data\n"
   "\t0x08226120 - 0x0824da50 is .eh_frame\n"
   "\t0x0824da50 - 0x0824dc28 is .gcc_except_table\n"
   "\t0x0824dc28 - 0x0824dc30 is .ctors\n"
   "\t0x0824dc30 - 0x0824dc38 is .dtors\n"
   "\t0x0824dc38 - 0x0824ddfc is .got\n"
   "\t0x0824ddfc - 0x0824deb4 is .dynamic\n"
   "\t0x0824dec0 - 0x082624c4 is .bss\n"
   "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
   "(gdb) "
-> "set confirm off\n"
#  File: waiting until GDB gets ready
<- "(gdb) "
-> "kill\n"
<- "The program is not being run.\n"
   "(gdb) "
-> "file\n"
<- "(gdb) "
-> "core\n"
<- "(gdb) "
-> "set confirm off\n"
<- "(gdb) "
-> "file /voice_app/bin/RVGK\n"
<- "(gdb) "
-> "info line\n"
<- "No line number information available.\n"
<- "(gdb) "
-> "list\n"
<- "274\t  callHandler.gkcciFacilityEvent = facilityHandler;\n"
<- "275\t  callHandler.gkcciInfoMsgEvent = NULL;\n"
<- "276\t  \n"
<- "277\t  gkrgiSetEventHandler(&regHandler,sizeof(regHandler));\n"
<- "278\t  gklrqiSetEventHandler(&lrqHandler,sizeof(lrqHandler));\n"
<- "279\t  gkcciSetEventHandler(&callHandler,sizeof(callHandler));\n"
<- "280\t#endif\n"
<- "281\t\n"
<- "282\t\n"
<- "283\t  mcgk_initlog(argc, argv);\n"
<- "(gdb) "
-> "info line\n"
<- "Line 283 of \"samapp.c\" starts at address 0x8050523 <main+3> and ends at 
0x8050533 <main+19>.\n"
<- 
"\032\032/users/sohan/rel4/build/loads/mrc/voice/samapp/samapp.c:283:7007:beg:0x8050523\n"
<- "(gdb) "
-> "info breakpoints\n"
<- "No breakpoints or watchpoints.\n"
<- "(gdb) "
-> "display\n"
<- "(gdb) "
-> "info display\n"
<- "There are no auto-display expressions now.\n"
<- "(gdb) "
#  Reading file "/users/sohan/rel4/build/loads/mrc/voice/samapp/samapp.c"...
#  Reading file 
"/users/sohan/rel4/build/loads/mrc/voice/samapp/samapp.c"...done.
#  File "/users/sohan/rel4/build/loads/mrc/voice/samapp/samapp.c" 732 lines, 
22700 characters
-> "x /i 0x8050523\n"
<- "0x8050523 <main+3>:\tmov    0xc(%ebp),%eax\n"
<- "(gdb) "
-> "x /i 0x8050620\n"
<- "0x8050620 <loadConf+24>:\tadd    $0x4,%esp\n"
<- "(gdb) "
#  Disassembling location 0x8050523...
-> "disassemble 0x8050523\n"
<- "Dump of assembler code for function main:\n"
<- "0x8050520 <main>:\tpush   %ebp\n"
<- "0x8050521 <main+1>:\tmov    %esp,%ebp\n"
<- "0x8050523 <main+3>:\tmov    0xc(%ebp),%eax\n"
<- "0x8050526 <main+6>:\tpush   %eax\n"
<- "0x8050527 <main+7>:\tmov    0x8(%ebp),%eax\n"
<- "0x805052a <main+10>:\tpush   %eax\n"
<- "0x805052b <main+11>:\tcall   0x8052860 <mcgk_initlog>\n"
<- "0x8050530 <main+16>:\tadd    $0x8,%esp\n"
<- "0x8050533 <main+19>:\tcall   0x80507e4 <initLogFile>\n"
<- "0x8050538 <main+24>:\tcall   0x8050744 <initAppDataBase>\n"
<- "0x805053d <main+29>:\tmov    %eax,%eax\n"
<- "0x805053f <main+31>:\ttest   %eax,%eax\n"
<- "0x8050541 <main+33>:\tjne    0x8050560 <main+64>\n"
<- "0x8050543 <main+35>:\tpush   $0x815a400\n"
<- "0x8050548 <main+40>:\tcall   0x8051450 <utilErrorHandler>\n"
<- "0x805054d <main+45>:\tadd    $0x4,%esp\n"
<- "0x8050550 <main+48>:\tmov    %eax,%edx\n"
<- "0x8050552 <main+50>:\tmov    %edx,%eax\n"
<- "0x8050554 <main+52>:\tjmp    0x8050604 <main+228>\n"
<- "0x8050559 <main+57>:\tlea    0x0(%esi,1),%esi\n"
<- "0x8050560 <main+64>:\tcall   0x8049e20 <allocationsInit>\n"
<- "0x8050565 <main+69>:\tmov    %eax,%eax\n"
<- "0x8050567 <main+71>:\ttest   %eax,%eax\n"
<- "0x8050569 <main+73>:\tjne    0x8050581 <main+97>\n"
<- "0x805056b <main+75>:\tpush   $0x815a420\n"
<- "0x8050570 <main+80>:\tcall   0x8051450 <utilErrorHandler>\n"
<- "0x8050575 <main+85>:\tadd    $0x4,%esp\n"
<- "0x8050578 <main+88>:\tmov    %eax,%edx\n"
<- "0x805057a <main+90>:\tmov    %edx,%eax\n"
<- "0x805057c <main+92>:\tjmp    0x8050604 <main+228>\n"
<- "0x8050581 <main+97>:\tcall   0x809a6b0 <gkmainInit>\n"
<- "0x8050586 <main+102>:\tmov    %eax,%eax\n"
<- "0x8050588 <main+104>:\tcmp    $0xffffffff,%eax\n"
<- "0x805058b <main+107>:\tjne    0x80505a0 <main+128>\n"
<- "0x805058d <main+109>:\tpush   $0x815a43f\n"
<- "0x8050592 <main+114>:\tcall   0x8051450 <utilErrorHandler>\n"
<- "0x8050597 <main+119>:\tadd    $0x4,%esp\n"
<- "0x805059a <main+122>:\tmov    %eax,%edx\n"
<- "0x805059c <main+124>:\tmov    %edx,%eax\n"
<- "0x805059e <main+126>:\tjmp    0x8050604 <main+228>\n"
<- "0x80505a0 <main+128>:\tpush   $0x2\n"
<- "0x80505a2 <main+130>:\tpush   $0x64\n"
<- "0x80505a4 <main+132>:\tcall   0x809c4d0 <gkpliInit>\n"
<- "0x80505a9 <main+137>:\tadd    $0x8,%esp\n"
<- "0x80505ac <main+140>:\tmov    %eax,%eax\n"
<- "0x80505ae <main+142>:\ttest   %eax,%eax\n"
<- "0x80505b0 <main+144>:\tjge    0x80505c5 <main+165>\n"
<- "0x80505b2 <main+146>:\tpush   $0x815a44f\n"
<- "0x80505b7 <main+151>:\tcall   0x8051450 <utilErrorHandler>\n"
<- "0x80505bc <main+156>:\tadd    $0x4,%esp\n"
<- "0x80505bf <main+159>:\tmov    %eax,%edx\n"
<- "0x80505c1 <main+161>:\tmov    %edx,%eax\n"
<- "0x80505c3 <main+163>:\tjmp    0x8050604 <main+228>\n"
<- "0x80505c5 <main+165>:\tcall   0x8050608 <loadConf>\n"
<- "0x80505ca <main+170>:\tmov    %eax,%eax\n"
<- "0x80505cc <main+172>:\ttest   %eax,%eax\n"
<- "0x80505ce <main+174>:\tjne    0x80505d7 <main+183>\n"
<- "0x80505d0 <main+176>:\tmov    $0xffffffff,%eax\n"
<- "0x80505d5 <main+181>:\tjmp    0x8050604 <main+228>\n"
<- "0x80505d7 <main+183>:\tmov    0xc(%ebp),%eax\n"
<- "0x80505da <main+186>:\tpush   %eax\n"
<- "0x80505db <main+187>:\tmov    0x8(%ebp),%eax\n"
<- "0x80505de <main+190>:\tpush   %eax\n"
<- "0x80505df <main+191>:\tcall   0x80528f4 <mcgk_init>\n"
<- "0x80505e4 <main+196>:\tadd    $0x8,%esp\n"
<- "0x80505e7 <main+199>:\tjmp    0x80505f0 <main+208>\n"
<- "0x80505e9 <main+201>:\tjmp    0x80505f7 <main+215>\n"
<- "0x80505eb <main+203>:\tnop    \n"
<- "0x80505ec <main+204>:\tlea    0x0(%esi,1),%esi\n"
<- "0x80505f0 <main+208>:\tcall   0x8121238 <seliSelect>\n"
<- "0x80505f5 <main+213>:\tjmp    0x80505e7 <main+199>\n"
<- "0x80505f7 <main+215>:\tcall   0x8052a78 <mcgk_exit>\n"
<- "0x80505fc <main+220>:\txor    %eax,%eax\n"
<- "0x80505fe <main+222>:\tjmp    0x8050604 <main+228>\n"
<- "0x8050600 <main+224>:\txor    %eax,%eax\n"
<- "0x8050602 <main+226>:\tjmp    0x8050604 <main+228>\n"
<- "0x8050604 <main+228>:\tleave  \n"
<- "0x8050605 <main+229>:\tret    \n"
<- "End of assembler dump.\n"
<- "(gdb) "
#  Disassembling location 0x8050523...done.
-> "info source\n"
<- "Current source file is samapp.c\n"
<- "Compilation directory is /home2/sohan/rel4/build/loads/mrc/voice/samapp/\n"
<- "Located in /users/sohan/rel4/build/loads/mrc/voice/samapp/samapp.c\n"
<- "Contains 732 lines.\n"
<- "Source language is c.\n"
<- "Compiled with stabs debugging format.\n"
<- "(gdb) "
-> "info files\n"
<- "Symbols from \"/voice_app/bin/RVGK\".\n"
<- "Local exec file:\n"
<- "\t`/voice_app/bin/RVGK\', file type elf32-i386.\n"
<- "\tEntry point: 0x8049d70\n"
<- "\t0x080480f4 - 0x08048107 is .interp\n"
<- "\t0x08048108 - 0x08048128 is .note.ABI-tag\n"
<- "\t0x08048128 - 0x080484b4 is .hash\n"
<- "\t0x080484b4 - 0x08048cb4 is .dynsym\n"
<- "\t0x08048cb4 - 0x08049161 is .dynstr\n"
<- "\t0x08049162 - 0x08049262 is .gnu.version\n"
<- "\t0x08049264 - 0x080492b4 is .gnu.version_r\n"
<- "\t0x080492b4 - 0x080492bc is .rel.got\n"
<- "\t0x080492bc - 0x080492ec is .rel.bss\n"
<- "\t0x080492ec - 0x08049654 is .rel.plt\n"
<- "\t0x08049654 - 0x08049683 is .init\n"
<- "\t0x08049684 - 0x08049d64 is .plt\n"
<- "\t0x08049d70 - 0x08157ce8 is .text\n"
<- "\t0x08157ce8 - 0x08157d02 is .fini\n"
<- "\t0x08157d20 - 0x0819b150 is .rodata\n"
<- "\t0x0819c160 - 0x08226120 is .data\n"
<- "\t0x08226120 - 0x0824da50 is .eh_frame\n"
<- "\t0x0824da50 - 0x0824dc28 is .gcc_except_table\n"
<- "\t0x0824dc28 - 0x0824dc30 is .ctors\n"
<- "\t0x0824dc30 - 0x0824dc38 is .dtors\n"
<- "\t0x0824dc38 - 0x0824ddfc is .got\n"
<- "\t0x0824ddfc - 0x0824deb4 is .dynamic\n"
<- "\t0x0824dec0 - 0x082624c4 is .bss\n"
<- "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
<- "(gdb) "
-> "source /tmp/fileaeqMng\n"
<- "Line 1 of \"calls.c\" is at address 0x8056d90 <calInit> but contains no 
code.\n"
<- 
"\032\032/users/sohan/rel4/build/loads/mrc/voice/gatekeeper/calls.c:1:0:beg:0x8056d90\n"
<- "The target architecture is assumed to be i386\n"
<- "Byte order is not selectable.The target endianness is set automatically 
(currently little endian)\n"
<- "(gdb) "
-> "info breakpoints\n"
<- "No breakpoints or watchpoints.\n"
<- "(gdb) "
#  Reading file "/voice_app/bin/calls.c"...
#  Reading file "/voice_app/bin/calls.c"...No such file or directory.
-> "info source\n"
<- "Current source file is calls.c\n"
<- "Compilation directory is 
/home2/sohan/rel4/build/loads/mrc/voice/gatekeeper/\n"
<- "Located in /users/sohan/rel4/build/loads/mrc/voice/gatekeeper/calls.c\n"
<- "Contains 14089 lines.\n"
<- "Source language is c.\n"
<- "Compiled with stabs debugging format.\n"
<- "(gdb) "
#  Reading file "calls.c" from GDB...
-> "list calls.c:1,1000000\n"
<- "1\t/*\n"
<- 
"2\t*********************************************************************************\n"
<- "3\t*                                                                        
       *\n"
<- "4\t* NOTICE:                                                                
       *\n"
<- "5\t* This document contains information that is confidential and 
proprietary to    *\n"
<- "6\t* RADVision LTD.. No part of this publication may be reproduced in any 
form     *\n"
<- "7\t* whatsoever without written prior approval by RADVision LTD..           
       *\n"
<- "8\t*                                                                        
       * \n"
<- "9\t* RADVision LTD. reserves the right to revise this publication and make 
changes *\n"
<- "10\t* without obligation to notify any person of such revisions or changes. 
        *    \n"
<- "11\t* Copyright RADVision 1996.                                             
        *\n"
<- "12\t* Last Revision: Jan. 2000                                              
        *\n"
<- 
"13\t*********************************************************************************\n"
<- "14\t*/\n"
<- "15\t    \n"
<- "16\t            
/*********************************************************\n"
<- "17\t            *                P A C K A G E    B O D Y\n"
<- "18\t            
*=========================================================\n"
<- "19\t            * TITLE:  calls\n"
<- "20\t            
*---------------------------------------------------------\n"
<- "21\t            * PROJECT:  GK\n"
<- "22\t            
*---------------------------------------------------------\n"
<- "23\t            * $Workfile$\n"
<- "24\t            *--------------------------------------------------------\n"
<- "25\t            * $Author$\n"
<- "26\t            
*---------------------------------------------------------\n"
<- "27\t            * $Date$\n"
<- "28\t            
*---------------------------------------------------------\n"
<- "29\t            * $Revision$\n"
<- "30\t            * $SKIP START$\n"
<- "31\t            
*********************************************************/\n"
<- "32\t            \n"
<- "33\t\n"
<- "34\t#ifdef __cplusplus\n"
<- "35\textern \"C\" {\n"
<- "36\t#endif\n"
<- "37\t\n"
<- "38\t\n"
<- "39\t/* range of errorCode for file \"facility.c\" is 8800 - 8899 */\n"
<- "40\t\n"
<- "41\t            
/********************************************************/\n"
<- "42\t            /*                     INTERFACE DECLARATIONS           
*/\n"
<- "43\t            
/********************************************************/\n"
<- "44\t\n"
<- "45\t#include <stdio.h>\n"
<- "46\t#include <stdarg.h>\n"
<- "47\t#include <stdlib.h>\n"
<- "48\t    \n"
<- "49\t#include \"rvcommon.h\"\n"
<- "50\t#include \"rvstd.h\"\n"
<- "51\t#include \"platform.h\"\n"
<- "52\t#include \"cm.h\"\n"
<- "53\t#include \"cmras.h\"\n"
<- "54\t#include \"pvaltree.h\"\n"
<- "55\t#include \"stkutils.h\"\n"
<- "56\t#include \"gkmain.h\"\n"
<- "57\t#include \"general.h\"\n"
<- "58\t#include \"gkTypes.h\"\n"
<- "59\t#include \"gkadd.h\"\n"
<- "60\t#include \"gkrgi.h\"\n"
<- "61\t#include \"gklrqi.h\"\n"
<- "62\t#include \"memoryrv.h\"\n"
<- "63\t#include \"gkstorage.h\"\n"
<- "64\t#include \"gkNVMem.h\"\n"
<- "65\t#include \"cfgapi.h\"\n"
<- "66\t#include \"gkcfg.h\"\n"
<- "67\t#include \"address.h\"\n"
<- "68\t#include \"gkTi.h\" \n"
<- "69\t#include \"cmutil.h\"\n"
<- "70\t#include \"net323.h\"\n"
<- "71\t#include \"gksvci.h\"\n"
<- "72\t#include \"service.h\"\n"
<- "73\t#include \"regtable.h\"\n"
<- "74\t#include \"regutil.h\"\n"
<- "75\t#include \"iutil.h\"\n"
<- "76\t#include \"regsearch.h\"\n"
<- "77\t#include \"regras.h\"\n"
<- "78\t#include \"thincci.h\"\n"
<- "79\t#include \"gkcci.h\"\n"
<- "80\t#include \"gkpli.h\"\n"
<- "81\t#include \"calls.h\"\n"
<- "82\t#include \"netphys.h\"\n"
<- "83\t#include \"semUtil.h\"\n"
<- "84\t#include \"li.h\"\n"
<- "85\t\n"
<- "86\t#include \"callh.h\"\n"
<- "87\t#include \"bw.h\"\n"
<- "88\t#include \"facility.h\"\n"
<- "89\t\n"
<- "90\t#include \"linehunt.h\"\n"
<- "91\t#include \"gkhash.h\"\n"
<- "92\t\n"
<- "93\t/* Start sohan */\n"
<- "94\t#include <sys/shm.h>\n"
<- "95\t#include <sys/ipc.h>\n"
<- "96\t#include <errno.h>\n"
<- "97\t#include \"media_router.h\"\n"
<- "98\t#include \"data_mgr.h\"\n"
<- "99\t/* End   sohan */\n"
<- "100\t  \n"
<- "101\t\n"
<- "102\t/* Avi 7/2000 */\n"
<- "103\t/* \n"
<- "104\t * Key of hash will be the alias used to connect to the service\n"
<- "105\t */\n"
<- "106\t#define HASH_DATA_SIZE         sizeof(cmRASAlias)\n"
<- "107\t/* \n"
<- "108\t * Data handle in hash will contain the exact transport to be used and 
number of \n"
<- "109\t * calls connected to it \n"
<- "110\t */\n"
<- "111\t#define HASH_DATA_HANDLE_SIZE  (sizeof(cmRASTransport) + sizeof(int) + 
sizeof(cmRASAlias))\n"
<- "112\t\t\n"
<- "113\t\t\n"
<- "114\textern HAPP dispStack;\n"
<- "115\textern int dispConfigRASTO;\n"
<- "116\textern memHandler_t memHandler;\n"
<- "117\textern stringType_t cciGetStringType( IN gkcciParameter_t    
parameter);\n"
<- "118\t\t\n"
<- "119\t/* the state callback functions for the application. It is set to the 
default event callback \n"
<- "120\tfirst, but will be overwritten by call to gkcciSetEventHandler */\n"
<- "121\tgkcciStateEvent_t stateEventCb = gkcciDefaultStateEventHandler;\n"
<- "122\t\n"
<- "123\t/* the bandwidth events callback functions for the application. It is 
set to the default event callback \n"
<- "124\tfirst, but will be overwritten by call to gkcciSetEventHandler */\n"
<- "125\tgkcciBandwidthEventHandler_t bandwidthEventCb = 
gkcciDefaultBandwidthEventHandler;\n"
<- "126\t\n"
<- "127\t/* the facility events callback functions for the application. It is 
set to the default event callback \n"
<- "128\tfirst, but will be overwritten by call to gkcciSetEventHandler */\n"
<- "129\tgkcciFacilityEventHandler_t facilityEventCb = 
gkcciDefaultFacilityEventHandler;\n"
<- "130\t\n"
<- "131\t/* the information message event callback function for the 
application. \n"
<- "132\tIt is set to the default handler first, but can be overwritten by \n"
<- "133\tthe call to gkcciSetEventHandler */\n"
<- "134\tgkcciInfoMsgEventHandler_t infoMsgEventCb = 
gkcciDefaultInfoMsgHandler;\n"
<- "135\t\n"
<- "136\t/* the message callback functions for the application. It is set to 
NULL \n"
<- "137\tfirst, but will be overwritten by call to gkcciSetEventHandler */\n"
<- "138\tgkcciMsgEvent_t msgEventCb = NULL; \n"
<- "139\t\n"
<- "140\t/* the handles hook callback function for the application. It can be 
bound later\n"
<- "141\tusing gkcciSetEventHandler */\n"
<- "142\tgkcciHook_t callHandleHookCb = NULL;\n"
<- "143\t\n"
<- "144\t/* start sohan */\n"
<- "145\tstatic struct alias_mediaproxy_mapping_tbl              *shmp = 
(struct alias_mediaproxy_mapping_tbl*) 0;\n"
<- "146\tstatic int                              shm_id = -1;\n"
<- "147\tstatic char                             
ip_address[IP_ADDRESS_STRING_SIZE + 1];\n"
<- "148\tstatic char                             message[BUFSIZ];\n"
<- "149\t\n"
<- "150\tstatic  BOOL log_msg(IN UINT32 log_class, IN const char      
*given_msg);\n"
<- "151\tstatic  BOOL get_alias_mediaproxy_mapping_tbl_shm();\n"
<- "152\tstatic  INT32 output_alias_mediaproxy_mapping_tbl_shm();\n"
<- "153\tchar    *Ip2String(IN UINT32 ipAddr, OUT char* buf);\n"
<- "154\tstatic  BOOL is_mainGK();\n"
<- "155\tstatic BOOL search_source_alias(IN char *alias_string, IN UINT32 
alias_len, OUT struct alias_media_proxy **alias_vsu);\n"
<- "156\t\n"
<- "157\t#define PRINT_CID 0\n"
<- "158\t#define DEST_CALL_SIGNAL_PORT 2720\n"
<- "159\t/*#define LOG_APPLICATION\t\t10;*/\n"
<- "160\t/* End   sohan */\n"
<- "161\t \n"
<- "162\t/********************************************************/\n"
<- "163\t/*                     LOCAL DECLARATIONS               */\n"
<- "164\t/********************************************************/\n"
   "165\t\n"
   "166\t\n"
   "167\t/*-----------------*/\n"
   "168\t/*   LOCAL TYPES   */\n"
   "169\t/*-----------------*/\n"
   "170\t\n"
   "171\t\n"
   "172\t\n"
   "173\t\n"
   "174\t/*------------------*/\n"
   "175\t/* GLOBAL VARIABLES */\n"
   "176\t/*------------------*/\n"
   "177\t\n"
   "178\tcallInfo_t *calls;\n"
   "179\tint globalMaxCalls;  /*call records including the backup records*/\n"
   "180\tint usedBackups = 0; /*number of used backups records  (sarit)*/\n"
   "181\tint usedCalls = 0;   /*nuber of used call record  (sarit)*/\n"
   "182\tint maxBackups;     /*backups only (sarit)*/\n"
   "183\tint maxRegularCalls;       /*regular calls only  (sarit)*/\n"
   "184\t\n"
   "185\tchar * stateName[30];\n"
   "186\tchar * sideName[3];\n"
   "187\tINT32 errorIndex; /* a global flag access through the function 
calGetErrorIndex()\n"
   "188\t\t\t\t\t  that gives the index of the alias that failed in a set or 
get \n"
   "189\tAPI operation */\n"
   "190\tguid_t emptyGuid = \"\";\n"
   "191\t\n"
   "192\t\t/* Handle to \"MCU\" services hash - correspondence between aliases 
and actual \n"
   "193\t\t * transpots \n"
   "194\t\t */\n"
   "195\t   void* serviceHashH;\n"
   "196\t\n"
   "197\t/*-----------------*/\n"
   "198\t/*   LOCAL VARS    */\n"
   "199\t/*-----------------*/                                        \n"
   "200\t\n"
   "201\t#ifdef GK_SET_DEST\n"
   "202\t   static char calDest1[ADD_MAX_BUF];\n"
   "203\t   static char calDest2[ADD_MAX_BUF];\n"
   "204\t#endif\n"
   "205\t\n"
   "206\t#ifdef GK_RAS_BYPASS\n"
   "207\t   static BOOL calRASBypassFlag=0;\n"
   "208\t#endif\n"
   "209\t\n"
   "210\t   /*-------------------------*/\n"
   "211\t   /* Forward Definition      */\n"
   "212\t   /*-------------------------*/\n"
   
"213\t/*******************************************************************/\n"
   "214\t/* LOCAL FUNCTIONS                                                 
*/\n"
   
"215\t/*******************************************************************/\n"
   "216\tvoid send_endpoint_info_to_mc(struct gk_to_mc_msg *);\n"
   "217\t\n"
   "218\tvoid get_source_ip(HRAS, cmRASTransport\t*);\n"
   "219\t\n"
   "220\tBOOL sendDRQMainGK(IN int );\n"
   "221\t\n"
   "222\tBOOL setDRQMainGK(\n"
   "223\t\t\t\tIN\tint,\n"
   "224\t\t\t\tOUT\tside_t*,\n"
   "225\t\t\t\tOUT \tHRAS*);\n"
   "226\t\n"
   "227\tBOOL clearARQMainGK(/*a gk ARQ is being Cleared*/\n"
   "228\t                   IN HAPPRAS ,\n"
   "229\t                   IN HRAS    );\n"
   "230\t/*******************************************************/\n"
   "231\t/* Alias Manipulations                                 */\n"
   "232\t/*******************************************************/\n"
   "233\t\n"
   "234\t    \n"
   "235\tINT32 setOrGetAliases(/* sets/gets all aliases between firstIndex and 
lastIndex into data.                      \n"
   "236\t\t\t\t\t\t  if lastIndex equals gktypeLAST_PARAM, all aliases from 
firstIndex\n"
   "237\t\t\t\t\t\t  to the last exists will be set/get. If the firstIndex is 
less than 0\n"
   "238\t\t\t\t\t\t  or lastIndex is greater than the array size, or lastIndex 
< firstIndex\n"
   "239\t\t\t\t\t\t  gkcciOutOfBounds will be returned and no alias will be 
set/get. \n"
   "240\t\t\t\t\t\t  Upon setting if an error occured in one of the aliases, 
all aliases \n"
   "241\t\t\t\t\t\t  in the range will be set to empty ones. The global 
variable errorIndex \n"
   "242\t\t\t\t\t\t  will give the index  (0-based) , where the error occured 
(of the API \n"
   "243\t\t\t\t\t\t  addresses, not of the table) and gkcciGKFailure will be 
returned. \n"
   "244\t\t\t\t\t\t  Upon getting, if an error occured, getting the next alias 
will \n"
   "245\t\t\t\t\t\t  not continue. errorIndex will give the index  (0-based) , 
where the error \n"
   "246\t\t\t\t\t\t  occured and gkcciGKFailure will be returned. */ \n"
   "247\t\t\t\t\t\t  IN  int cl,\n"
   "248\t\t\t\t\t\t  IN cmRASAlias aliasArray[], \n"
   "249\t\t\t\t\t\t  IN int arraySize, \n"
   "250\t\t\t\t\t\t  IN void *data, \n"
   "251\t\t\t\t\t\t  IN INT32 firstIndex, \n"
   "252\t\t\t\t\t\t  IN INT32 lastIndex,\n"
   "253\t\t\t\t\t\t  IN BOOL setMode, /* TRUE when set is requested */\n"
   "254\t\t\t\t\t\t  IN stringType_t dataType  /* relevant only when setMode is 
FALSE*/ );\n"
   "255\t\n"
   "256\tvoid setAlias( /*sets the alias type and string */\n"
   "257\t\t\t\t  IN cmRASAlias     *alias,\n"
   "258\t\t\t\t  IN cmRASAliasType type,\n"
   "259\t\t\t\t  IN char           *str);\n"
   "260\t\n"
   "261\tINT32 setCallModel(\n"
   "262\t\t\t\t\t   IN int cl,\n"
   "263\t\t\t\t\t   IN gktypeCallModel_t model);\n"
   "264\t\n"
   "265\t\n"
   "266\tBOOL inListAlias (/* return true if address is in linked list */\n"
   "267\t\t\t\t\t  IN calDataIndex_t listE164,\n"
   "268\t\t\t\t\t  IN calDataIndex_t\tlistH323,\n"
   "269\t\t\t\t\t  IN cmRASAlias *data);\n"
   "270\t\n"
   "271\tBOOL inListTransport(/* return true if address is in linked list */\n"
   "272\t\t\t\t\t\t IN calDataIndex_t list,\n"
   "273\t\t\t\t\t\t IN c"
<- "mRASTransport *data);\n"
   "274\t\n"
   "275\tint findFirstE164(/*returns index of first E164 alias in the 
\'aliasArray\' of size arraySize.\n"
   "276\t\t\t\t\t   returns arraySize (an invalid index number because array 
begins at 0)\n"
   "277\t\t\t\t      if no E164 alias exists in the array*/\n"
   "278\t\t\t\t      IN cmRASAlias * aliasArray,\n"
   "279\t\t\t\t      IN int arraySize);\n"
   "280\t\t\t\t\t\t \n"
   "281\t/*******************************************************/\n"
   "282\t/* Messages Parameters                                 */\n"
   "283\t/*******************************************************/\n"
   "284\tINT32 getNSParam( /* gets the non standard param of a message part 
*/\n"
   "285\t\t\t\t\t IN   gkcciParameter_t  parameter, \n"
   "286\t\t\t\t\t IN   int               cl, \n"
   "287\t\t\t\t\t IN   gkcciSide_t       side, \n"
   "288\t\t\t\t\t IN   void*             data);\n"
   "289\t\n"
   "290\tINT32 setNSParam( /* sets the non standard param of a message part 
*/\n"
   "291\t\t\t\t\t IN   gkcciParameter_t  parameter, \n"
   "292\t\t\t\t\t IN   int               cl, \n"
   "293\t\t\t\t\t IN   gkcciSide_t       side, \n"
   "294\t\t\t\t\t IN   void*             data);\n"
   "295\t\n"
   "296\tvoid getNonStandardRequestArguments(/* arrange the requset to pass to 
the stack */\n"
   "297\t\t\t\t\t\t\t\t\t\tIN int               cl,\n"
   "298\t\t\t\t\t\t\t\t\t\tIN gkcciParameter_t  parameter,\n"
   "299\t\t\t\t\t\t\t\t\t\tIN cmuMessage_t     *message,\n"
   "300\t\t\t\t\t\t\t\t\t\tIN gkcciSide_t       side);\n"
   "301\t\n"
   "302\t\t\t\t\t\t\t\t\t\t/* get the canMapAlias field from the ARQ message. 
return an error message if the\n"
   "303\tfield is not there or the hsRas is NULL */\n"
   "304\tINT32 getCanMapAlias(IN HRAS    hsRas,\n"
   "305\t\t\t\t\t\t OUT void   *data);\n"
   "306\t\n"
   "307\tINT32 setAlternateEpParam(\n"
   "308\t\t\t\t\t\t\t  IN int cl,\n"
   "309\t\t\t\t\t\t\t  IN   HRAS              hsRas, /* RAS handle for 
rejection message */\n"
   "310\t\t\t\t\t\t\t  IN   gkcciParameter_t  parameter,  /* The parameter to 
set (AlternateGk/AltGKisPermanent) */\n"
   "311\t\t\t\t\t\t\t  IN   INT32             firstIndex, /* The same as in 
calAppSetParameter */\n"
   "312\t\t\t\t\t\t\t  IN   INT32             lastIndex,  /* The same as in 
calAppSetParameter */\n"
   "313\t\t\t\t\t\t\t  IN   void *            data);\n"
   "314\t\n"
   "315\tINT32 getAlternateEpParam(\n"
   "316\t\t\t\t\t\t\t  IN int cl,\n"
   "317\t\t\t\t\t\t\t  IN   HRAS              hsRas, /* RAS handle for 
rejection message */\n"
   "318\t\t\t\t\t\t\t  IN   gkcciParameter_t  parameter,  /* The parameter to 
set (AlternateGk/AltGKisPermanent) */\n"
   "319\t\t\t\t\t\t\t  IN   INT32             firstIndex, /* The same as in 
calAppGetParameter */\n"
   "320\t\t\t\t\t\t\t  IN   INT32             lastIndex,  /* The same as in 
calAppGetParameter */\n"
   "321\t\t\t\t\t\t\t  OUT  void *            data);\n"
   "322\t\n"
   "323\tint countAlternateEp(\n"
   "324\t\t\t\t\t\t IN HRAS hsRas);\n"
   "325\t\n"
   "326\tINT32 setAlternateGkParam(/* Set the alternateGk parameter type into 
the RAS message. Called from calAppSetParameter */\n"
   "327\t\t\t\t\t\t\t  IN int cl,\n"
   "328\t\t\t\t\t\t\t  IN   HRAS              hsRas, /* RAS handle for 
rejection message */\n"
   "329\t\t\t\t\t\t\t  IN   gkcciParameter_t  parameter,  /* The parameter to 
set (AlternateGk/AltGKisPermanent) */\n"
   "330\t\t\t\t\t\t\t  IN   INT32             firstIndex, /* The same as in 
calAppSetParameter */\n"
   "331\t\t\t\t\t\t\t  IN   INT32             lastIndex,  /* The same as in 
calAppSetParameter */\n"
   "332\t\t\t\t\t\t\t  IN   void *            data);\n"
   "333\t\n"
   "334\tINT32 getAlternateGkParam(/* Get the alternateGk parameter type from 
the RAS message. Called from calAppGetParameter */\n"
   "335\t\t\t\t\t\t\t  IN int cl,\n"
   "336\t\t\t\t\t\t\t  IN   HRAS              hsRas, /* RAS handle for 
rejection message */\n"
   "337\t\t\t\t\t\t\t  IN   gkcciParameter_t  parameter,  /* The parameter to 
set (AlternateGk/AltGKisPermanent) */\n"
   "338\t\t\t\t\t\t\t  IN   INT32             firstIndex, /* The same as in 
calAppGetParameter */\n"
   "339\t\t\t\t\t\t\t  IN   INT32             lastIndex,  /* The same as in 
calAppGetParameter */\n"
   "340\t\t\t\t\t\t\t  OUT  void *            data);\n"
   "341\t\n"
   "342\tint countAlternateGk(/* Count number of alternateGatekeeper records in 
RAS reject message. Called from calAppGetParameterNumber */\n"
   "343\t\t\t\t\t\t IN int cl,\n"
   "344\t\t\t\t\t\t IN HRAS hsRas);\n"
   "345\t\n"
   "346\t\n"
   "347\t\n"
   "348\t/*******************************************************/\n"
   "349\t/* Auxilary Functions                                  */\n"
   "350\t/*******************************************************/\n"
   "351\tBOOL handleEmptyTransport( /* if address resolution didn\'t find 
transport address check\n"
   "352\t\t\t\t\t\t\t   that it\'s allowed to make call to out o"
<- "f zone. \n"
<- "353\t\t\t\t\t\t\t   Check the number of aliases in the call and return it. 
Return FALSE\n"
<- "354\t\t\t\t\t\t\t   if sent ARJ or deisconnected call. Third argument 
indicate if it\'s\n"
<- "355\t\t\t\t\t\t\t   ARQ or setup situation */\n"
<- "356\t\t\t\t\t\t\t   IN int cl);\n"
<- "357\t\n"
<- "358\t\n"
<- "359\tBOOL RIPPossible(/*returns TRUE if the specified side of the call\n"
<- "360\t       \t\t\t   has a pending ARQ that a RIP can be sent to*/\n"
   "361\t\t\t\t\t   IN  int\t\t\t\t\t\tcl,\n"
   "362\t\t       \t\t   IN \tgkcciRIPMsg_t msg,\n"
   "363\t\t\t\t\t   IN  side_t\t\t\t\tside);\n"
   "364\t\t\t\t\t   int cmHook245(int cl,HCALL c1,HCALL c2);\n"
   "365\t\t\t\t\t\t\t   \n"
   "366\t\t\t\t\t\t\t   \n"
   "367\tint getCmParam(/* gets the stack parameter out of the GK one */\n"
   "368\t\t\t\t   IN   gkcciParameter_t  parameter);\n"
   "369\t\t\t\t\t\t\t   \n"
   "370\tBOOL paramCopy(/* copies param from message attached to origMsgHandle 
to message attached to destMsgHandle\n"
   "371\t\t\t\t\t  supports only a limited set of param : cmParamDisplay, 
cmParamUserUser, cmParamNonStandard\n"
   "372\t\t\t\t\t  FALSE returned when used with illegal parameter*/\n"
   "373\t\t\t\t\t  IN int cl,\n"
   "374\t\t\t\t\t  IN cmCallParam param,\n"
   "375\t\t\t\t\t  IN HCALL destMsgHandle,\n"
   "376\t\t\t\t\t  IN HCALL origMsgHandle);\n"
   "377\t\t\t\t\t\t\t\t   \n"
   "378\t\t\t\t\t\t\t\t   \n"
   "379\t\t\t\t\t\t\t\t   \n"
   "380\tBOOL checkParameterLegalForDelete( /* check if requested parameter is 
legal at this stage of call (or at all) for\n"
   "381\t\t\t\t\t\t  delete of an alias */\n"
   "382\t\t\t\t\t\t  IN   int                 cl,\n"
   "383\t\t\t\t\t\t  IN   gkcciParameter_t    parameter);\n"
   "384\t\t\t\t\t  \n"
   "385\tBOOL checkParameterLegal( /* check if requested parameter is legal at 
this stage of call (or at all) */\n"
   "386\t\t\t\t\t\t\t IN   int                 cl,\n"
   "387\t\t\t\t\t\t\t IN   gkcciParameter_t    parameter,\n"
   "388\t\t\t\t\t\t\t IN   gkcciSide_t         side, \n"
   "389\t\t\t\t\t\t\t IN   calOperation_t      operation);\n"
   "390\t\n"
   "391\tBOOL checkOperationLegal( /* check if set operation is legal at this 
stage of call (or at all) */\n"
   "392\t\t\t\t\t\t\t IN   int                 cl,\n"
   "393\t\t\t\t\t\t\t IN   gkcciParameter_t    parameter,\n"
   "394\t\t\t\t\t\t\t IN   gkcciSide_t         side);\n"
   "395\t\n"
   "396\t\n"
   "397\t\n"
   "398\t/*******************************************************/\n"
   "399\t/*      Address Resolution                             */\n"
   "400\t/*******************************************************/\n"
   "401\t\n"
   "402\t            BOOL appAddressNotUpdated( /* an application callback. The 
application didn\'t updated the addresses. The\n"
   "403\t                                             GK should proccess the 
addresses only if it\'s the first round of\n"
   "404\t                                             address resolution */\n"
   "405\t                                             IN   int cl);\n"
   "406\t\n"
   "407\t            BOOL appAliasUpdated( /* an application callback. The 
application updated the aliases. The\n"
   "408\t                                        GK should erase the ip address 
and proccess the addresses again */\n"
   "409\t                                        IN   int cl);\n"
   "410\t\n"
   "411\t            BOOL appAddressUpdated( /* an application callback. The 
application updated the addresses. The\n"
   "412\t                                          GK should proccess the new 
addresses again */\n"
   "413\t                                          IN   int cl);\n"
   "414\t\n"
   "415\t            BOOL fixFinalDest(/* decides type of call - whether it is 
zoned prefixed, to service, to forwarded endp, or regular.\n"
   "416\t                                 Accordingly, performs address 
manipulation so the dest addresses are set properly and updates the \n"
   "417\t                                 relevant fields in cl.*/\n"
   "418\t                               IN int cl);\n"
   "419\t\n"
   "420\t            BOOL appAddressDone( /* continue call after recieving 
address done confirmation from \n"
   "421\t                                    the application */\n"
   "422\t                                    IN int cl);\n"
   "423\t\n"
   "424\t            BOOL appAddressFinal( /* an application callback. The 
application wants the call to go through \n"
   "425\t                                        without processing of the 
addresses by the GK */\n"
   "426\t            \t\t\t               IN   int cl);\n"
   "427\t\n"
   "428\t            BOOL doneAddressResolution( /* Address resolution is done. 
If it\'s service check permission.\n"
   "429\t                                           If it\'s forward message, 
execute it. See if we need to send LRQ. \n"
   "430\t                                           Change state and notify the 
application about it and wait \n"
   "431\t                                           for its answer */\n"
   "432\t                                          IN int cl );\n"
   "433\t\n"
   "434\t            BOOL appAddressIncomplete(/* send ARJ with Incomplet"
<- "eAddress reason */\n"
   "435\t                                      IN int cl);\n"
   "436\t\n"
   "437\t           /*******************************************************/\n"
   "438\t           /* RAS and Q.931 Messages for the call                 */\n"
   "439\t           /*******************************************************/\n"
   "440\t\n"
   "441\t            BOOL loadAliasLRQ(/* load aliases from call to lrq 
message*/\n"
   "442\t              IN int cl,\n"
   "443\t              IN HRAS hsRas);\n"
   "444\t\n"
   "445\t            BOOL loadLCFInfo(\n"
   "446\t              IN  HRAS  hsRas,\n"
   "447\t              IN  int   cl,\n"
   "448\t              OUT BOOL* newDestInfo,\n"
   "449\t              OUT BOOL* newDestTransport,\n"
   "450\t              OUT BOOL* newDestAlias);\n"
   "451\t                       \n"
   "452\t            BOOL loadFromARQ(/* load parameters from ARQ message to 
call */\n"
   "453\t              IN HRAS hsRas,\n"
   "454\t              side_t side,\n"
   "455\t              IN int cl);\n"
   "456\t            \n"
   "457\t            BOOL loadFromSetup(\n"
   "458\t              IN HCALL hsCall,\n"
   "459\t              IN int cl);\n"
   "460\t\n"
   "461\t            int copySetup(IN int cl);\n"
   "462\t            void downloadToSetup(IN int cl, IN int destSetupNode, IN 
BOOL isService);\n"
   "463\t\n"
   "464\t\n"
   "465\t            BOOL releaseCompleteCheckAndCopy(/*checks if r.c. is 
supposed to copied from srcSide to destSide\n"
   "466\t                                         and if so, does the copying. 
returns FALSE on error*/\n"
   "467\t                                         side_t destSide,\n"
   "468\t                                         side_t srcSide,\n"
   "469\t                                         int cl,\n"
   "470\t                                         stateMode_t stateMode);\n"
   "471\t            \n"
   "472\t            BOOL releaseCompleteCheck(/*returns TRUE if r.c. is 
supposed to copied from srcSide to destSide*/\n"
   "473\t                                         side_t destSide,\n"
   "474\t                                         side_t srcSide,\n"
   "475\t                                         int cl,\n"
   "476\t                                         stateMode_t stateMode);\n"
   "477\t\n"
   "478\t\n"
   "479\t            \n"
   "480\t            BOOL ACF(/* generate an ACF messages return true/false on 
success*/\n"
   "481\t            \t IN HRAS hsRas,\n"
   "482\t               IN int cl,\n"
   "483\t               IN side_t side);\t\n"
   "484\t            \n"
   "485\t            BOOL ARJ(/*generate an ARJ message. return true/false on 
success */\n"
   "486\t                     IN HRAS hsRas,\n"
   "487\t                     IN cmRASReason reason,\n"
   "488\t                     IN int cl,\n"
   "489\t                     IN side_t side);\n"
   "490\t\n"
   "491\t            BOOL releaseARQ(\n"
   "492\t                            IN int cl,\n"
   "493\t                            IN side_t side);\n"
   "494\t\n"
   "495\t\n"
   "496\t\n"
   "497\t\n"
   "498\t            BOOL LRQ( /*issue LRQ message */\n"
   "499\t            \t IN int cl);\n"
   "500\t                       \n"
   "501\t            BOOL sendLRQ2Nbr( /* send LRQ to members in the neighbor 
list */\n"
   "502\t                              UINT16 neighbor,\n"
   "503\t                              int cl);\n"
   "504\t\t\t\t\t\t\tBOOL sendLRQ2Ip(int cl,cmRASTransport *ta);\n"
   "505\t            BOOL sendLRQ2NonNbr(/*send LRQ to a non-neighbor GK*/\n"
   "506\t                 UINT16 index,\n"
   "507\t                 int cl);\n"
   "508\t            BOOL removeOneLRQ(/*performs the actions that arise from 
recieving either timeout(reject = FALSE)\n"
   "509\t                              or LRJ(reject=TRUE)*/\n"
   "510\t                             IN int cl);\n"
   "511\t\n"
   "512\t            BOOL sendMulticast(/*  decides according whether a to 
multicast a LRQ message.\n"
   "513\t                                   NOTE that FALSE id returned for 
unregistered endp */\n"
   "514\t                                   IN UINT16 endp);\n"
   "515\t\n"
   "516\t            /* timer handler for expiration of gk timeout on multicast 
LRQ */\n"
   "517\t            void CALLCONV calLRQaudit(void *call); \n"
   "518\t\n"
   "519\t\n"
   "520\t\n"
   "521\t            BOOL sendDRQ(\n"
   "522\t                         IN int cl);\n"
   "523\t\n"
   "524\t\t\t\t\t\t\tBOOL setDRQ(\n"
   "525\t\t\t\t\t\t\t\tIN\tint\t\t\t\t\t\t\tcl,\n"
   "526\t\t\t\t\t\t\t\tOUT\tside_t*\t\t\t\t\tsd,\n"
   "527\t\t\t\t\t\t\t\tOUT HRAS*\t\t\t\t\t\thsRas);\n"
   "528\t\n"
   "529\t            BOOL DCF(\n"
   "530\t                     IN HRAS hsRas,\n"
   "531\t                     IN int cl,\n"
   "532\t                     IN side_t side);\n"
   "533\t            \n"
   "534\t            BOOL DRJ(\n"
   "535\t         "
<- "            IN HRAS hsRas,\n"
<- "536\t                     IN cmRASReason reason,\n"
<- "537\t                     IN int cl,\n"
<- "538\t                     IN side_t side);\n"
<- "539\t\n"
<- "540\t\n"
   "541\t           /*      Call Association                             */\n"
   "542\t  BOOL assocReqToCall(/*searces for the call side that the incoming 
message belongs to. If found,\n"
   "543\t\t\t\tcall and side specify the matching call and TRUE returned. If 
not found, call is\n"
   "544\t\t\t\tset to NOT_CALL and FALSE returned*/\n"
   "545\t\t\t      IN\tHRAS\t\t\t\t\t\t\thsRas,\n"
   "546\t\t\t      IN\tint*\t\t\t\t\t\t\tcall,\n"
   "547\t\t\t      IN side_t*\t\t\t\t\t\tside);\n"
   "548\t\n"
   "549\t            void locateARQCall(/*locate call (if any) that is 
associate with an ARQ when function return a VALID(cl)\n"
   "550\t            \t\t                indicate a match  */\n"
   "551\t            \t\t                IN HRAS hsRas,\n"
   "552\t\t\t\t                          IN HCALL hsCall,\n"
   "553\t            \t\t                IN int * call);\n"
   "554\t\n"
   "555\t            static int loacteARQByGuid(/*if searchByCallID=TRUE, 
searches the table by the callID field.Otherwise by the \n"
   "556\t                                       cid fied.If a match is found, 
but clashes with destCs, the search continues.\n"
   "557\t                                       -1 returned if none found.*/\n"
   "558\t                                       IN guid_t guid,\n"
   "559\t                                       IN BOOL searchByCallID,\n"
   "560\t                                       cmRASTransport *destCs);\n"
   "561\t\n"
   "562\t\t\t\t\t\t\tstatic int locateCallByCRV(/*Searches for call side that 
matches the specified crv and udp values*/\n"
   "563\t                             IN UINT16\t\t\t\t\tcrv,\n"
   "564\t                             IN cmRASTransport* udp,\n"
   "565\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t IN guid_t\t\t\t\t\tcallID,\n"
   "566\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t IN guid_t\t\t\t\t\tconfID,\n"
   "567\t                             IN side_t\t\t\t\t\tside);\n"
   "568\t\n"
   "569\t\n"
   "570\t           /*******************************************************/\n"
   "571\t           /*      Call Setup process                             */\n"
   "572\t           /*******************************************************/\n"
   "573\t\n"
   "574\t           \n"
   "575\t           int continueCallAfterSetup (/* continue call after setup 
after recieved approval of the application */\n"
   "576\t                            IN int cl);\n"
   "577\t\n"
   "578\t           int makeDestCall( /* send setup to destination */\n"
   "579\t                              IN int cl, IN BOOL isService);\n"
   "580\t\n"
   "581\t           int sendCallProc(IN int cl);\n"
   "582\t\n"
   "583\t           /* send connect to origin after getting application 
approval */\n"
   "584\t           BOOL connectDestinationToOrigin(IN int cl);\n"
   "585\t\n"
   "586\t           /* Handles alerting message from destination. Generates a 
state event\n"
   "587\t\t\t\t\t\t\t  and forwards the message to the origin. returns TRUE on 
succes. */\n"
   "588\t           static BOOL handleRingback(int cl);\n"
   "589\t      \n"
   "590\t           /* Handles call-proceeding message from destination. 
Generates a state event\n"
   "591\t\t\t\t\t\t    and offloads H.245 address from message. returns TRUE on 
succes. */\n"
   "592\t           static BOOL handleCallProceeding(int cl); /* meir GK-MC 
*/\n"
   "593\t\n"
   "594\t           /* The application changed the addresses when notified 
that\n"
   "595\t              the call cannot be completed or before a new line hunt. 
\n"
   "596\t              returning to address resolution state again */\n"
   "597\t           BOOL appRerouteCall(IN   int                 cl ,\n"
   "598\t                               IN   gkcciReplyReason_t  reason);\n"
   "599\t\n"
   "600\t           BOOL checkLineHunting(/* Check if line hunting cannot go on 
and notify the application about it. \n"
   "601\t                                     Otherwise, if makeCall is TRUE 
we\'ll make new call in the function lineHunt \n"
   "602\t                                     if not, we\'ll ask for 
application permission to continue hunting  */\n"
   "603\t                                     IN int cl,\n"
   "604\t                                     IN BOOL makeCall);\n"
   "605\t\n"
   "606\t           int lineHunt(/*hunt for next free service */\n"
   "607\t                         IN int cl,\n"
   "608\t                         IN BOOL makeCall);\n"
   "609\t\n"
   "610\t\tvoid setDestZone(IN int cl);\n"
   "611\t           /*******************************************************/\n"
   "612\t           /*      Call State Machine and Handlers                */\n"
   "613\t           /*******************************************************/\n"
   "614\t\n"
   "615\t           BOOL checkCallStat"
<- "e( /* check that the call is in the right state */\n"
   "616\t                                        IN int          cl, \n"
   "617\t                                        IN calStatus_t  state, \n"
   "618\t                                        IN char         *action_str 
);\n"
   "619\t\n"
   "620\t           int handleNewCall( /*when state change is reported */\n"
   "621\t            \t\t  IN      HCALL           hsCall,\n"
   "622\t            \t\t  IN \tHAPPCALL\thaCall,\n"
   "623\t            \t\t  IN \tUINT32 \t\tstate,\n"
   "624\t            \t\t  IN \tUINT32\t\tstateMode);\n"
   "625\t\n"
   "626\t           void handleStateChange(/* change state an print 
notification */\n"
   "627\t                             IN int cl,\n"
   "628\t                             IN calStatus_t newState,\n"
   "629\t                             IN char * display );           \n"
   "630\t            \n"
   "631\t            int handleOriginStateChange( /*when state change is 
reported */\n"
   "632\t            \t\t\t   IN   HCALL           hsCall,\n"
   "633\t            \t\t\t   IN \tHAPPCALL\thaCall,\n"
   "634\t            \t\t\t   IN \tUINT32 \t\tstate,\n"
   "635\t            \t\t\t   IN \tUINT32\t\tstateMode,\n"
   "636\t            \t\t\t   IN   int             cl);\n"
   "637\t            \n"
   "638\t            \n"
   "639\t            \n"
   "640\t            int handleDestinationStateChange( /*when state change is 
reported */\n"
   "641\t            \t\t\t\tIN      HCALL           hsCall,\n"
   "642\t            \t\t\t\tIN \tHAPPCALL\thaCall,\n"
   "643\t            \t\t\t\tIN \tUINT32 \t\tstate,\n"
   "644\t            \t\t\t\tIN \tUINT32\t\tstateMode,\n"
   "645\t            \t\t\t\tIN      int             cl);\n"
   "646\t\n"
   "647\t            BOOL handleOriginARQ(\n"
   "648\t            \t\t     IN HRAS      hsRas,\n"
   "649\t            \t\t     IN HCALL\t    hsCall,\n"
   "650\t            \t\t     IN HAPPCALL  haCall,\n"
   "651\t                     IN UINT16    endpoint );\n"
   "652\t\n"
   "653\t            BOOL handleDestinationARQ(\n"
   "654\t            \t\t\t  IN HRAS      hsRas,\n"
   "655\t            \t\t\t  IN HCALL\t   hsCall,\n"
   "656\t            \t\t\t  IN HAPPCALL  haCall,\n"
   "657\t                    IN UINT16    endpoint);\n"
   "658\t\n"
   "659\t           gkcciReason_t getAppReason( /* translate a call reason to 
cci reason */\n"
   "660\t             IN int cl);\n"
   "661\t    \n"
   "662\t           gkcciState_t getAppState( /* translate a call state to cci 
state */\n"
   "663\t             IN UINT32 state);\n"
   "664\t\n"
   "665\t           /*******************************************************/\n"
   "666\t           /*       Call Disconnection                            */\n"
   "667\t           /*******************************************************/\n"
   "668\t\n"
   "669\t           static int callDropParam(/*set the drop reason in the 
database and drop\n"
   "670\t\t\t\t\t\t\t\t\t\t the call using cmutilCallDropPara,*/\n"
   "671\t\t\t\t\t\t\t\t\t\tIN int cl,   IN   side_t   side,\n"
   "672\t\t\t    \t\t\t\t\t\tIN  HCALL\t        hsCall,\n"
   "673\t\t\t\t\t\t\t\t\t\tIN  cmReasonType   cmReason);\n"
   "674\t\t\t   \n"
   "675\t\t\t   \n"
   "676\t\t\t   \n"
   "677\t\t\t   BOOL stopCall(/* stop the call according to its state */\n"
   "678\t                                       IN int           cl, \n"
   "679\t                                       IN calReason_t   reason,\n"
   "680\t                                       IN cmReasonType  
disconnectOrigReason,\n"
   "681\t                                       IN cmReasonType  
disconnectDestReason,\n"
   "682\t                                       IN cmRASReason   ARJReason);\n"
   "683\t\n"
   "684\t           BOOL teardownCall(/*pending aggressive call shut down */\n"
   "685\t             IN int cl,\n"
   "686\t             IN side_t side);\n"
   "687\t\n"
   "688\t           BOOL disengageCall( /* disconnect call using H323 messages 
*/\n"
   "689\t\t\t\t\t\t\t\t\tIN int cl,\n"
   "690\t                IN gkcciDisconnectReason_t disconnectReasonOrig,\n"
   "691\t                IN gkcciDisconnectReason_t disconnectReasonDest);\n"
   "692\t\n"
   "693\t           BOOL disconnectCall(/* initiate call disconnect sequnce 
*/\n"
   "694\t                                IN int cl,\n"
   "695\t                                IN cmReasonType origReason,\n"
   "696\t                                IN cmReasonType destReason,\n"
   "697\t                                IN int\t\t\torigCause,\n"
   "698\t                                IN int\t\t\tdestCause,\n"
   "699\t                                IN BOOL gkInitiated);\n"
   "700\t\n"
   "701\tstatic BOOL freeBackupCall(/*free backup call record of a given 
call*/\n"
   "702\t\t\t\t\t\t\t   IN int cl);\n"
   "703\t           BOOL freeCall(/*free call resources */\n"
   "704\t                      "
<- "    IN int cl);\n"
<- "705\t\n"
<- "706\t           void clearCall( /* clear call entry */\n"
<- "707\t             IN int cl);\n"
   "708\t\n"
   "709\t           BOOL closeCall(/*if cl.side has open BRQ then they are 
handled and then closeCallHandle is called.\n"
   "710\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFALSE returned if cl is invalid*/\n"
   "711\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tIN int cl,\n"
   "712\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tIN side_t side);\n"
   "713\t\n"
   "714\t           void CALLCONV alertingTimerExpired(/* Alerting timer 
expired. Destination has been ringing for\n"
   "715\t                                     allowed seconds. Terminate call 
to current destination and allow\n"
   "716\t                                     application to choose an 
alternative destination */\n"
   "717\t                                     IN void* call);\n"
   "718\t           \n"
   "719\t           BOOL handleCannotComplete( /* sets the state and reason of 
the call and notify the application\n"
   "720\t                                          that the call cannot be 
completed */\n"
   "721\t                                          IN int cl,\n"
   "722\t                                          IN calReason_t   callRsn,\n"
   "723\t                                          IN gkcciReason_t gkcciRsn,\n"
   "724\t                                          IN char          *rsnStr);\n"
   "725\t\n"
   "726\t           BOOL terminateOrigin( /*terminate call from origin event 
return true/false on success */\n"
   "727\t                                   IN int cl);           \n"
   "728\t           BOOL terminateDestination( /*terminate call from origin 
event return true/false on success */\n"
   "729\t                                        IN int cl);\n"
   "730\t            \n"
   "731\t\n"
   "732\t           BOOL appConfirmDisconnect(/* application approved 
disconnecting */\n"
   "733\t                                     IN int cl);\n"
   "734\t\n"
   "735\t           BOOL appDisconnectDestination( /* the application descided 
to disconnect the\n"
   "736\t                                          destination and reroute the 
call, before \n"
   "737\t                                          sending connect to the 
origin */\n"
   "738\t                                          IN   int                 
cl,\n"
   "739\t                                          IN   gkcciReplyReason_t  
reason);\n"
   "740\t\n"
   "741\t            BOOL newCallDisconnect (/* A new call cannot complete, 
notify the application\n"
   "742\t                                    and don\'t wait for answer. 
Disconnect the call */\n"
   "743\t                                    IN  int cl,\n"
   "744\t                                    IN  HCALL         hsCall,\n"
   "745\t                                    IN  cmReasonType  cmReason,\n"
   "746\t                                    IN  HRAS          hsRas,\n"
   "747\t                                    IN  cmRASReason   ARJReason,\n"
   "748\t                                    IN  side_t        side,\n"
   "749\t                                    IN  gkcciState_t  state,\n"
   "750\t                                    IN  gkcciReason_t reason);\n"
   "751\t\n"
   "752\t           BOOL centralizedShutdown(void); /*closes all stack handles 
and frees calls*/\n"
   "753\t\n"
   "754\t\n"
   "755\t           void CALLCONV expectDRQTOForOrigin(/*terminates origin as 
if recieved a drq from origin*/\n"
   "756\t                                        void * call);           \n"
   "757\t           void CALLCONV expectDRQTOForDest(/*terminates destination 
as if recieved a drq from destination*/\n"
   "758\t                                        void * call);\n"
   "759\t\n"
   "760\t           \n"
   "761\t           BOOL gwIndicationUserBusy(/*returns TRUE if gw 
releaseComplete reply indicates that the called user is busy*/\n"
   "762\t                                      int cl);\n"
   "763\t            \n"
   "764\t           cmReasonType origDropReason(/*decides what reason to send 
orig out of the drop reason the dest has recieved*/\n"
   "765\t                                                  IN int cl);\n"
   "766\t  \n"
   "767\t           cmReasonType destDropReason(/*decides what reason to send 
dest out of the drop reason the orig has recieved*/\n"
   "768\t                                                  IN int cl);\n"
   "769\t\n"
   "770\t           gkcciReason_t dropRsnToAppRsn( /* translate the drop reason 
of the origin to the \n"
   "771\t                                            respective reason for the 
application */\n"
   "772\t                                            IN int cl);\n"
   "773\t           /* translate the disconnect reas"
<- "on to DRQ reason */\n"
   "774\t           int disconnectRsnToDRQRsn(IN gkcciDisconnectReason_t 
reason);\n"
   "775\t\n"
   "776\t           BOOL disconnectRsnApp2CM(/*if an improper rsn is used, 
cmRsn will be set to cmReasonTypeUndefinedReason and FALSE returned*/\n"
   "777\t                     IN int cl,\n"
   "778\t                     OUT  cmReasonType*             cmRsn,\n"
   "779\t                     IN   gkcciDisconnectReason_t   appRsn);\n"
   "780\t\n"
   "781\t           BOOL disconnectRsnCM2App(/*if an improper rsn is used, 
cmRsn will be set to cmReasonTypeUndefinedReason and FALSE returned*/\n"
   "782\t                     IN int cl,\n"
   "783\t                     OUT  gkcciDisconnectReason_t* appRsn,\n"
   "784\t                     IN   cmReasonType cmRsn);\n"
   "785\t\n"
   "786\t           cmRASReason ARJRsnApp2cm(\n"
   "787\t                                 IN int cl,\n"
   "788\t                                 IN gkcciARJReason_t app);\n"
   "789\t\n"
   "790\t           gkcciARJReason_t ARJRsnCm2App(\n"
   "791\t                              IN cmRASReason cmReason);\n"
   "792\t\n"
   "793\t           BOOL clearSuppServBuffer(IN int cl,\n"
   "794\t                                    IN side_t side);\n"
   "795\t\n"
   "796\t           /*******************************************************/\n"
   "797\t           /* Timeouts                                             
*/\n"
   "798\t           /*******************************************************/\n"
   "799\t           BOOL  waitingForApp( /* returns TRUE if call is waiting for 
application response */\n"
   "800\t                                 IN int cl);        \n"
   "801\t    \n"
   "802\t            void CALLCONV applicationTimeoutCheck(/* goes over all 
calls and if they\'re in state of waiting to the application\n"
   "803\t                                             and the call timeout 
counter is 0 increament the counter. If the counter is 1 \n"
   "804\t                                             stop waiting and 
disconnect the call */\n"
   "805\t                                             void *dummy);\n"
   "806\t\n"
   "807\t\n"
   "808\t           /*******************************************************/\n"
   "809\t           /* LAS - OBSOLETE!!!                                   */\n"
   "810\t           /*******************************************************/\n"
   "811\t           /* continue the call as usual, whether after consulting the 
las app or not */\n"
   "812\t           int continueCall(IN  int cl,\n"
   "813\t                            IN  BOOL fixDest); \n"
   "814\t\n"
   "815\t           BOOL sendCallToApp( /* sends the request to the LAS 
application and change\n"
   "816\t                              state to CAL_WAIT_APP. Sets the auth 
field in order to\n"
   "817\t                              identify the response */\n"
   "818\t                              IN int cl);\n"
   "819\t            \n"
   "820\t           /*******************************************************/\n"
   "821\t           /* Display (Logs and Printouts)                        */\n"
   "822\t           /*******************************************************/\n"
   "823\t\n"
   "824\t           static void callTitlesHeaders();           \n"
   "825\t           static BOOL callTitlesData(IN int cl);\n"
   "826\t           \n"
   "827\t           static void formatTheMessage(\n"
   "828\t             IN char* buf,\n"
   "829\t             IN const char* str,\n"
   "830\t             IN int cl,\n"
   "831\t             IN int level);\n"
   "832\t\n"
   "833\t\n"
   "834\t  /************************************/\n"
   "835\t  /* Call Services                    */\n"
   "836\t  /************************************/\n"
   "837\t  BOOL locateService(/*test if destination is a call adjust call 
serive number\n"
   "838\t                       for both propriety and V2 (GW prefixes) 
services */\n"
   "839\t            \t\t   IN int cl);\n"
   "840\t            \n"
   "841\t            \n"
   "842\t  void locateDestInZone(/*test if destination is in zone and adjust 
destination address */\n"
   "843\t    IN int cl);\n"
   "844\t\n"
   "845\t/* start sohan */\n"
   "846\t  BOOL locateSrcInZone(/*test if source is in zone  */\n"
   "847\t    IN int cl, OUT cmRASTransport *srcCallSignal);\n"
   "848\t/* End sohan */\n"
   "849\t\n"
   "850\t  BOOL handleZonePrefixedCall(/*  removes the prefix from all the 
numbers requested in this call.NOTE that permission\n"
   "851\t                                            is not verified*/\n"
   "852\t                                            IN int cl);\n"
   "853\t\n"
   "854\t  BOOL placeForward(/*to be a local function in fo"
<- "rward module*/\n"
<- "855\t    IN int cl,\n"
<- "856\t    IN UINT16 reg,\n"
   "857\t    IN cmRASAlias * alias);\n"
   "858\t                    \n"
   "859\t BOOL locateSecondForward(/*searches destExtra array for second 
forward.\n"
   "860\t                            if found, index will be the index in the 
array.\n"
   "861\t                            if not index will be 
DESTINATION_NUMBER*/\n"
   "862\t                            IN int cl,\n"
   "863\t                            IN int* index);        \n"
   "864\t                              \n"
   "865\t BOOL cancelForward(/*to be a local function in forward module*/\n"
   "866\t   IN int cl,\n"
   "867\t   IN UINT16 reg);\n"
   "868\t \n"
   "869\t \n"
   "870\t BOOL exchangeForwardInfo(/*replaces destInfo field with the forwarded 
aliasname*/\n"
   "871\t   IN int cl);\n"
   "872\t\n"
   "873\t\n"
   "874\t  \n"
   
"875\t/****************************************************************************************************\n"
   "876\t\n"
   "877\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGK RECOVERY MANAGEMENT\n"
   "878\t\n"
   
"879\t*****************************************************************************************************/\n"
   "880\t\n"
   "881\t\n"
   "882\tINT32 RMCallBackup(\n"
   "883\t\tIN\t\t\tint\t\t\t\t\t\tcl,\n"
   "884\t\tIN\t\t\tgkHCALL\t\t\t\thCall,\n"
   "885\t\tIN\t\t\tgkcciSide_t\t\tsd,\n"
   "886\t\tOUT\t\t\tgkcciRMCall*\tdata);\n"
   "887\t\n"
   "888\tBOOL getEndpointID(\n"
   "889\t\t\t\tIN\t\tUINT16 reg,\n"
   "890\t\t\t\tOUT\tgkaddEndpointId_t endpID);\n"
   "891\t\n"
   "892\tINT32 RMRestoreData(\n"
   "893\t\tIN\t\t\tint\t\t\t\t\t\tcl,\n"
   "894\t\tIN\t\t\tgkcciSide_t\t\tsd,\n"
   "895\t\tIN\t\t\tgkcciRMCall*\tdata);\n"
   "896\t\n"
   "897\tINT32 RMLinkToRegtable(\n"
   "898\t\tIN\t\t\tint\t\t\t\t\t\tcl,\n"
   "899\t\tIN\t\t\tside_t\t\t\t\tside,\n"
   "900\t\tIN\t\t\tgkcciRMCall*\tdata);\n"
   "901\t\n"
   "902\tINT32 RMRestoreFunctionality(\n"
   "903\t\tIN\t\t\tint\t\t\t\t\t\tcl,\n"
   "904\t\tIN\t\t\tgkHCALL\t\t\t\thCall,\n"
   "905\t\tIN\t\t\tgkHAPPCALL\t\thaCall,\n"
   "906\t\tIN\t\t\tgkcciRMCall*\torigin,/*set to NULL if setting only 
destination information*/\n"
   "907\t\tIN\t\t\tgkcciRMCall*\tdestination/*set to NULL if setting only 
origin information*/);\n"
   "908\t\n"
   "909\tINT32 RMRestroreStackHandle(\n"
   "910\t\tIN int cl,\n"
   "911\t\tIN side_t side);\n"
   "912\t\n"
   "913\t\n"
   "914\t\n"
   
"915\t/*************************************************************************\n"
   "916\t *\n"
   "917\t * Hash related functions, hash callbacks. \n"
   "918\t *\n"
   "919\t * The hash is used to associate a specific alias with a service 
provider\n"
   "920\t *  and use the same hash later\n"
   "921\t *\n"
   "922\t 
*************************************************************************/\n"
   "923\t\n"
   "924\t/* \n"
   "925\t * generateKeyHash: Call-back used by hash-table module.\n"
   "926\t * This call-back will turn a hash-table key into an index.\n"
   "927\t *  Implements the hash function.\n"
   "928\t */\n"
   "929\tINT32 CALLCONV generateKeyHash(                                  \n"
   "930\t          IN void* handle,\n"
   "931\t          IN char* data,\n"
   "932\t          IN INT32 dataSize_chars,\n"
   "933\t          IN char* dataHandle);\n"
   "934\t/* \n"
   "935\t * identifyHash: call-back used by hash-table when trying to compare 
hash-table\n"
   "936\t *   data entries \n"
   "937\t */ \n"
   "938\tBOOL CALLCONV identifyHash(\n"
   "939\t          IN void* handle,\n"
   "940\t          IN gkhashOperation operation,\n"
   "941\t          IN char* data_a,\n"
   "942\t          IN INT32 dataSize_chars_a,\n"
   "943\t          IN char* dataHandle_a,\n"
   "944\t          IN char* dataHandle_b);\n"
   "945\t\n"
   "946\t/*\n"
   "947\t * traverse_function: this callback defines the action done when 
traversing the hash\n"
   "948\t *  (in our case, we print the full hash entries)\n"
   "949\t */ \n"
   "950\tvoid CALLCONV traverse_function (\n"
   "951\t          IN void* handle,\n"
   "952\t          IN int flag,/*indicates if the entry is occupied(0) 
markedAsDeleted(1) or vacant(2)*/ \n"
   "953\t          IN char*dataHandle,/*if not occupied, will be set to NULL*/ 
\n"
   "954\t          INT32 place);\n"
   "955\t\n"
   "956\t/*\n"
   "957\t * findInHash:  given a call index, find if that given call tries to 
call a service, \n"
   "958\t *  Assumption : the call is to a service\n"
   "959\t *\n"
   "960\t */\n"
   "961\tBOOL findInHash(\n"
   "962\t\t\t\t\tIN int cl,\n"
   "963\t\t\t\t\tOUT char* data,\n"
   "964\t\t\t\t\tOUT char* dataHandle,\n"
   "965\t\t\t\t\tint* aliasIndex);\n"
   "966\t\n"
   "967\t/* \n"
   "968\t * insertNewMcuHash - insert a new entry to the MCU hash\n"
   "969\t *    insert the alias as key, transport as data (and count = 0) \n"
   "970\t *    as additional data\n"
   "971\t */\n"
   "972\tBOOL insertNewMcuHash(\n"
   "973\t\t\t\t\t\t  IN int cl,\n"
   "974\t\t\t\t\t\t  char * data);\n"
   "975\t\n"
   "976\t/* \n"
   "977\t * updateMcuHash - updates an  entry to the MCU hash\n"
   "978\t *    the change would be changing the count stored in hash \n"
   "979\t *    (incremenet it by 1)\n"
   "980\t */\n"
   "981\tBOOL updateMcuHash(IN int cl,\n"
   "982\t\t\t"
<- "\t\t   IN int aliasIndex,\n"
   "983\t\t\t\t\t   char *data,\n"
   "984\t\t\t\t\t   char *dataHandle, \n"
   "985\t\t\t\t\t   BOOL  add); /* Indicates if the update adds or subtracts  
*/\n"
   "986\t\n"
   "987\t/*\n"
   "988\t * disconnectCalMCUHash - remove the call from the MCUhash table 
(assuming it \n"
   "989\t *   was there in the first place).\n"
   "990\t */\n"
   "991\tvoid disconnectCallMCUHash(IN int cl);\n"
   "992\t\n"
   "993\t/*\n"
   "994\t * addToMcuHash - insert the call to the MCU hash,\n"
   "995\t *   the key to the data will be the alias used to access the 
service\n"
   "996\t *   and the actual data will be number of calls connected, and \n"
   "997\t */\n"
   "998\tvoid addToMcuHash(IN int cl);\n"
   "999\t\n"
   "1000\t/*\n"
   "1001\t * printHash - debug function that will print all the hash table\n"
   "1002\t *\n"
   "1003\t */\n"
   "1004\tvoid printHash();\n"
   "1005\t\n"
   "1006\t\n"
   "1007\t/* \n"
   "1008\t *  Decode the data that was stored in the hash table\n"
   "1009\t */\n"
   "1010\tvoid dataHandleDecodeMCUHash (\n"
   "1011\t\t\tOUT  cmRASTransport* transport, \n"
   "1012\t\t\tOUT  int*   \t\t count, \n"
   "1013\t\t\tIN   char*           dataHandle);\n"
   "1014\t\n"
   "1015\t/* \n"
   "1016\t *  Encode the actual data to be stored in the hash table\n"
   "1017\t */\n"
   "1018\tvoid dataHandleEncodeMCUHash (\n"
   "1019\t\t\tIN  cmRASTransport* transport, \n"
   "1020\t\t\tIN  int\t\t\t    count, \n"
   "1021\t\t\tOUT char*           dataHandle);\n"
   "1022\t\n"
   "1023\t/*\n"
   "1024\t * Decode of the hash key, just transfer from bytes to specific 
structure\n"
   "1025\t */ \n"
   "1026\tstatic void dataDecodeMCUHash(\n"
   "1027\t        IN  char* data,\n"
   "1028\t        OUT char* alias);\n"
   "1029\t\n"
   "1030\t/*\n"
   "1031\t * Encode of the hash key, just transfer it to char. \n"
   "1032\t */ \n"
   "1033\tstatic void dataEncodeMCUHash(\n"
   "1034\t        IN  char* alias, \n"
   "1035\t\t\tOUT char* data);\n"
   "1036\t\n"
   "1037\t\n"
   "1038\t/*\n"
   "1039\t * Conference hunting : check if proprietary service, or V2 prefix 
service is \n"
   "1040\t *  used for \"Conference Hunting\"\n"
   "1041\t */\n"
   "1042\tBOOL ConferenceHuntingService(IN int cl);\n"
   "1043\t\n"
   "1044\t/* 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 */\n"
   "1045\t/* 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 */\n"
   "1046\t\n"
   "1047\t\n"
   "1048\t  /********************************************************/\n"
   "1049\t  /*                  IMPLEMENTATION                      */\n"
   "1050\t  /********************************************************/\n"
   "1051\t\n"
   "1052\t  /*******************************************************/\n"
   "1053\t  /* Module Initialization and close                     */\n"
   "1054\t  /*******************************************************/\n"
   "1055\t  /* init functions */\n"
   "1056\t  BOOL calInit(IN int maxCalls)\n"
   "1057\t  {\n"
   "1058\t    int i,level,cl;\n"
   "1059\t    maxRegularCalls = maxCalls; /*sarit 20/5/00 adding the backup 
mechanizm*/\n"
   "1060\t\tif(maxCalls < 10)\n"
   "1061\t\t\tmaxBackups = 2;\n"
   "1062\t\telse\t\n"
   "1063\t\t\tmaxBackups = (maxCalls)*2/10;\n"
   "1064\t    globalMaxCalls = maxCalls+1+maxBackups;\n"
   "1065\t\n"
   "1066\t    if (!cmuInit(globalMaxCalls))\n"
   "1067\t    {\n"
   "1068\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8700, -1,\"Error in GK initialization - cmuInit\"));\n"
   "1069\t      return FALSE;\n"
   "1070\t    }\n"
   "1071\t    GK_NOTIFY(\"calInit\",GEN_NA,10);\n"
   "1072\t    if ((calls = 
(callInfo_t*)malloc(globalMaxCalls*sizeof(callInfo_t))) == NULL)\n"
   "1073\t    {\n"
   "1074\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8701, -1,\"malloc failure in malloc(globalMaxCalls*sizeof(callInfo_t))\" ));\n"
   "1075\t      return FALSE;\n"
   "1076\t    }\n"
   "1077\t    for (cl=0;cl<globalMaxCalls;cl++)\n"
   "1078\t      memset(&(CL),0,sizeof(callInfo_t));\n"
   "1079\t\n"
   "1080\t\tmemset(stateName, 0, sizeof(stateName));\n"
   "1081\t    stateName[0]=\"NO_STATE\"; /* newNaomi. Add it because of the 
core in clearCall at init */\n"
   "1082\t    stateName[CAL_NO_CALL]=\"CAL_NO_CALL\";\n"
   "1083\t    stateName[CAL_HANDLES]=\"CAL_HANDLES\";\n"
   "1084\t    stateName[CAL_ADDRESS_RESOLUTION]=\"CAL_ADDRESS_RESOLUTION\";\n"
   "1085\t    stateName[CAL_ADDRESS_DONE]=\"CAL_ADDRESS_DONE\";\n"
   "1086\t    stateName[CAL_LRQ_SENT]=\"CAL_LRQ_SENT\";\n"
   "1087\t    stateName[CAL_WAIT_ORIG_ADMISSION]=\"CAL_WAIT_ORIG_ADMISSION\";\n"
   "1088\t    stateName[CAL_WAIT_OFFERING]=\"CAL_WAIT_OFFERING\";\n"
   "1089\t    stateName[CAL_WAIT_LRQ]=\"CAL_WAIT_LRQ\";\n"
   "1090\t    stateName[CAL_CANNOT_COMPLETE]=\"CAL_CANNOT_COMPLETE\";\n"
   "1091\t    stateName[CAL_RAS_CONNECT]=\"CAL_RAS_CONNECT\";\n"
   "1092\t    stateName[CAL_EXPECTING_DRQ]=\"CAL_EXPECTING_DRQ\";"
<- "\n"
<- "1093\t    
stateName[CAL_EXPECTING_DRQ_TO_HUNT]=\"CAL_EXPECTING_DRQ_TO_HUNT\";\n"
   "1094\t    stateName[CAL_WAIT_DEST_ADMISSION]=\"CAL_WAIT_DEST_ADMISSION\";\n"
   "1095\t    stateName[CAL_WAIT_DEST_CONNECT]=\"CAL_WAIT_DEST_CONNECT\";\n"
   "1096\t    stateName[CAL_WAIT_DEST_DISCONNECT] = 
\"CAL_WAIT_DEST_DISCONNECT\";\n"
   "1097\t    stateName[CAL_HUNTING]=\"CAL_HUNTING\";\n"
   "1098\t    stateName[CAL_WAIT_HUNTING]=\"CAL_WAIT_HUNTING\";\n"
   "1099\t    stateName[CAL_CONNECT]=\"CAL_CONNECT\";\n"
   "1100\t    stateName[CAL_DISCONNECT]=\"CAL_DISCONNECT\";\n"
   "1101\t    stateName[CAL_APP_HANDLE]=\"CAL_APP_HANDLE\";\n"
   "1102\t    stateName[CAL_WAIT_ADDRCMPLT]=\"CAL_WAIT_ADDRCMPLT\";\n"
   "1103\t    
stateName[CAL_WAIT_SETUP_ADDRCMPLT]=\"CAL_WAIT_SETUP_ADDRCMPLT\";\n"
   "1104\t    stateName[CAL_NW_SETUP]=\"CAL_NW_SETUP\";\n"
   "1105\t    \n"
   "1106\t    \n"
   "1107\t    \n"
   "1108\t    sideName[0]=\"Origin\";\n"
   "1109\t    sideName[1]=\"Destination\";\n"
   "1110\t    sideName[2]=\"No side\";\n"
   "1111\t    \n"
   "1112\t    /* newnaomi. I must put the call to clearCall after the init of 
stateName,\n"
   "1113\t    because clearCall is using it in CHANGE_STATE. Also init 
stateName[0],\n"
   "1114\t    because thats the value of CL.state, before the init (being 
global) */\n"
   "1115\t    level = genGetDbgL();\n"
   "1116\t    genSetDbgL(0);\n"
   "1117\t    for (i=0;i<globalMaxCalls;i++)\n"
   "1118\t    {\n"
   "1119\t      clearCall(i);\n"
   "1120\t    }\n"
   "1121\t    /* set the timer that takes care of application timeout */\n"
   "1122\t    gkTiTimerSet(applicationTimeoutCheck,(void*)NULL, 
APPLICATION_TO_DELAY);\n"
   "1123\t    genSetDbgL(level);\n"
   "1124\t    \n"
   "1125\t#ifdef GK_SET_DEST\n"
   "1126\t    calDest1[0]=calDest2[0]=0;\n"
   "1127\t#endif\n"
   "1128\t\t/* AVI 6/2000 */\n"
   "1129\t\t/* Initialize hash table for \"MCU\" services */\n"
   "1130\t\t/* We define the capacity as 2*globalmaxcalls, globalcalls equals 
maxcalls+1,\n"
   "1131\t\t   since every call is a potential entry in the hash table, and \n"
   "1132\t\t   we multiply it by two to ensure o(1) access to the hash - see \n"
   "1133\t\t   analysis of hash for the factor of 2 */\n"
   "1134\t\t/* The data_handle is what actually stored in the hash table */\n"
   "1135\t\t/* The data is the key */\n"
   "1136\t\tserviceHashH = 
gkhashInit(2*globalMaxCalls,HASH_DATA_HANDLE_SIZE,NULL,generateKeyHash,identifyHash,traverse_function);\n"
   "1137\t    \n"
   "1138\t    return TRUE;\n"
   "1139\t  }\n"
   "1140\t \n"
   "1141\t  /* module cleanup function */\n"
   "1142\t  void calEnd(void)\n"
   "1143\t  {\n"
   "1144\t    gkTiTimerKill(applicationTimeoutCheck,(void*)NULL);\n"
   "1145\t    if (calls)\n"
   "1146\t      free(calls);\n"
   "1147\t    cmuEnd();\n"
   "1148\t\tgkhashEnd(serviceHashH);\n"
   "1149\t  }\n"
   "1150\t\n"
   "1151\t\n"
   "1152\t  /*******************************************************/\n"
   "1153\t  /*      Call State Machine                             */\n"
   "1154\t  /*******************************************************/\n"
   "1155\t  /* new call handler*/\n"
   "1156\t  int calEvNewCall(\n"
   "1157\t    IN \tHCALL \t\thsCall,\n"
   "1158\t    OUT \tLPHAPPCALL \tlphaCall)\n"
   "1159\t  {\n"
   "1160\t    if(hsCall);\n"
   "1161\t    *lphaCall=(HAPPCALL)0;\n"
   "1162\t    return 0;\n"
   "1163\t  } \n"
   "1164\t\n"
   
"1165\t/*----------------------------------------------------------------------------*/
    \n"
   "1166\t  int calEvCallNewRate(\n"
   "1167\t                       IN \tHAPPCALL\thaCall,\n"
   "1168\t                       IN \tUINT32 \t\trate)\n"
   "1169\t  {\t  \n"
   "1170\t    side_t side;\n"
   "1171\t    int cl;\n"
   "1172\t    \n"
   "1173\t    if (CALL_NEW(haCall))\n"
   "1174\t      return 0;\n"
   "1175\t    cl=getCall(haCall,&side);\n"
   "1176\t    \n"
   "1177\t    CALL_NOTIFY(\"EvCallNewRate\",GEN_NA,30,cl);\n"
   "1178\t    \n"
   "1179\t    if (!VALID(cl))\n"
   "1180\t      return ERROR;\n"
   "1181\t\n"
   "1182\t    if (CL.OTHER_SIDE.stack==(HCALL)NULL)\n"
   "1183\t    {\n"
   "1184\t      return 0;\n"
   "1185\t    }\n"
   "1186\t    else\n"
   "1187\t      return cmCallSetRate(CL.OTHER_SIDE.stack,rate);\n"
   "1188\t    \n"
   "1189\t  }\n"
   "1190\t  \n"
   
"1191\t/*----------------------------------------------------------------------------*/
  \n"
   "1192\t/* Start sohan */\n"
   "1193\tvoid getGuidString(char *ID, char *String1, char *String2)\n"
   "1194\t{\n"
   "1195\t    int  charBuf=0, i=0;\n"
   "1196\t\n"
   "1197\t    memset(String1, 0, sizeof(String1));\n"
   "1198\t    memset(String2, 0, sizeof(String2));\n"
   "1199\t         \n"
   "1200\t    sprintf(String2,\"0x\");\n"
   "1201\t    for (i=0;i<GUID_LEN;i++)\n"
   "1202\t    {\n"
   "1203\t    \tcharBuf=(UINT8)ID[i];\n"
   "1204\t        sprintf(String2,\"%s%02x\",String2,charBuf);\n"
   "1205\t        sprintf(String1,\"%s%c\",String1,(char)ID[i]);\n"
   "1206\t\t// sohan commented to avoid crash\n"
   "1207\t    }\n"
   "1208\t}\n"
   "1209\t     "
<- " \n"
   "1210\tchar*\n"
   "1211\tStrToHex(\n"
   "1212\t            BYTE* data,\n"
   "1213\t            int len)\n"
   "1214\t{\n"
   "1215\t  static char buf[100];\n"
   "1216\t  char* digits=(char *)\"01234567890ABCDEF\";\n"
   "1217\t  unsigned int i;\n"
   "1218\t\n"
   "1219\t  for (i=0;i<min(len,sizeof(buf)/2-1);i++)  {\n"
   "1220\t      buf[i*2]=digits[data[i]>>4];\n"
   "1221\t      buf[i*2+1]=digits[data[i]&0xf];\n"
   "1222\t  }\n"
   "1223\t            \n"
   "1224\t  buf[i*2]=0;\n"
   "1225\t  return buf;\n"
   "1226\t}\n"
   "1227\t/* End   sohan */\n"
   
"1228\t/*----------------------------------------------------------------------------*/
  \n"
   "1229\t  int calEvCallStateChanged(\n"
   "1230\t    IN    HCALL           hsCall,\n"
   "1231\t    IN \tHAPPCALL\thaCall,\n"
   "1232\t    IN \tUINT32 \t\tstate,\n"
   "1233\t    IN \tUINT32\t\tstateMode)\n"
   "1234\t    \n"
   "1235\t  { \n"
   "1236\t    int cl;\n"
   "1237\t    side_t side;\n"
   "1238\t    if (CALL_NEW(haCall))\n"
   "1239\t      /* no handle where exchanged yet */\n"
<- "1240\t      return handleNewCall(hsCall,haCall,state,stateMode);\n"
   "1241\t    cl=getCall(haCall,&side);\n"
   "1242\t\n"
   "1243\t#ifdef GK_DEBUG\n"
   "1244\t    {\n"
   "1245\t      char buf[150];\n"
   "1246\t      sprintf(buf,\"side %s chaged to state:%s, 
stateMode:%s\",sideName[side],cmuStateName((cmCallState_e)state),cmuStateModeName((cmCallStateMode_e)stateMode));\n"
   "1247\t      CALL_NOTIFY(buf,GEN_NA,20,cl); \n"
   "1248\t    }\n"
   "1249\t#endif\n"
   "1250\t\n"
   "1251\t    if (!VALID(cl))\n"
   "1252\t      return ERROR;\n"
   "1253\t\n"
   "1254\t\t/*restoration*/\n"
   "1255\t\tif (state == cmCallStateDisconnected && CL.SIDE.recovered)\n"
   "1256\t\t  return 0;/*this is a superfluous disconnect event that results 
from the cmCallDrop on the artificial hsCall\n"
   "1257\t\t\t\t\tthat was created in the restore function*/\n"
   "1258\t\n"
   "1259\t    if (side==ORIGIN)\n"
   "1260\t      return 
handleOriginStateChange(hsCall,haCall,state,stateMode,cl);\n"
   "1261\t    else\n"
   "1262\t      if (side==DESTINATION)\n"
   "1263\t        return 
handleDestinationStateChange(hsCall,haCall,state,stateMode,cl);\n"
   "1264\t      return 0;\n"
   "1265\t  }\n"
   "1266\t\n"
   
"1267\t/*----------------------------------------------------------------------------*/
             \n"
   "1268\t  int handleNewCall( /*when state change is reported */\n"
   "1269\t    IN    HCALL           hsCall,\n"
   "1270\t    IN \tHAPPCALL\thaCall,\n"
   "1271\t    IN \tUINT32 \t\tstate,\n"
   "1272\t    IN \tUINT32\t\tstateMode)\n"
   "1273\t    \n"
   "1274\t  {\n"
   "1275\t    int cl = -1;\n"
   "1276\t    \n"
   "1277\t    if (CALL_NEW(haCall))\t{\n"
   "1278\t\t\t\n"
   "1279\t    switch (state)\n"
   "1280\t    {\n"
   "1281\t    case cmCallStateWaitAddressAck: \n"
   "1282\t    case cmCallStateOffering:\n"
   "1283\t      {\n"
   "1284\t        if (!gkcfgFlagValue(GKCFG_ACCEPT_CALLS) || 
!gkcfgFlagValue(GKCFG_GK_ON))\n"
   "1285\t        {\n"
   "1286\t          CALL_NOTIFY(\"gk in not-accepting-calls state - dropping 
call\",GEN_NA,10, cl);\n"
   "1287\t          /*SARAH_DROP*/\n"
   "1288\t          \n"
   "1289\t          /* let the app hook to the disconnect message before 
sending it - NL_9_26 */\n"
   "1290\t          hookToCall((gkHCALL)GKCCI_NO_GKHCALL, (gkHAPPCALL 
*)GKCCI_NO_GKHAPPCALL, hsCall, (HRAS)GKCCI_NO_HSRAS,  gkcciMsgSendDisconnect, 
gkcciSideOrig);\n"
   "1291\t          \n"
   "1292\t          return 
newCallDisconnect(CAL_NULL_INDEX,hsCall,cmReasonTypeGatekeeperResource, \n"
   "1293\t            NULL, cmRASReasonUndefined, ORIGIN,\n"
   "1294\t            gkcciSttSetupReject, gkcciRsnResourceUnavailable);\n"
   "1295\t        }\n"
   "1296\t        \n"
   "1297\t        if (!assignCall(&cl))\n"
   "1298\t        {\n"
   "1299\t          CALL_NOTIFY(\"No free call to allocate in new 
Call\",GEN_NA,10,cl);\n"
   "1300\t          DBGL_CONDITION(50,gkPAC());\n"
   "1301\t\n"
   "1302\t          /* let the app hook to the disconnect message before 
sending it - NL_9_26 */\n"
   "1303\t\t\t  hookToCall((gkHCALL)GKCCI_NO_GKHCALL, (gkHAPPCALL 
*)GKCCI_NO_GKHAPPCALL, hsCall, (HRAS)GKCCI_NO_HSRAS,  gkcciMsgSendDisconnect, 
gkcciSideOrig);\n"
   "1304\t\n"
   "1305\t          return 
newCallDisconnect(CAL_NULL_INDEX,hsCall,cmReasonTypeGatekeeperResource, \n"
   "1306\t            NULL, cmRASReasonUndefined, ORIGIN,\n"
   "1307\t            gkcciSttSetupReject, gkcciRsnResourceUnavailable);\n"
   "1308\t        }\n"
   "1309\t        CL.handle = generateHandle(cl); /* also sets the auth field 
*/\n"
   "1310\t        cmSetCallHandle(hsCall,(HAPPCALL)&(CL.ORIG.callNo));\t\n"
   "1311\t        CALL_NOTIFY(\"New call chosen\",GEN_NA,10,cl);\n"
   "1312\t        CHANGE_STATE(CAL_HANDLES,\"new call assigned \");\n"
   "1313\t        CL.model=cmRASCallModelTypeGKRouted;\n"
   "1314\t        CL.overlappedSendSetup = (state == 
cmCallStateWaitAddressAck);\n"
   "1315\t        return 
handleOriginStateChange(hsCall,haCall,state,stateMode,cl);\n"
   "1316\t      }\n"
   "1317\t\n"
   "1318\t\n"
   "1319\t    case cmCallStateDisconnected:\n"
   "1320\t      {\n"
   "1321\t      /*if (stateMode!=cmCallStateModeDisconnectedLocal)\n"
   "1322\t\t\t\thook...\n"
   "1323\t        SE(cmCallDrop(hsCall))*/\n"
   "1324\t        return 0;\n"
   "1325\t      }\n"
   "1326\t\n"
   "1327\t\n"
   "1328\t    case cmCallStateIdle:\n"
   "1329\t      {\n"
   "1330\t        return closeCallHandle(hsCall,NULL);\n"
   "1331\t      }\n"
   "1332\t      \n"
   "1333\t    default: CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8702, cl,\"call without handle and state change not 
offering/idle/disconnected\"));\n"
   "1334\t    }\n"
   "1335\t    }\n"
   "1336\t    return 0;\n"
   "1337\t  }\n"
   
"1338\t/*----------------------------------------------------------------------------*/
             \n"
   "1339\t  int handleOriginStateChange( /*when state c"
<- "hange is reported */\n"
   "1340\t    IN   HCALL           hsCall,\n"
   "1341\t    IN \tHAPPCALL\thaCall,\n"
   "1342\t    IN \tUINT32 \t\tstate,\n"
   "1343\t    IN \tUINT32\t\tstateMode,\n"
   "1344\t    IN   int             cl)\n"
   "1345\t  { \n"
   "1346\t    perSideInfo_t old=CL.ORIG;       \n"
   "1347\t    \n"
   "1348\t    if(haCall);\n"
   "1349\t    CL.ORIG.state=state;\n"
   "1350\t    CL.ORIG.stateMode=stateMode;\n"
   "1351\t    \n"
   "1352\t    switch (state)\n"
   "1353\t    {\n"
   "1354\t    case cmCallStateDialtone:\n"
   "1355\t    case cmCallStateProceeding:\n"
   "1356\t    case cmCallStateRingBack: CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8703, cl,\"Call State DialTone/Procceding/Ring back at 
origin side\"));\n"
   "1357\t      break;\n"
   "1358\t\n"
   "1359\t\n"
   "1360\t    case cmCallStateConnected:\n"
   "1361\t\t\tCL.timeOfStart = gkTiSeconds();\n"
   "1362\t\t\tCL.usecTimeOfStart = gkTiMilliseconds();\n"
   "1363\t\t\tCALL_NOTIFY(\"block\",GEN_NA,30,cl);\n"
   "1364\t\t\tCALL_NOTIFY(\"origin connect\",GEN_NA,10,cl);\n"
   "1365\t\t\tif ((CALL_SETUP_SIDE(CL.ORIG)) &&(!CALL_SETUP_SIDE(old)) ) {\n"
   "1366\t\t\t\tif (CALL_SETUP_SIDE(CL.DEST)) {\n"
   "1367\t\t\t\t\tif (CL.state!=CAL_HUNTING) {\n"
   "1368\t\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8704, cl,\"Connection without line hunting at calEvCallStateChanged\"));\n"
   "1369\t\t\t\t\t}\n"
   
"1370\t\t\t\t\tCHANGE_STATE(CAL_CONNECT,\"OriginStateChange,cmCallStateConnected\");\n"
   "1371\t\t\t\t\tCALL_NOTIFY(\"Call is formed\",GEN_NA,5,cl);\n"
   "1372\t\t\t\t\t/*sarit: I moved the set of time of start to the top*/\n"
   "1373\t\t\t\t\t/* AVI 6/2000 */\n"
   "1374\t\t\t\t\t/* check that the call is to a service, */\n"
   "1375\t\t\t\t\t/* and that the service is used for conference hunting */ \n"
   "1376\t\t\t\t\t\t\n"
   "1377\t\t\t\t\tif (ConferenceHuntingService(cl)) {\n"
   "1378\t\t\t\t\t\t\taddToMcuHash(cl);\n"
   "1379\t\t\t\t\t\t\tGK_NOTIFY(\"Added a service alias to the hash 
table\",GEN_NA,20);\n"
   "1380\t\t\t\t\t\t\t/* printHash(); */\n"
   "1381\t\t\t\t\t\t}\t\n"
   "1382\t\t\t\t\tCL.round=HUNT_DONE;                   \n"
   "1383\t\t\t\t\t\tif (CL.service != NET3_NOT_SERVICE)\n"
   "1384\t\t\t\t\t\t\tif (gkcfgSet(GKCFG_SERVICE_SUPPLIER, CL.service, 
(void*)&CL.nextScan) == FALSE) \n"
   "1385\t\t\t\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8644, cl, \"connectDestinationToOrigin: Failed in update 
line hunting start supplier (for next call) of V1 service by RR order\"));\n"
   "1386\t\t\t\t\t\tif (CL.callService != SRV_INVALID_SERV)\n"
   "1387\t\t\t\t\t\t{\n"
   "1388\t\t\t\t\t\t\tif (srvServiceSetCurrSupplier(CL.callService, 
CL.nextGwServiceScan) == ERROR)\n"
   "1389\t\t\t\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8644, cl, \"connectDestinationToOrigin: Failed in update 
line hunting start supplier (for next call) of V2 service by RR order\"));\n"
   "1390\t\t\t\t\t\t}\n"
   "1391\t\t\t\t}\n"
   "1392\t\t\t\telse\n"
   "1393\t\t\t\t{\n"
   "1394\t\t\t\t\t/* SA_450 replace with flag */\n"
   "1395\t\t\t\t\tif (CL.DEST.stack) \n"
   "1396\t\t\t\t\t{\n"
   "1397\t\t\t\t\t\tCALL_NOTIFY(\"Origin side connected and destination not 
connected at calEvCallStateChanged\",GEN_NA,10,cl);\n"
   "1398\t\t\t\t\t\tif 
(!disconnectCall(cl,cmReasonTypeUndefinedReason,cmReasonTypeUndefinedReason, \n"
   "1399\t\t\t\t\t\t\tUNDEFINED_DROP_CAUSE, UNDEFINED_DROP_CAUSE, TRUE))\n"
   "1400\t\t\t\t\t\t\treturn ERROR;\n"
   "1401\t\t\t\t\t}\n"
   "1402\t\t\t\t}\n"
   "1403\t\t\t}\n"
   "1404\t\t\t\n"
   "1405\t\t\tif ((CONTROL_CHANNEL_SIDE(CL.ORIG)) 
&&(!CONTROL_CHANNEL_SIDE(old)))\n"
   "1406\t\t\t{\n"
   "1407\t\t\t\tif (CONTROL_CHANNEL_SIDE(CL.DEST))\n"
   "1408\t\t\t\t{\n"
   "1409\t\t\t\t\tif ((CL.state!=CAL_HUNTING) && (CL.state!=CAL_CONNECT))\n"
   "1410\t\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8705, cl,\"Connection of control channel not in hunting or connect state\"));\n"
   "1411\t\t\t\t\tif (cmHook245(cl,CL.ORIG.stack,CL.DEST.stack)!=0)\n"
   "1412\t\t\t\t\t\treturn ERROR;\n"
   "1413\t\t\t\t}\n"
   "1414\t\t\t}\n"
   "1415\t\t\t/* notify the application */\n"
   "1416\t\t\tif(!sendStateEvent(cl, gkcciSttConnected, gkcciRsnUndefined))\n"
   "1417\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8706, cl,\"handleOriginStateChange: Error calling the application callback\")); 
 \n"
   "1418\t\t\tbreak;\n"
   "1419\t\t\t\n"
   "1420\t    case cmCallStateDisconnected:\n"
   "1421\t      {\n"
   "1422\t       cmuMessage_t message;\n"
   "1423\t       /*setting the release complete time in the database*/ \n"
   "1424\t       if(CL.timeOfRelease == 0)   \n"
   "1425\t\t      CL.timeOfRelease = gkTiSeconds();\n"
   "1426\t\t\t  \n"
   "1427\t\t\t\n"
   "1428\t\n"
   "1429\t\t\t\t\t/* let the application handle the disconnect msg first */\n"
   "1430\t        hookToCall((gkHCALL)CL.handle, &CL.appHandle, 
hsCall,GKCCI_NO_HSRAS, gkcciMsgReceiveDisconnect, gkcciSideOrig);\n"
   "1431\t\n"
   "1432\t       "
<- " releaseCompleteCheckAndCopy(DESTINATION,ORIGIN,cl,stateMode);\n"
   "1433\t        
cmuLoadParams(message,CMU_Q931,(HRAS)0,(cmRASTrPart)0,CL.ORIG.stack);\n"
   "1434\t        if(!sendMsgEvent(cl, gkcciMsgReceiveDisconnect, 
gkcciSideOrig))\n"
   "1435\t        {       \n"
   "1436\t          CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8707, cl, \"handleOriginStateChange: Failed in sending disconnect receive 
message notification to the application\"));     \n"
   "1437\t          return ERROR;\n"
   "1438\t        }\n"
   "1439\t        
cmuGetParam(&message,cmParamReleaseCompleteCause,FALSE,0,(int*)&CL.ORIG.dropCause,NULL);\n"
   "1440\t        
cmuGetParam(&message,cmParamReleaseCompleteReason,FALSE,0,(int*)&CL.ORIG.dropReason,NULL);\n"
   "1441\t        if ((CL.state==CAL_LRQ_SENT) ||\n"
   "1442\t          (CL.state==CAL_RAS_CONNECT))\n"
   "1443\t          CALL_NOTIFY(\"Disconnecect from LRQ/RAS_CONNECT state from 
origin\",GEN_NA,30,cl);\n"
   "1444\t        switch (stateMode)\n"
   "1445\t        {\n"
   "1446\t        case cmCallStateModeDisconnectedBusy:\n"
   "1447\t        case cmCallStateModeDisconnectedReject:\n"
   "1448\t        case cmCallStateModeDisconnectedUnreachable:\n"
   "1449\t        case cmCallStateModeDisconnectedUnknown:\n"
   "1450\t          CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8708, cl,\"Call StateMode: Disconnecte Busy/reject/unreachable/unknowen at 
origin side\"));\n"
   "1451\t        case cmCallStateModeDisconnectedNormal:\n"
   "1452\t          CALL_NOTIFY(\"block\",GEN_NA,30,cl);\n"
   "1453\t          if(!sendStateEvent(cl, gkcciSttDisconnected, 
gkcciRsnOrigDisconnected) )\n"
   "1454\t            CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8709, cl,\"handleOriginStateChange: Error calling the 
application callback\"));\n"
   "1455\t          if 
(!disconnectCall(cl,cmReasonTypeUndefinedReason,destDropReason(cl), \n"
   "1456\t    \t\t\t\t\t\t\t UNDEFINED_DROP_CAUSE, CL.ORIG.dropCause, FALSE))\n"
   "1457\t                   return ERROR;\n"
   "1458\t          break;\n"
   "1459\t\t\t\tcase cmCallStateModeDisconnectedLocal:\n"
   "1460\t\t\t\t\tbreak; \n"
   "1461\t        } \n"
   "1462\t      } \n"
   "1463\t      break;\n"
   "1464\t\n"
   "1465\t\n"
   "1466\t    case cmCallStateIdle:\t\n"
   "1467\t      {\n"
   "1468\t        if (CL.ORIG.ARQ==(HRAS)NULL)\n"
   "1469\t        {\n"
   "1470\t          if (!terminateOrigin(cl))\n"
   "1471\t            return ERROR;\n"
   "1472\t        }\n"
   "1473\t        else\n"
   "1474\t        {\n"
   "1475\t          /* newnaomi. set all timers where they need to be set */\n"
   "1476\t          CALL_NOTIFY(\"setting expectDRQForOrigin timer (for 
origin): \",GEN_NA,30,cl);\n"
   "1477\t          
gkTiTimerSet(expectDRQTOForOrigin,(void*)cl,EXPECT_DRQ_TO_DELAY);               
  \n"
   "1478\t          CHANGE_STATE(CAL_EXPECTING_DRQ,\"Idle on origin\");         
       \n"
   "1479\t        }\n"
   "1480\t\t\t};\n"
   "1481\t\t\tbreak;\n"
   "1482\t      \n"
   "1483\t    case cmCallStateOffering: \n"
   "1484\t     if (CL.reason == RSN_NEED_OFFERING || CL.callProcSent || 
CL.setupSend)\n"
   "1485\t        return 0;\n"
   "1486\t      /* break is left out intentionally! */\n"
   "1487\t    case cmCallStateWaitAddressAck:\n"
   "1488\t      \n"
   "1489\t      CALL_NOTIFY(\"setup received - Offering\",GEN_NA,10,cl);\n"
   "1490\t      CL.ORIG.stack=hsCall;\n"
   "1491\t      CL.setupArrived =TRUE;\n"
   "1492\t      CL.setupPending=TRUE;\n"
   "1493\t      \n"
   "1494\t      /* let the application handle the setup msg first */\n"
   "1495\t      hookToCall((gkHCALL)CL.handle, &CL.appHandle, 
hsCall,GKCCI_NO_HSRAS, gkcciMsgReceiveSetup, gkcciSideOrig);\n"
   "1496\t      \n"
   "1497\t      /* load the setup data */\n"
   "1498\t      loadFromSetup(hsCall,cl);\n"
   "1499\t      \n"
   "1500\t      /* meir GK-MC: If an H.245 address is found in Setup message 
then no H.245 address\n"
   "1501\t      needs to be sent with Call-Proceeding. Send a default 
Call-Proceeding right away. */\n"
   "1502\t      \n"
   "1503\t      if (CL.ORIG.reg == RGTBL_REG_NOT_VALID)\n"
   "1504\t      {\n"
   "1505\t        rgsrLocateAliasFromCall(&CL.srcCallSignal, CL.srcInfo, 
&CL.ORIG.reg);\n"
   "1506\t        if (CL.ORIG.reg != RGTBL_REG_NOT_VALID)\n"
   "1507\t          rgtblEndpointType(RGTBL_GET, CL.ORIG.reg, 
&(CL.ORIG.endpointType));\n"
   "1508\t        /* else get endpointType from setup message! */\n"
   "1509\t      }\n"
   "1510\t      \n"
   "1511\t      if (CL.model == cmRASCallModelTypeDirect) /*newnatan 19/8*/\n"
   "1512\t      {\n"
   "1513\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8711, cl,\"OrigSttChange(offering) with direct call.Changing to rou"
<- "ted and continuing\"));\n"
   "1514\t        CL.model = cmRASCallModelTypeGKRouted;\n"
   "1515\t      }\n"
   "1516\t      if (genGetDbgL() >= 40)\n"
   "1517\t        gkPC(cl);\n"
   "1518\t      else if (genGetDbgL() >= 30)\n"
   "1519\t        calPrintCallTitles(cl);\n"
   "1520\t        \n"
   "1521\t      /* notify the app. that setup was processed */\n"
   "1522\t      if(!sendMsgEvent(cl, gkcciMsgReceiveSetup, gkcciSideOrig))\n"
   "1523\t      {       \n"
   "1524\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8712, cl, \"handleOriginStateChange: Failed in sending setup receive message 
notification to the application\"));     \n"
   "1525\t        return ERROR;\n"
   "1526\t      }\n"
   "1527\t\n"
   "1528\t      /*Sending call proceeding if the configuration delayCallProc is 
set to immediately\n"
   "1529\t\t    or the 245 address arrived in setup and there is no overlap 
sending*/\n"
   "1530\t\n"
   "1531\t\t  if(state == cmCallStateOffering || state == 
cmCallStateWaitAddressAck) {\n"
   "1532\t\t    gkcfgiDelayCallProc_t *delayCallProc;\n"
   "1533\t        gkcfgGet(GKCFG_DELAY_CALLPROC, 0, (void**)&delayCallProc);\n"
   "1534\t    /* meir GK-MC: If an H.245 address is found in Setup message then 
no H.245 address\n"
   "1535\t      needs to be sent with Call-Proceeding. Send a default 
Call-Proceeding right away. */\n"
   "1536\t\t\tswitch(*delayCallProc) {\n"
   "1537\t\t\tcase GKCFGI_IMMEDIATELY:\n"
   "1538\t\t\t\tif (state == cmCallStateWaitAddressAck)\n"
   "1539\t\t\t\t\tcmCallAddressComplete(hsCall); \n"
   "1540\t\t\t\tCL.callProcSent = TRUE;\n"
   "1541\t\t\t\tcmCallSendCallProceeding(hsCall);\n"
   "1542\t\t\t\tbreak;\n"
   "1543\t\t\tcase GKCFGI_WITH_245ADDRESS:\n"
   "1544\t\t\t\tif (CL.setupH245Add.ip != 0) {\n"
   "1545\t\t\t\t\tif (state == cmCallStateWaitAddressAck)\n"
   "1546\t\t\t\t\t\tcmCallAddressComplete(hsCall); \n"
   "1547\t\t\t\t\tCL.callProcSent = TRUE;\n"
   "1548\t\t\t\t\tcmCallSendCallProceeding(hsCall);\n"
   "1549\t\t\t\t}\n"
   "1550\t\t\tdefault:\n"
   "1551\t\t\t\tbreak;\n"
   "1552\t\t\t}\n"
   "1553\t\t  }\n"
   "1554\t\n"
   "1555\t      if (CL.infoSrc==SETUP_INFORMATION)\n"
   "1556\t      {\n"
   "1557\t        \n"
   "1558\t        CALL_NOTIFY(\"Sending address resolution request to the 
application: \",GEN_NA,10,cl);\n"
   "1559\t        CL.reason = RSN_NEW_ORIG;\n"
   "1560\t        CHANGE_STATE(CAL_ADDRESS_RESOLUTION, \"Address resolution 
request was sent to application after setup\");                       \n"
   "1561\t        \n"
   "1562\t        if(!sendStateEvent(cl, gkcciSttAddressResolution, 
gkcciRsnNewOrigSetup))\n"
   "1563\t        {\n"
   "1564\t          CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8713, cl,\"handleOriginStateChange: Failed in sending Address Resolution 
request to the application\"));\n"
   "1565\t          stopCall(cl, RSN_FAILURE_EVENT_HANDLER,\n"
   "1566\t            cmReasonTypeUndefinedReason,cmReasonTypeUndefinedReason, 
\n"
   "1567\t            cmRASReasonUndefined);\n"
   "1568\t          return ERROR;\n"
   "1569\t        }\n"
   "1570\t        /* xyx we need here to start a timeout */\n"
   "1571\t        \n"
   "1572\t      }\n"
   "1573\t      else /* newnaomi. I put else here so I will stop after calling 
the application and\n"
   "1574\t           not continue after to here. The other part will be done 
when the \n"
   "1575\t           address resolution will be done and a destination found. 
If we had ARQ first\n"
   "1576\t           we will reach here immediately */\n"
   "1577\t      { \n"
   "1578\t      /* now it\'s a situation without ARQ pending. When stoping the 
call\n"
   "1579\t        we need to disconnect */\n"
   "1580\t        CL.isARQ = NO_ARQ; \n"
   "1581\t        \n"
   "1582\t        CALL_NOTIFY(\"Wait for application response to 
setup\",GEN_NA, 31,cl);\n"
   "1583\t\t\t\t\t\n"
   "1584\t        CHANGE_STATE(CAL_NW_SETUP, \"Setup Arrived from NW\");\n"
   "1585\t        if(!sendStateEvent(cl, gkcciSttSetupArrived, 
gkcciRsnOrigSetup))\n"
   "1586\t        {\n"
   "1587\t          CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8714, cl,\"handleOriginStateChange: Failed in sending setup state to the 
application\"));\n"
   "1588\t          stopCall(cl, RSN_FAILURE_EVENT_HANDLER, 
cmReasonTypeUndefinedReason,\n"
   "1589\t            cmReasonTypeUndefinedReason, cmRASReasonUndefined);\n"
   "1590\t          return ERROR;\n"
   "1591\t        }\n"
   "1592\t\t\t\t\t\n"
   "1593\t        /*CHANGE_STATE(CAL_WAIT_OFFERING, \"offering request was sent 
to application after setup\");\n"
   "1594\t        if(!sendStateEvent(cl, gkcciSttWaitOrigOffering, 
gkcciRsnOrigSetup))\n"
   "1595\t        {\n"
   "1596\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8714, cl,\"handleOriginStateChange"
<- ": Failed in sending setup state to the application\"));\n"
   "1597\t\t\t\t\tstopCall(cl, RSN_FAILURE_EVENT_HANDLER, 
cmReasonTypeUndefinedReason,\n"
   "1598\t\t\t\t\tcmReasonTypeUndefinedReason, cmRASReasonUndefined);\n"
   "1599\t\t\t\t\treturn ERROR;\n"
   "1600\t\t\t\t}*/\n"
   "1601\t      }\n"
   "1602\t      break;\n"
   "1603\t     }\n"
   "1604\t     return 0;\n"
   "1605\t   } /* of state change from origin */\n"
   "1606\t\n"
   
"1607\t/*----------------------------------------------------------------------------*/
    \n"
   "1608\t   int handleDestinationStateChange( /*when state change is reported 
*/\n"
   "1609\t                                    IN  HCALL           hsCall,\n"
   "1610\t                                    IN \tHAPPCALL\thaCall,\n"
   "1611\t                                    IN \tUINT32 \t\tstate,\n"
   "1612\t                                    IN \tUINT32\t\tstateMode,\n"
   "1613\t                                    IN  int             cl)\n"
   "1614\t     \n"
   "1615\t   {\n"
   "1616\t     perSideInfo_t old=CL.DEST;    \n"
   "1617\t     \n"
   "1618\t     if(haCall);\n"
   "1619\t     /* save the situation of alert before disconnect for later. It 
will be an indicator \n"
   "1620\t     for no answer situation */\n"
   "1621\t     if(state == cmCallStateRingBack)\n"
   "1622\t       CL.wasAlertBeforeDisconnect = TRUE;\n"
   "1623\t     if((state != cmCallStateRingBack) && (state != 
cmCallStateDisconnected) && \n"
   "1624\t       (state != cmCallStateIdle) && (CL.wasAlertBeforeDisconnect == 
TRUE ))\n"
   "1625\t       CL.wasAlertBeforeDisconnect = FALSE;\n"
   "1626\t     \n"
   "1627\t     CL.DEST.state=state;\n"
   "1628\t     CL.DEST.stateMode=stateMode;\n"
   "1629\t     switch (state) {\n"
   "1630\t       \n"
   "1631\t     case cmCallStateDialtone:\n"
   "1632\t\t\t CL.usecTimeOfAlert = gkTiMilliseconds();\t\n"
   "1633\t\t\t /* at this state the destination is known so the destZone can be 
set*/\n"
   "1634\t\t\t setDestZone(cl);\n"
   "1635\t\t\t /* eli - Checking and setting canOverlapSending and 
sendingComplete fileds in outgoing\n"
   "1636\t\t\t setup should be done here AFTER the stack alters them according 
to configuration\n"
   "1637\t\t\t values \n"
   "1638\t\t\t sarit 6/6/00 -     \n"
   "1639\t\t\t if the mode is immidiate call proceeding setup will always be 
sent with\n"
   "1640\t\t\t address complete.*/\n"
   "1641\t\t\t {\n"
   "1642\t\t\t\t HPVT hpvt = cmGetValTree(dispStack);\n"
   "1643\t\t\t\t int setupNodeId = cmGetProperty((HPROTOCOL)hsCall);\n"
   "1644\t\t\t\t char* canOverlapSendPath = 
\"setup.message.*.userUser.h323-UserInformation.h323-uu-pdu.h323-message-body.setup.canOverlapSend\";\n"
   "1645\t\t\t\t /*newSarit 6/6/00*/\n"
   "1646\t\t\t\t BOOL *delayCallProc;\n"
   "1647\t\t\t\t gkcfgGet(GKCFG_DELAY_CALLPROC, 0, (void**)&delayCallProc);\n"
   "1648\t\t\t\t if (CL.sendingCompleteFlag || (*delayCallProc != 
GKCFGI_AFTER_OVERLAPPED_SENDING)) /*sarit second condition*/\n"
   "1649\t\t\t\t\t pvtBuildByPath (hpvt, setupNodeId, 
\"setup.message.setup.sendingComplete\", 0, NULL);\n"
   "1650\t\t\t\t \n"
   "1651\t\t\t\t pvtBuildByPath (hpvt, setupNodeId, canOverlapSendPath, 
CL.canOverlapSend, NULL);\n"
   "1652\t\t\t\t if (!sendStateEvent(cl, getAppState(state), 
gkcciRsnUndefined))\n"
   "1653\t\t\t\t\t CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8715, cl,\n"
   "1654\t\t\t\t\t \"handleDestinationStateChange: Error calling the 
application callback\"));\n"
   "1655\t\t\t }\n"
   "1656\t\t\t break;\n"
   "1657\t\t\t /* newnaomi. I remove the break in order to notify the 
application. The rest will be done only for \n"
   "1658\t\t\t the cmCallStateProceeding and the cmCallStateRingBack states.\n"
   "1659\t\t\t break; */\n"
   "1660\t\t\t /* newnatan - I returned it but without causing changes */\n"
   "1661\t\t\t /* meir GK-MC changed once more. */\n"
   "1662\t     case cmCallStateProceeding:\n"
   "1663\t       if (!handleCallProceeding(cl)) {\n"
   "1664\t         CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8716, cl,\"handleCallProceeding returned FALSE in 
handleDestinationStateChange\"));\n"
   "1665\t         return ERROR;\n"
   "1666\t       }\n"
   "1667\t       break;\n"
   "1668\t     case cmCallStateRingBack:\n"
   "1669\t       CALL_NOTIFY(\"destination alerts\",GEN_NA,10,cl);\n"
   "1670\t       CL.alertingPending = TRUE;\n"
   "1671\t\n"
   "1672\t\t\t\t /* let the application handle the alert msg first NL_9_26 */\n"
   "1673\t\t\t\t hookToCall((gkHCALL)CL.handle, &CL.appHandle, 
hsCall,GKCCI_NO_HSRAS, gkcciMsgReceiveAlert, gkcciSideDest);\n"
   "1674\t       \n"
   "1675\t       /* SA_450_TR if the call is one sided just notify the 
application */\n"
   "1676\t       if (DEST_ONLY_CALL(cl)) {        \n"
   "1677\t         sendMsgEvent(cl, gkcciMsgReceiveAlert, gkc"
<- "ciSideDest);\n"
   "1678\t         sendStateEvent(cl, getAppState(cmCallStateRingBack), 
gkcciRsnUndefined);\n"
   "1679\t         CL.alertingPending = FALSE;\n"
   "1680\t       }\n"
   "1681\t       /* if it is a regular call, copy the alerting to the origin Ep 
*/\n"
   "1682\t       else\n"
   "1683\t       {\n"
   "1684\t         if (!handleRingback(cl)) \n"
   "1685\t         {\n"
   "1686\t           CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8717, cl,\"handleRingback returned FALSE in handleDestinationStateChange\"));\n"
   "1687\t           return ERROR;\n"
   "1688\t         }\n"
   "1689\t       }\n"
   "1690\t\n"
   "1691\t\n"
   "1692\t       break;\n"
   "1693\t\n"
   "1694\t     case cmCallStateConnected:\n"
   "1695\t       CALL_NOTIFY(\"destination connect\",GEN_NA,10,cl);\n"
   "1696\t       if ((CALL_SETUP_SIDE(CL.DEST)) &&(!CALL_SETUP_SIDE(old)))\n"
   "1697\t         CL.connectPending = TRUE;\n"
   "1698\t\n"
   "1699\t       /* Kill the alerting timer */\n"
   "1700\t       if (CL.alertingTimeout > 0) {\n"
   "1701\t         gkTiTimerKill(alertingTimerExpired, (void*)cl);\n"
   "1702\t         CL.alertingTimeout = 0;\n"
   "1703\t       }\n"
   "1704\t       /*if the gatekeeper initiated the call then the connection 
time is the\n"
   "1705\t\t   time the connect message was received*/\n"
   "1706\t\t   if(calls[cl].h450Info.transferStartedCall || 
calls[cl].sideInfo[0].stack == NULL) {\n"
   "1707\t\t\t  CL.timeOfStart = gkTiSeconds();\n"
   "1708\t\t\t  CL.usecTimeOfStart = gkTiMilliseconds();\n"
   "1709\t\t   }\n"
   "1710\t\t\t\t /* let the application handle the connect msg first NL_9_26 
*/\n"
   "1711\t\t\t\t hookToCall((gkHCALL)CL.handle, &CL.appHandle, 
hsCall,GKCCI_NO_HSRAS, gkcciMsgReceiveConnect, gkcciSideDest);\n"
   "1712\t\n"
   "1713\t       if(!sendMsgEvent(cl, gkcciMsgReceiveConnect, gkcciSideDest))\n"
   "1714\t       {       \n"
   "1715\t         CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8718, cl, \"handleDestinationStateChange: Failed in sending connect receive 
message notification to the application\"));     \n"
   "1716\t         return ERROR;\n"
   "1717\t       }\n"
   "1718\t\n"
   "1719\t       if ((CONTROL_CHANNEL_SIDE(CL.DEST)) 
&&(!CONTROL_CHANNEL_SIDE(old)))\n"
   "1720\t       {\n"
   "1721\t         /* test if control channel established at this event */\n"
   "1722\t         if (CONTROL_CHANNEL_SIDE(CL.ORIG))\n"
   "1723\t         {\n"
   "1724\t           if ((CL.state!=CAL_HUNTING) && (CL.state!=CAL_CONNECT))\n"
   "1725\t             CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8719, cl,\"Connection of control channel not in hunting or 
connect state\"));\n"
   "1726\t           if (cmHook245(cl,CL.ORIG.stack,CL.DEST.stack)!=0)\n"
   "1727\t             return ERROR;\n"
   "1728\t         }\n"
   "1729\t         return 0;\n"
   "1730\t       }\n"
   "1731\t       \n"
   "1732\t       if ((CALL_SETUP_SIDE(CL.DEST)) &&(!CALL_SETUP_SIDE(old)))\n"
   "1733\t         /*test if call setup channel was established at this 
event*/\n"
   "1734\t       {\n"
   "1735\t         int val,origConnectNode,destConnectNode;\n"
   "1736\t         HPVT hpvt = cmGetValTree(dispStack);\n"
   "1737\t         gkcciReason_t reason;\n"
   "1738\t         cmuMessage_t message;\n"
   "1739\t         
cmuLoadParams(message,CMU_Q931,(HRAS)0,(cmRASTrPart)0,CL.DEST.stack);\n"
   "1740\t\n"
   "1741\t         if (CL.state!=CAL_HUNTING)\n"
   "1742\t             CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8720, cl,\"Connection at destination without line hunting 
at calEvCallStateChanged\"));\n"
   "1743\t           \n"
   "1744\t         origConnectNode = 
pvtGetNodeIdByPath(hpvt,cmGetProperty((HPROTOCOL)(CL.ORIG.stack)),\"connect\");\n"
   "1745\t         destConnectNode = 
pvtGetNodeIdByPath(hpvt,cmGetProperty((HPROTOCOL)(CL.DEST.stack)),\"connect\");\n"
   "1746\t         \n"
   "1747\t         
if(cmuGetParam(&message,cmParamH245Address,FALSE,0,&val,(char*)&(CL.connectH245Add))<0)\n"
   "1748\t         {\n"
   "1749\t           CL.connectH245Add.ip = 0;\n"
   "1750\t           CALL_NOTIFY(\"No H.245 address in the connect 
message\",GEN_NA,20,cl);\n"
   "1751\t         }\n"
   "1752\t         else\n"
   "1753\t         {\n"
   "1754\t           CALL_NOTIFY(\"Getting the connect H.245 
address\",GEN_NA,20,cl);\n"
   "1755\t           
CALL_NOTIFY(addIpToString(&CL.connectH245Add),GEN_NA,20,cl);\n"
   "1756\t         }\n"
   "1757\t\n"
   "1758\t         if (   CL.ORIG.state==cmCallStateOffering \n"
   "1759\t             || (CL.ORIG.state == cmCallStateWaitAddressAck && 
!CL.callProcSent)\n"
   "1760\t             || DEST_ONLY_CALL(cl))\n"
   "1761\t         {\n"
   "1762\t           if (!DEST_ONLY_CALL(cl))\n"
   "1763\t           {\n"
   "1764\t             reason = gkcciRsnUndefined;\n"
   "1765\t             if (!(origConnectNode >= 0 && destConnectNode >= 0))\n"
   "1766\t             {\n"
   "1767\t               CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8721, cl,\"pvtGetNodeIdByPath returned error when accessing 
connect.will not copy\"));\n"
   "1768\t             }\n"
   "1769\t             else\n"
   "1770\t\t\t\t\t\t\t {\n"
   "1771\t\t\t\t\t\t\t\t int uuNode;\n"
   "1772\t               
pvtSetTree(hpvt,origConnectNode,hpvt,destConnectNode);\n"
   "1773\t\t\t\t\t\t\t\t if (CL.fastStart)\n"
   "1774\t\t\t\t\t\t\t\t {\n"
   "1775\t\t\t\t\t\t\t\t /* Call-proceeding and alerting fastStart elements 
should be sent with the connect \n"
   "1776\t\t\t\t\t\t\t\t    message. This behavior is implemented so as to 
allow line-hunting to proceed among \n"
   "1777\t\t\t\t\t\t\t\t\t  different destination types some of which might or 
might not support fastStart. */\n"
   "1778\t\t\t\t\t\t\t\t\t uuNode = pvtGetNodeIdByPath(hpvt, origConnectNode, 
\"message.*.userUser.h323-UserInformation.h323-uu-pdu.h323-message-body.*\");\n"
   "1779\t\t\t\t\t\t\t\t\t if (pvtGetNodeIdByPath(hpvt, uuNode, \"fastStart\") 
< 0)\n"
   "1780\t\t\t\t\t\t\t\t\t {\n"
   "1781\t\t\t\t\t\t\t\t\t\t int fsNode;\n"
   "1782\t\t\t\t\t\t\t\t\t\t fsNode = 
pvtGetNodeIdByPath(hpvt,cmGetProperty((HPROTOCOL)(CL.DEST.stack)),\"alerting.message.*.userUser.h323-UserInformation.h323-uu-pdu.h323-message-body.*.fastStart\");\n"
   "1783\t\t\t\t\t\t\t\t\t\t if (fsNode < 0)\n"
   "1784\t\t\t\t\t\t\t\t\t\t\t fsNode = 
pvtGetNodeIdByPath(hpvt,cmGetProperty((HPROTOCOL)(CL.DEST.stack)),\"callProceeding.message.*.userUser.h323-UserInformation.h323-uu-pdu.h323-message-body.*.fastStart\");\n"
   "1785\t\t\t\t\t\t\t\t\t\t if (fsNode >= 0)\n"
   "1786\t\t\t\t\t\t\t\t\t\t {\n"
   "1787\t\t\t\t\t\t\t\t\t\t\t int connNode;\n"
   "1788\t\t\t\t\t\t\t\t\t\t\t connNode = pvtBuildByPath(hpvt, uuNode, 
\"fastStart\", 0, NULL);\n"
   "1789\t\t\t\t\t\t\t\t\t\t\t pvtSetTree(hpvt, connNode, hpvt, fsNode);\n"
   "1790\t\t\t\t\t\t\t\t\t\t }\n"
   "1791\t\t\t\t\t\t\t\t\t }\n"
   "1792\t\t\t\t\t\t\t\t }\n"
   "1793\t\t\t\t\t\t\t\t\t\n"
   "1794\t\t\t\t\t\t\t }\n"
   "1795\t           }\n"
   "1796\t           else\n"
   "1797\t             reason = gkcciRsnGKInitiatedCall;\n"
   "1798\t \n"
   "1799\t           /* ask for aplication approval to connect destination \n"
   "1800\t           application can decide to disconnect call or reroute it 
*/\n"
   "1801\t           CHANGE_STATE(CAL_WAIT_DEST_CONNECT, \"requesting for 
application approval to connect to origin\");\n"
   "1802\t           if(!sendStateEvent(cl, gkcciSttWaitDestConnect, reason))\n"
   "1803\t           {\n"
   "1804\t             CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8722, cl,\"handleDestinationStateChange: Failed in sending 
destination connect request to the application\"));\n"
   "1805\t             (void)stopCall(cl, RSN_FAILURE_EVENT_HANDLER, 
cmReasonTypeUndefinedReason,cmReasonTypeUndefinedReason, cmRASReasonUndefined); 
\n"
   "1806\t             return ERROR;\n"
   "1807\t           }         \n"
   "1808\t           return 0;         \n"
   "1809\t         }\n"
   "1810\t         else\n"
   "1811\t         {\n"
   "1812\t           CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8723, cl,\"origin call state not offering when destination connected\"))\t;\n"
   "1813\t           if (CALL_SETUP_SIDE(CL.ORIG))\n"
   "1814\t           {\n"
   "1815\t             /* notify the application */\n"
   "1816\t             if(!sendStateEvent(cl, gkcciSttConnected, 
gkcciRsnOrigConnectedFirst))\n"
   "1817\t               CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8724, cl,\"handleDestinationStateChange: Error calling the 
application callback\"));\n"
   "1818\t             CHANGE_STATE(CAL_CONNECT,\"connect at destination, 
origin connected already\");\n"
   "1819\t             CL.round=HUNT_DONE;\n"
   "1820\t\t\t\t \n"
   "1821\t\t\t\t /* AVI 7/2000 */\n"
   "1822\t\t\t\t\t\t\t\n"
   "1823\t\t\t\t /* check that this is a service */\n"
   "1824\t\t\t\t /* and if it is an MCU style service, enter call details into 
the \n"
   "1825\t\t\t\t  * hash\n"
   "1826\t\t\t\t  */\n"
   "1827\t\t\t\t  if (ConferenceHuntingService(CL.service)) {\n"
   "1828\t\t\t\t\t\t  addToMcuHash(cl);\n"
   "1829\t\t\t\t\t\t  GK_NOTIFY(\"Added a service alias to the hash 
table\",GEN_NA,20);\n"
   "1830\t\t\t\t\t\t  /* printHash(); */\n"
   "1831\t\t\t\t\t  }\n"
   "1832\t           }\n"
   "1833\t           else\n"
   "1834\t             if (!disconnectCall(cl,cmReasonTypeUndefinedReason, 
destDropReason(cl),UNDEFINED_DROP_CAUSE, CL.ORIG.dropCause,TRUE))\n"
   "1835\t               return ERROR;\n"
   "1836\t             else \n"
   "1837\t               return 0;\n"
   "1838\t         }\n"
   "1839\t       }\n"
   "1840\t       break;\n"
   "1841\t     case cmCallStateDisconnected:\n"
   "1842\t\t\t {\n"
   "1843\t\t\t\t \n"
   "1844\t\t\t\t cmuMessag"
<- "e_t message;\n"
   "1845\t\t\t\t /*setting the release complete time in the database*/ \n"
   "1846\t\t\t\t if(CL.timeOfRelease == 0)   \n"
   "1847\t\t\t\t\t CL.timeOfRelease = gkTiSeconds();\n"
   "1848\t\t\t\t \n"
   "1849\t\t\t\t \n"
   "1850\t\t\t\t \n"
   "1851\t\t\t\t /* let the application handle the disconnect msg first */\n"
   "1852\t\t\t\t hookToCall((gkHCALL)CL.handle, &CL.appHandle, 
hsCall,GKCCI_NO_HSRAS, gkcciMsgReceiveDisconnect, gkcciSideDest);\n"
   "1853\t\t\t\t \n"
   "1854\t\t\t\t 
releaseCompleteCheckAndCopy(ORIGIN,DESTINATION,cl,stateMode);\n"
   "1855\t\t\t\t 
cmuLoadParams(message,CMU_Q931,(HRAS)0,(cmRASTrPart)0,CL.DEST.stack);\n"
   "1856\t\t\t\t \n"
   "1857\t\t\t\t if (CL.alertingTimeout > 0 && CL.alertingTOExpired == FALSE)\n"
   "1858\t\t\t\t\t gkTiTimerKill(alertingTimerExpired, (void*)cl);\n"
   "1859\t\t\t\t \n"
   "1860\t\t\t\t if(!sendMsgEvent(cl, gkcciMsgReceiveDisconnect, 
gkcciSideDest))\n"
   "1861\t\t\t\t {       \n"
   "1862\t\t\t\t\t CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8725, cl, \"handleDestinationStateChange: Failed in sending disconnect receive 
message notification to the application\"));\n"
   "1863\t\t\t\t\t return ERROR;\n"
   "1864\t\t\t\t }\n"
   "1865\t\t\t\t 
cmuGetParam(&message,cmParamReleaseCompleteCause,FALSE,0,(int*)&CL.DEST.dropCause,NULL);\n"
   "1866\t\t\t\t 
cmuGetParam(&message,cmParamReleaseCompleteReason,FALSE,0,(int*)&CL.DEST.dropReason,NULL);\n"
   "1867\t\t\t\t if ((CL.state!=CAL_HUNTING) && 
(CL.state!=CAL_WAIT_DEST_ADMISSION) &&\n"
   "1868\t\t\t\t\t (CL.state!=CAL_CONNECT) && (CL.state!=CAL_WAIT_DEST_CONNECT) 
&& (CL.state != CAL_WAIT_DEST_DISCONNECT) &&\n"
   "1869\t\t\t\t\t (CL.state!=CAL_EXPECTING_DRQ)&& 
(CL.state!=CAL_DISCONNECT))\n"
   "1870\t\t\t\t\t CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8726, cl,\"Disconnected not from hunting or connected state. from destination 
side\"));\n"
   "1871\t\t\t\t CL.setupSend = FALSE; /* setup ansewred with disconnect */\n"
   "1872\t\t\t\t switch (stateMode)\n"
   "1873\t\t\t\t {\n"
   "1874\t\t\t\t case cmCallStateModeDisconnectedBusy:\n"
   "1875\t\n"
   "1876\t          /* A change in the busy reason */\n"
   "1877\t          CL.reason = RSN_DESTINATION_BUSY;\n"
   "1878\t          /* 3003: BUG N5565  - cmReasonTypeUnreachableDestination 
changed to cmReasonTypeInConf*/\n"
   "1879\t          CL.DEST.dropReason = cmReasonTypeInConf;\n"
   "1880\t\n"
   "1881\t          /*CL.DEST.dropReason = cmReasonTypeAdaptiveBusy;\n"
   "1882\t potential BUG3001: change order of \'case\'s to avoid call reason 
overwriting*/\n"
   "1883\t       case cmCallStateModeDisconnectedUnreachable:\n"
   "1884\t         /* A change in No Answer Reason */\n"
   "1885\t         /* When GK Stack decide to disconnect destination and call 
source in the offering state \n"
   "1886\t         here GK TO for connection occure. The situation like the 
Alert was sent by destination \n"
   "1887\t         but Setup doesn\'t arrived. This trick will be used in the 
function to handle destination\n"
   "1888\t         doesn\'t answers state */\n"
   "1889\t         if(CL.ORIG.state == cmCallStateOffering)\n"
   "1890\t         {\n"
   "1891\t           /*CL.wasAlertBeforeDisconnect = TRUE;\n"
   "1892\t            3003: BUG N5565 changed*/\n"
   "1893\t           if (CL.reason != RSN_DESTINATION_BUSY){\n"
   "1894\t             CL.reason = RSN_NEED_ALERT;\n"
   "1895\t             CL.DEST.dropReason = 
cmReasonTypeUnreachableDestination;\n"
   "1896\t           }\n"
   "1897\t         }\n"
   "1898\t\t\t\t case cmCallStateModeDisconnectedReject:\n"
   "1899\t\t\t\t case cmCallStateModeDisconnectedUnknown:\n"
   "1900\t\t\t\t case cmCallStateModeDisconnectedNormal:\n"
   "1901\t\t\t\t\t CALL_NOTIFY(\"block\",GEN_NA,30,cl);\n"
   "1902\t\t\t\t\t if (gwIndicationUserBusy(cl))\n"
   "1903\t\t\t\t\t {\n"
   "1904\t\t\t\t\t\t CL.destState = DEST_FAILURE_OR_BUSY;\n"
   "1905\t\t\t\t\t\t CL.round=HUNT_DONE;\n"
   "1906\t\t\t\t\t }\n"
   "1907\t\t\t\t\t \n"
   "1908\t\t\t\t\t if ((CL.state!=CAL_HUNTING) && (CL.state!= 
CAL_WAIT_DEST_CONNECT) && \n"
   "1909\t\t\t\t\t\t (CL.state!=CAL_WAIT_DEST_ADMISSION) && (CL.state!= 
CAL_WAIT_DEST_DISCONNECT)) \n"
   "1910\t\t\t\t\t\t /* don\'t disconnect the call if it\'s one of the 
following:\n"
   "1911\t\t\t\t\t\t 1) it\'s hunting state \n"
   "1912\t\t\t\t\t\t 2) asking application for permission before sending 
connect\n"
   "1913\t\t\t\t\t\t to the origin \n"
   "1914\t\t\t\t\t\t 3) asking permission to send ACF to destination \n"
   "1915\t\t\t\t\t\t 4) waiting for disconnect event before rerouting call */\n"
   "1916\t\t\t\t\t {\n"
   "1917\t\t\t\t\t\t \n"
   "1918\t\t\t\t\t\t if(!sendStateEvent(cl, gkcciSttDisconnected, 
gkcciRsnDestDisconnected) )\n"
   "1919\t\t\t\t\t\t\t CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8727, cl,\"handleDestinationStateChange: Error "
<- "calling the application callback\"));\n"
   "1920\t\t\t\t\t\t if 
(!disconnectCall(cl,origDropReason(cl),cmReasonTypeUndefinedReason,\n"
   "1921\t\t\t\t\t\t\t CL.DEST.dropCause, UNDEFINED_DROP_CAUSE, FALSE))\n"
   "1922\t\t\t\t\t\t\t return ERROR;\n"
   "1923\t\t\t\t\t }\n"
   "1924\t\t\t\t\t break;\n"
   "1925\t\t\t\t\t \n"
   "1926\t\t\t\t case cmCallStateModeDisconnectedLocal:\n"
   "1927\t\t\t\t\t if(CL.destState != DEST_APP_DISCONNECTED) \n"
   "1928\t\t\t\t\t {\n"
   "1929\t\t\t\t\t\t CALL_NOTIFY(\"disconnected local\",GEN_NA, 30,cl);\n"
   "1930\t\t\t\t\t }\n"
   "1931\t\t\t\t\t else\n"
   "1932\t\t\t\t\t\t CALL_NOTIFY(\"application disconnected 
destination\",GEN_NA, 30,cl);\n"
   "1933\t\t\t\t\t break;\n"
   "1934\t\t\t\t default:\n"
   "1935\t\t\t\t\t CALL_NOTIFY(\"disconnected with unknown stateMode\",GEN_NA, 
30,cl);\n"
   "1936\t\t\t\t\t break;\n"
   "1937\t\t\t\t } \n"
   "1938\t\t\t\t \n"
   "1939\t\t\t }\n"
   "1940\t\t\t break;\n"
   "1941\t     case cmCallStateIdle:\t\n"
   "1942\t       {\n"
   "1943\t         if (IS_ARQ_DEST)\n"
   "1944\t         {\n"
   "1945\t           if (CL.DEST.ARQ)\n"
   "1946\t             cmRASClose(CL.DEST.ARQ);\n"
   "1947\t           releaseARQ(cl, DESTINATION);\n"
   "1948\t         }\n"
   "1949\t         if (CL.DEST.ARQ==NULL)\n"
   "1950\t         {\n"
   "1951\t           if (!terminateDestination(cl))\n"
   "1952\t             return ERROR;\n"
   "1953\t         }\n"
   "1954\t         else\n"
   "1955\t         {               \n"
   "1956\t           /* Enable the destination to disconnect without 
disconnecting the origin */\n"
   "1957\t           if ((CL.state==CAL_HUNTING) || 
(CL.state==CAL_WAIT_DEST_ADMISSION) || \n"
   "1958\t             (CL.state == CAL_WAIT_DEST_CONNECT) || (CL.state == 
CAL_WAIT_DEST_DISCONNECT))\n"
   "1959\t           {\n"
   "1960\t             /* save the previous state to know were to return */\n"
   "1961\t             CL.previousState = CL.state;\n"
   "1962\t             /* newnaomi. set all timers where they need to be set it 
used to\n"
   "1963\t             be here expectDRQToHuntTO but it\'s doing the same as 
expectDRQTOForDest*/\n"
   "1964\t             CALL_NOTIFY(\"setting expectDRQForDest timer (while 
hunting)\",GEN_NA,30,cl);\n"
   "1965\t             
gkTiTimerSet(expectDRQTOForDest,(void*)cl,EXPECT_DRQ_TOHUNT_TO_DELAY);\n"
   "1966\t             CHANGE_STATE(CAL_EXPECTING_DRQ_TO_HUNT,\"Idle on 
destination while hunting/before fully connecting\");\n"
   "1967\t           }\n"
   "1968\t           else\n"
   "1969\t           {\n"
   "1970\t             /* newnaomi. set all timers where they need to be set 
*/\n"
   "1971\t             CALL_NOTIFY(\"setting expectDRQForDest timer (for 
destination)\",GEN_NA,30,cl);\n"
   "1972\t             
gkTiTimerSet(expectDRQTOForDest,(void*)cl,EXPECT_DRQ_TO_DELAY);                 
\n"
   "1973\t             CHANGE_STATE(CAL_EXPECTING_DRQ,\"Idle on destination 
side \");\n"
   "1974\t           }\n"
   "1975\t         }\n"
   "1976\t       };\n"
   "1977\t       break;\n"
   "1978\t\n"
   "1979\t     case cmCallStateOffering: \n"
   "1980\t\t case cmCallStateWaitAddressAck:\t /*sarit 15/6/00- this is also an 
ilegal state for destination*/\n"
   "1981\t\t\t CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8728, 
cl,\"Offering at destination side\"));\n"
   "1982\t       if 
(!disconnectCall(cl,cmReasonTypeUndefinedReason,cmReasonTypeUndefinedReason,\n"
   "1983\t         UNDEFINED_DROP_CAUSE, UNDEFINED_DROP_CAUSE, TRUE))\n"
   "1984\t         return ERROR;\n"
   "1985\t       \n"
   "1986\t     }\n"
   "1987\t     return 0;\n"
   "1988\t   }\n"
   "1989\t\n"
   
"1990\t/*----------------------------------------------------------------------------*/
 \n"
   "1991\tBOOL checkCallState( /* check that the call is in the right state 
*/\n"
   "1992\t                    IN int          cl, \n"
   "1993\t                    IN calStatus_t  state, \n"
   "1994\t                    IN char         *action_str)\n"
   "1995\t{\n"
   "1996\t  if(CL.state != state)\n"
   "1997\t  {\n"
   "1998\t    char str[256];\n"
   "1999\t    \n"
   "2000\t    sprintf(str, \"Call is in the wrong state %s. %s cannot be 
completed\",stateName[CL.state], action_str);\n"
   "2001\t    CALL_NOTIFY(str, GEN_NA, 10,cl);\n"
   "2002\t    return FALSE;\n"
   "2003\t  }\n"
   "2004\t  \n"
   "2005\t  return TRUE;\n"
   "2006\t}\n"
   "2007\t\n"
   
"2008\t/*----------------------------------------------------------------------------*/
 \n"
   "2009\tvoid handleStateChange(/* change state an print notification */\n"
   "2010\t                       IN  int cl,\n"
   "2011\t                       IN calStatus_t newState,\n"
   "2012\t                       IN char * display )\n"
   "2013\t{\n"
   "2014\t  char s[200];\n"
   "2015\t  sprintf(s,\"changed from %s to 
%s(%s)\",stateName[CL.state],stateName[newState],display);\n"
   "2016\t  CALL_NOTIFY(s,GEN_NA,20,cl);\n"
   "2017\t  CL.state=newState;\n"
   "2018"
<- "\t}\n"
   "2019\t\n"
   
"2020\t/*----------------------------------------------------------------------------*/
 \n"
   "2021\t   gkcciState_t getAppState( /* translate a call state to cci state 
*/\n"
   "2022\t                         IN UINT32 state)\n"
   "2023\t{\n"
   "2024\t  switch (state)\n"
   "2025\t  {\n"
   "2026\t  case cmCallStateDialtone: \n"
   "2027\t    return gkccisttDialTone;\n"
   "2028\t  case cmCallStateProceeding: \n"
   "2029\t    return gkcciSttProceeding;\n"
   "2030\t  case cmCallStateRingBack: \n"
   "2031\t    return gkcciSttDestAlerting;\n"
   "2032\t  default:\n"
   "2033\t    break;   \n"
   "2034\t  }\n"
   "2035\t  return (gkcciState_t)-1;\n"
   "2036\t}\n"
   "2037\t\n"
   
"2038\t/*----------------------------------------------------------------------------*/
 \n"
   "2039\t   gkcciReason_t getAppReason( /* translate a call reason to cci 
reason */\n"
   "2040\t     IN int cl)\n"
   "2041\t   {\n"
   "2042\t     switch(CL.reason)\n"
   "2043\t     {\n"
   "2044\t     case RSN_FAILURE_EVENT_HANDLER:\n"
   "2045\t       return gkcciRsnFailureInEventHandler;\n"
   "2046\t     case RSN_FAILURE_INTERNAL:\n"
   "2047\t       return gkcciRsnFailureInternal;  \n"
   "2048\t     case RSN_SERVICE_NOT_ALLOWED:\n"
   "2049\t       return gkcciRsnServiceNotAllowed;\n"
   "2050\t     case RSN_EXIT_ZONE_NOT_ALLOWED:\n"
   "2051\t       return gkcciRsnExitZoneNotAllowed;\n"
   "2052\t     case RSN_NO_DESTINATION:\n"
   "2053\t       return gkcciRsnNoDestinationInCall;\n"
   "2054\t     case RSN_CANNOT_SEND_LRQ:\n"
   "2055\t       return gkcciRsnCannotSendLRQ;\n"
   "2056\t     case RSN_LRQ_NOT_FOUND:\n"
   "2057\t       return gkcciRsnLRQAddressNotFound;\n"
   "2058\t     case RSN_RESOURCE_UNAVAILABLE:\n"
   "2059\t       return gkcciRsnResourceUnavailable;\n"
   "2060\t     case RSN_INVALID_ENDPOINT:\n"
   "2061\t       return gkcciRsnInvalidEndpoint;\n"
   "2062\t     case RSN_ROUTE_CALL_TO_GK:\n"
   "2063\t       return gkcciRsnRouteCallToGK;\n"
   "2064\t     case RSN_APP_TO:\n"
   "2065\t       return gkcciRsnAppTO;\n"
   "2066\t     case RSN_APP_DISCONNECT_DEST:\n"
   "2067\t       return gkcciRsnAppDisconnectDestination;\n"
   "2068\t\t\t     /*case RSN_OVLPSEND:\n"
   "2069\t       return ???*/\n"
   "2070\t     default:\n"
   "2071\t       return gkcciRsnUndefined;\n"
   "2072\t     }\n"
   "2073\t     \n"
   "2074\t   }\n"
   "2075\t\n"
   
"2076\t/*----------------------------------------------------------------------------*/
 \n"
   "2077\t   BOOL sendStateEvent( /* send event to the application */\n"
   "2078\t     IN     int           cl,\n"
   "2079\t     IN     gkcciState_t  state, \n"
   "2080\t     IN     gkcciReason_t reason) \n"
   "2081\t   { \n"
   "2082\t     BOOL error;\n"
   "2083\t     gkHAPPCALL tmp;\n"
   "2084\t\n"
   "2085\t     if(VALID(cl))\n"
   "2086\t     {\n"
   "2087\t\t   BOOL pli;\t \n"
   "2088\t\t \n"
   "2089\t\t   /* clear previous event on call from plugin coordinator DB */\n"
   "2090\t\t   gkpliIsInitialized(&pli);\n"
   "2091\t\t   if (pli)\n"
   "2092\t\t   {\n"
   "2093\t\t\t   gkpliTransaction transaction;\n"
   "2094\t\t\t   gkpliCallTransaction(CL.handle, CL.appState, CL.appReason, 
&transaction);\n"
   "2095\t\t\t   gkpliTransactionRemove(&transaction);\n"
   "2096\t\t   }\n"
   "2097\t\n"
   "2098\t       CL.appState = state;\n"
   "2099\t       CL.appReason = reason;\n"
   "2100\t       error = (((*stateEventCb)((gkHCALL)CL.handle, &(CL.appHandle), 
state, reason)) < 0);\n"
   "2101\t     }\n"
   "2102\t     else\n"
   "2103\t       error = (((*stateEventCb)(GKCCI_CALL_NOT_VALID,  &tmp, state, 
reason)) < 0);\n"
   "2104\t     return(!error);\n"
   "2105\t   }\n"
   "2106\t\n"
   
"2107\t/*----------------------------------------------------------------------------*/\n"
   "2108\t   BOOL sendMsgEvent( /* send message event to the application */\n"
   "2109\t     IN     int           cl,\n"
   "2110\t     IN     gkcciMsg_t    msg, \n"
   "2111\t     IN     gkcciSide_t   side) \n"
   "2112\t   { \n"
   "2113\t     BOOL error = FALSE;\n"
   "2114\t     \n"
   "2115\t     if(msgEventCb == NULL) /* event handler was not set. No 
notification required */\n"
   "2116\t       return TRUE;\n"
   "2117\t     \n"
   "2118\t     if(VALID(cl)) /* only send messages of valid endpoint */\n"
   "2119\t     {\n"
   "2120\t       error = (((*msgEventCb)((gkHCALL)CL.handle, &(CL.appHandle), 
msg, side)) < 0);\n"
   "2121\t     }\n"
   "2122\t     return (!error);\n"
   "2123\t   }\n"
   "2124\t\n"
   
"2125\t/*----------------------------------------------------------------------------*/
  \n"
   "2126\t   BOOL hookToCall(IN     gkHCALL     hCall,   /* GK handle to the 
call */\n"
   "2127\t     IN OUT gkHAPPCALL  *haCall, /* application handle to the call 
*/\n"
   "2128\t     IN  HCALL          hsCall,  /* stack handle to call */     \n"
   "2129\t     IN  HRAS           hsRas,   /* stack handle of RAS msg 
associated with call */\t                      \n"
   "2130\t     I"
<- "N  gkcciMsg_t     msg,     /* The message received or about to be sent */\n"
   "2131\t     IN  gkcciSide_t    side     /* the size of the message */)\n"
   "2132\t   {\n"
   "2133\t     if (callHandleHookCb == NULL)\n"
   "2134\t       return TRUE;\n"
   "2135\t     \n"
   "2136\t     return (((*callHandleHookCb)(hCall, haCall, hsCall, hsRas, msg, 
side)) >= 0);\n"
   "2137\t   }\n"
   "2138\t                            \n"
   "2139\t            \n"
   "2140\t  /*******************************************************/\n"
   "2141\t  /*  RAS and Q.931 Messages For the Call                */\n"
   "2142\t  /*******************************************************/ \n"
   "2143\t  \n"
   "2144\t  BOOL calARQ(\n"
   "2145\t              IN HRAS hsRas,\n"
   "2146\t              IN HCALL\thsCall,\n"
   "2147\t              IN HAPPCALL haCall,\n"
   "2148\t              IN cmRASTransport * srcAddress)\n"
   "2149\t  {\n"
   "2150\t    UINT16 endpoint;\n"
   "2151\t    int answerCall;\n"
   "2152\t    gkcciSide_t side;\n"
   "2153\t    char buf[120];\n"
   "2154\t    cmuMessage_t message;\n"
   "2155\t    cmuLoadParams(message,CMU_RAS,hsRas,cmRASTrPartRequest,NULL);\n"
   "2156\t    \n"
   "2157\t    /* let the application hanlde the ARQ first */\n"
   "2158\t    /* at this point neighter the ARQ handles nor the destination 
stack handle are \n"
   "2159\t    set in the call table so although the hsCall might be valid for 
destination\n"
   "2160\t    ARQ we set it to NULL */\n"
   "2161\t    
cmuGetParam(&message,cmRASParamAnswerCall,FALSE,0,&answerCall,NULL); /* 
origin|destination */\n"
   "2162\t    side = (answerCall == TRUE)?gkcciSideDest:gkcciSideOrig;\n"
   "2163\t    hookToCall((gkHCALL)GKCCI_NO_GKHCALL, (gkHAPPCALL 
*)GKCCI_NO_GKHAPPCALL, NULL, hsRas, gkcciMsgReceiveARQ, side);\n"
   "2164\t    \n"
   "2165\t    if (!gkcfgFlagValue(GKCFG_ACCEPT_CALLS) || 
!gkcfgFlagValue(GKCFG_GK_ON))\n"
   "2166\t    {\n"
   "2167\t      CALL_NOTIFY(\"gk in not-accepting-calls state - arj and 
dropping call\",GEN_NA,10,-1);\n"
   "2168\t      return 
newCallDisconnect(CAL_NULL_INDEX,hsCall,cmReasonTypeGatekeeperResource, \n"
   "2169\t        hsRas, cmRASReasonResourceUnavailable, (side_t)side, \n"
   "2170\t        (CALL_NEW(haCall) ? gkcciSttAdmissionReject : gkcciSttIdle), 
gkcciRsnResourceUnavailable);\n"
   "2171\t    }\n"
   "2172\t    \n"
   "2173\t    \n"
   "2174\t    if (!rgsrIdentify(&message,&endpoint))\n"
   "2175\t    {\n"
   "2176\t      sprintf(buf,\"endpIdentify failed in calARQ sent by 
%s\",addIpToString(srcAddress));\n"
   "2177\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8729,-1,buf));\n"
   "2178\t      return 
newCallDisconnect(CAL_NULL_INDEX,hsCall,cmReasonTypeUndefinedReason, \n"
   "2179\t        hsRas, cmRASReasonUndefined, (side_t)side, \n"
   "2180\t        (CALL_NEW(haCall) ? gkcciSttAdmissionReject : gkcciSttIdle), 
gkcciRsnUndefined);\n"
   "2181\t    }\n"
   "2182\t    \n"
   "2183\t    if (!answerCall)\n"
   "2184\t    {\n"
   "2185\t      sprintf(buf,\"admission request (origin) from %s. 
endpoint=%i\",addIpToString(srcAddress),endpoint);\n"
   "2186\t      CALL_NOTIFY(buf,GEN_NA,10,-1);\n"
   "2187\t      DBGL_CONDITION(30,rgtblPrintRegTitles(endpoint))\n"
   "2188\t        return handleOriginARQ(hsRas,hsCall,haCall,endpoint);\n"
   "2189\t    }\n"
   "2190\t    else\n"
   "2191\t    {\n"
   "2192\t      CALL_NOTIFY(\"block\",GEN_NA,30,-1);\n"
   "2193\t      sprintf(buf,\"admission request (destination) from %s. 
endpoint=%i\",addIpToString(srcAddress),endpoint);\n"
   "2194\t      CALL_NOTIFY(buf,GEN_NA,10,-1);\n"
   "2195\t      DBGL_CONDITION(30,rgtblPrintRegTitles(endpoint))\n"
   "2196\t        return handleDestinationARQ(hsRas,hsCall,haCall,endpoint);\n"
   "2197\t    }\n"
   "2198\t  }\n"
   "2199\t\n"
   
"2200\t/*----------------------------------------------------------------------------*/
  \n"
   "2201\tBOOL handleOriginARQ(IN HRAS hsRas,\n"
   "2202\t\t                 IN HCALL\thsCall,\n"
   "2203\t\t                 IN HAPPCALL haCall,\n"
   "2204\t\t                 IN UINT16 endpoint) {\n"
   "2205\t\tint cl,tmp;\n"
   "2206\t\tBOOL retCode = TRUE;\n"
   "2207\t\tBOOL wasActive = TRUE;\n"
   "2208\t\tBOOL isNewCall = FALSE;\n"
   "2209\t\tgkcciReason_t reason;\n"
   "2210\t    gkcciState_t state;\n"
   "2211\t\tcmuMessage_t message;\n"
   "2212\t\tcmuLoadParams(message,CMU_RAS,hsRas,cmRASTrPartRequest,(HCALL)0);\n"
   "2213\t\t\n"
   "2214\t\t/* Test if this is the start of a new call */\n"
   "2215\t\tisNewCall = CALL_NEW(haCall);\n"
   "2216\t\tif (!isNewCall)\n"
   "2217\t\t{\n"
   "2218\t\t\tside_t side;\n"
   "2219\t\t\tcl=getCall(haCall,&side);\n"
   "2220\t\t\t\n"
   "2221\t\t\tif (!VALID(cl))\n"
   "2222\t\t\t{\n"
   "2223\t\t\t/* major mismatch between the application and the GK. \n"
   "2224\t\t\t\tsend ARJ and issue an exception */\n"
   "2225\t\t\t\tCA"
<- "LL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8730, cl,\"ARQ for 
non-existing call. Possible data corruption\"));\n"
   "2226\t\t\t\treturn ARJ(hsRas,cmRASReasonUndefined,-1,ORIGIN);\n"
   "2227\t\t\t}\n"
   "2228\t\t\telse\n"
   "2229\t\t\t{\n"
   "2230\t\t\t\tif (CL.state != CAL_WAIT_ADDRCMPLT)\n"
   "2231\t\t\t\t{\n"
   "2232\t\t\t\t/* ARQ is not the first message in call, while not \n"
   "2233\t\t\t\t\tin overlapped sending */\n"
   "2234\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8731, cl,\"ARQ not first message in call\"));\n"
   "2235\t\t\t\t\tretCode = ARJ(hsRas,cmRASReasonUndefined,-1,ORIGIN);\n"
   "2236\t\t\t\t\t\n"
   "2237\t\t\t\t\tif (hsCall == CL.ORIG.stack)\n"
   "2238\t\t\t\t\t\treturn retCode; /*handle already in use - do not close 
it*/\n"
   "2239\t\t\t\t\telse\n"
   "2240\t\t\t\t\t{\n"
   "2241\t\t\t\t\t\tif (!closeCallHandle(hsCall,CL.ORIG.stack))\n"
   "2242\t\t\t\t\t\t\tretCode = FALSE;\n"
   "2243\t\t\t\t\t\treturn retCode;\n"
   "2244\t\t\t\t\t}\n"
   "2245\t\t\t\t}\n"
   "2246\t\t\t}\n"
   "2247\t\t}\n"
   "2248\t\t\n"
   "2249\t\tif (isNewCall)\n"
   "2250\t\t{\n"
   "2251\t\t\tif (!assignCall(&cl))\n"
   "2252\t\t\t{\n"
   "2253\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8732, cl,\"assignCall failed at handle Origin ARQ\"));\n"
   "2254\t\t\t\tDBGL_CONDITION(50,gkPAC());\n"
   "2255\t\t\t\treturn 
newCallDisconnect(CAL_NULL_INDEX,hsCall,cmReasonTypeGatekeeperResource, \n"
   "2256\t\t\t\t\thsRas, cmRASReasonResourceUnavailable, ORIGIN, \n"
   "2257\t\t\t\t\tgkcciSttAdmissionReject, gkcciRsnResourceUnavailable);\n"
   "2258\t\t\t}\n"
   "2259\t\t}\n"
   "2260\t\t\n"
   "2261\t\tif (CL.state != CAL_WAIT_ADDRCMPLT)\n"
   "2262\t\t\tCL.handle = generateHandle(cl); /* also sets the auth field */\n"
   "2263\t\t\n"
   "2264\t\tCL.ORIG.ARQ=hsRas;\n"
   "2265\t\tCL.isARQ = ARQ_ORIG; /* call started from origin ARQ */\n"
   "2266\t\tif (loadFromARQ(hsRas, ORIGIN, cl) == FALSE) \n"
   "2267\t\t{       \n"
   "2268\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8733, 
cl, \"handleOriginARQ: failed to read origin ARQ info\"));\n"
   "2269\t\t\tARJ(hsRas,cmRASReasonUndefined,cl,ORIGIN);\n"
   "2270\t\t\treturn FALSE;\n"
   "2271\t\t}\n"
   "2272\t\tcmSetCallHandle(hsCall,(HAPPCALL)&(CL.ORIG.callNo));\n"
   "2273\t\tCL.ORIG.stack=hsCall;\n"
   "2274\t\tCALL_NOTIFY(\"loaded information from admission 
request\",GEN_NA,30,cl);\n"
   "2275\t\tDBGL_CONDITION(30,calPrintCallTitles(cl));\n"
   "2276\t\t\n"
   "2277\t\tif (endpoint!=RGTBL_REG_NOT_VALID)\n"
   "2278\t\t{\n"
   "2279\t\t\tCL.ORIG.reg=endpoint;\n"
   "2280\t\t\trgtblEndpointType(RGTBL_GET, CL.ORIG.reg, 
&(CL.ORIG.endpointType));\n"
   "2281\t\t\tif (!rgtblIncrCallCount(endpoint))\n"
   "2282\t\t\t{\n"
   "2283\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8613, cl, \"handleOriginARQ: Failed to increment registration\'s call 
count\"));\n"
   "2284\t\t\t}\n"
   "2285\t\t}\n"
   "2286\t\t\n"
   "2287\t\tif(!sendMsgEvent(cl, gkcciMsgReceiveARQ, gkcciSideOrig))\n"
   "2288\t\t{       \n"
   "2289\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8734, 
cl, \"handleOriginARQ: Failed in sending ARQ receive message notification to 
the application\"));\n"
   "2290\t\t\tARJ(hsRas,cmRASReasonInvalidEndpointID,cl,ORIGIN);\n"
   "2291\t\t\t/*this ARJ will also close the hsCall*/\n"
   "2292\t\t\treturn FALSE;\n"
   "2293\t\t} \n"
   "2294\t\t\n"
   "2295\t\tif (endpoint==RGTBL_REG_NOT_VALID)\n"
   "2296\t\t{\n"
   "2297\t\t\tCALL_NOTIFY(\"bad endpID.endpoint sending admission (origin) 
could not be identified in the registration table\",GEN_NA,0,cl);\n"
   "2298\t\t\tDBGL_CONDITION(30,gkPAR());\n"
   "2299\t\t\treturn ARJ(hsRas,cmRASReasonInvalidEndpointID,cl,ORIGIN); /* in 
this stage, ARJ sends notification to the application */\n"
   "2300\t\t\t/*this ARJ will also close the hsCall*/\n"
   "2301\t\t}\n"
   "2302\t\t\n"
   "2303\t\trgtblAccessActivityFlag(RGTBL_SET,endpoint,&wasActive);\n"
   "2304\t\tcmuGetParam(&message,cmRASParamBandwidth,FALSE,0,&tmp,NULL); 
CL.ORIG.bw.bwReq=tmp;\n"
   "2305\t\tif 
(!bwSendBandwidthEvent(cl,ORIGIN,gkcciARQBW,gkcciBWRsnUndefined))\n"
   "2306\t\t{\n"
   "2307\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8735, 
cl,\"handleOriginARQ: Failed in sending bandwidth event to the 
application\"));\n"
   "2308\t\t\treturn ARJ(hsRas,cmRASReasonUndefined,cl,ORIGIN);\n"
   "2309\t\t\t/*this ARJ will also close the hsCall*/\n"
   "2310\t\t}\n"
   "2311\t/* Start sohan - Main Gk - Route calls to GK*/\n"
   "2312\t\n"
   "2313\t/* \n"
   "2314\t\n"
   "2315\tEventually this code of Main GK roting calls to Normal GK,\n"
   "2316\tbased on  routing Information sent by PNCU, can be replaced\n"
   "2317\tby a more elegant means. Perform Location for source requst \n"
   "2318\tusing the Radvision methods, perform LRQ to neighbors + m\'cast \n"
   "2319\tand return the Call signal address returned in LCF to \n"
   "2320\tRequsted party. Calling party then diverts t"
<- "he H.225, h.245 \n"
   "2321\tsignalling to the new address.\n"
   "2322\tIf no address match then proceed with normal flow.\n"
   "2323\tHandling ARQ also requires handling DRQ--->\n"
   "2324\t\n"
   "2325\t   Perform  LRQ -------->\n"
   "2326\t            LCF <-------\n"
   "2327\t            Return the CallSignalAddress in ACF -------->\n"
   "2328\t*/\n"
   "2329\t\n"
   "2330\t  if (is_mainGK())\n"
   "2331\t  {\n"
   "2332\t\tcmRASTransport srcCS;\n"
   "2333\t\tstruct alias_media_proxy *alias_vsu=NULL;\t\n"
   "2334\t  \tif (!locateSrcInZone(cl, &srcCS))\n"
   "2335\t\t{\n"
   "2336\t\t\tif (search_source_alias(CL.srcInfo[0].string, 
CL.srcInfo[0].length, &alias_vsu))\n"
   "2337\t\t\t{\n"
   "2338\t      \t\t\tchar buf[ADD_MAX_BUF*8];\n"
   "2339\t\t\t/*\tUINT32 inip=0, outip=0,i=0;\n"
   "2340\t \t\t\tBYTE* ip1=(BYTE*)&inip; \n"
   "2341\t \t\t\tBYTE* ip2=(BYTE*)&outip; \n"
   "2342\t\t\t\tinip = alias_vsu->media_proxy_ip;\t\n"
   "2343\t\t\t\tfor (i=0;i<4;i++)\n"
   "2344\t\t\t\t\tip2[3-i] = ip1[i];*/\n"
   "2345\t                \n"
   "2346\t#if 1\n"
   "2347\t                        CL.destInfo[0].type = cmRASAliasTypeE164;\n"
   "2348\t                        memcpy(CL.destInfo[0].string,(char 
*)alias_vsu->alias,strlen(alias_vsu->alias));\n"
   "2349\t                        CL.destInfo[0].length = 
strlen(alias_vsu->alias);\n"
   "2350\t                        CL.ORIG.endpointType = 
cmRASEndpointTypeUndefined;\n"
   "2351\t                        /*CL.destCallSignal.ip=outip;   */\n"
   "2352\t                        
/*cmRASSetParam(hsRas,cmRASTrPartConfirm,cmRASParamDestInfo,0,sizeof(CL.destInfo[0]),
 (char *)&(CL.destInfo[0]));*/\n"
   "2353\t#endif\n"
   "2354\t\t\t        /* Send ACF with replaced VSU\'s CallSignal address */\n"
   "2355\t                        
CL.destCallSignal.ip=alias_vsu->media_proxy_ip;\n"
   "2356\t                        
CL.destCallSignal.port=DEST_CALL_SIGNAL_PORT;\n"
   "2357\t                        sprintf(buf,\"CL.srcInfo = %s, 
CL.destCallSignal.ip = %d : %s, CL.destCallSignal.port\",CL.srcInfo[0].string, 
CL.destCallSignal.ip, \\\n"
   "2358\tgkaddIp2String(CL.destCallSignal.ip, ip_address), 
CL.destCallSignal.port);\n"
   "2359\t                        GK_NOTIFY(buf, GEN_NA,10);\n"
   "2360\t                        
cmRASSetParam(hsRas,cmRASTrPartConfirm,cmRASParamDestCallSignalAddress,0,sizeof(cmRASTransport),(char*)&(CL.destCallSignal));\n"
   "2361\t                        retCode =  ACF(CL.ORIG.ARQ,cl,ORIGIN);\n"
   "2362\t// Fix for Bug No: 67 Main Gatekeeper requires a dedicated MRC\n"
   "2363\t/* start sohan*/\n"
   "2364\t#if 1\n"
   "2365\t\t\t\tCALL_NOTIFY(\"handleOriginARQ: Diverted call successfully. 
Clearing registration Info.- beginning disengaing process\",GEN_NA,10,-1);\n"
   "2366\t                        if (VALID(cl))\n"
   "2367\t                        {\n"
   "2368\t\t\t\t\tside_t\tside;\n"
   "2369\t      \t\t\t\tif(CL.callsTOCounter == 0)\n"
   "2370\t        \t\t\t\tCL.callsTOCounter++;\n"
   "2371\t                        \tif (CL.ORIG.stack)      \n"
   "2372\t                                {\n"
   "2373\t                                        side = ORIGIN;\n"
   "2374\t\t\t\t\t\tCALL_NOTIFY(\"handleOriginARQ: clearARQMainGK - 
ORIGIN\",GEN_NA,10,-1);\n"
   "2375\t\t\t\t\t\tclearARQMainGK((HAPPRAS)&(CL.SIDE.callNo),hsRas);\n"
   "2376\t                                }\n"
   "2377\t                                if (CL.DEST.stack)\n"
   "2378\t                                {\n"
   "2379\t                                        side = DESTINATION;\n"
   "2380\t                                        
CALL_NOTIFY(\"handleOriginARQ: clearARQMainGK - DESTINATION\",GEN_NA,10,-1);\n"
   "2381\t\t\t\t\t\tclearARQMainGK((HAPPRAS)&(CL.SIDE.callNo),hsRas);\n"
   "2382\t                                }\n"
   "2383\t                        }\n"
   "2384\t                        else\n"
   "2385\t                        \tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 9000, cl, \"handleOriginARQ: Invalid cl. Failed to call 
calDRQTimeout\"));\n"
   "2386\t\t\t\t\n"
   "2387\t#endif\n"
   "2388\t#if 0\n"
   "2389\t  \t\t\tCALL_NOTIFY(\"handleOriginARQ: Diverted call successfully. 
Clearing registration Info.- beginning disengaing process\",GEN_NA,10,-1);\n"
   "2390\t     \t\t\tif (CL.ORIG.ARQ || CL.DEST.ARQ)\n"
   "2391\t     \t\t\t{\n"
   "2392\t       \t\t\t\tsendDRQMainGK(cl);\n"
   "2393\t  \t\t\t\tCALL_NOTIFY(\"handleOriginARQ: Call 
cmRASClose\",GEN_NA,10,-1);\n"
   "2394\t  \t\t\t\tif (cmRASClose(hsRas)!=0)\n"
   "2395\t  \t\t\t\t{\n"
   "2396\t    \t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 9000, cl, \"handleOriginARQ: Failed to close RAS 
handle\"));\n"
   "2397\t \t\t\t\t}\n"
   "2398\t\t\t\t\n"
   "2399\t  \t\t\t\tif (VALID(cl))\n"
   "2400\t\t\t\t\t{\n"
   "2401\t\t\t\t\t\tif (CL.ORIG.stack)\t\n"
   "2402\t\t\t\t\t\t{\n"
   "2403\t\t\t\t\t\t\tteardownCall(cl, ORIGIN);\n"
   "2404\t  \t\t\t\t\t\tCALL_NOTIFY(\"handleOriginARQ: Call teardownCall - 
ORIGIN\",GEN_NA,10,-1);\n"
   "2405\t\t\t\t\t\t}\n"
   "2406\t\t\t\t\t\tif (CL.DEST.stack)\n"
   "2407\t\t\t\t\t\t{\n"
   "2408\t\t\t\t\t\t\tteardownCall(cl, DESTINATION);\n"
   "2409\t  \t\t\t\t\t\tCALL_NOTIFY(\"handleOriginARQ: Call teardownCall - 
DESTINATION\",GEN_NA,10,-1);\n"
   "2410\t\t\t\t\t\t}\n"
   "2411\t\t\t\t\t}\n"
   "2412\t\t\t\t\telse\n"
   "2413\t    \t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 9000, cl, \"handleOriginARQ: Invalid cl. Failed to teardown 
call\"));\n"
   "2414\t     \t\t\t}\n"
   "2415\t\t\t/*\t\n"
   "2416\t  \t\t\tCALL_NOTIFY(\"handleOriginARQ: Diverted call successfully. 
Clearing registration Info.- beginning disengaing process\",GEN_NA,10,-1);\n"
   "2417\t  \t\t\tif (VALID(cl))\n"
   "2418\t\t\t\t{\n"
   "2419\t  \t\t\t\tif (cmRASClose(hsRas)!=0)\n"
   "2420\t  \t\t\t\t{\n"
   "2421\t    \t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 9000, cl, \"handleOriginARQ: Failed to close RAS 
handle\"));\n"
   "2422\t \t\t\t\t}\n"
   "2423\t  \t\t\t\tteardownCall(cl, ORIGIN);\n"
   "2424\t\t\t\t}\n"
   "2425\t\t\t\telse\n"
   "2426\t    \t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 9000, cl, \"handleOriginARQ: Invalid cl. Failed to teardown 
call\"));\n"
   "2427\t\t\t*/\n"
   "2428\t#endif\n"
   "2429\t/* end sohan */\n"
   "2430\t\t\t\treturn retCode;\n"
   "2431\t\t\t}\n"
   "2432\t\t\telse {\n"
   "2433\t\t\t\t/* ARQ from unregistered/ Un known entity . No handling */\n"
   "2434\t\t\t}\n"
   "2435\t\n"
   "2436\t        }\n"
   "2437\t        else {\n"
   "2438\t                /* Src found in local zone/ Reg table. Local GK. 
Continue */\n"
   "2439\t        }\n"
   "2440\t  }\n"
   "2441\t  else {\n"
   "2442\t        /* Is not a Main GK continue */\n"
   "2443\t  }\n"
   "2444\t\n"
   "2445\t/* End   sohan - Main Gk - Route calls to GK*/\n"
   "2446\t\t\n"
   "2447\t\t/* here we ask for the application to do address resolution */\n"
   "2448\t\t/* Nimrod 6/8/00: added the state gkcciSttWaitAddressComplete for 
ARQ/ARJ overlapped\n"
   "2449\t\t\tsending, as it appears in the GK programmer guide. If the 
previous state was CAL_WAIT_ADDRCMPLT, \n"
   "2450\t\t\tno state or\treason changes are neccessary and the we should call 
the application with the\n"
   "2451\t\t\tgkcciSttWaitAddressComplete state */\n"
   "2452\t\tif (CL.state == CAL_WAIT_ADDRCMPLT)\n"
   "2453\t\t{\n"
   "2454\t\t\tCALL_NOTIFY(\"Overlap Sending: sending to application\",GEN_NA, 
31,cl);\n"
   "2455\t\t\tstate = gkcciSttWaitAddressComplete;\n"
   "2456\t\t\treason = gkcciRsnAdditionalAddress;\n"
   "2457\t\t\t/* Nimrod DEBUG: check if reason change is neccessary */\n"
   "2458\t\t\tCL.reason = RSN_OVLPSEND;\n"
   "2459\t\t}\n"
   "2460\t\telse {\n"
   "2461\t\t\tCALL_NOTIFY(\"Sending address resolution request to the 
application\",GEN_NA, 31,cl);\n"
   "2462\t\t\tCL.reason = RSN_NEW_ORIG;\n"
   "2463\t\t\tstate = gkcciSttAddressResolution;\n"
   "2464\t\t\treason = gkcciRsnNewOrigAdmission;\n"
   "2465\t\t\tCHANGE_STATE(CAL_ADDRESS_RESOLUTION, \"Address resolution request 
was sent to application after ARQ\");\n"
   "2466\t\t}\n"
   "2467\t\t/* end nimrod */\n"
   "2468\t\tif(!sendStateEvent(cl, state, reason))\n"
   "2469\t\t{\n"
   "2470\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8736, 
cl,\"handleOriginARQ: Failed in sending admission Resolution request to the 
application\"));\n"
   "2471\t\t\treturn ARJ(CL.ORIG.ARQ,cmRASReasonUndefined,cl,ORIGIN);\n"
   "2472\t\t\t/*this ARJ will also close the hsCall*/\n"
   "2473\t\t}\n"
   "2474\t\t/* xyx we need here to start a timeout */\n"
   "2475\t\treturn TRUE;\n"
   "2476\t}\n"
   "2477\t\n"
   "2478\t/* Start sohan */\n"
   "2479\t#if 1\n"
   
"2480\t/*----------------------------------------------------------------------------*/\n"
   "2481\tBOOL clearARQMainGK(/*a gk ARQ is being Cleared*/\n"
   "2482\t                   IN HAPPRAS haRas,\n"
   "2483\t                   IN HRAS    hsRas)\n"
   "2484\t\n"
   "2485\t\n"
   "2486\t{\n"
   "2487\t  side_t side;\n"
   "2488\t  int cl=getCall((HAPPCALL)haRas,&side);\n"
   "2489\t  CALL_NOTIFY(\"ARQ being cleared- beginning disengaing 
process\",GEN_NA,10,-1);\n"
   "2490\t  if (cmRASClose(hsRas)!=0)\n"
   "2491\t  {\n"
   "2492\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 9000, 
cl, \" clearARQMainGK: Failed to close RAS handle\"));\n"
   "2493\t  }\n"
   "2494\t  return teardownCall(cl, side);\n"
   "2495\t}\n"
   "2496\t#endif\n"
   "2497\t\n"
   "2498\t#if 0\n"
   
"2499\t/*----------------------------------------------------------------------------*/\n"
   "2500\tBOOL sendDRQMainGK(\n"
   "2501\t                         IN int cl)\n"
   "2502\t\n"
   "2503\t{\n"
   "2504\t        side_t side;\n"
   "2505\t        HRAS hsRas;\n"
   "2506\t        HCALL hsCall;\n"
   "2507\t        gkcciSide_t hside;\n"
   "2508\t        BOOL retCode;\n"
   "2509\t\n"
   "2510\t        CALL_NOTIFY(\"sendDRQMainGK: Begin\",GEN_"
<- "NA,10,-1);\n"
   "2511\t\n"
   "2512\t        if (!setDRQMainGK(cl,&side,&hsRas))\n"
   "2513\t                return FALSE;\n"
   "2514\t\n"
   "2515\t  /* inform the application about sending DRQ to the call. Don\'t 
wait up */\n"
   "2516\t  CL.SIDE.GKDRQ = hsRas;\n"
   "2517\t  CALL_NOTIFY(\"Sending notification to the application before 
sending DRQ\",GEN_NA, 31,cl);\n"
   "2518\t\n"
   "2519\t  hside = (side == ORIGIN) ? gkcciSideOrig:gkcciSideDest;\n"
   "2520\t\n"
   "2521\t  if(!sendMsgEvent(cl, gkcciMsgSendGKDRQ, hside))\n"
   "2522\t  { \n"
   "2523\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8621, 
cl, \"sendDRQ: Failed in sending GKDRQ send message notification to 
application\"));\n"
   "2524\t  }\n"
   "2525\t\n"
   "2526\t  /* let the app access the message before sending it */\n"
   "2527\t  if (!getCallHandle(cl, hside, &hsCall)) hsCall = NULL;\n"
   "2528\t  hookToCall((gkHCALL)CL.handle, (gkHAPPCALL *)&CL.appHandle, hsCall, 
hsRas,\n"
   "2529\t    gkcciMsgSendGKDRQ, hside);\n"
   "2530\t\n"
   "2531\t  if(!sendStateEvent(cl, gkcciSttGKInitiatedDRQ,  
gkcciRsnUndefined))\n"
   "2532\t  {\n"
   "2533\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8622, 
cl,\"sendDRQ: Failed in sending gk initiated DRQ notification to the 
application\"));\n"
   "2534\t  }\n"
   "2535\t  retCode = (cmRASRequest(hsRas) == 0 );\n"
   "2536\t  retCode = TRUE;\n"
   "2537\t  CL.SIDE.GKDRQ = (HRAS)NULL;\n"
   "2538\t  CALL_NOTIFY(\"sendDRQMainGK: End\",GEN_NA,10,-1);\n"
   "2539\t  return retCode;\n"
   "2540\t}\n"
   "2541\t\n"
   
"2542\t/*----------------------------------------------------------------------------*/\n"
   "2543\tBOOL setDRQMainGK(\n"
   "2544\t                        IN      int                                   
  cl,\n"
   "2545\t                        OUT     side_t*                               
  sd,\n"
   "2546\t                        OUT     HRAS*                                 
  hsRas)\n"
   "2547\t{\n"
   "2548\t        HCALL hsCall;\n"
   "2549\t        side_t side;\n"
   "2550\t        cmRASTransport trans;\n"
   "2551\t        cmRASAlias endpId;\n"
   "2552\t        char endpIdBuf[ADD_MAX_BUF];\n"
   "2553\t        char buf[120];\n"
   "2554\t        BOOL answeredCall;\n"
   "2555\t        cmuMessage_t message;\n"
   "2556\t        endpId.string=endpIdBuf;\n"
   "2557\t        endpId.type=cmRASAliasTypeEndpointID;\n"
   "2558\t        endpId.length = 0;\n"
   "2559\t        trans.ip = 0;\n"
   "2560\t\n"
   "2561\t        CALL_NOTIFY(\"setDRQMainGK: Begin\",GEN_NA,10,-1);\n"
   "2562\t        if (getDRQAddress(cl, ORIGIN, &trans))\n"
   "2563\t        {\n"
   "2564\t                *sd = ORIGIN;\n"
   "2565\t                answeredCall = 0;\n"
   "2566\t        }\n"
   "2567\t        else if (getDRQAddress(cl, DESTINATION, &trans))\n"
   "2568\t        {\n"
   "2569\t                *sd = DESTINATION;\n"
   "2570\t                answeredCall = 1;\n"
   "2571\t        }\n"
   "2572\t        else\n"
   "2573\t        {\n"
   "2574\t                CALL_NOTIFY(\"setDRQ: DRQ will not be sent to either 
side\",GEN_NA,30,cl);\n"
   "2575\t                return FALSE;\n"
   "2576\t        }\n"
   "2577\t        side = *sd;\n"
   "2578\t        sprintf(buf,\"sending disengage request to %s. 
endpoint=%i\",addIpToString(&trans),CL.SIDE.reg);\n"
   "2579\t        CALL_NOTIFY(buf,GEN_NA,10,cl);\n"
   "2580\t        if (!rgtblEndpointId(RGTBL_GET,CL.SIDE.reg,&endpId))\n"
   "2581\t        {\n"
   "2582\t                CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8791, cl,\"rgtblEndpointId failed at setDRQ for endpoint 
%d\",CL.SIDE.reg ));\n"
   "2583\t                return FALSE;\n"
   "2584\t        }\n"
   "2585\t        if (CL.SIDE.recovered && CL.SIDE.dummyStack)\n"
   "2586\t                hsCall = (HCALL)NULL;\n"
   "2587\t        else\n"
   "2588\t                hsCall = CL.SIDE.stack;\n"
   "2589\t        /* Sohan Do not send a actual DRQ */\n"
   "2590\t        
cmRASStartTransaction(dispStack,(HAPPRAS)&(CL.SIDE.callNo),hsRas,cmRASDisengage,&trans,hsCall);\n"
   "2591\t\n"
   "2592\t        
cmuLoadParams(message,CMU_RAS,*hsRas,cmRASTrPartRequest,NULL);\n"
   "2593\t        
cmuSetParam(&message,cmRASParamEndpointID,0,sizeof(endpId),(char*)&(endpId));\n"
   "2594\t        
cmuSetParam(&message,cmRASParamDisengageReason,0,disconnectRsnToDRQRsn(CL.SIDE.disconnectReason),(char*)NULL);\n"
   "2595\t        
cmuSetParam(&message,cmRASParamAnsweredCall,0,answeredCall,(char*)NULL);\n"
   "2596\t\n"
   "2597\t        if (!cmuDownloadGkId(*hsRas,cmRASTrPartRequest))\n"
   "2598\t        {\n"
   "2599\t                CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 0, cl,\"cmuDownloadGkId failed at setDRQ\" ));\n"
   "2600\t        }\n"
   "2601\t        if (!hsCall) {\n"
   "2602\t                UINT16 crv = CL.SIDE.CRVras ^ 0x8000;\n"
   "2603\t                
cmuSetParam(&message,cmRASParamCallID,0,sizeof(guid_t),(char*)CL.SIDE.callID);\n"
   "2604\t                
cmuSetParam(&message,cmRASParamCID,0,sizeof(guid_t),(char*)CL.cid);\n"
   "2605\t                
cmuSetParam(&message,cmRASParamCRV,0,crv,(char*)NULL);\n"
   "2606\t        }\n"
   "2607\t        CALL_NOTIFY(\"setDRQMainGK: End\",GEN_NA,10,-1);\n"
   "2608\t        return TRUE;\n"
   "2609\t}\n"
   "2610\t/* End sohan */\n"
   "2611\t#endif\n"
   "2612\t\n"
   "2613\t\n"
   "2614\t\n"
   
"2615\t/*----------------------------------------------------------------------------*/
 \n"
   "2616\tBOOL handleDestinationARQ(\n"
   "2617\t                          IN HRAS hsRas,\n"
   "2618\t                          IN HCALL\thsCall,\n"
   "2619\t                          IN HAPPCALL haCall,\n"
   "2620\t                          IN UINT16 endpoint)\n"
   "2621\t                          \n"
   "2622\t{ \n"
   "2623\t    int cl;\n"
   "2624\t    side_t side;\n"
   "2625\t    int tmp, retCode;\n"
   "2626\t    BOOL wasActive = TRUE;\n"
   "2627\t    cmuMessage_t message;\n"
   "2628\t\n"
   "2629\t    cmuLoadParams(message,CMU_RAS,hsRas,cmRASTrPartRequest,NULL);\n"
   "2630\t  \n"
   "2631\t#ifdef GK_RAS_BYPASS\n"
   "2632\t  {\n"
   "2633\t    if (calRASBypassFlag)\n"
   "2634\t    {\n"
   "2635\t      int bw;\n"
   "2636\t      cmuMessage_t mes;\n"
   "2637\t      cmuLoadParams(mes,CMU_RAS,hsRas,cmRASTrPartRequest,(HCALL)0);\n"
   "2638\t      gkcfgSetMode(GKCFG_ROUTED);\n"
   "2639\t      cmuGetParam(&mes,cmRASParamBandwidth,FALSE,0,&bw,NULL);\n"
   "2640\t      
cmRASSetParam(hsRas,cmRASTrPartConfirm,cmRASParamBandwidth,0,bw,NULL);\n"
   "2641\t      
cmRASSetParam(hsRas,cmRASTrPartConfirm,cmRASParamCallModel,0,cmRASCallModelTypeGKRouted,NULL);\n"
   "2642\t      rgrasSetReplyAddress(hsRas,cmRASTrPartConfirm);\n"
   "2643\t      /*fix this so it closes hsCall*/\n"
   "2644\t\t\t\t/* let the app hook to the disconnect message before sending it 
- NL_9_26 */\n"
   "2645\t\t\t\thookToCall((gkHCALL)GKCCI_NO_GKHCALL, (gkHAPPCALL 
*)GKCCI_NO_GKHAPPCALL, hsCall, hsRas,  gkcciMsgSendDisconnect, 
gkcciSideDest);\n"
   "2646\t      return cmuConfirm(hsRas);\n"
   "2647\t    }\n"
   "2648\t  }\n"
   "2649\t#endif\n"
   "2650\t  \n"
   "2651\t    if (CALL_NEW(haCall))/*newnatan 28/8.otherwise the stack does the 
association and there is no need to double check it*/\n"
   "2652\t        locateARQCall(hsRas,hsCall,&cl);\n"
   "2653\t    else\n"
   "2654\t        cl=getCall(haCall,&side);\n"
   "2655\t    \n"
   "2656\t    /*\n"
   "2657\t    if ((cl!=getCall(haCall,&side)) && (!CALL_NEW(haCall))) {\n"
   "2658\t            CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8789, cl,\"call handle in contradiction to ARQ info in 
handleDestinationARQ for call %d\",cl )); \n"
   "2659\t      }\n"
   "2660\t    */\n"
   "2661\t  \n"
   "2662\t    if (VALID(cl)) {      /* answering existing call */\n"
   "2663\t        /* check if stack handles match, otherwise reject the call 
*/\n"
   "2664\t        if((hsCall != CL.DEST.stack) && (CL.DEST.stack != NULL) ) { 
/* something wrong in finding that call belonging */\n"
   "2665\t    \n"
   "2666\t            retCode = ARJ(hsRas, cmRASReasonUndefined, -1, 
DESTINATION);\n"
   "2667\t            if (!closeCallHandle(hsCall,CL.DEST.stack))\n"
   "2668\t                retCode = FALSE;\n"
   "2669\t            return retCode;\n"
   "2670\t        }\n"
   "2671\t    \n"
   "2672\t        /* check that the destination was not disconnected already\n"
   "2673\t           because of the application, if so reject ARQ */\n"
   "2674\t    \n"
   "2675\t        if ((CL.destState == DEST_APP_DISCONNECTED ) || \n"
   "2676\t            (CL.destState == DEST_APP_INITIATED_DISCONNECT )) {\n"
   "2677\t            CL.reason = RSN_APP_DISCONNECT_DEST;\n"
   "2678\t            retCode = ARJ(hsRas, cmRASReasonUndefined, cl, 
DESTINATION);\n"
   "2679\t            if (!closeCallHandle(hsCall,CL.DEST.stack))\n"
   "2680\t                retCode = FALSE;\n"
   "2681\t            return retCode;\n"
   "2682\t        }\n"
   "2683\t    \n"
   "2684\t        /* newnaomi. solve the problem of disconnecting the call 
before getting the ARQ */\n"
   "2685\t        if( (CL.state == CAL_DISCONNECT ) || (CL.state == 
CAL_EXPECTING_DRQ ) || \n"
   "2686\t            (CL.state == CAL_EXPECTING_DRQ_TO_HUNT )  || (CL.state == 
CAL_CANNOT_COMPLETE)) {\n"
   "2687\t        \n"
   "2688\t            retCode = ARJ(hsRas, cmRASReasonUndefined, cl, 
DESTINATION);\n"
   "2689\t            if (!closeCallHandle(hsCall,CL.DEST.stack))\n"
   "2690\t                retCode = FALSE;\n"
   "2691\t            return retCode;\n"
   "2692\t        }\n"
   "2693\t\n"
   "2694\t        /* check that the destinatio"
<- "n didn\'t send ARQ already */\n"
   "2695\t        if(CL.DEST.ARQ != NULL) {\n"
   "2696\t            CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8736, cl,\"Call already received ARQ from destination\")); 
\n"
   "2697\t            retCode = ARJ(hsRas, cmRASReasonUndefined, -1, 
DESTINATION);\n"
   "2698\t            if (!closeCallHandle(hsCall,CL.DEST.stack))\n"
   "2699\t                retCode = FALSE;\n"
   "2700\t            return retCode;\n"
   "2701\t        }\n"
   "2702\t\t\t\n"
   "2703\t        /* neweli ??????????????*/\n"
   "2704\t\t    CL.infoSrc = NO_INFORMATION;\n"
   "2705\t\t    if (loadFromARQ(hsRas, DESTINATION, cl) == FALSE) {       \n"
   "2706\t            CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8740, cl, \"handleDestinationARQ: failed to read 
destination ARQ info\"));\n"
   "2707\t            ARJ(hsRas,cmRASReasonUndefined,cl,DESTINATION);\n"
   "2708\t            return FALSE;\n"
   "2709\t        }\n"
   "2710\t\t    /* neweli ??????????????*/\n"
   "2711\t\n"
   "2712\t        CALL_NOTIFY(\"Answering existing Call \",GEN_NA,20,cl);\n"
   "2713\t        CL.DEST.ARQ=hsRas;\n"
   "2714\t        CL.DEST.reg=endpoint;\n"
   "2715\t        rgtblEndpointType(RGTBL_GET, CL.DEST.reg, 
&(CL.DEST.endpointType));\n"
   "2716\t        /*xyx check if exist */\n"
   "2717\t        CL.DEST.stack=hsCall;\n"
   "2718\t        cmuGetParam(&message,cmRASParamCRV,FALSE,0,&tmp,NULL);\n"
   "2719\t        CL.DEST.CRVras = tmp;\n"
   "2720\t    \t    \n"
   "2721\t        
cmuGetParam(&message,cmRASParamDestinationIpAddress,FALSE,0,&tmp,(char*)&(CL.DEST.UDPAddress));\n"
   "2722\t        cmSetCallHandle(hsCall,(HAPPCALL)&(CL.DEST.callNo));\n"
   "2723\t        CL.isARQ = ARQ_DEST;\n"
   "2724\t    \n"
   "2725\t        if(!sendMsgEvent(cl, gkcciMsgReceiveARQ, gkcciSideDest)) {    
   \n"
   "2726\t            CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8737, cl, \"handleDestinationARQ: Failed in sending ARQ 
receive message notification to the application\"));\n"
   "2727\t            return FALSE;\n"
   "2728\t        }                   \n"
   "2729\t        if (endpoint==RGTBL_REG_NOT_VALID) {\n"
   "2730\t            CALL_NOTIFY(\"bad endpID.endpoint sending admission 
(destination) could not be identified in the registration 
table\",GEN_NA,0,cl);\n"
   "2731\t            DBGL_CONDITION(40,gkPAR());\n"
   "2732\t            CL.reason = RSN_INVALID_ENDPOINT;\n"
   "2733\t            return 
ARJ(hsRas,cmRASReasonInvalidEndpointID,cl,DESTINATION); /* the application get 
notified ny the ARJ */\n"
   "2734\t        }\n"
   "2735\t    \n"
   "2736\t        if (!rgtblIncrCallCount(endpoint)) {\n"
   "2737\t            CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8613, cl, \"handleOriginARQ: Failed to increment 
registration\'s call count\"));\n"
   "2738\t        }\n"
   "2739\t\n"
   "2740\t        rgtblAccessActivityFlag(RGTBL_SET,endpoint,&wasActive);\n"
   "2741\t    \n"
   "2742\t        cmuGetParam(&message,cmRASParamBandwidth,FALSE,0,&tmp,NULL); 
CL.DEST.bw.bwReq=tmp;\n"
   "2743\t        if 
(!bwSendBandwidthEvent(cl,DESTINATION,gkcciARQBW,gkcciBWRsnUndefined)) {\n"
   "2744\t            CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8738, cl,\"handleDestARQ: Failed in sending bandwidth event 
to the application\"));\n"
   "2745\t            return ARJ(hsRas,cmRASReasonUndefined,cl,DESTINATION);\n"
   "2746\t        }\n"
   "2747\t\n"
   "2748\t    }\n"
   "2749\t    else {/* answering NON existing call */\n"
   "2750\t        if (!assignCall(&cl)) {\n"
   "2751\t      \n"
   "2752\t            CALL_NOTIFY(\"Destination ARQ: Failed to create new 
call\",GEN_NA,10,cl);\n"
   "2753\t            DBGL_CONDITION(50,gkPAC());\n"
   "2754\t      \n"
   "2755\t            return 
newCallDisconnect(CAL_NULL_INDEX,hsCall,cmReasonTypeGatekeeperResource, \n"
   "2756\t                hsRas, cmRASReasonResourceUnavailable, DESTINATION, 
\n"
   "2757\t                gkcciSttAdmissionReject, 
gkcciRsnResourceUnavailable);\n"
   "2758\t        }\n"
   "2759\t\n"
   "2760\t        CL.handle = generateHandle(cl); /* also sets the auth field 
*/\n"
   "2761\t        CALL_NOTIFY(\"Creating new call\",GEN_NA,30,cl);\n"
   "2762\t        CL.isARQ = ARQ_DEST;\n"
   "2763\t        CL.DEST.ARQ=hsRas;\n"
   "2764\t\t\t\n"
   "2765\t        
cmuGetParam(&message,cmRASParamCRV,FALSE,0,&tmp,NULL);CL.DEST.CRVras = tmp;\n"
   "2766\t        CL.DEST.CRVras = tmp;\n"
   "2767\t\t\t\n"
   "2768\t        
cmuGetParam(&message,cmRASParamDestinationIpAddress,FALSE,0,&tmp,(char*)&(CL.DEST.UDPAddress));\n"
   "2769\t        rgtblEndpointType(RGTBL_GET, CL.DEST.reg, 
&(CL.DEST.endpointType));\n"
   "2770\t        CL.DES"
<- "T.reg=endpoint;\n"
   "2771\t    \n"
   "2772\t        if (!rgtblIncrCallCount(endpoint)) {\n"
   "2773\t            CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8613, cl, \"handleOriginARQ: Failed to increment 
registration\'s call count\"));\n"
   "2774\t        }\n"
   "2775\t        \n"
   "2776\t        if (CL.infoSrc != SETUP_INFORMATION) {\n"
   "2777\t            if (loadFromARQ(hsRas, DESTINATION, cl) == FALSE) {       
\n"
   "2778\t                CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8740, cl, \"handleDestinationARQ: failed to read 
destination ARQ info\"));\n"
   "2779\t                ARJ(hsRas,cmRASReasonUndefined,cl,DESTINATION);\n"
   "2780\t                return FALSE;\n"
   "2781\t            }\n"
   "2782\t        }\n"
   "2783\t    \n"
   "2784\t        
cmuGetParam(&message,cmRASParamBandwidth,FALSE,0,&tmp,NULL);\n"
   "2785\t        CL.DEST.bw.bwReq=tmp;\n"
   "2786\t        cmSetCallHandle(hsCall,(HAPPCALL)&(CL.DEST.callNo));\n"
   "2787\t        CL.DEST.stack=hsCall;/*newnatan 7_6 this and prev line were 
previoulsy after the message*/ \n"
   "2788\t    \n"
   "2789\t        if(!sendMsgEvent(cl, gkcciMsgReceiveARQ, gkcciSideDest)) {    
   \n"
   "2790\t            CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8741, cl, \"handleDestinationARQ: Failed in sending ARQ 
receive message notification to the application\"));\n"
   "2791\t            return ARJ(hsRas,cmRASReasonUndefined,cl,DESTINATION);\n"
   "2792\t        }\n"
   "2793\t        if 
(!bwSendBandwidthEvent(cl,DESTINATION,gkcciARQBW,gkcciBWRsnUndefined)) {\n"
   "2794\t            CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8742, cl,\"handleDestARQ: Failed in sending bandwidth event 
to the application\"));\n"
   "2795\t            return ARJ(hsRas,cmRASReasonUndefined,cl,DESTINATION);\n"
   "2796\t        }\n"
   "2797\t\n"
   "2798\t        if (endpoint==RGTBL_REG_NOT_VALID) {\n"
   "2799\t            CALL_NOTIFY(\"bad endpID.endpoint sending admission 
(destination) could not be identified in the registration 
table\",GEN_NA,0,cl);\n"
   "2800\t            DBGL_CONDITION(40,gkPAR());\n"
   "2801\t            CL.reason = RSN_INVALID_ENDPOINT;\n"
   "2802\t            return 
ARJ(hsRas,cmRASReasonInvalidEndpointID,cl,DESTINATION);\n"
   "2803\t        }\n"
   "2804\t   \n"
   "2805\t\n"
   "2806\t/* start sohan changes for Main GK      */\n"
   "2807\t/* Destination ARQ is to be handled     */\n"
   "2808\t    {\n"
   "2809\t        struct alias_media_proxy *alias_vsu=NULL;\n"
   "2810\t        CALL_NOTIFY(\"Checking for Static Endpoints. Calling 
is_mainGK()\",GEN_NA,10,cl);\n"
   "2811\t        if (is_mainGK() && search_source_alias(CL.destInfo[0].string, 
CL.destInfo[0].length, &alias_vsu))\n"
   "2812\t        {\n"
   "2813\t                CALL_NOTIFY(\"Destination ARQ from static endpoint 
registered with Main GK/Normal GK. Allow call\",GEN_NA,10,cl);\n"
   "2814\t\n"
   "2815\t                retCode =  ACF(hsRas,cl,DESTINATION);\n"
   "2816\t// Fix for Bug No: 67 Main Gatekeeper requires a dedicated MRC\n"
   "2817\t/* start sohan*/\n"
   "2818\t#if 1\n"
   "2819\t                        CALL_NOTIFY(\"handleOriginARQ: Diverted call 
successfully. Clearing registration Info.- beginning disengaing 
process\",GEN_NA,10,-1);\n"
   "2820\t                        if (VALID(cl))\n"
   "2821\t                        {\n"
   "2822\t                                side_t  side;\n"
   "2823\t                                if(CL.callsTOCounter == 0)\n"
   "2824\t                                        CL.callsTOCounter++;\n"
   "2825\t                                if (CL.ORIG.stack)\n"
   "2826\t                                {\n"
   "2827\t                                        side = ORIGIN;\n"
   "2828\t                                        
CALL_NOTIFY(\"handleOriginARQ: clearARQMainGK - ORIGIN\",GEN_NA,10,-1);\n"
   "2829\t                                        
clearARQMainGK((HAPPRAS)&(CL.SIDE.callNo),hsRas);\n"
   "2830\t                                }\n"
   "2831\t                                if (CL.DEST.stack)\n"
   "2832\t                                {\n"
   "2833\t                                        side = DESTINATION;\n"
   "2834\t                                        
CALL_NOTIFY(\"handleOriginARQ: clearARQMainGK - DESTINATION\",GEN_NA,10,-1);\n"
   "2835\t                                        
clearARQMainGK((HAPPRAS)&(CL.SIDE.callNo),hsRas);\n"
   "2836\t                                }\n"
   "2837\t                        }\n"
   "2838\t                        else\n"
   "2839\t                                CALL_EXC"
<- "EPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 9000, cl, 
\"handleOriginARQ: Invalid cl. Failed to call calDRQTimeout\"));\n"
   "2840\t\n"
   "2841\t#endif\n"
   "2842\t#if 0\n"
   "2843\t                CALL_NOTIFY(\"handleDestinationARQ: Diverted call 
successfully. Clearing registration Info.- beginning disengaing 
process\",GEN_NA,10,-1);\n"
   "2844\t                if (CL.ORIG.ARQ || CL.DEST.ARQ)\n"
   "2845\t                {\n"
   "2846\t                        sendDRQMainGK(cl);\n"
   "2847\t                        CALL_NOTIFY(\"handleDestinationARQ: Call 
cmRASClose\",GEN_NA,10,-1);\n"
   "2848\t                        if (cmRASClose(hsRas)!=0)\n"
   "2849\t                        {\n"
   "2850\t                                
CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 9000, cl, 
\"handleOriginARQ: Failed to close RAS handle\"));\n"
   "2851\t                        }\n"
   "2852\t\n"
   "2853\t                        if (VALID(cl))\n"
   "2854\t                        {\n"
   "2855\t                                if (CL.ORIG.stack)\n"
   "2856\t                                {\n"
   "2857\t                                        teardownCall(cl, ORIGIN);\n"
   "2858\t                                        
CALL_NOTIFY(\"handleDestinationARQ: Call teardownCall - 
ORIGIN\",GEN_NA,10,-1);\n"
   "2859\t                                }\n"
   "2860\t                                if (CL.DEST.stack)\n"
   "2861\t                                {\n"
   "2862\t                                        teardownCall(cl, 
DESTINATION);\n"
   "2863\t                                        
CALL_NOTIFY(\"handleDestinationARQ: Call teardownCall - 
DESTINATION\",GEN_NA,10,-1);\n"
   "2864\t                                }\n"
   "2865\t                        }\n"
   "2866\t                        else\n"
   "2867\t                                
CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 9000, cl, 
\"handleOriginARQ: Invalid cl. Failed to teardown call\"));\n"
   "2868\t                }\n"
   "2869\t#endif\n"
   "2870\t                return retCode;\n"
   "2871\t/* End sohan */\n"
   "2872\t        }\n"
   "2873\t        else\n"
   "2874\t        if (CL.model == cmRASCallModelTypeGKRouted)/*newnatan 
19/8*/\n"
   "2875\t        {\n"
   "2876\t                CALL_NOTIFY(\"call initiator should route the call to 
gatekeeper\",GEN_NA,10,cl);\n"
   "2877\t                CL.reason = RSN_ROUTE_CALL_TO_GK;\n"
   "2878\t                return 
ARJ(hsRas,cmRASReasonRouteCallToGatekeeper,cl,DESTINATION);\n"
   "2879\t        }\n"
   "2880\t    }\n"
   "2881\t/* End sohan changes for Main GK        */\n"
   "2882\t \n"
   "2883\t    \n"
   "2884\t        /* don\'t send ACF, notify the application and wait for reply 
*/\n"
   "2885\t        /*\n"
   "2886\t        return ACF(hsRas,cl,DESTINATION);  \n"
   "2887\t        */\n"
   "2888\t    } /* else */\n"
   "2889\t  \n"
   "2890\t    \n"
   "2891\t    /* save previous call state, so we\'ll know where to continue 
after approval */\n"
   "2892\t    CL.previousState = CL.state;\n"
   "2893\t    CHANGE_STATE(CAL_WAIT_DEST_ADMISSION, \"waiting for application 
to approve destination ARQ\");\n"
   "2894\t    if(!sendStateEvent(cl, gkcciSttWaitDestAdmission, 
gkcciRsnUndefined)) {\n"
   "2895\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8743, cl,\"handleDestinationARQ: Failed in sending destination admission 
request to the application\"));\n"
   "2896\t        (void)stopCall(cl, RSN_FAILURE_EVENT_HANDLER, 
cmReasonTypeUndefinedReason,\n"
   "2897\t            cmReasonTypeUndefinedReason, cmRASReasonUndefined); \n"
   "2898\t        return FALSE;\n"
   "2899\t    }\n"
   "2900\t    return TRUE;\n"
   "2901\t}\n"
   "2902\t\n"
   "2903\t\n"
   "2904\tBOOL calBRQ(/*recieving a BRQ*/\n"
   "2905\t             IN HRAS hsRas,\n"
   "2906\t             IN HCALL  hsCall,\n"
   "2907\t             IN HAPPCALL haCall)\n"
   "2908\t{\n"
   "2909\t  int cl;\n"
   "2910\t  side_t side;\n"
   "2911\t  \n"
   "2912\t  /* let the application handle the message first */\n"
   "2913\t  /* the call handle which the application will see is the handle 
which */\n"
   "2914\t  /* is already associated with the call in the GK, if applicable. 
The hsCall */\n"
   "2915\t  /* in the argument list might be a new handle which the stack 
allocated because */\n"
   "2916\t  /* the message seemed to refer to a non-existing call */\n"
   "2917\t\tif (CALL_NEW(haCall))\n"
   "2918\t\t\tassocReqToCall(hsRas,&cl,&side);/*might be a recovered call*/\n"
   "2919\t\telse\n"
   "2920\t\t\tcl=getCall(haCall,&side);\n"
   "2921\t\treturn bwBRQ(hsRas,hsCall,haCall,cl,side);\n"
   "2922\t}\n"
   "2923\t\n"
   
"2924\t/*----------------------------------------------------------------------------*/
 \n"
   
"2925\t/*----------------------------------------------------------------------------*/
 \n"
   "2926\tBOOL calDRQ(\n"
   "2927\t            IN HRAS hsRas,\n"
   "2928\t            IN HCALL  hsCall,\n"
   "2929\t            IN HAPPCALL haCall,\n"
   "2930\t            IN cmRASTransport * srcAddress)\n"
   "2931\t{\n"
   "2932\t  int cl, retCode=TRUE;\n"
   "2933\t  side_t side;\n"
   "2934\t  gkcciSide_t msgside;\n"
   "2935\t  HCALL handle = NULL;\n"
   "2936\t  gkHCALL gkhCall = (gkHCALL)GKCCI_NO_GKHCALL;\n"
   "2937\t  /* gkHAPPCALL tmp = (gkHAPPCALL)GKCCI_NO_GKHAPPCALL;\n"
   "2938\t  gkHAPPCALL *gkhaCallAddr = &tmp; */\n"
   "2939\t  gkHAPPCALL *gkhaCallAddr = NULL;\n"
   "2940\t  UINT16 endpointCall,endpointMessage;\n"
   "2941\t  BOOL error;\n"
   "2942\t  char buf[120];\n"
   "2943\t  cmuMessage_t message;\n"
   "2944\t  cmuLoadParams(message,CMU_RAS,hsRas,cmRASTrPartRequest,NULL);\n"
   "2945\t  \n"
   "2946\t  /* let the application process the message first */\n"
   "2947\t  /* see calBRQ for remarks */\n"
   "2948\t\tif (CALL_NEW(haCall))\n"
   "2949\t\t\tassocReqToCall(hsRas,&cl,&side);/*might be a recovered call*/\n"
   "2950\t\telse\n"
   "2951\t\t\tcl=getCall(haCall,&side);\n"
   "2952\t  msgside = (side == ORIGIN ? gkcciSideOrig : gkcciSideDest);\n"
   "2953\t  if (VALID(cl)) {\n"
   "2954\t    gkhCall = (gkHCALL)CL.handle; \n"
   "2955\t    gkhaCallAddr = &CL.appHandle;\n"
   "2956\t    getCallHandle(cl, (gkcciSide_t)side, &handle);\n"
   "2957\t    /*set the DRQ time for that call*/\n"
   "2958\t    if(CL.timeOfDRQ == 0)   /*this is the first DRQ*/\n"
   "2959\t\t   CL.timeOfDRQ = gkTiSeconds();\n"
   "2960\t  }\n"
   "2961\t  /*else ?\tneweli*/\n"
   "2962\t  \n"
   "2963\t  hookToCall(gkhCall, gkhaCallAddr, handle, hsRas, 
gkcciMsgReceiveDRQ, msgside);\n"
   "2964\t  \n"
   "2965\t  if (!VALID(cl) || (CALL_NEW(haCall) && !CL.SIDE.recovered))\n"
   "2966\t  {\n"
   "2967\t/*The OR part detects if newCall occured on a regular call that is 
not a recovered one*/\n"
   "2968\t    sprintf(buf,\"not a valid call on calDRQ from %s 
\",addIpToString(srcAddress));\n"
   "2969\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8744, 
cl,buf));\n"
   "2970\t    retCode = DRJ(hsRas, cmRASReasonNotRegistered, CAL_NULL_INDEX, 
ORIGIN); \n"
   "2971\t    if (!closeCallHandle(hsCall,NULL))\n"
   "2972\t      retCode = FALSE;\n"
   "2973\t    return retCode;\n"
   "2974\t  }\n"
   "2975\t\tif (CL.SIDE.recovered && CL.SIDE.dummyStack) {\n"
   "2976\t/*if the recovered call holds a dummy hsCall, drop it and store the 
real one*/\n"
   "2977\t\t\tcmSetCallHandle(CL.SIDE.stack,(HAPPCALL)NULL);\n"
   "2978\t\t\tcallDropParam(cl, 
side,CL.SIDE.stack,cmReasonTypeUndefinedReason);\n"
   "2979\t\t\tCL.SIDE.stack = hsCall;\n"
   "2980\t\t\tcmSetCallHandle(CL.SIDE.stack,(HAPPCALL)(&CL.SIDE.callNo));\n"
   "2981\t\t\tCL.SIDE.dummyStack = FALSE;\n"
   "2982\t\t}\n"
   "2983\t\n"
   "2984\t\t\n"
   "2985\t  if ((CL.SIDE.stack == NULL) || (hsCall != 
CL.SIDE.stack))/*newnatan*/\n"
   "2986\t  {\n"
   "2987\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8745, 
cl,\"callHandle mismatch in calDRQ\"));\n"
   "2988\t    DRJ(hsRas, cmRASReasonNotRegistered, CAL_NULL_INDEX, ORIGIN);\n"
   "2989\t    closeCallHandle(hsCall,CL.SIDE.stack);\n"
   "2990\t    return FALSE;\n"
   "2991\t  }\n"
   "2992\t  /*from now on hsRas and CL.SIDE.stack match*/\n"
   "2993\t  if (!rgsrIdentify(&message,&endpointMessage))\n"
   "2994\t  {\n"
   "2995\t    sprintf(buf,\"endpIdentify failed in calDRQ from %s 
\",addIpToString(srcAddress));\n"
   "2996\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8746, 
cl,buf));\n"
   "2997\t    DRJ(hsRas,cmRASReasonNotRegistered, CAL_NULL_INDEX, ORIGIN);\n"
   "2998\t    return FALSE;\n"
   "2999\t  }\n"
   "3000\t  CL.SIDE.DRQ = hsRas;\n"
   "3001\t  CALL_NOTIFY(\"block\",GEN_NA,10,cl);\n"
   "3002\t  if (side == ORIGIN)\n"
   "3003\t  {\n"
   "3004\t    sprintf(buf,\"disengage request from %s(origin). 
endpoint=%i\",addIpToString(srcAddress),CL.SIDE.reg);\n"
   "3005\t    CALL_NOTIFY(buf,GEN_NA,10,cl);\n"
   "3006\t  }\n"
   "3007\t  if (side == DESTINATION)\n"
   "3008\t  {\n"
   "3009\t    sprintf(buf,\"disengage request from %s(destination). 
endpoint=%i\",addIpToString(srcAddress),CL.SIDE.reg);\n"
   "3010\t    CALL_NOTIFY(buf,GEN_NA,10,cl);\n"
   "3011\t  }\n"
   "3012\t  endpointCall=CL.SIDE.reg;/*newnatan 7_6 this was previoulsy after 
the message*/\n"
   "3013\t  if(!sendMsgEvent(cl, gkcciMsgReceiveDRQ, (side == 
ORIGIN?gkcciSideOrig:gkcciSideDest)))\n"
   "3014\t  {       \n"
   "3015\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8747, 
cl, \"calDRQ: Failed in sending DRQ receive message notification to 
application\"));\n"
   "3016\t  }          \n"
   "3017\t  if ((endpointCall!=endpointMessage) || (CL.SI"
<- "DE.ARQ==(HRAS)NULL))\n"
   "3018\t  {\n"
   "3019\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8748, 
cl,\"endpoint mismatch at calDRQ or DRQ before admission\"));\n"
   "3020\t    return DRJ(hsRas, cmRASReasonNotRegistered, cl, side);\n"
   "3021\t  }\n"
   "3022\t  error=!DCF(hsRas,cl,side);\n"
   "3023\t  CL.SIDE.DRQ = (HRAS)NULL;\n"
   "3024\t  /* notify application */\n"
   "3025\t  if(!sendStateEvent(cl , gkcciSttDCFSent, 
(side==ORIGIN?gkcciRsnDCFToOrig:gkcciRsnDCFToDest) ))\n"
   "3026\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8749, 
cl,\"calDRQ: Error calling the application callback\"));          \n"
   "3027\t\n"
   "3028\t  releaseARQ(cl,side);\n"
   "3029\t\n"
   "3030\t  /* BUG3001:*/\n"
   "3031\t  /* for asynchronous proceeding of arrived ARQ the next situation is 
possible:\n"
   "3032\t     Before GK send back ACF to endpoint, DRQ arrives from the 
endpoint.\n"
   "3033\t     GK didn\'t reach CAL_RAS_CONNECT state for source ARQ proceeding 
or \n"
   "3034\t     CAL_HUNT state for destination ARQ. But it must go to CALL_IDLE 
state.\n"
   "3035\t     Therefore one more test for \'current call state = 
CAL_WAIT_ORIG_ADMISSION || \n"
   "3036\t     CAL_ADDRESS_RESOLUTION || CAL_WAIT_ADDRCMPLT\' - states of the 
call between source \n"
   "3037\t     ARQ receive and ACF send moments was added before initiating 
pass to \n"
   "3038\t     CALL_IDLE state by call \'callDropParam()\' */\n"
   "3039\t  if ( (CL.model== cmRASCallModelTypeDirect) ||   \n"
   "3040\t  (CL.state == CAL_RAS_CONNECT) || (CL.state == CAL_LRQ_SENT) ||\n"
   "3041\t  (CL.state == CAL_WAIT_ORIG_ADMISSION || CL.state == 
CAL_ADDRESS_RESOLUTION || CL.state == CAL_WAIT_ADDRCMPLT))   /* this will cause 
the disconnect event\n"
   "3042\t                                                                  
that will drive on the state machine \n"
   "3043\t                                                                  in 
this cases */\n"
   "3044\t  {\n"
   "3045\t\n"
   "3046\t    if(!sendMsgEvent(cl, gkcciMsgSendDisconnect, (side == 
ORIGIN?gkcciSideOrig:gkcciSideDest))) \n"
   "3047\t    {     \n"
   "3048\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8750, cl, \"calDRQ: Failed in sending disconnect send message notification to 
application\"));\n"
   "3049\t    }\n"
   "3050\t\n"
   "3051\t/*    appendSupplementaryServices(cl, side);*/\n"
   "3052\t\n"
   "3053\t\t\t/* let the app hook to the disconnect message before sending it - 
NL_9_26 */\n"
   "3054\t\t\thookToCall((gkHCALL)CL.handle, (gkHAPPCALL *)&CL.appHandle, 
CL.SIDE.stack,\n"
   "3055\t\t\t\t(HRAS)GKCCI_NO_HSRAS,  gkcciMsgSendDisconnect, (side == 
ORIGIN?gkcciSideOrig:gkcciSideDest));\n"
   "3056\t\n"
   "3057\t    error=((callDropParam(cl, side, 
CL.SIDE.stack,cmReasonTypeUndefinedReason)!=0) || error);\n"
   "3058\t  }\n"
   "3059\t  \n"
   "3060\t  else /* routed */\n"
   "3061\t    if ((CL.state == CAL_EXPECTING_DRQ) || (CL.state 
==CAL_EXPECTING_DRQ_TO_HUNT)) \n"
   "3062\t    {\n"
   "3063\t      if (side==ORIGIN)\n"
   "3064\t        error=(!terminateOrigin(cl))||error;\n"
   "3065\t      else\n"
   "3066\t        error=(!terminateDestination(cl))||error;\n"
   "3067\t    }\n"
   "3068\t      \n"
   "3069\t  return !error;\n"
   "3070\t      \n"
   "3071\t}\n"
   "3072\t\n"
   
"3073\t/*----------------------------------------------------------------------------*/
         \n"
   "3074\tBOOL calDCF(\n"
   "3075\t            IN HAPPRAS haRas,\n"
   "3076\t            IN HRAS    hsRas)\n"
   "3077\t            \n"
   "3078\t{\n"
   "3079\t  int cl;\n"
   "3080\t  side_t side;\n"
   "3081\t\tgkcciSide_t hside;\n"
   "3082\t  \n"
   "3083\t\n"
   "3084\t  cl=getCall((HAPPCALL)haRas,&side);\n"
   "3085\t\thside = (side == ORIGIN) ? gkcciSideOrig:gkcciSideDest;\n"
   "3086\t\t/* let the application access the message. NL9_26*/\n"
   "3087\t\tif (VALID(cl))\n"
   "3088\t\t\thookToCall((gkHCALL)CL.handle, (gkHAPPCALL *)&CL.appHandle, NULL, 
hsRas, gkcciMsgReceiveDCF, hside);\n"
   "3089\t\telse\n"
   "3090\t\t\thookToCall((gkHCALL)GKCCI_NO_GKHCALL, (gkHAPPCALL 
*)GKCCI_NO_GKHAPPCALL, NULL, hsRas, gkcciMsgReceiveDCF, hside);\n"
   "3091\t  if(VALID(cl))\n"
   "3092\t  {\n"
   "3093\t    CL.SIDE.EPDCF = hsRas;\n"
   "3094\t    if(!sendMsgEvent(cl, gkcciMsgReceiveDCF, (side == 
ORIGIN?gkcciSideOrig:gkcciSideDest)))\n"
   "3095\t    {       \n"
   "3096\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8751, cl, \"calDCF: Failed in sending DCF receive message notification to 
application\"));\n"
   "3097\t    }\n"
   "3098\t    CL.SIDE.EPDCF = (HRAS)NULL;\n"
   "3099\t  }\n"
   "3100\t  \n"
   "3101\t  CALL_NOTIFY(\"recieved DCF - beginning disengaing 
process\",GEN_NA,10,cl);\n"
   "3102\t  if (cmRASClose(hsRas)!=0)\n"
   "3103\t  {\n"
   "3104\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 9000, 
cl, \"calDCF: Failed to close RAS handle\"));\n"
   "3105\t  }\n"
   "3106\t  return teardownCall(cl, side);\n"
   "3107\t}\n"
   
"3108\t/*----------------------------------------------------------------------------*/\n"
   "3109\tBOOL calDRJ(\n"
   "3110\t            IN HAPPRAS haRas,\n"
   "3111\t            IN HRAS    hsRas,\n"
   "3112\t            IN cmRASReason reason)\n"
   "3113\t            \n"
   "3114\t{\n"
   "3115\t  int cl;\n"
   "3116\t  side_t side;\n"
   "3117\t  gkcciSide_t hside;\n"
   "3118\t\n"
   "3119\t  if(reason);\n"
   "3120\t  cl=getCall((HAPPCALL)haRas,&side);\n"
   "3121\t\thside = (side == ORIGIN) ? gkcciSideOrig:gkcciSideDest;\n"
   "3122\t\n"
   "3123\t\t/* let the application access the message. NL9_26*/\n"
   "3124\t\tif (VALID(cl))\n"
   "3125\t\t\thookToCall((gkHCALL)CL.handle, (gkHAPPCALL *)&CL.appHandle, NULL, 
hsRas, gkcciMsgReceiveDRJ, hside);\n"
   "3126\t\telse\n"
   "3127\t\t\thookToCall((gkHCALL)GKCCI_NO_GKHCALL, (gkHAPPCALL 
*)GKCCI_NO_GKHAPPCALL, NULL, hsRas, gkcciMsgReceiveDRJ, hside);\n"
   "3128\t\n"
   "3129\t  if(VALID(cl))\n"
   "3130\t  {\n"
   "3131\t    CL.SIDE.EPDRJ = hsRas;\n"
   "3132\t    if(!sendMsgEvent(cl, gkcciMsgReceiveDRJ, (side == 
ORIGIN?gkcciSideOrig:gkcciSideDest)))\n"
   "3133\t    {       \n"
   "3134\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8752, cl, \"calDRJ: Failed in sending DRJ receive message notification to 
application\"));\n"
   "3135\t    }\n"
   "3136\t    CL.SIDE.EPDRJ = (HRAS)NULL;\n"
   "3137\t  }\n"
   "3138\t  CALL_NOTIFY(\"recieved DRJ - overuling the rejection and beginning 
disengaing process\",GEN_NA,10,cl);\n"
   "3139\t  if (cmRASClose(hsRas)!=0)\n"
   "3140\t  {\n"
   "3141\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 9000, 
cl, \"calDRJ: Failed to close RAS handle\"));\n"
   "3142\t  }\n"
   "3143\t  return teardownCall(cl, side);\n"
   "3144\t}  \n"
   "3145\t\n"
   
"3146\t/*----------------------------------------------------------------------------*/
  \n"
   "3147\tBOOL calDRQTimeout(/*a gk DRQ has been replied with a timeout*/\n"
   "3148\t                   IN HAPPRAS haRas,\n"
   "3149\t                   IN HRAS    hsRas)\n"
   "3150\t                   \n"
   "3151\t            \n"
   "3152\t{\n"
   "3153\t  side_t side;\n"
   "3154\t  int cl=getCall((HAPPCALL)haRas,&side);\n"
   "3155\t  CALL_NOTIFY(\"recieved timeout on DRQ - beginning disengaing 
process\",GEN_NA,10,-1);\n"
   "3156\t  if (cmRASClose(hsRas)!=0)\n"
   "3157\t  {\n"
   "3158\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 9000, 
cl, \"calDRQTimeout: Failed to close RAS handle\"));\n"
   "3159\t  }\n"
   "3160\t  return teardownCall(cl, side);\n"
   "3161\t}\n"
   "3162\t\n"
   "3163\t\n"
   
"3164\t/*----------------------------------------------------------------------------*/
  \n"
   
"3165\t/*----------------------------------------------------------------------------*/
  \n"
   "3166\t/* Description: send LRQ message                           */\n"
   "3167\t/* The lrq\'s will be issued in the order listed in the lrqStage_t 
enumeration (provided the\n"
   "3168\t   application wants to send an lrq to those gks) if the \"lrq 
simultaneously\" is true, lrq\'s\n"
   "3169\t   will be sent to all gks (ldap, dns, neighbors etc.) at once */\n"
   "3170\t\n"
   "3171\t/* The neighbor destination GK are selected in the following order: 
*/\n"
   "3172\t/* 1. Neiboughrs with matched zone prefix to the dialed number */\n"
   "3173\t/* 2. If not found, Neiboughrs without zone prefix             */\n"
   "3174\t/* 3. And if multicast is enabled, send mcast LRQ              */\n"
   "3175\tBOOL LRQ( /*issue LRQ message */\n"
   "3176\t         IN int cl)\n"
   "3177\t{\n"
   "3178\t  UINT16 i,j,neighbor,maxNbr;\n"
   "3179\t  HRAS\thsRas;\n"
   "3180\t  char gk_id[GKCFGI_GKIDLEN]; /*shiri 10/2000*/\n"
   "3181\t  HCALL hsCall;\n"
   "3182\t  cmRASTransport tatmp,*ta=&tatmp;\n"
   "3183\t  BOOL error=FALSE, *lrqLDAP,*lrqDNS,*lrqNeighbors, 
*simultaneously;\n"
   "3184\t\n"
   "3185\t  gkcfgGet(GKCFG_LRQ_LDAP,0,(void**)&lrqLDAP);\n"
   "3186\t  gkcfgGet(GKCFG_LRQ_DNS,0,(void**)&lrqDNS);\n"
   "3187\t  gkcfgGet(GKCFG_LRQ_NEIGHBORS,0,(void**)&lrqNeighbors);\n"
   "3188\t  gkcfgGet(GKCFG_LRQ_SIMULTANEOUSLY,0,(void**)&simultaneously);\n"
   "3189\t  maxNbr = net3MaxNbr();\n"
   "3190\t\n"
   "3191\t  CL.lrqStage = (lrqStage_t)((int)CL.lrqStage + 1); \n"
   "3192\t\n"
   "3193\t\tif (CL.lrqStage == LRQ_LDAP && *lrqLDAP) {\n"
   "3194\t\t\t/*LDAP*/\n"
   "3195\t\t\tCALL_NOTIFY(\"sending LRQ to LDAP GKs\",GEN_NA,10,cl);\n"
   "3196\t\t\tgkcfgiGetGKID(gk_id); /* shiri 10/2000*/\n"
   "3197\t\t\tfor (i = 0;i < GKCCI_MAX_SPECIFIED_GKS_FOR_LRQ;i++) {\n"
   "3198\t\t\t\tif ((strlen(CL.specifiedGksForLRQ[i]) != 0) &&\n"
   "3199\t\t\t\t\t(strcmp("
<- "CL.specifiedGksForLRQ[i], gk_id)!= 0)) /* shiri 10/2000 : in order not to 
send LRQ massege to your GK*/\n"
   "3200\t\t\t\t{\n"
   "3201\t\t\t\t\tfor (j=0;j<maxNbr;j++) {\n"
   "3202\t\t\t\t\t\tif (net3SameGkid(j,CL.specifiedGksForLRQ[i]) && 
rgutilNbrAvailable(CL.ORIG.reg,j)) {\n"
   "3203\t\t\t\t\t\t\terror = !sendLRQ2Nbr(j,cl) || error;\n"
   "3204\t\t\t\t\t\t}\n"
   "3205\t\t\t\t\t\t\n"
   "3206\t\t\t\t\t}\n"
   "3207\t\t\t\t}\n"
   "3208\t\t\t}\n"
   "3209\t\n"
   "3210\t        /* no LDAP gks were found or lrq simultaneously is true, 
advance to next \"lrq group\" */\n"
   "3211\t        if (!CL.waitForLRQanswer || *simultaneously)\n"
   "3212\t          CL.lrqStage = (lrqStage_t)((int)CL.lrqStage + 1);\n"
   "3213\t        if (!CL.waitForLRQanswer) \n"
   "3214\t        GK_NOTIFY(\"no LDAP GKS. Sending LRQ to rest of 
GKs\",GEN_NA,10);\n"
   "3215\t        \n"
   "3216\t\t}\n"
   "3217\t    if (CL.lrqStage == LRQ_LDAP && *lrqLDAP==FALSE)\n"
   "3218\t          CL.lrqStage = (lrqStage_t)((int)CL.lrqStage + 1);\n"
   "3219\t    if (CL.lrqStage == LRQ_DNS && *lrqDNS) {\n"
   "3220\t\t\t/*DNS*/\n"
   "3221\t\t\tCALL_NOTIFY(\"sending LRQ to DNS GKs\",GEN_NA,10,cl);\n"
   "3222\t\t\tfor (i = 0;i < GKCCI_MAX_NON_NEIGHBOR_GKS_FOR_LRQ;i++) {\n"
   "3223\t\t\t\tif (CL.nonNeighborGksforLRQ[i].ip != 0)\n"
   "3224\t                error = !sendLRQ2NonNbr(i,cl) || error;\n"
   "3225\t        }   \n"
   "3226\t         /* no DNS gks were found or lrq simultaneously is true, 
advance to next \"lrq group\" */\n"
   "3227\t        if (!CL.waitForLRQanswer || *simultaneously)\n"
   "3228\t              CL.lrqStage = (lrqStage_t)((int)CL.lrqStage + 1);\n"
   "3229\t        if (!CL.waitForLRQanswer)\n"
   "3230\t             GK_NOTIFY(\"no DNS GKS. Sending LRQ to rest of 
GKs\",GEN_NA,10);\n"
   "3231\t    } \n"
   "3232\t\n"
   "3233\t    if (CL.lrqStage == LRQ_DNS && *lrqDNS == FALSE)\n"
   "3234\t          CL.lrqStage = (lrqStage_t)((int)CL.lrqStage + 1);\n"
   "3235\t\t\n"
   "3236\t\tif (CL.lrqStage == LRQ_NEIGHBORS && *lrqNeighbors)\n"
   "3237\t\t{\n"
   "3238\t\t\tGK_NOTIFY(\"Sending LRQ to non LDAP neighbor GKs\",GEN_NA,10);\n"
   "3239\t\t\t/*the algorithm : find the first match between an alias and a 
zoneprefix. \n"
   "3240\t\t\tIf a match was found than for all nbrs with same prefix send lrq 
according to the distance limit of the endpoint*/\n"
   "3241\t\t\tnet3LocateNbr(CL.destInfo,DESTINATION_NUMBER,&neighbor);\n"
   "3242\t\t\tif (neighbor < maxNbr)\n"
   "3243\t\t\t{\n"
   "3244\t\t\t\tCALL_NOTIFY(\"found a nbr with matching zone prefix.checking 
distance permissions. nbr = \",neighbor,10,cl);\n"
   "3245\t\t\t\tfor (i=neighbor;i<maxNbr;i++)\n"
   "3246\t\t\t\t{\n"
   "3247\t\t\t\t\t\tif (net3SameZone(neighbor,i) && 
rgutilNbrAvailable(CL.ORIG.reg,i))\n"
   "3248\t\t\t\t\t\t\terror = !sendLRQ2Nbr(i,cl) || error;\n"
   "3249\t\t\t\t}\n"
   "3250\t\t\t}\n"
   "3251\t\t\telse\n"
   "3252\t\t\t{  \n"
   "3253\t\t\t\tCALL_NOTIFY(\"no nbr with matching zoneprefix.LRQ to nbrs 
without zone prefixes\",GEN_NA,10,cl);\n"
   "3254\t\t\t\tfor (i=0;i<maxNbr;i++)\n"
   "3255\t\t\t\t{\n"
   "3256\t\t\t\t\t\tif (!net3NbrHasZoneNum(i) && 
rgutilNbrAvailable(CL.ORIG.reg,i))\n"
   "3257\t\t\t\t\t\t\terror = !sendLRQ2Nbr(i,cl) || error;\n"
   "3258\t\t\t\t}\n"
   "3259\t        }\n"
   "3260\t        if (!CL.waitForLRQanswer || *simultaneously)\n"
   "3261\t              CL.lrqStage = (lrqStage_t)((int)CL.lrqStage + 1);\n"
   "3262\t    }\n"
   "3263\t\n"
   "3264\t    if (CL.lrqStage == LRQ_NEIGHBORS && *lrqNeighbors == FALSE)\n"
   "3265\t          CL.lrqStage = (lrqStage_t)((int)CL.lrqStage + 1);\n"
   "3266\t\n"
   "3267\t    if (CL.lrqStage == LRQ_MCAST)\n"
   "3268\t    {\n"
   "3269\t        if (sendMulticast(CL.ORIG.reg))\n"
   "3270\t\t\t{\n"
   "3271\t            CALL_NOTIFY(\"Issuing LRQ to mcast\",GEN_NA,10,cl);\n"
   
"3272\t\t\t\tSE(cmRASStartTransaction(dispStack,(HAPPRAS)(CL.ORIG.callNo),&hsRas,cmRASLocation,ta,CL.ORIG.stack));\n"
   
"3273\t\t\t\tcmRASSetParam(hsRas,cmRASTrPartRequest,cmRASParamMulticastTransaction,0,TRUE,(char*)NULL);\n"
   "3274\t\t\t\tloadAliasLRQ(cl,hsRas);\n"
   "3275\t\t\t\tCL.GKLRQ = hsRas;\n"
   "3276\t\t\t\tif(!sendStateEvent(cl, gkcciSttSendingLRQ,  
gkcciRsnUndefined))\n"
   "3277\t\t\t\t{       \n"
   "3278\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8753, cl, \"LRQ: Failed in sending LRQ notification to the application\"));     
\n"
   "3279\t\t\t\t\treturn FALSE;\n"
   "3280\t\t\t\t}          \n"
   "3281\t      \n"
   "3282\t\t\t\tif(!sendMsgEvent(cl, gkcciMsgSendGKLRQ, gkcciSideOrig))\n"
   "3283\t\t\t\t{       \n"
   "3284\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8754, cl, \"LRQ: Failed in sending GKLRQ send message notification to 
application\"));\n"
   "3285\t\t\t\t}\n"
   "3286\t\t\t\t/* xxx verify that the hook sends the correct values at this 
point */\n"
   "3287\t\t\t\tif (!getCallHandle(cl, gkcciSideOrig, &hsCall)"
<- ") hsCall = NULL;\n"
   "3288\t\t\t\thookToCall((gkHCALL)CL.handle , &CL.appHandle, hsCall ,hsRas, 
gkcciMsgSendGKLRQ, gkcciSideOrig);\n"
   "3289\t\t\t\tCL.GKLRQ = (HRAS)NULL;\n"
   "3290\t\t\t\terror=(cmRASRequest(hsRas)!=0);\n"
   "3291\t\t\t\tCL.mcastLRQ = hsRas;\n"
   "3292\t\t\t\tCL.waitForLRQanswer++;\n"
   "3293\t\t\t\tgkTiTimerSet(calLRQaudit, (void *)cl, 3000*dispConfigRASTO + 
100);\n"
   "3294\t        }\n"
   "3295\t\t}\n"
   "3296\t  \n"
   "3297\t  if (CL.waitForLRQanswer)\n"
   "3298\t  {\n"
   "3299\t    /* inform the application about sending LRQ for the call. Don\'t 
wait up */\n"
   "3300\t    CHANGE_STATE(CAL_LRQ_SENT,\"LRQ sent \");\n"
   "3301\t    CALL_NOTIFY(\"Number of LRQs for this call: 
\",CL.waitForLRQanswer,20,cl);\n"
   "3302\t    \n"
   "3303\t    CALL_NOTIFY(\"Sending LRQ notification to the 
application\",GEN_NA,31,cl);\n"
   "3304\t    if(!sendStateEvent(cl, gkcciSttLRQSent,  gkcciRsnUndefined))\n"
   "3305\t    {       \n"
   "3306\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8755, cl, \"LRQ: Failed in sending LRQ notification to the application\"));     
\n"
   "3307\t      return FALSE;\n"
   "3308\t    }          \n"
   "3309\t  }            \n"
   "3310\t  else\n"
   "3311\t  {\n"
   "3312\t      calReason_t calRsn;\n"
   "3313\t      gkcciReason_t gkcciRsn;\n"
   "3314\t      char str[32];\n"
   "3315\t  \n"
   "3316\t      if (CL.waitFurtherLRQ) /* DNS: if we expect further LRQs, 
return TRUE and wait */\n"
   "3317\t          return TRUE;\n"
   "3318\t    CALL_NOTIFY(\"No GKs to issue LRQ to\",GEN_NA,10,cl);\n"
   "3319\t    if (CL.state==CAL_LRQ_SENT) {\n"
   "3320\t        calRsn = RSN_LRQ_NOT_FOUND;\n"
   "3321\t        gkcciRsn = gkcciRsnLRQAddressNotFound;\n"
   "3322\t        strcpy (str, \"Address Not Found\");\n"
   "3323\t    }\n"
   "3324\t    else {\n"
   "3325\t        calRsn = RSN_CANNOT_SEND_LRQ;\n"
   "3326\t        gkcciRsn = gkcciRsnCannotSendLRQ;\n"
   "3327\t        strcpy (str, \"Cannot send LRQ\");\n"
   "3328\t    }\n"
   "3329\t    return handleCannotComplete( cl, calRsn, gkcciRsn, str);    \n"
   "3330\t  }\n"
   "3331\t  return !error;\n"
   "3332\t}\n"
   "3333\t\n"
   
"3334\t/*----------------------------------------------------------------------------*/\n"
   "3335\tBOOL sendLRQ2Nbr(\n"
   "3336\t                 UINT16 neighbor,\n"
   "3337\t                 int cl)\n"
   "3338\t{\n"
   "3339\t  HRAS\thsRas;\n"
   "3340\t  HCALL hsCall;\n"
   "3341\t  BOOL error = FALSE;\n"
   "3342\t  cmRASTransport tatmp,*ta=&tatmp;\n"
   "3343\t  \n"
   "3344\t  if (net3NbrLocation(neighbor,&ta))\n"
   "3345\t  {\n"
   "3346\t    if (!addEmptyTransport(ta))\n"
   "3347\t    {\n"
   "3348\t      CALL_NOTIFY(\"LRQ to nbr \",neighbor,10,cl);\n"
   "3349\t      CALL_NOTIFY(addIpToString(ta),GEN_NA,40,cl);\n"
   "3350\t      
error=(cmRASStartTransaction(dispStack,(HAPPRAS)(CL.ORIG.callNo),&hsRas,cmRASLocation,ta,CL.ORIG.stack)
 !=0) ||error;\n"
   "3351\t      loadAliasLRQ(cl,hsRas);\n"
   "3352\t      CL.GKLRQ = hsRas;\n"
   "3353\t      if(!sendStateEvent(cl, gkcciSttSendingLRQ,  
gkcciRsnUndefined))\n"
   "3354\t      {       \n"
   "3355\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8756, cl,\"LRQ: Failed in sending LRQ notification to the application\"));     
\n"
   "3356\t        return FALSE;\n"
   "3357\t      }          \n"
   "3358\t      if(!sendMsgEvent(cl, gkcciMsgSendGKLRQ, gkcciSideOrig))\n"
   "3359\t      {       \n"
   "3360\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8757, cl, \"sendLRQ2Nbr: Failed in sending GKLRQ send message notification to 
application.\"));\n"
   "3361\t        return FALSE;\n"
   "3362\t      } \n"
   "3363\t      /* xxx verify that the hook sends the correct values at this 
point */\n"
   "3364\t      if (!getCallHandle(cl, gkcciSideOrig, &hsCall)) hsCall = 
NULL;\n"
   "3365\t      hookToCall((gkHCALL)CL.handle, &CL.appHandle, hsCall ,hsRas, 
gkcciMsgSendGKLRQ, gkcciSideOrig);\n"
   "3366\t      CL.GKLRQ = (HRAS)NULL;\n"
   "3367\t      error=(cmRASRequest(hsRas)!=0) || error;\n"
   "3368\t      CL.waitForLRQanswer++;\n"
   "3369\t      CALL_NOTIFY(\"number of LRQ\'s sent: 
\",CL.waitForLRQanswer,20,cl);\n"
   "3370\t    }\n"
   "3371\t  }\n"
   "3372\t  return !error;\n"
   "3373\t}\n"
   "3374\t\n"
   "3375\tBOOL sendLRQ2NonNbr(\n"
   "3376\t                 UINT16 index,\n"
   "3377\t                 int cl)\n"
   "3378\t{\n"
   "3379\t  HRAS\thsRas;\n"
   "3380\t  HCALL hsCall;\n"
   "3381\t  BOOL error = FALSE;\n"
   "3382\t  cmRASTransport ta;\n"
   "3383\t  \n"
   "3384\t  ta.type=cmTransportTypeIP;\n"
   "3385\t  ta.ip=CL.nonNeighborGksforLRQ[index].ip;\n"
   "3386\t  ta.port=CL.nonNeighborGksforLRQ[index].port;\n"
   "3387\t  CALL_NOTIFY(\"LRQ to DNS gatekeeper \",GEN_NA,10,cl);\n"
   "3388\t  CALL_NOTIFY(addIpToString(&ta),GEN_NA,40,cl);\n"
   "3389\t  error=(cmRASStartTransaction(dispStack,(HAPPRAS)(CL.ORIG."
<- "callNo),&hsRas,cmRASLocation,&ta,CL.ORIG.stack) !=0) ||error;\n"
   "3390\t  loadAliasLRQ(cl,hsRas);\n"
   "3391\t  CL.GKLRQ = hsRas;\n"
   "3392\t  if(!sendStateEvent(cl, gkcciSttSendingLRQ,  gkcciRsnUndefined))\n"
   "3393\t  {       \n"
   "3394\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8756, cl,\"LRQ: Failed in sending LRQ notification to the application\"));     
\n"
   "3395\t      return FALSE;\n"
   "3396\t  } \n"
   "3397\t  if(!sendMsgEvent(cl, gkcciMsgSendGKLRQ, gkcciSideOrig))\n"
   "3398\t  {  \n"
   "3399\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8757, cl, \"sendLRQ2Nbr: Failed in sending GKLRQ send message notification to 
application.\"));\n"
   "3400\t      return FALSE;\n"
   "3401\t  } \n"
   "3402\t  /* xxx verify that the hook sends the correct values at this point 
*/\n"
   "3403\t  if (!getCallHandle(cl, gkcciSideOrig, &hsCall)) hsCall = NULL;\n"
   "3404\t  hookToCall((gkHCALL)CL.handle, &CL.appHandle, hsCall ,hsRas, 
gkcciMsgSendGKLRQ, gkcciSideOrig);\n"
   "3405\t  CL.GKLRQ = (HRAS)NULL;\n"
   "3406\t  error=(cmRASRequest(hsRas)!=0) || error;\n"
   "3407\t  CL.waitForLRQanswer++;\n"
   "3408\t  CALL_NOTIFY(\"number of LRQ\'s sent: 
\",CL.waitForLRQanswer,20,cl);\n"
   "3409\t  \n"
   "3410\t  return !error;\n"
   "3411\t}\n"
   "3412\t\n"
   
"3413\t/*----------------------------------------------------------------------------*/\n"
   "3414\tBOOL calLCF(/*recieving an LCF sent by another entity*/\n"
   "3415\t            IN HAPPRAS haRas,\n"
   "3416\t            IN HRAS    hsRas)\n"
   "3417\t            \n"
   "3418\t{\n"
   "3419\t  int cl = (UINT16)(UINTPTR)haRas;\n"
   "3420\t  BOOL error = FALSE, mcast, newDestInfo = FALSE, newDestTransport = 
FALSE, newDestAlias = FALSE, retSuccess;\n"
   "3421\t  cmuMessage_t message;\n"
   "3422\t  cmuLoadParams(message,CMU_RAS,hsRas,cmRASTrPartConfirm,NULL);\n"
   "3423\t\n"
   "3424\t\t/* let the application access the message. NL9_26*/\n"
   "3425\t\tif (VALID(cl))\n"
   "3426\t\t\thookToCall((gkHCALL)CL.handle, (gkHAPPCALL *)&CL.appHandle, NULL, 
hsRas, gkcciMsgReceiveLCF, gkcciSideOrig);\n"
   "3427\t\telse\n"
   "3428\t\t\thookToCall((gkHCALL)GKCCI_NO_GKHCALL, (gkHAPPCALL 
*)GKCCI_NO_GKHAPPCALL, NULL, hsRas, gkcciMsgReceiveLCF, gkcciSideOrig);\n"
   "3429\t  \n"
   "3430\t  if (!VALID(cl))\n"
   "3431\t  {\n"
   "3432\t    CALL_NOTIFY(\"LCF arrived for in-valid call\",GEN_NA,10,cl);\n"
   "3433\t    return (cmRASClose(hsRas) >= 0);\n"
   "3434\t  }\n"
   "3435\t  \n"
   "3436\t  CL.EPLCF = hsRas;\n"
   "3437\t  mcast = (hsRas == CL.mcastLRQ);\n"
   "3438\t  if(!sendMsgEvent(cl, gkcciMsgReceiveLCF, gkcciSideOrig))\n"
   "3439\t  {       \n"
   "3440\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8758, 
cl, \"calLCF: Failed in sending EPLCF receive message notification to 
application\"));\n"
   "3441\t  }              \n"
   "3442\t  if (CL.state==CAL_LRQ_SENT)\n"
   "3443\t  {\n"
   "3444\t    /* New algorithm: newDestInfo = 1 if there is alias in the LCF, 
\n"
   "3445\t     Old algorithm: newDestInfo = 1 if there is transport CallSignal 
in the LCF*/\n"
   "3446\t    loadLCFInfo(hsRas, cl, &newDestInfo, &newDestTransport, 
&newDestAlias);\n"
   "3447\t\n"
   "3448\t    if (newDestInfo) \n"
   "3449\t    {\n"
   "3450\t      if(!sendStateEvent(cl, gkcciSttReceivedLCF, 
gkcciRsnUndefined))\n"
   "3451\t      {\n"
   "3452\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8759, cl,\"calLCF: Failed in sending Address Resolution Done request to the 
application\"));\n"
   "3453\t        cmRASClose(hsRas);\n"
   "3454\t        (void)stopCall(cl, RSN_FAILURE_EVENT_HANDLER, 
cmReasonTypeUndefinedReason,\n"
   "3455\t          cmReasonTypeUndefinedReason, cmRASReasonUndefined); \n"
   "3456\t        return FALSE;\n"
   "3457\t      }\n"
   "3458\t    }\n"
   "3459\t  }\n"
   "3460\t  else\n"
   "3461\t  {\n"
   "3462\t    CALL_NOTIFY(\"LCF arrived for call which does not wait for LRQ 
response\",GEN_NA,10,cl);\n"
   "3463\t    CL.EPLCF = (HRAS)NULL;\n"
   "3464\t    return (cmRASClose(hsRas) >= 0);\n"
   "3465\t  }\n"
   "3466\t  \n"
   "3467\t  if (!mcast)\n"
   "3468\t    error=(cmRASClose(hsRas)<0);\n"
   "3469\t  \n"
   "3470\t  if (newDestTransport || newDestInfo)\n"
   "3471\t  {\n"
   "3472\t    CL.waitForLRQanswer = 0;\n"
   "3473\t    /* No point in keeping\n"
   "3474\t    the calLRQAudit timer around once a valid LCF arrives. Kill the 
timer and \n"
   "3475\t    close the mcast LRQ transaction, if open. */\n"
   "3476\t    gkTiTimerKill(calLRQaudit, (void *)cl);\n"
   "3477\t    if (CL.mcastLRQ != NULL)\n"
   "3478\t    {\n"
   "3479\t      error = (cmRASClose(CL.mcastLRQ) < 0) || error;\n"
   "3480\t      CL.mcastLRQ = NULL;\n"
   "3481\t    }\n"
   "3482\t    \n"
   "3483\t    CHANGE_STATE(CAL_ADDRESS_RESOLUTION, \"recieved LCF\");\n"
   "3484\t"
<- "    if (!addEmptyTransport(&CL.destCallSignal)) /* transport address 
downloaded from LCF. Move on. */\n"
   "3485\t    {\n"
   "3486\t      if(IS_ARQ_ORIG)\n"
   "3487\t        CL.reason = RSN_NEED_ACF;\n"
   "3488\t      else\n"
   "3489\t      {\n"
   "3490\t        if (CL.overlappedSendSetup)\n"
   "3491\t          CL.reason = RSN_NEED_OFFERING;\n"
   "3492\t        else\n"
   "3493\t          CL.reason = RSN_NEED_SETUP;\n"
   "3494\t      }\n"
   "3495\t      /* If as a result of LCF, GK must send ACF with destination 
alias other then ARQ destination alias\n"
   "3496\t         and terminal has no capability update it\'s destination 
alias (used in Setup message)\n"
   "3497\t         and call in the direct mode, GK switched call to routed mode 
and restart ARQ destination address \n"
   "3498\t         resolution */\n"
   "3499\t      if (newDestAlias == TRUE  &&  \n"
   "3500\t          CL.model == cmRASCallModelTypeDirect  &&  
CL.canMapAliasForCall == FALSE)\n"
   "3501\t      {\n"
   "3502\t        CL.model = cmRASCallModelTypeGKRouted;\n"
   "3503\t        retSuccess = sendStateEvent(cl, gkcciSttAddressResolution, 
gkcciRsnDestInfoInLRQ);\n"
   "3504\t      }\n"
   "3505\t      else\n"
   "3506\t        retSuccess = sendStateEvent(cl, 
gkcciSttAddressResolutionDone, gkcciRsnAddressFound);\n"
   "3507\t\n"
   "3508\t      if(!retSuccess)\n"
   "3509\t      {\n"
   "3510\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8760, cl,\"calLCF: Failed in sending Address Resolution Done request to the 
application\"));\n"
   "3511\t        (void)stopCall(cl, RSN_FAILURE_EVENT_HANDLER, 
cmReasonTypeUndefinedReason,\n"
   "3512\t          cmReasonTypeUndefinedReason, cmRASReasonUndefined); \n"
   "3513\t        return FALSE;\n"
   "3514\t      }\n"
   "3515\t    }\n"
   "3516\t    else /* No transport address but new destination info. Retry 
address resolution */\n"
   "3517\t    {\n"
   "3518\t      CL.reason = RSN_EMPTY_LCF;\n"
   "3519\t      if (newDestAlias == TRUE  &&  CL.canMapAliasForCall == FALSE)\n"
   "3520\t        CL.model = cmRASCallModelTypeGKRouted;\n"
   "3521\t      if(!sendStateEvent(cl, gkcciSttAddressResolution, 
gkcciRsnDestInfoInLRQ))\n"
   "3522\t      {\n"
   "3523\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8761, cl,\"calLCF: Failed in sending Address Resolution Done request to the 
application\"));\n"
   "3524\t        (void)stopCall(cl, RSN_FAILURE_EVENT_HANDLER, 
cmReasonTypeUndefinedReason,\n"
   "3525\t          cmReasonTypeUndefinedReason, cmRASReasonUndefined); \n"
   "3526\t        return FALSE;\n"
   "3527\t      }\n"
   "3528\t    }\n"
   "3529\t  }\n"
   "3530\t  else /* No new dest info in LCF. */\n"
   "3531\t  {\n"
   "3532\t    CALL_NOTIFY(\"Ignoring empty LCF\",GEN_NA,20,cl);\n"
   "3533\t    if (!mcast)\n"
   "3534\t      error = !removeOneLRQ(cl) || error;\n"
   "3535\t  }\n"
   "3536\t  \n"
   "3537\t  return !error;\n"
   "3538\t}\n"
   "3539\t\n"
   
"3540\t/*----------------------------------------------------------------------------*/
 \n"
   "3541\tBOOL calLRJ(/*recieving an LRJ sent by another entity*/\n"
   "3542\t            IN HAPPRAS haRas,\n"
   "3543\t            IN HRAS    hsRas,\n"
   "3544\t            IN cmRASReason reason)\n"
   "3545\t{\n"
   "3546\t  int cl;\n"
   "3547\t  BOOL success = TRUE;\n"
   "3548\t  \n"
   "3549\t  if(reason);\n"
   "3550\t  cl = (UINT16)(UINTPTR)haRas;\n"
   "3551\t\n"
   "3552\t\t/* let the application access the message. NL9_26*/\n"
   "3553\t\tif (VALID(cl))\n"
   "3554\t\t\thookToCall((gkHCALL)CL.handle, (gkHAPPCALL *)&CL.appHandle, NULL, 
hsRas, gkcciMsgReceiveLRJ, gkcciSideOrig);\n"
   "3555\t\telse\n"
   "3556\t\t\thookToCall((gkHCALL)GKCCI_NO_GKHCALL, (gkHAPPCALL 
*)GKCCI_NO_GKHAPPCALL, NULL, hsRas, gkcciMsgReceiveLRJ, gkcciSideOrig);\n"
   "3557\t\n"
   "3558\t  if (VALID(cl))\n"
   "3559\t  {\n"
   "3560\t    \n"
   "3561\t    CL.EPLRJ = hsRas;\n"
   "3562\t    if(!sendMsgEvent(cl, gkcciMsgReceiveLRJ, gkcciSideOrig))       \n"
   "3563\t      GK_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 9217, 
\"calLRJ: Failed in sending EPLRJ receive message notification to application. 
Call %d\", cl ));              \n"
   "3564\t    CL.EPLRJ = (HRAS)NULL;\n"
   "3565\t    \n"
   "3566\t    if (CL.mcastLRQ != hsRas)\n"
   "3567\t    {\n"
   "3568\t      success = (cmRASClose(hsRas) >= 0);\n"
   "3569\t      success = removeOneLRQ(cl) && success;\n"
   "3570\t    }\n"
   "3571\t  }\n"
   "3572\t  else\n"
   "3573\t    success = (cmRASClose(hsRas) >= 0);\n"
   "3574\t  return success;\n"
   "3575\t}\n"
   "3576\t\n"
   
"3577\t/*----------------------------------------------------------------------------*/
 \n"
   "3578\t/* GK Timeout on multicast LRQ */\n"
   "3579\tvoid CALLCONV calLRQaudit(void *call)\n"
   "3580\t{\n"
   "3581\t  int cl = (int)call;\n"
   "3582\t  \n"
   "3583\t  if (VALID(c"
<- "l))\n"
   "3584\t  {\n"
   "3585\t    if (CL.mcastLRQ == NULL)\n"
   "3586\t    {\n"
   "3587\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8762, cl,\"multicast LRQ expired with no RAS handle\"));\n"
   "3588\t      gkTiTimerKill(calLRQaudit, call);\n"
   "3589\t    }\n"
   "3590\t    else\n"
   "3591\t    {\n"
   "3592\t      CALL_NOTIFY(\"multicast LRQ Expired\",GEN_NA,10,cl);\n"
   "3593\t      calLRQTimeout((HAPPRAS)call, CL.mcastLRQ);\n"
   "3594\t    }\n"
   "3595\t  }\n"
   "3596\t  else\n"
   "3597\t  {\n"
   "3598\t    GK_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8600, 
\"LRQ expired for invalid call\"));\n"
   "3599\t    gkTiTimerKill(calLRQaudit, call);\n"
   "3600\t  }\n"
   "3601\t}\n"
   "3602\t\n"
   "3603\t\n"
   "3604\tBOOL calLRQTimeout(/*a gk LRQ has been replied with a timeout*/\n"
   "3605\t                   IN HAPPRAS haRas,\n"
   "3606\t                   IN HRAS    hsRas)\n"
   "3607\t{\n"
   "3608\t  int cl;\n"
   "3609\t  BOOL success = TRUE;\n"
   "3610\t  BOOL mcast = FALSE;\n"
   "3611\t  \n"
   "3612\t  GK_NOTIFY(\"timeout on LRQ has arrived\",GEN_NA,10);\n"
   "3613\t  cl = (UINT16)(UINTPTR)haRas;\n"
   "3614\t  cmRASGetParam(hsRas, cmRASTrPartRequest, 
cmRASParamMulticastTransaction, 0, (INT32 *)&mcast, (char *)NULL);\n"
   "3615\t  success = (cmRASClose(hsRas) >= 0);\n"
   "3616\t  if (VALID(cl))\n"
   "3617\t  {\n"
   "3618\t    /* The following line checks that this is not a second timeout on 
a multicast LRQ\n"
   "3619\t    transaction. It\'s possible that calLRQaudit timer expired 
already and that the\n"
   "3620\t    stack timer has now expired on the same multicast transaction. 
*/\n"
   "3621\t    if (!(mcast && CL.mcastLRQ == NULL))\n"
   "3622\t    {\n"
   "3623\t      if (CL.mcastLRQ == hsRas)\n"
   "3624\t      {\n"
   "3625\t        CL.mcastLRQ = NULL;\n"
   "3626\t        gkTiTimerKill(calLRQaudit, (void*)cl);\n"
   "3627\t      }\n"
   "3628\t      success = removeOneLRQ(cl) && success;\n"
   "3629\t    }\n"
   "3630\t  }\n"
   "3631\t  return success;\n"
   "3632\t}\n"
   "3633\t\n"
   "3634\t\n"
   "3635\tBOOL removeOneLRQ(/*performs the actions that arise from recieving 
either timeout or LRJ*/\n"
   "3636\t                  IN int cl)\n"
   "3637\t                  \n"
   "3638\t{\n"
   "3639\t  BOOL succ= TRUE;\n"
   "3640\t\n"
   "3641\t  if (!VALID(cl))\n"
   "3642\t  {\n"
   "3643\t    GK_NOTIFY(\"in-valid call in removeOneLRQ\",cl,30);\n"
   "3644\t    return succ;\n"
   "3645\t  }\n"
   "3646\t  \n"
   "3647\t  /* check if we got here in a situation when LRJ or TO comes\n"
   "3648\t  after LCF */\n"
   "3649\t  if (CL.state!=CAL_LRQ_SENT || (CL.waitForLRQanswer < 0))\n"
   "3650\t    return succ;\n"
   "3651\t  \n"
   "3652\t  CL.waitForLRQanswer--;\n"
   "3653\t  \n"
   "3654\t  if (CL.waitForLRQanswer <=0)\n"
   "3655\t  {\n"
   "3656\t    GK_NOTIFY(\"received responses to all LRQ\'s send. none 
identifies the destination\",GEN_NA,10);\n"
   "3657\t    return LRQ(cl);\n"
   "3658\t    /*CL.lrqStage++;\n"
   "3659\t\t\tif (CL.lrqStage != LRQ_DONE)\n"
   "3660\t\t\t\treturn LRQ(cl);\n"
   "3661\t        else {\n"
   "3662\t            if (CL.waitFurtherLRQ)\n"
   "3663\t                return TRUE;\n"
   "3664\t            return handleCannotComplete( cl, RSN_LRQ_NOT_FOUND, 
gkcciRsnLRQAddressNotFound,\"Address not found by LRQ\");\n"
   "3665\t        }*/\n"
   "3666\t  }\n"
   "3667\t  \n"
   "3668\t  return TRUE;  \n"
   "3669\t}\n"
   "3670\t\n"
   "3671\t\n"
   
"3672\t/*----------------------------------------------------------------------------*/
  \n"
   
"3673\t/*----------------------------------------------------------------------------*/\n"
   "3674\t\n"
   "3675\tINT32 calRIP(/*sends a Request In Progress message to the pending ARQ 
message associated with hCall\n"
   "3676\t\t\t\t\t\t\t\t\t\t\t\t\t\tof the specified side.gkcciInvalidHandle 
returned for invalid handle.\n"
   "3677\t                          gkcciCannotSendRIP returned if the hCall 
the ARQ transaction is not in a stage \n"
   "3678\t                          that RIP can be sent.gkcciFailure returned 
if an error occured*/\n"
   "3679\t                          IN  gkHCALL\t\t\t\thCall,\n"
   "3680\t                          IN  gkcciRIPMsg_t msg,\n"
   "3681\t                          IN  gkcciSide_t\t\tripSide,\n"
   "3682\t                          IN int\t\t\t\t\t\tmsecDelay)\n"
   "3683\t{\n"
   "3684\t  int cl;\n"
   "3685\t  HRAS hsRas;\n"
   "3686\t  side_t side;\n"
   "3687\t\tHCALL hsCall;\n"
   "3688\t\n"
   "3689\t  if (ripSide == gkcciSideOrig)\n"
   "3690\t    side = ORIGIN;\n"
   "3691\t  else\n"
   "3692\t    side = DESTINATION;\n"
   "3693\t  if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "3694\t  {\n"
   "3695\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8790, 
-1,\"calAppSetAppLineHunting: Illegal handle: %d\", (UINT32)hCall ));\n"
   "3696\t      return gkcciInvalidHandle;\n"
   "3697\t  } \n"
   "3698\t\tif (!getCallHandle(cl, ripSide, &hsCall)) hsCall = NULL;\n"
   "3699\t  \n"
   "3700\t "
<- " if (!RIPPossible(cl,msg,side))\n"
   "3701\t  {\n"
   "3702\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8604, 
cl,\"calRIP: no pending message of specified type to send a RIP to\"));\n"
   "3703\t    return gkcciCannotSendRIP;\n"
   "3704\t  }\n"
   "3705\t  switch (msg) {\n"
   "3706\t  case gkcciRIPMsgARQ :\n"
   "3707\t    hsRas = CL.SIDE.ARQ;\n"
   "3708\t    break;\n"
   "3709\t  case gkcciRIPMsgDRQ :\n"
   "3710\t    hsRas = CL.SIDE.DRQ;\n"
   "3711\t    break;\n"
   "3712\t  case gkcciRIPMsgBRQ :\n"
   "3713\t    {\n"
   "3714\t      gkcciReturnValue_t retCode = gkcciOK;\n"
   "3715\t      brqFifo_t fifo;\n"
   "3716\t\t\t\thsRas = CL.SIDE.bw.hsRas;\n"
   "3717\t\t\t\tif(!sendMsgEvent(cl,gkcciMsgSendRIP,ripSide))\n"
   "3718\t\t\t\t{       \n"
   "3719\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8613, cl, \"RIP: Failed in sending RIP send message notification to 
application\"));\n"
   "3720\t\t\t\t\tretCode = gkcciFailure;\n"
   "3721\t\t\t\t}\n"
   "3722\t\t\t\thookToCall((gkHCALL)CL.handle,(gkHAPPCALL *)&CL.appHandle, 
hsCall,hsRas,gkcciMsgSendRIP,ripSide);\n"
   "3723\t      if (cmRASInProgress(hsRas,msecDelay) != 0)\n"
   "3724\t        retCode = gkcciFailure;\n"
   "3725\t      memcpy(&fifo,&(CL.SIDE.bw.fifo),sizeof(brqFifo_t));\n"
   "3726\t      while(bwBRQFifoPop(&fifo,&hsRas))\n"
   "3727\t\t\t\t{\n"
   "3728\t\t\t\t\tif(!sendMsgEvent(cl,gkcciMsgSendRIP,ripSide))\n"
   "3729\t\t\t\t\t{       \n"
   "3730\t\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8613, cl, \"RIP: Failed in sending RIP send message notification to 
application\"));\n"
   "3731\t\t\t\t\t\tretCode = gkcciFailure;\n"
   "3732\t\t\t\t\t}\n"
   "3733\t\t\t\t\thookToCall((gkHCALL)CL.handle,(gkHAPPCALL *)&CL.appHandle, 
hsCall,hsRas,gkcciMsgSendRIP,ripSide);\n"
   "3734\t\t\t\t\tif (cmRASInProgress(hsRas,msecDelay) != 0)\n"
   "3735\t\t\t\t\t\tretCode = gkcciFailure;\n"
   "3736\t\t\t\t}\n"
   "3737\t\t\t\treturn retCode;\n"
   "3738\t    }\n"
   "3739\t    break;\n"
   "3740\t  default :\n"
   "3741\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8605, 
cl,\"unhandled RIPMsg in calRIP\"));\n"
   "3742\t    return gkcciFailure;\n"
   "3743\t  }\t\t\t\t\t\t\t\t\t\t\n"
   "3744\t\tif(!sendMsgEvent(cl,gkcciMsgSendRIP,ripSide))\n"
   "3745\t\t{       \n"
   "3746\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8613, 
cl, \"RIP: Failed in sending RIP send message notification to 
application\"));\n"
   "3747\t\t\treturn gkcciFailure;\n"
   "3748\t\t}\n"
   "3749\t\thookToCall((gkHCALL)CL.handle,(gkHAPPCALL *)&CL.appHandle, 
hsCall,hsRas,gkcciMsgSendRIP,ripSide);\n"
   "3750\t\tif (cmRASInProgress(hsRas,msecDelay) != 0)\n"
   "3751\t\t\treturn gkcciFailure;\n"
   "3752\t\telse\n"
   "3753\t\t\treturn gkcciOK;\n"
   "3754\t}\n"
   "3755\t\n"
   
"3756\t/*******************************************************************/\n"
   "3757\t/* Building Q.931 and RAS Messages                                 
*/\n"
   
"3758\t/*******************************************************************/\n"
   "3759\t\n"
   
"3760\t/*----------------------------------------------------------------------------*/
   \n"
   "3761\t\n"
   "3762\tBOOL loadAliasLRQ(/* load aliases from call to lrq message*/\n"
   "3763\t    IN int cl,\n"
   "3764\t    IN HRAS hsRas)\n"
   "3765\t  {\n"
   "3766\t    cmuMessage_t message;\n"
   "3767\t    int idx;\n"
   "3768\t    int nodeId;\n"
   "3769\t    BOOL canMapAlias;\n"
   "3770\t    \n"
   "3771\t    HPVT hpvt = cmGetValTree(dispStack);\n"
   "3772\t    
cmuLoadParams(message,CMU_RAS,hsRas,cmRASTrPartRequest,(HCALL)0);\n"
   "3773\t    if 
(!cmuDownLoadAliasList(&message,cmRASParamDestInfo,DESTINATION_NUMBER,CL.destInfo))\n"
   "3774\t      return FALSE;\n"
   "3775\t    \n"
   "3776\t    /* download srcInfo into the the LRQ sourceInfo field */\n"
   "3777\t    pvtBuildByPath(hpvt, cmGetProperty((HPROTOCOL)(hsRas)), 
\"request.locationRequest.sourceInfo\", 0, NULL);\n"
   "3778\t    nodeId = pvtGetNodeIdByPath(hpvt, 
cmGetProperty((HPROTOCOL)(hsRas)), \"request.locationRequest.sourceInfo\");\n"
   "3779\t    if (nodeId < 0)\n"
   "3780\t      return FALSE;\n"
   "3781\t    for (idx=0; idx < SOURCE_NUMBER; ++idx)\n"
   "3782\t    {\n"
   "3783\t      if (!addEmptyAlias(&(CL.srcInfo[idx])))\n"
   "3784\t        if 
(cmAlias2Vt(hpvt,&(CL.srcInfo[idx]),pvtBuildByPath(hpvt,nodeId,\"0\",0,NULL)) < 
0)\n"
   "3785\t          return FALSE;\n"
   "3786\t    }\n"
   "3787\t    \n"
   "3788\t    canMapAlias = (CL.canMapAliasForCall || (CL.model != 
cmRASCallModelTypeDirect));\n"
   "3789\t    if (pvtBuildByPath(hpvt, cmGetProperty((HPROTOCOL)(hsRas)), 
\"request.locationRequest.canMapAlias\", canMapAlias, NULL) < 0)\n"
   "3790\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8606, cl,\"loadAliasLRQ: pvtBuildByPath failed for LRQ canMapAlias\"));\n"
   "3791\t    \n"
   "3792"
<- "\t    return TRUE;\n"
   "3793\t  }\n"
   "3794\t\n"
   "3795\t\n"
   
"3796\t/*----------------------------------------------------------------------------*/
 \n"
   "3797\tBOOL loadLCFInfo(\n"
   "3798\t                 IN  HRAS  hsRas,\n"
   "3799\t                 IN  int   cl,\n"
   "3800\t                 OUT BOOL* newDestInfo,\n"
   "3801\t                 OUT BOOL* newDestTransport,\n"
   "3802\t                 OUT BOOL* newDestAlias)\n"
   "3803\t{\n"
   "3804\t  char buf[120];\n"
   "3805\t  int nodeId;\n"
   "3806\t  int val;\n"
   "3807\t  cmRASAlias oldDestInfo;\n"
   "3808\t  char oldDestInfoString[ADD_MAX_BUF];\n"
   "3809\t  HPVT hpvt = cmGetValTree(dispStack);\n"
   "3810\t  int rootNode = cmGetProperty((HPROTOCOL)hsRas);\n"
   "3811\t  cmuMessage_t message;\n"
   "3812\t  cmuLoadParams(message,CMU_RAS,hsRas,cmRASTrPartConfirm,NULL);\n"
   "3813\t  \n"
   "3814\t  
cmuGetParam(&message,cmRASParamCallSignalAddress,FALSE,0,&val,(char*)&(CL.destCallSignal));\n"
   "3815\t  *newDestTransport = !addEmptyTransport(&CL.destCallSignal);\n"
   "3816\t  if (*newDestTransport)\n"
   "3817\t  {\n"
   "3818\t    sprintf(buf,\"Call-signalling address received in LCF for call 
%i: %s\",cl,addIpToString(&(CL.destCallSignal)));\n"
   "3819\t    CALL_NOTIFY(buf,GEN_NA,10,cl);\n"
   "3820\t  }\n"
   "3821\t/* BUG300 N4241 : proceeding of call when originator cann\'t map 
alias\n"
   "3822\t  (CL.canMapAliasForCall == FALSE) and GK in direct call mode 
(CL.model == cmRASCallModelTypeDirect)\n"
   "3823\t  is implemented now, and it need parameters from received LCF.\n"
   "3824\t  That is why it need to cancel this check.\n"
   "3825\t  if (CL.canMapAliasForCall || CL.model != 
cmRASCallModelTypeDirect)\n"
   "3826\t  {\n"
   "3827\t*/\n"
   "3828\t    if ((nodeId = pvtGetNodeIdByPath(hpvt, rootNode, 
\"response.locationConfirm.destinationInfo\")) >= 0)\n"
   "3829\t    {\n"
   "3830\t      *newDestInfo = TRUE;\n"
   "3831\t      CALL_NOTIFY(\"Loading destintation aliases from LCF\", GEN_NA, 
20, cl);\n"
   "3832\t      oldDestInfo.string = &oldDestInfoString[0];\n"
   "3833\t      addCopyAlias(&oldDestInfo,&CL.destInfo[0]);\n"
   "3834\t      /* BUG300 N4241 : why new alias is loaded into destInfo[0] 
always? No LRQ proceess for destInfo[2] is possible ?*/\n"
   "3835\t\t\t\t\t\t\t\t\t\t\t\t\t       /* BUG300 N4241 : check for 
oldDestInfo=newDestInfo add overhead, but it\'s purpose only to prevent 
noncorrect LCF content*/\n"
   "3836\t      cmuLoadVtAliasList(hpvt, nodeId, DESTINATION_NUMBER, 
&(CL.destInfo[0]));\n"
   "3837\t      if (addEqualAlias(&CL.destInfo[0],&oldDestInfo) == FALSE)\n"
   "3838\t        *newDestAlias = TRUE;\n"
   "3839\t    }\n"
   "3840\t    if (*newDestInfo)\n"
   "3841\t    {\n"
   "3842\t      if ((nodeId = pvtGetNodeIdByPath(hpvt, rootNode, 
\"response.locationConfirm.destExtraCallInfo\")) >= 0)\n"
   "3843\t      {\n"
   "3844\t        CALL_NOTIFY(\"Loading destintation extra call info aliases 
from LCF\", GEN_NA, 20, cl);\n"
   "3845\t        cmuLoadVtAliasList(hpvt, nodeId, DESTINATION_NUMBER, 
&(CL.destExtra[0]));\n"
   "3846\t      }\n"
   "3847\t      if ((nodeId = pvtGetNodeIdByPath(hpvt, rootNode, 
\"response.locationConfirm.remoteExtensionAddress\")) >= 0)\n"
   "3848\t      {\n"
   "3849\t        CALL_NOTIFY(\"Loading remote extension address from LCF\", 
GEN_NA, 20, cl);\n"
   "3850\t        cmuLoadVtAliasList(hpvt, nodeId, 1, &(CL.remoteExtension));\n"
   "3851\t      }\n"
   "3852\t    }\n"
   "3853\t/*  }\n"
   "3854\t*/\n"
   "3855\t  if (*newDestInfo)\n"
   "3856\t  {\n"
   "3857\t    if ((nodeId = pvtGetNodeIdByPath(hpvt, rootNode, 
\"response.locationConfirm.destinationType\")) >= 0)\n"
   "3858\t      cmuRASGetDestinationType(hpvt, nodeId, 
&(CL.DEST.endpointType));\n"
   "3859\t  }\n"
   "3860\t  return TRUE;\n"
   "3861\t}\n"
   "3862\t\n"
   
"3863\t/*----------------------------------------------------------------------------*/
   \n"
   "3864\t\n"
   "3865\t/*\n"
   "3866\t * loadFromARQ - Load parameters from ARQ message to call \n"
   "3867\t */\n"
   "3868\tBOOL loadFromARQ(IN HRAS hsRas,\n"
   "3869\t                 IN side_t side,\n"
   "3870\t                 IN int cl)\n"
   "3871\t{\n"
   "3872\t    int tmp;\n"
   "3873\t    int val;\n"
   "3874\t\tint i;\n"
   "3875\t\tgkaddAlias_t destinationInfo[DESTINATION_NUMBER];\n"
   "3876\t\tBOOL update = TRUE;\n"
   "3877\t    cmuMessage_t message;\n"
   "3878\t    \n"
   "3879\t    
cmuLoadParams(message,CMU_RAS,hsRas,cmRASTrPartRequest,(HCALL)0);\n"
   "3880\t    \n"
   "3881\t    if (CL.infoSrc != NO_INFORMATION) {\n"
   "3882\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8607, cl,\"Attempt to reload ARQ\"));\n"
   "3883\t        return FALSE;\n"
   "3884\t    }\n"
   "3885\t    \n"
   "3886\t    cmuGetParam(&message,cmRASParamCallType,FALSE,0,&tmp,NULL); 
CL.callType=(cmCallType)tmp;\n"
   "3"
<- "887\t    
/*cmRASGetParam(hsRas,cmRASTrPartRequest,cmRASParamCallModel,0,&tmp,NULL); 
CL.model=tmp;\n"
   "3888\t    \n"
   "3889\t    note that this paramter if loaded and is indirect requires some 
fixes in arj procedures */ \n"
   "3890\t    /* ??? AVI TEST - Should I restict it some more ???*/\n"
   "3891\t\tgkcciGetParameter(CL.handle, gkcciParamAlias, gkcciSideDest, 0, 
DESTINATION_NUMBER-1, (void *)destinationInfo);\n"
   "3892\t\tfor(i = 0 ; i < DESTINATION_NUMBER ; i++) {\n"
   "3893\t\t\tif(destinationInfo[i].type > 0) {\n"
   "3894\t\t\t\t\tupdate = FALSE;\t\n"
   "3895\t\t\t\t\tbreak;\n"
   "3896\t\t\t}\n"
   "3897\t\t}\n"
   "3898\t    if ((side != (side_t) gkcciSideDest) || ((side == (side_t) 
gkcciSideDest) && update)) {\n"
   "3899\t        
cmuLoadAliasList(&message,cmRASParamDestInfo,DESTINATION_NUMBER,&(CL.destInfo[0]));
 \n"
   "3900\t        
cmuGetParam(&message,cmRASParamDestCallSignalAddress,FALSE,0,&val,(char*)&(CL.destCallSignal));
    \n"
   "3901\t    \n"
   "3902\t        
cmuLoadAliasList(&message,cmRASParamDestExtraCallInfo,DESTINATION_NUMBER,&(CL.destExtra[0]));\n"
   "3903\t    }\n"
   "3904\t    \n"
   "3905\t    
cmuLoadAliasList(&message,cmRASParamSrcInfo,SOURCE_NUMBER,&(CL.srcInfo[0]));\n"
   "3906\t    
cmuGetParam(&message,cmRASParamSrcCallSignalAddress,FALSE,0,&val,(char*)&(CL.srcCallSignal));\n"
   "3907\t    \n"
   "3908\t    /* Removed by meir 8/2/99: This check will take place in 
loadFromSetup \n"
   "3909\t                               even if ARQ was received\n"
   "3910\t    if (addEmptyTransport(&(CL.srcCallSignal)))\n"
   "3911\t        CL.round = 1;\n"
   "3912\t    */\n"
   "3913\t    \n"
   "3914\t    cmuGetParam(&message,cmRASParamBandwidth,FALSE,0,&tmp,NULL); 
CL.SIDE.bw.bwReq=tmp;\n"
   "3915\t    if (cmuGetParam(&message,cmRASParamCID,FALSE,0,&tmp,CL.cid) == 
ERROR)\n"
   "3916\t        memcpy(CL.cid,emptyGuid,GUID_LEN);\n"
   "3917\t    \n"
   "3918\t    if 
(cmuGetParam(&message,cmRASParamCallID,FALSE,0,&tmp,CL.SIDE.callID) == ERROR)\n"
   "3919\t        memcpy(CL.SIDE.callID,emptyGuid,GUID_LEN);\n"
   "3920\t    \n"
   "3921\t    cmuGetParam(&message,cmRASParamActiveMC,FALSE,0,&tmp,NULL); 
CL.SIDE.activeMc=tmp;\n"
   "3922\t    
cmuGetParam(&message,cmRASParamCRV,FALSE,0,&tmp,NULL);CL.SIDE.CRVras = tmp;\n"
   "3923\t    
cmuGetParam(&message,cmRASParamDestinationIpAddress,FALSE,0,&tmp,(char*)&(CL.SIDE.UDPAddress));\n"
   "3924\t\n"
   "3925\t    /* load the can map alias boolean */\n"
   "3926\t    if (side == (side_t)gkcciSideOrig) {\n"
   "3927\t        if (getCanMapAlias(hsRas, &tmp) >= 0)\n"
   "3928\t            CL.canMapAliasForCall = (BOOL)tmp;\n"
   "3929\t\t    else\n"
   "3930\t\t\t    CL.canMapAliasForCall = TRUE;\n"
   "3931\t\t}\n"
   "3932\t    \n"
   "3933\t    CL.infoSrc = ARQ_INFORMATION;\n"
   "3934\t    return TRUE;\n"
   "3935\t}\n"
   "3936\t  \n"
   "3937\t    \n"
   
"3938\t/*----------------------------------------------------------------------------*/
    \n"
   "3939\t  BOOL loadFromSetup(\n"
   "3940\t    IN HCALL hsCall,\n"
   "3941\t    IN int cl)\n"
   "3942\t  {\n"
   "3943\t    int val;\n"
   "3944\t    INTPTR fieldId;\n"
   "3945\t    BOOL isString, bVal;\n"
   "3946\t    char *path;\n"
   "3947\t    HPVT hpvt = cmGetValTree(dispStack);\n"
   "3948\t    int property=cmGetProperty((HPROTOCOL)(CL.ORIG.stack));\n"
   "3949\t\t\tcmRASTransport setupTarget;\n"
   "3950\t    \n"
   "3951\t    \n"
   "3952\t    cmuMessage_t message;\n"
   "3953\t    cmuLoadParams(message,CMU_Q931,(HRAS)0,(cmRASTrPart)0,hsCall);\n"
   "3954\t    \n"
   "3955\t    if ((CL.infoSrc==ARQ_INFORMATION) || 
(CL.infoSrc==NO_INFORMATION))\n"
   "3956\t    {\n"
   "3957\t      /* get the call rate */\n"
   "3958\t      cmCallGetRate(CL.ORIG.stack, &CL.rate);\n"
   "3959\t      cmCallGetParam(CL.ORIG.stack, cmParamMultiRate, 1, 
(INT32*)&CL.multirate, NULL);\n"
   "3960\t      \n"
   "3961\t      path = 
\"setup.message.*.userUser.h323-UserInformation.h323-uu-pdu.h245Tunneling\";\n"
   "3962\t      if (pvtGetByPath(hpvt, property, path, &fieldId, &bVal, 
&isString) >= 0)\n"
   "3963\t\t\t  CL.tunneledH245 = bVal;\n"
   "3964\t\t  path = 
\"setup.message.*.userUser.h323-UserInformation.h323-uu-pdu.h323-message-body.*.fastStart\";\n"
   "3965\t\t  {\n"
   "3966\t\t\t  int fs = pvtGetNodeIdByPath(hpvt,property,path);\n"
   "3967\t\t\t  CL.fastStart = (fs > 0);\n"
   "3968\t      }\n"
   "3969\t      cmuGetParam(&message,cmParamConferenceGoal,FALSE,0,&val,NULL); 
\n"
   "3970\t      CL.confGoal = (cmConferenceGoalType)val;\n"
   "3971\t      
if(cmuGetParam(&message,cmParamSetupH245Address,FALSE,0,&val,(char*)&(CL.setupH245Add))<0)\n"
   "3972\t      {\n"
   "3973\t        CL.setupH245Add.ip = 0;\n"
   "3974\t        CL.setupH245Add.port = 0;\n"
   "3975\t        CALL_NOTIFY(\"No setup H.245 address\",GEN_NA,20,cl);\n"
   "3976"
<- "\t      }\n"
   "3977\t      else\n"
   "3978\t      {\n"
   "3979\t        CALL_NOTIFY(\"Getting the setup H.245 
address\",GEN_NA,20,cl);\n"
   "3980\t        CALL_NOTIFY(addIpToString(&CL.setupH245Add),GEN_NA,20,cl);\n"
   "3981\t      }\n"
   "3982\t      if (addEmptyAlias(&CL.remoteExtension))\n"
   "3983\t        
cmuLoadAliasList(&message,cmParamExtention,1,&(CL.remoteExtension));         \n"
   "3984\t    }\n"
   "3985\t    \n"
   "3986\t      /* meir 3/2/99: If no srcCallSignalAddress in ARQ attempt to 
reload it\n"
   "3987\t      from Setup. Some terminals put the srcCallSignalAddress only in 
the\n"
   "3988\t    Setup message and not in the ARQ message. (This is 
counter-standard). */\n"
   "3989\t    if (addEmptyTransport(&(CL.srcCallSignal)))\n"
   "3990\t\t\t  {\n"
   "3991\t\t\t    
cmuGetParam(&message,cmParamSrcCallSignalAddress,FALSE,0,&val,(char*)&(CL.srcCallSignal));\n"
   "3992\t        if (addEmptyTransport(&(CL.srcCallSignal)))\n"
   "3993\t          CL.round = 1;\n"
   "3994\t\t\t  }\n"
   "3995\t\n"
   "3996\t    /* If dest. call signal address is NULL or is that of the GK\'s 
try to load a new\n"
   "3997\t\t\tdest call signal address from the Seup message. */\n"
   "3998\t    
cmuGetParam(&message,cmParamDestinationIpAddress,FALSE,0,&val,(char*)&setupTarget);\n"
   "3999\t    if (addEmptyTransport(&(CL.destCallSignal)) || \n"
   "4000\t\t\t\t  (CL.destCallSignal.ip == setupTarget.ip && 
CL.destCallSignal.port == setupTarget.port))\n"
   "4001\t\t\t{\n"
   "4002\t\t\t\tcmRASTransport destCallSignal;\n"
   "4003\t      
cmuGetParam(&message,cmParamDestCallSignalAddress,FALSE,0,&val,(char*)&destCallSignal);\n"
   "4004\t      if 
((setupTarget.ip!=destCallSignal.ip)||(setupTarget.port!=destCallSignal.port))/*address
 in destCallSignal is not the gk\'s add*/\n"
   "4005\t        
memcpy(&(CL.destCallSignal),&destCallSignal,sizeof(cmRASTransport));\n"
   "4006\t\t\t\telse\n"
   "4007\t\t\t\t  memset(&(CL.destCallSignal), 0, sizeof(cmRASTransport)); /* 
If GK\'s address, nullify address */\n"
   "4008\t\t\t}\n"
   "4009\t\n"
   "4010\t\tif (cmuGetParam(&message, cmParamSetupCanOverlapSending, FALSE, 0, 
&val, NULL) >= 0)\n"
   "4011\t\t\tCL.canOverlapSend = (BOOL)val;\n"
   "4012\t    \n"
   "4013\t\t /*sarit 23/3/2000: if setup message arrives after the ARQ 
message:\n"
   "4014\t\t  taking the calling party number from the setup message and 
saving\n"
   "4015\t\t  it in the call record. if the ARQ didn\'t contain this address as 
the first\n"
   "4016\t\t  e164, this address will be downloade to the outgoing setup to 
the\n"
   "4017\t\t  calling party number field. (This is a hugo request and is 
counter standars)*/\n"
   "4018\t\t  if (CL.infoSrc == ARQ_INFORMATION) {\n"
   "4019\t\t      /*saving the calling party number.*/\n"
   "4020\t\t\t  
cmuGetParam(&message,cmParamCallingPartyNumber,TRUE,0,&val,(char*)&(CL.callingPartyNumber));
 \t\t\t\t\n"
   "4021\t          CALL_NOTIFY(\"Saving calling party 
number\",GEN_NA,40,cl);\n"
   "4022\t          
CALL_NOTIFY(aliasToString(&(CL.callingPartyNumber)),GEN_NA,40,cl);\n"
   "4023\t\t  }\n"
   "4024\t\t  \n"
   "4025\t    if (CL.infoSrc!=ARQ_INFORMATION)\n"
   "4026\t    {\n"
   "4027\t\t\t    cmRASTransport destCallSignal,setupTarget;\n"
   "4028\t        destCallSignal.ip = setupTarget.ip = 0;\n"
   "4029\t        \n"
   "4030\t        
cmuGetParam(&message,cmParamCalledPartyNumber,TRUE,0,&val,(char*)&(CL.destInfo[0]));\n"
   "4031\t        
cmuGetParam(&message,cmParamCallingPartyNumber,TRUE,0,&val,(char*)&(CL.srcInfo[0]));
 \t\t\t\t\n"
   "4032\t        
cmuLoadAliasList(&message,cmParamSourceAddress,SOURCE_NUMBER-1,&(CL.srcInfo[1]));\n"
   "4033\t        \n"
   "4034\t        
cmuLoadAliasList(&message,cmParamDestinationAddress,DESTINATION_NUMBER-1,&(CL.destInfo[1]));\n"
   "4035\t        
cmuLoadAliasList(&message,cmParamDestExtraCallInfo,DESTINATION_NUMBER,CL.destExtra);
         \n"
   "4036\t        cmuGetParam(&message,cmParamActiveMc,FALSE,0,&val,NULL); 
CL.ORIG.activeMc=(BOOL)val;\n"
   "4037\t        if (cmuGetParam(&message,cmParamCID,FALSE,0,&val,CL.cid) == 
ERROR)\n"
   "4038\t          memcpy(CL.cid,emptyGuid,GUID_LEN);\n"
   "4039\t        if 
(cmuGetParam(&message,cmParamCallID,FALSE,0,&val,CL.ORIG.callID) == ERROR)\n"
   "4040\t          memcpy(CL.ORIG.callID,emptyGuid,GUID_LEN);\n"
   "4041\t        \n"
   "4042\t        cmuGetParam(&message,cmParamCallType,FALSE,0,&val,NULL); \n"
   "4043\t        CL.callType=(cmCallType)val;\n"
   "4044\t        \n"
   "4045\t        path = 
\"setup.message.*.userUser.h323-UserInformation.h323-uu-pdu.h323-message-body.setup.mediaWaitForConnect\";\n"
   "4046\t        if (pvtGetByPath(hpvt, property, path, &fieldId, &bVal, 
&isStrin"
<- "g) >= 0)\n"
   "4047\t          CL.mediaWaitForConnect = bVal;\n"
   "4048\t        \n"
   "4049\t#ifdef GK_SET_DEST\n"
   "4050\t        if (strlen(calDest1))\n"
   "4051\t\t\t      {\n"
   "4052\t          CALL_NOTIFY(\"Overwriting 
calledParyNumber\",GEN_NA,30,cl);\n"
   "4053\t          CL.destInfo[0].type = cmRASAliasTypeE164;\n"
   "4054\t          memcpy(CL.destInfo[0].string,calDest1,strlen(calDest1));\n"
   "4055\t          CL.destInfo[0].length = strlen(calDest1);\n"
   "4056\t\t\t      }\n"
   "4057\t        if (strlen(calDest2))\n"
   "4058\t\t\t      {\n"
   "4059\t          CALL_NOTIFY(\"Overwriting destExtra[0]\",GEN_NA,30,cl);\n"
   "4060\t          CL.destExtra[0].type = cmRASAliasTypeE164;\n"
   "4061\t          memcpy(CL.destExtra[0].string,calDest2,strlen(calDest2));\n"
   "4062\t          CL.destExtra[0].length = strlen(calDest2);\n"
   "4063\t\t\t      }\n"
   "4064\t#endif\n"
   "4065\t        \n"
   "4066\t        CL.infoSrc=SETUP_INFORMATION;\n"
   "4067\t\t\t}\n"
   "4068\t\n"
   "4069\t\t/* neweli 5/4/2000. if sendingComplete field exists here it should 
be conveyed to the\n"
   "4070\t\tdestination. it is saved here as a call parameter and will be 
loaded to the outgoing\n"
   "4071\t\tsetup message. */\n"
   "4072\t\tpath = \"setup.message.setup.sendingComplete\";\n"
   "4073\t\tif (pvtGetByPath(hpvt, property, path, &fieldId, &bVal, &isString) 
>= 0)\n"
   "4074\t\t\tCL.sendingCompleteFlag = TRUE;\n"
   "4075\t/*\telse\n"
   "4076\t\t\tCL.sendingCompleteFlag = FALSE;*/ /* NIMROD: Disabled it. Set it 
to false in clearCall*/\n"
   "4077\t    memcpy(CL.DEST.callID,CL.ORIG.callID,GUID_LEN);\n"
   "4078\t    return TRUE;\n"
   "4079\t  } \n"
   "4080\t    \n"
   "4081\t\n"
   
"4082\t/*----------------------------------------------------------------------------*/\n"
   "4083\t    int copySetup(IN int cl)\n"
   "4084\t    {\n"
   "4085\t      int origSetupNode = -1 ,destSetupNode = -1;\n"
   "4086\t      HPVT hpvt = cmGetValTree(dispStack);\n"
   "4087\t\n"
   "4088\t      origSetupNode = 
pvtGetNodeIdByPath(hpvt,cmGetProperty((HPROTOCOL)(CL.ORIG.stack)),\"setup\");\n"
   "4089\t      destSetupNode = 
pvtGetNodeIdByPath(hpvt,cmGetProperty((HPROTOCOL)(CL.DEST.stack)),\"setup\");\n"
   "4090\t\n"
   "4091\t      /* SA_450_TR if GK initiated call there is only one setup 
message */\n"
   "4092\t      /*if (!CL.ORIG.stack)*/\n"
   "4093\t      if (DEST_ONLY_CALL(cl))\n"
   "4094\t        return destSetupNode;\n"
   "4095\t\n"
   "4096\t      if (origSetupNode < 0 || destSetupNode < 0)\n"
   "4097\t        return -1;\n"
   "4098\t\n"
   "4099\t      pvtSetTree(hpvt,destSetupNode,hpvt,origSetupNode);\n"
   "4100\t      
pvtSetTree(hpvt,cmCallGetLocalEndpointInfoHandle(CL.DEST.stack),     \n"
   "4101\t                 
hpvt,cmCallGetRemoteEndpointInfoHandle(CL.ORIG.stack));\n"
   "4102\t      return destSetupNode;\n"
   "4103\t    }\n"
   
"4104\t/*----------------------------------------------------------------------------*/\n"
   "4105\tvoid downloadToSetup(IN int cl, IN int destSetupNode, IN BOOL 
isService)\n"
   "4106\t      \n"
   "4107\t    {\n"
   "4108\t      int firstE164;\n"
   "4109\t      int setupNode1=-1,setupNode2=-1, h323pduNode=-1;\n"
   "4110\t      cmuMessage_t message;\n"
   "4111\t      HPVT hpvt = cmGetValTree(dispStack);\n"
   "4112\t      char buf[128];\n"
   "4113\t      int buffLen;\n"
   "4114\t      \n"
   "4115\t      *buf = 0;\n"
   "4116\t      message.type=CMU_Q931;\n"
   "4117\t      message.hsCall=CL.DEST.stack; \n"
   "4118\t      \n"
   "4119\t      \n"
   "4120\t      {       \n"
   "4121\t        if ((setupNode1 = 
pvtGetNodeIdByPath(hpvt,destSetupNode,\"message.setup\")) < 0)\n"
   "4122\t        {\n"
   "4123\t          CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8608, cl,\"error accessing setupNode1 in downloadToSetup\"));\n"
   "4124\t        }\n"
   "4125\t        if ((h323pduNode = pvtGetNodeIdByPath(hpvt, destSetupNode, \n"
   "4126\t          \"message.*.userUser.h323-UserInformation\")) < 0)\n"
   "4127\t          CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8609, cl,\"error accessing h323 body in downloadToSetup\"));\n"
   "4128\t          /*if ((setupNode2 = 
pvtGetNodeIdByPath(hpvt,destSetupNode,\n"
   "4129\t        
\"message.*.userUser.h323-UserInformation.h323-uu-pdu.h323-message-body.*\")) < 
0)*/\n"
   "4130\t        if ((setupNode2 = pvtGetNodeIdByPath(hpvt, h323pduNode,\n"
   "4131\t          \"h323-uu-pdu.h323-message-body.*\")) < 0)\n"
   "4132\t        {\n"
   "4133\t          CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8610, cl,\"error accessing setupNode2 in downloadToSetup\"));\n"
   "4134\t        }\n"
   "4135\t      }\n"
   "4136\t\n"
   "4137\t      cmCallSetRate(CL.DEST.stack, CL.rate);\n"
   "4138\t      cmCallSetParam(CL.DEST.stack, cmParamMultiRate, 1, 
CL.multirate, N"
<- "ULL);\n"
   "4139\t\n"
   "4140\t      firstE164 = findFirstE164(CL.destInfo,DESTINATION_NUMBER);\n"
   "4141\t      cmuDeleteTree(hpvt,setupNode2,\"destinationAddress\");\n"
   "4142\t      cmuDeleteTree(hpvt,setupNode1,\"calledPartyNumber\");\n"
   "4143\t      if (firstE164 == DESTINATION_NUMBER)\n"
   "4144\t        
cmuDownLoadAliasList(&message,cmParamDestinationAddress,DESTINATION_NUMBER,&(CL.destInfo[0]));\n"
   "4145\t      else\n"
   "4146\t      {\n"
   "4147\t        if (!addEmptyAlias(&(CL.destInfo[firstE164])))\n"
   "4148\t        {\n"
   "4149\t          CALL_NOTIFY(\"Feeding called party 
number\",GEN_NA,40,cl);\n"
   "4150\t          
CALL_NOTIFY(addAliasToString(&(CL.destInfo[firstE164])),GEN_NA,40,cl);\n"
   "4151\t          
cmCallSetParam(CL.DEST.stack,cmParamCalledPartyNumber,0,sizeof(cmRASAlias),(char*)&(CL.destInfo[firstE164]));\n"
   "4152\t        }\n"
   "4153\t        
cmuDownLoadAliasList(&message,cmParamDestinationAddress,firstE164,&(CL.destInfo[0]));\n"
   "4154\t        
cmuDownLoadAliasList(&message,cmParamDestinationAddress,DESTINATION_NUMBER-firstE164-1,&(CL.destInfo[firstE164+1]));\n"
   "4155\t      }\n"
   "4156\t\t  /*setting the source aliases and the calling party number*/\n"
   "4157\t\t  firstE164 = findFirstE164(CL.srcInfo,SOURCE_NUMBER);\n"
   "4158\t      cmuDeleteTree(hpvt,setupNode2,\"sourceAddress\");\n"
   "4159\t      cmuDeleteTree(hpvt,setupNode1,\"callingPartyNumber\");\n"
   "4160\t      \n"
   "4161\t\t  /* there is no E164 in source aliases*/\n"
   "4162\t\t  if (firstE164 == SOURCE_NUMBER) {\n"
   "4163\t\t\t  
cmuDownLoadAliasList(&message,cmParamSourceAddress,SOURCE_NUMBER,&(CL.srcInfo[0]));\n"
   "4164\t\t\t  /* if the calling party number is not empty and there is no 
e164 in source aliases\n"
   "4165\t\t\t  the calling party number should be download to the outgoing 
setup*/\n"
   "4166\t\t\t  if(!addEmptyAlias(&(CL.callingPartyNumber))) {\n"
   "4167\t\t\t\t  CALL_NOTIFY(\"Feeding calling party number from incoming 
setup\",GEN_NA,40,cl);\n"
   "4168\t\t\t\t  
CALL_NOTIFY(addAliasToString(&(CL.callingPartyNumber)),GEN_NA,40,cl);\n"
   "4169\t\t\t\t  
cmCallSetParam(CL.DEST.stack,cmParamCallingPartyNumber,0,sizeof(cmRASAlias),(char*)&(CL.callingPartyNumber));\t\n"
   "4170\t\t\t  }\n"
   "4171\t\t  }\n"
   "4172\t\t  else {  /*first e164 was found*/\n"
   "4173\t\t\t  if (addEmptyAlias(&(CL.callingPartyNumber)) || \n"
   "4174\t\t\t\t  
addEqualAlias(&(CL.callingPartyNumber),&(CL.srcInfo[firstE164])) ){\n"
   "4175\t\t\t\t  /*no calling party number, or equal aliases put the first 
e164 \n"
   "4176\t\t\t\t  in the calling party number field */\n"
   "4177\t\t\t\t  if (!addEmptyAlias(&(CL.srcInfo[firstE164]))){\n"
   "4178\t\t\t\t\t  CALL_NOTIFY(\"Feeding calling party number form ARQ 
srcAddresses\",GEN_NA,40,cl);\n"
   "4179\t\t\t\t\t  
CALL_NOTIFY(aliasToString(&(CL.srcInfo[firstE164])),GEN_NA,40,cl);\n"
   "4180\t\t\t\t\t  
cmCallSetParam(CL.DEST.stack,cmParamCallingPartyNumber,0,sizeof(cmRASAlias),(char*)&(CL.srcInfo[firstE164]));\n"
   "4181\t\t\t\t  }\n"
   "4182\t\t\t\t  /*saving the source aliases list, without the first e164*/\n"
   "4183\t\t\t\t  
cmuDownLoadAliasList(&message,cmParamSourceAddress,firstE164,&(CL.srcInfo[0]));\n"
   "4184\t\t\t\t  
cmuDownLoadAliasList(&message,cmParamSourceAddress,SOURCE_NUMBER-firstE164-1,&(CL.srcInfo[firstE164+1]));\n"
   "4185\t\t\t\t  \n"
   "4186\t\t\t  }\t\n"
   "4187\t\t\t  else {\n"
   "4188\t              /*the calling party number is not empty and is not 
equal to the \n"
   "4189\t\t\t\t\tfirst e164 - Feeding calling party number from incoming 
setup*/\n"
   "4190\t\t\t\t  CALL_NOTIFY(\"Feeding calling party number from incoming 
setup\",GEN_NA,40,cl);\n"
   "4191\t\t\t\t  
CALL_NOTIFY(aliasToString(&(CL.callingPartyNumber)),GEN_NA,40,cl);\n"
   "4192\t\t\t\t  
cmCallSetParam(CL.DEST.stack,cmParamCallingPartyNumber,0,sizeof(cmRASAlias),(char*)&(CL.callingPartyNumber));\t
  \n"
   "4193\t\t\t\t  
cmuDownLoadAliasList(&message,cmParamSourceAddress,SOURCE_NUMBER,&(CL.srcInfo[0]));\n"
   "4194\t\t\t\t\t  \n"
   "4195\t\t\t  }\n"
   "4196\t\t  }\n"
   "4197\t      \n"
   "4198\t      /*xyx 
cmCallSetParam(CL.DEST.stack,cmParamCalledPartySubAddress,0,sizeof(cmRASAlias),(char*)&(CL.destSubAddress));*/\n"
   "4199\t      cmuDeleteTree(hpvt,setupNode2,\"destExtraCallInfo\");\n"
   "4200\t      
cmuDownLoadAliasList(&message,cmParamDestExtraCallInfo,DESTINATION_NUMBER,CL.destExtra);\n"
   "4201\t      if (addEmptyAlias(&CL.remoteExtension))\n"
   "4202\t        cmuDeleteTree(hpvt,setupNode2,\"remoteExtensionAddress\");\n"
   "4203\t      else\n"
   "4204\t        cmCallSetParam(message.hsCall, cmParamExtention, 0, 
sizeof(cmRASAlias), (char*)&CL.remoteExtension);\n"
   "4205\t   "
<- "  \n"
   "4206\t      cmuDeleteTree(hpvt,setupNode2,\"activeMC\");\n"
   "4207\t      
cmCallSetParam(CL.DEST.stack,cmParamActiveMc,0,CL.ORIG.activeMc,NULL);\n"
   "4208\t      if (memcmp(CL.cid, emptyGuid,GUID_LEN))\n"
   "4209\t      {\n"
   "4210\t        cmuDeleteTree(hpvt,setupNode2,\"conferenceID\");\n"
   "4211\t        
cmCallSetParam(CL.DEST.stack,cmParamCID,0,sizeof(CL.cid),CL.cid);\n"
   "4212\t      }\n"
   "4213\t      else\n"
   "4214\t      {\n"
   "4215\t        int cidLen = sizeof(CL.cid);\n"
   "4216\t        cmCallGetParam(CL.DEST.stack,cmParamCID, 0, &cidLen, 
CL.cid);\n"
   "4217\t      }\n"
   "4218\t\n"
   "4219\t      if (memcmp(CL.DEST.callID,emptyGuid,GUID_LEN))\n"
   "4220\t      {\n"
   "4221\t        cmuDeleteTree(hpvt,setupNode2,\"callIdentifier.guid\");\n"
   "4222\t        cmCallSetParam(CL.DEST.stack, cmParamCallID, 
0,sizeof(CL.DEST.callID),CL.DEST.callID);\n"
   "4223\t      }\n"
   "4224\t      else\n"
   "4225\t      {\n"
   "4226\t        int callIdLen = sizeof(CL.DEST.callID);\n"
   "4227\t        if 
(cmCallGetParam(CL.DEST.stack,cmParamCallID,0,&callIdLen,CL.DEST.callID) < 0)\n"
   "4228\t          CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8611, cl,\"downloadToSetup: cmCallGetParam failed for call identifier\"));\n"
   "4229\t      }\n"
   "4230\t      \n"
   "4231\t      cmuDeleteTree(hpvt,setupNode2,\"conferenceGoal\");\n"
   "4232\t      
cmCallSetParam(CL.DEST.stack,cmParamConferenceGoal,0,CL.confGoal,NULL); \n"
   "4233\t      cmuDeleteTree(hpvt,setupNode2,\"callType\");\n"
   "4234\t      
cmCallSetParam(CL.DEST.stack,cmParamCallType,0,CL.callType,NULL);\n"
   "4235\t      cmuDeleteTree(hpvt,setupNode2,\"h245Address\");\n"
   "4236\t      if (CL.mcRoutedMode)\n"
   "4237\t\t\t\t{\n"
   "4238\t\t\t\t\tcmuDeleteTree(hpvt,setupNode2,\"fastStart\");\n"
   "4239\t\t\t\t\tcmuDeleteTree(hpvt,h323pduNode,\"h245Control\");\n"
   "4240\t\t\t\t\t/* Following line removed because of lack of support for 
H.245 tunneling.\n"
   "4241\t\t\t\t\t  All Setup messages received by GK will contain 
h245Tunneling=0 */\n"
   "4242\t\t\t\t\t/*cmuDeleteTree(hpvt,h323pduNode,\"h245Tunneling\");*/\n"
   "4243\t\t\t\t\tif (CL.DEST.mcH245Addr.ip != 0)\n"
   "4244\t\t\t\t\t{\n"
   "4245\t\t\t\t\t\tCALL_NOTIFY(\"Forwarding MC supplied H.245 
address\",GEN_NA,20,cl);\n"
   "4246\t\t\t\t\t\tCALL_NOTIFY(addIpToString(&CL.setupH245Add),GEN_NA,20,cl); 
\n"
   
"4247\t\t\t\t\t\tcmCallSetParam(CL.DEST.stack,cmParamSetupH245Address,0,sizeof(cmRASTransport),(char*)&(CL.DEST.mcH245Addr));\n"
   "4248\t\t\t\t\t}\n"
   "4249\t\t\t\t\telse\n"
   "4250\t\t\t\t\t{\n"
   "4251\t\t\t\t\t\tCALL_NOTIFY(\"MC supplied H.245 address = 0.Will not send 
it with setup\",GEN_NA,20,cl);\n"
   "4252\t\t\t\t\t}\n"
   "4253\t\t\t\t}\n"
   "4254\t      else if(CL.setupH245Add.ip != 0)\n"
   "4255\t      {\t\t  \n"
   "4256\t\t\t  if(isService && 
gkcfgFlagValue(GKCFG_REMOVE_H245ADRS_IN_CALL_HUNTING_OR_CFNR_OR_CFB)) /* 
shiri:removing H245 address from setup in service call, if requested */\n"
   "4257\t\t\t  {\n"
   "4258\t\t\t\t\tCL.setupH245Add.ip = 0; \n"
   "4259\t\t\t\t\tCL.setupH245Add.port = 0;\n"
   "4260\t\t\t\t\tCALL_NOTIFY(\"setup H.245 address = 0.Will not forward 
it\",GEN_NA,20,cl);\n"
   "4261\t\t\t  }\n"
   "4262\t\t\t  else\n"
   "4263\t\t\t  {\n"
   "4264\t\t\t\t\tCALL_NOTIFY(\"Forwarding setup H.245 
address\",GEN_NA,20,cl);\n"
   "4265\t\t\t\t\tCALL_NOTIFY(addIpToString(&CL.setupH245Add),GEN_NA,20,cl); \n"
   
"4266\t\t\t\t\tcmCallSetParam(CL.DEST.stack,cmParamSetupH245Address,0,sizeof(cmRASTransport),(char*)&(CL.setupH245Add));\n"
   "4267\t\t\t  }\n"
   "4268\t      }\n"
   "4269\t      else\n"
   "4270\t      {\n"
   "4271\t        CALL_NOTIFY(\"setup H.245 address = 0.Will not forward 
it\",GEN_NA,20,cl);\n"
   "4272\t      }\n"
   "4273\t      
cmCallSetParam(CL.DEST.stack,cmParamDestinationIpAddress,0,sizeof(cmRASTransport),(char*)&(CL.destCallSignal));\n"
   "4274\t      cmuDeleteTree(hpvt,setupNode2,\"destCallSignalAddress\");\n"
   "4275\t      
cmCallSetParam(CL.DEST.stack,cmParamDestCallSignalAddress,0,sizeof(cmRASTransport),(char*)&(CL.destCallSignal));\n"
   "4276\t      cmuDeleteTree(hpvt,setupNode2,\"sourceCallSignalAddress\");\n"
   "4277\t      
cmCallSetParam(CL.DEST.stack,cmParamSrcCallSignalAddress,0,sizeof(cmRASTransport),(char*)&(CL.srcCallSignal));\n"
   "4278\t      \n"
   "4279\t      /* version 1 - version 2 synchronization */\n"
   "4280\t      buffLen=utlEncodeOID(sizeof(buf), buf,\"itu-t recommendation h 
2250 0 2\");\n"
   "4281\t      cmuDeleteTree(hpvt,setupNode2,\"protocolIdentifier\");\n"
   "4282\t      pvtBuildByPath(hpvt, setupNode2, \"protocolIdentifier\", 
buffLen, buf);\n"
   "4283\t      \n"
   "4284\t      pvtBuildByPath(hpvt, setupNode2, \"mediaWaitForConnect\", 
CL.mediaWaitForConnect, NULL);\n"
   "4285\t\n"
   "4286\t\t/* canOverlapSend and sendingComplete fiel"
<- "ds are handled in state event handler in\n"
   "4287\t\tstate dialTone */\n"
   "4288\t      appendSupplementaryServices(cl, DESTINATION);\n"
   "4289\t      }\n"
   "4290\t\n"
   
"4291\t/*----------------------------------------------------------------------------*/\n"
   "4292\tBOOL releaseCompleteCheckAndCopy(/*checks if r.c. is supposed to 
copied from srcSide to destSide\n"
   "4293\t                                 and if so, does the copying. returns 
FALSE on error*/\n"
   "4294\t                                 side_t destSide,\n"
   "4295\t                                 side_t srcSide,\n"
   "4296\t                                 int cl,\n"
   "4297\t                                 stateMode_t stateMode)\n"
   "4298\t{\n"
   "4299\t  int origReleaseCompleteNode,destReleaseCompleteNode, outRCNode;\n"
   "4300\t  HPVT hpvt;\n"
   "4301\t  if (releaseCompleteCheck(destSide,srcSide,cl,stateMode) == FALSE)\n"
   "4302\t    return TRUE;\n"
   "4303\t  hpvt = cmGetValTree(dispStack);  \n"
   "4304\t  origReleaseCompleteNode = 
pvtGetNodeIdByPath(hpvt,cmGetProperty((HPROTOCOL)(CL.ORIG.stack)),\"releaseComplete\");\n"
   "4305\t  destReleaseCompleteNode = 
pvtGetNodeIdByPath(hpvt,cmGetProperty((HPROTOCOL)(CL.DEST.stack)),\"releaseComplete\");\n"
   "4306\t\n"
   "4307\t  if (!(origReleaseCompleteNode >= 0 && destReleaseCompleteNode >= 
0))\n"
   "4308\t  {\n"
   "4309\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8612, 
cl,\"pvtGetNodeIdByPath returned error when accessing releaseComplete.will not 
copy\"));\n"
   "4310\t    return FALSE;\n"
   "4311\t  }\n"
   "4312\t\n"
   "4313\t  if (destSide == ORIGIN)\n"
   "4314\t  {\n"
   "4315\t    CALL_NOTIFY(\"copying release complete from destination to 
origin\",GEN_NA,20,cl);\n"
   "4316\t    
pvtSetTree(hpvt,origReleaseCompleteNode,hpvt,destReleaseCompleteNode);\n"
   "4317\t\t  outRCNode = origReleaseCompleteNode;\n"
   "4318\t  }\n"
   "4319\t  else\n"
   "4320\t  {\n"
   "4321\t    CALL_NOTIFY(\"copying release complete from origin to 
destination\",GEN_NA,20,cl);\n"
   "4322\t    
pvtSetTree(hpvt,destReleaseCompleteNode,hpvt,origReleaseCompleteNode);\n"
   "4323\t\t  outRCNode = destReleaseCompleteNode;\n"
   "4324\t  }\n"
   "4325\t\n"
   "4326\t  /* RVrep00001005: If octet3 is missing from releaseComplete message 
add it using the PVT\n"
   "4327\t  API. Stack adds octet4 only and release complete cannot be sent 
with octet4 but no octet3.\n"
   "4328\t  This is a workaround to a stack bug. */\n"
   "4329\t  if (pvtGetNodeIdByPath(hpvt, outRCNode, 
\"message.releaseComplete.cause.octet3\") < 0)\n"
   "4330\t  {\n"
   "4331\t\t\tint octet3Node = pvtBuildByPath(hpvt, outRCNode, 
\"message.releaseComplete.cause.octet3\", 0, NULL);\n"
   "4332\t\t\tpvtBuildByPath(hpvt, octet3Node, \"codingStandard\", 0, NULL);\n"
   "4333\t\t\tpvtBuildByPath(hpvt, octet3Node, \"spare\", 0, NULL);\n"
   "4334\t\t\tpvtBuildByPath(hpvt, octet3Node, \"location\", 0, NULL);\n"
   "4335\t  }\n"
   "4336\t\n"
   "4337\t  return TRUE;\n"
   "4338\t}\n"
   
"4339\t/*----------------------------------------------------------------------------*/\n"
   "4340\tBOOL releaseCompleteCheck(/*returns TRUE if r.c. is supposed to 
copied from srcSide to destSide*/\n"
   "4341\t                          side_t destSide,\n"
   "4342\t                          side_t srcSide,\n"
   "4343\t                          int cl,\n"
   "4344\t                          stateMode_t stateMode)\n"
   "4345\t{\n"
   "4346\t\n"
   "4347\t  if(srcSide);\n"
   "4348\t\n"
   "4349\t  if (CL.sideMap != JOINED)\n"
   "4350\t    return FALSE;\n"
   "4351\t\n"
   "4352\t  if (stateMode == cmCallStateModeDisconnectedLocal)\n"
   "4353\t    return FALSE;\n"
   "4354\t  if (CL.DEST.stack == NULL || CL.ORIG.stack == NULL)\n"
   "4355\t    return FALSE;\n"
   "4356\t  if (destSide == ORIGIN)\n"
   "4357\t  {\n"
   "4358\t    if ((CL.ORIG.state == cmCallStateDisconnected) || (CL.ORIG.state 
== cmCallStateIdle))\n"
   "4359\t      return FALSE;\n"
   "4360\t  }\n"
   "4361\t  else /* destSide == DESTINATION */\n"
   "4362\t  {\n"
   "4363\t    if ((CL.DEST.state == cmCallStateDisconnected) || ((CL.DEST.state 
== cmCallStateIdle) && !CL.setupSend))\n"
   "4364\t      return FALSE;\n"
   "4365\t  }\n"
   "4366\t  \n"
   "4367\t  return TRUE;\n"
   "4368\t}\n"
   "4369\t\n"
   
"4370\t/*******************************************************************/\n"
   "4371\t/* Sending Q.931 and RAS Messages                                  
*/\n"
   
"4372\t/*******************************************************************/\n"
   "4373\t\n"
   "4374\tBOOL ACF(/* generate an ACF messages return true/false on success*/\n"
   "4375\t         IN HRAS hsRas,\n"
   "4376\t         IN int cl,\n"
   "4377\t         IN side_t side)\n"
   "4378\t         \n"
   "4379\t{\n"
   "4380\t  BOOL retCode;\n"
   "4381\t  HCALL hsCall = N"
<- "ULL;\n"
   "4382\t  gkcciSide_t hside;\n"
   "4383\t  \n"
   "4384\t  if (CL.destZone == DEST_ZONE_EXTERNAL)/*naomi merge*/\n"
   "4385\t                  CL.model = cmRASCallModelTypeGKRouted;/*xyx maybe 
in verison 2 of statndard out going calls\n"
   "4386\t  will be allowed to be direct  naomi merge */\n"
   "4387\t  if (CL.service == NET3_NOT_SERVICE && CL.callService == 
SRV_INVALID_SERV) \n"
   "4388\t  {\n"
   "4389\t    CALL_NOTIFY(\"sending admission confirm\",GEN_NA,10,cl);\n"
   "4390\t  }\n"
   "4391\t  else\n"
   "4392\t  {\n"
   "4393\t    CALL_NOTIFY(\"sending admission confirm for SERVICE 
call\",GEN_NA,10,cl);\n"
   "4394\t  }\n"
   "4395\t  
cmRASSetParam(hsRas,cmRASTrPartConfirm,cmRASParamCallModel,0,CL.model,NULL);\n"
   "4396\t  \n"
   "4397\t  if (side == DESTINATION)\n"
   "4398\t  {\n"
   "4399\t    int val;\n"
   "4400\t    cmuMessage_t message;\n"
   "4401\t    cmRASTransport destCs;\n"
   "4402\t    destCs.ip = 0;\n"
   "4403\t    hside = gkcciSideDest;\n"
   "4404\t    cmuLoadParams(message,CMU_RAS,hsRas,cmRASTrPartRequest,NULL);\n"
   "4405\t    \n"
   "4406\t    if (!addEmptyTransport(&(CL.destCallSignal)))\n"
   "4407\t      
cmRASSetParam(hsRas,cmRASTrPartConfirm,cmRASParamDestCallSignalAddress,0,sizeof(cmRASTransport),(char*)&(CL.destCallSignal));\n"
   "4408\t    else\n"
   "4409\t    {\n"
   "4410\t      
cmuGetParam(&message,cmRASParamDestCallSignalAddress,FALSE,0,&val,(char*)&destCs);\n"
   "4411\t      if (!addEmptyTransport(&destCs))/*otherwise GK address will be 
returned by default*/\n"
   "4412\t        
cmRASSetParam(hsRas,cmRASTrPartConfirm,cmRASParamDestCallSignalAddress,0,sizeof(cmRASTransport),(char*)&destCs);\n"
   "4413\t    }\n"
   "4414\t  }\n"
   "4415\t  else/*side == ORIGIN*/\n"
   "4416\t  {\n"
   "4417\t    cmuMessage_t message;\n"
   "4418\t    cmuLoadParams(message,CMU_RAS,hsRas,cmRASTrPartConfirm,NULL);\n"
   "4419\t    hside = gkcciSideOrig;\n"
   "4420\t    
cmuDownLoadAliasList(&message,cmRASParamDestInfo,DESTINATION_NUMBER,CL.destInfo);\n"
   "4421\t    /*bug fix - sarit 25/6/00 - the parameter was 
cmParamDestExtraCallInfo and not\n"
   "4422\t\t  cmRASParamDestExtraCallInfo*/\n"
   
"4423\t\tcmuDownLoadAliasList(&message,cmRASParamDestExtraCallInfo,DESTINATION_NUMBER,CL.destExtra);\n"
   "4424\t    /* Download remoteExtension address. */\n"
   "4425\t    if (!addEmptyAlias(&(CL.remoteExtension))) \n"
   "4426\t    {\n"
   "4427\t      int remExtNode;\n"
   "4428\t      HPVT hpvt = cmGetValTree(dispStack);\n"
   "4429\t      if ((remExtNode = pvtBuildByPath(hpvt, 
cmGetProperty((HPROTOCOL)(hsRas)), 
\"response.admissionConfirm.remoteExtensionAddress.0\", 0, NULL)) < 0)\n"
   "4430\t      {\n"
   "4431\t        GK_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8601, \"ACF: remote extension node could not be accessed\"));\n"
   "4432\t      }\n"
   "4433\t      if (cmAlias2Vt(hpvt,&(CL.remoteExtension),remExtNode) < 0)\n"
   "4434\t      {\n"
   "4435\t        GK_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8602, \"ACF: remote extension alias could not be set\"));\n"
   "4436\t      }\n"
   "4437\t    }\n"
   "4438\t    if (CL.model==cmRASCallModelTypeDirect)\n"
   "4439\t      
cmRASSetParam(hsRas,cmRASTrPartConfirm,cmRASParamDestCallSignalAddress,0,sizeof(cmRASTransport),(char*)&(CL.destCallSignal));\n"
   "4440\t  }\n"
   "4441\t  \n"
   "4442\t  rgrasSetReplyAddress(hsRas,cmRASTrPartConfirm);\n"
   "4443\t\n"
   "4444\t  {\n"
   "4445\t  \tcmRASTransport\t\tsource;\n"
   "4446\t\n"
   "4447\t\t(void) memcpy((char *) &source, (char *) &(CL.srcCallSignal),\n"
   "4448\t\t\t\tsizeof(source));\n"
   "4449\t\n"
   "4450\t\tif(!source.ip)\n"
   "4451\t\t{\n"
   "4452\t\t\tGK_NOTIFY(\"!!!src ip is not set; retrieving it!!!\", 
GEN_NA,10);\n"
   "4453\t\t\tget_source_ip(hsRas, &source);\n"
   "4454\t\t}\n"
   "4455\t\n"
   "4456\t  }\n"
   "4457\t\n"
   "4458\t  /*xyx perhaps there are other states where change_state should be 
avoided*/\n"
   "4459\t  if (CL.state != CAL_HUNTING)\n"
   "4460\t    CHANGE_STATE(CAL_RAS_CONNECT,\"ACF issued\");\n"
   "4461\t  DBGL_CONDITION(30,calPrintCallTitles(cl));\n"
   "4462\t  \n"
   "4463\t  if(!sendMsgEvent(cl, gkcciMsgSendACF, (side == 
ORIGIN?gkcciSideOrig:gkcciSideDest)))\n"
   "4464\t  {       \n"
   "4465\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8613, 
cl, \"ACF: Failed in sending ACF send message notification to 
application\"));\n"
   "4466\t    return FALSE;\n"
   "4467\t  }\n"
   "4468\t  \n"
   "4469\t\tif (!CL.SIDE.bw.wasAllocated)\n"
   "4470\t    
bwAllocateBandwidth(cl,side,CL.SIDE.bw.bwReq,gkcciRsnBWinARQ,FALSE);\n"
   "4471\t\n"
   "4472\t  
cmRASSetParam(hsRas,cmRASTrPartConfirm,cmRASParamBandwidth,0,CL.SIDE.bw.bwApp,NULL);\n"
   "4473\t  if (CL.DEST.endpointType != cmRASEndpointTypeUndefined)\n"
   "4474\t  {\n"
   "4475\t    HPVT hpvt = cmGetValTree(dispStack);\n"
   "4476\t    int nodeId = pvtBuildByPath(hpvt, 
cmGetProperty((HPROTOCOL)hsRas), \"response.admissionConfirm.destinationType\", 
0, NULL);\n"
   "4477\t    if (nodeId >= 0)\n"
   "4478\t      cmuRASSetDestinationType(hpvt,nodeId,CL.DEST.endpointType);\n"
   "4479\t  }\n"
   "4480\t  /*shiri 01/2001*/\n"
   "4481\t  if(CL.accessTokenNodeID > 0) {\n"
   "4482\t\tHPVT hpvt = cmGetValTree(dispStack);\n"
   "4483\t    int oldNodeId = pvtBuildByPath(hpvt, 
cmGetProperty((HPROTOCOL)hsRas), 
\"response.admissionConfirm.cryptoTokens.nestedcryptoToken\", 0, NULL);\n"
   "4484\t\tpvtSetTree(hpvt, oldNodeId, hpvt,  CL.accessTokenNodeID);\n"
   "4485\t }\n"
   "4486\t  /* let the app access the ACF before sending it */\n"
   "4487\t  getCallHandle(cl, hside, &hsCall);\n"
   "4488\t  hookToCall((gkHCALL)CL.handle, (gkHAPPCALL *)&CL.appHandle, hsCall, 
hsRas, \n"
   "4489\t    gkcciMsgSendACF, hside);\n"
   "4490\t  \n"
   "4491\t  /*senfing the ACF*/\n"
   "4492\t  retCode = cmuConfirm(hsRas);\n"
   "4493\t  /*setting the time for the first ACF to leave the gatekeeper for 
this call*/\n"
   "4494\t  if(retCode) {\n"
   "4495\t\t  if(CL.timeOfACF == 0)\n"
   "4496\t\t\t  CL.timeOfACF = gkTiSeconds();\n"
   "4497\t\t  if(CL.usecTimeOfACF == 0)\n"
   "4498\t\t\t  CL.usecTimeOfACF = gkTiMilliseconds();\n"
   "4499\t  }\n"
   "4500\t  CL.SIDE.bw.wasAllocated = FALSE;\n"
   "4501\t  CL.isARQ = NO_ARQ;\n"
   "4502\t  if (side == DESTINATION)\n"
   "4503\t  {\n"
   "4504\t    if(!sendStateEvent(cl, gkcciSttWaitForNWConnect, 
gkcciRsnUndefined))\n"
   "4505\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8614, cl, \"ACF: Failed in sending WaitForNWConnect notification to the 
application\"));\n"
   "4506\t  }\n"
   "4507\t  else /* ORIGIN */\n"
   "4508\t  {\n"
   "4509\t    if(!sendStateEvent(cl, gkcciSttWaitForSetup, 
gkcciRsnUndefined))\n"
   "4510\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8615, cl, \"ACF: Failed in sending WaitForSetup notification to the 
application\"));\n"
   "4511\t  }\n"
   "4512\t  return retCode;\n"
   "4513\t}\n"
   "4514\t            \n"
   "4515\tBOOL ARJ(/*generate an ARJ message. return true/false on success */\n"
   "4516\t         IN HRAS hsRas,\n"
   "4517\t         IN cmRASReason reason,\n"
   "4518\t         IN int cl,\n"
   "4519\t         IN side_t side)\n"
   "4520\t{\n"
   "4521\t  cmRASReason finalRejectReason;\n"
   "4522\t  gkcciARJReason_t gkFinalRejectReason;\n"
   "4523\t  BOOL success=TRUE;\n"
   "4524\t  HCALL handle = NULL;\n"
   "4525\t  HCALL hsCall = NULL;\n"
   "4526\t  gkHCALL gkhCall = (gkHCALL)GKCCI_NO_GKHCALL;\n"
   "4527\t  gkHAPPCALL *gkhaCallAddr = NULL;\n"
   "4528\t  gkcciSide_t msgSide = (side == 
ORIGIN?gkcciSideOrig:gkcciSideDest);\n"
   "4529\t  gkcciState_t state = gkcciSttOrigAdmissionReject;\n"
   "4530\t   char ARJNotif[100];\n"
   "4531\t  if (hsRas == NULL)\n"
   "4532\t  {\n"
   "4533\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8617, 
cl, \"ARJ: Null RAS handle\"));\n"
   "4534\t    return FALSE;\n"
   "4535\t  }\n"
   "4536\t  \n"
   "4537\t  if (VALID(cl))\n"
   "4538\t  {\n"
   "4539\t    CALL_NOTIFY(\"ARJ\",GEN_NA,10,cl);\n"
   "4540\t  }\n"
   "4541\t  else\n"
   "4542\t    CALL_NOTIFY(\"ARJ for invalid call\",GEN_NA,10,cl);\n"
   "4543\t  \n"
   "4544\t  if (VALID(cl))\n"
   "4545\t  {\n"
   "4546\t    /* this is an ARJ for a call already in the calls table */\n"
   "4547\t    if (side == ORIGIN)\n"
   "4548\t    {\n"
   "4549\t      /* releaseARQ(cl,ORIGIN); !!! release only after callbacks were 
used */\n"
   "4550\t      /*CL.ORIG.ARQ = NULL;*/\n"
   "4551\t      handle = CL.ORIG.stack;\n"
   "4552\t      state = gkcciSttOrigAdmissionReject;\n"
   "4553\t    }\n"
   "4554\t    if (side == DESTINATION)\n"
   "4555\t    {\n"
   "4556\t      /* releaseARQ(cl,DESTINATION); !!! release only after callbacks 
were used */\n"
   "4557\t      /*CL.DEST.ARQ = NULL;*/\n"
   "4558\t      /*if (CL.model==cmRASCallModelTypeDirect) we want to send 
releaseComplete iff there is not setup for the call.\n"
   "4559\t      the previous if did not cover the case of ARJ(routeCallToGK) 
and would therefor not send r.c. in\n"
   "4560\t      this situation - call would not be cleared. The following if 
covers all the cases:newnatan23/11*/\n"
   "4561\t      if (!CL.setupArrived && (CL.sideMap == JOINED)) /* SA_450 */\n"
   "4562\t        handle = CL.DEST.stack;\n"
   "4563\t      state = gkcciSttDestAdmissionReject;\n"
   "4564\t      /* xyx may be better to ask for oringin ARQ */\n"
   "4565\t    }\n"
   "4566\t    \n"
   "4567\t    /* inform the application about disconnecting the call. Don\'t 
wait up.\n"
   "4568\t    Because no answer is needed I can do it in the middle of the 
function.*/\n"
   "4569\t    CALL_NOTIFY(\"Sending admission reject notification to the 
application\",GEN_NA, 3"
<- "1,cl);\n"
   "4570\t    if(!sendMsgEvent(cl, gkcciMsgSendARJ, msgSide))\n"
   "4571\t    {       \n"
   "4572\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8617, cl, \"ARJ: Failed in sending ARJ send message notification to 
application\"));\n"
   "4573\t    }\n"
   "4574\t    if(!sendStateEvent(cl, state,  getAppReason(cl)))\n"
   "4575\t    {       \n"
   "4576\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8618, cl, \"ARJ: Failed in sending admission reject notification to the 
application\"));\n"
   "4577\t    }  \n"
   "4578\t  }\n"
   "4579\t  \n"
   "4580\t  rgrasSetReplyAddress(hsRas,cmRASTrPartReject);\n"
   "4581\t  \n"
   "4582\t  /* let the app access the ARJ before sending it. The hsCall has 
value only */\n"
   "4583\t  /* for valid calls at this point,  unlike the handle which use for 
closing */\n"
   "4584\t  /* the call in the stack and thus has wider \"life span\" */\n"
   "4585\t  if (VALID(cl))\n"
   "4586\t  {\n"
   "4587\t    getCallHandle(cl, msgSide, &hsCall);\n"
   "4588\t    gkhCall = (gkHCALL)CL.handle;\n"
   "4589\t    gkhaCallAddr = (gkHAPPCALL *)&CL.appHandle;\n"
   "4590\t  }\n"
   "4591\t  hookToCall(gkhCall, gkhaCallAddr, hsCall, hsRas, gkcciMsgSendARJ, 
msgSide);\n"
   "4592\t  /*sarit: saving the reason in the call record*/\n"
   "4593\t  if (reason == cmRASReasonUndefined) {\n"
   "4594\t\t  if (VALID(cl))\n"
   "4595\t\t\t  finalRejectReason = ARJRsnApp2cm(cl,CL.SIDE.ARJReason);\n"
   "4596\t\t  else\n"
   "4597\t\t\t  finalRejectReason = reason;\n"
   "4598\t  }\n"
   "4599\t  else {\n"
   "4600\t\t  finalRejectReason = reason;\n"
   "4601\t\t  if(VALID(cl))\n"
   "4602\t\t\tCL.SIDE.ARJReason = ARJRsnCm2App(reason); /*newSarit - add the 
reason to\n"
   "4603\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthe call record*/\n"
   "4604\t  }\n"
   "4605\t  gkFinalRejectReason = ARJRsnCm2App(finalRejectReason);\n"
   "4606\t  if(VALID(cl))\n"
   "4607\t  {\n"
   "4608\t\t  sprintf(ARJNotif,\"ARJ (reason = %s)\", 
gkcciARJReasonName(gkFinalRejectReason));\n"
   "4609\t\t  CALL_NOTIFY(ARJNotif,GEN_NA,10,cl);\n"
   "4610\t  }\n"
   "4611\t  else {\n"
   "4612\t    sprintf(ARJNotif,\"ARJ for invalid call (reason = %s)\", 
gkcciARJReasonName(gkFinalRejectReason));\n"
   "4613\t    CALL_NOTIFY(ARJNotif,GEN_NA,10,cl);\n"
   "4614\t  }\n"
   "4615\t  \n"
   "4616\t  /*getting the final reject reason in gk enum*/\n"
   "4617\t  success = (cmRASReject(hsRas,finalRejectReason)>=0);\n"
   "4618\t  if(success) /*sarit - saving the time*/\n"
   "4619\t\tif (VALID(cl))\n"
   "4620\t\t  CL.timeOfARJ=gkTiSeconds();\n"
   "4621\t\n"
   "4622\t  if (!sendStateEvent(cl, gkcciSttARJSent, gkcciRsnUndefined ))\n"
   "4623\t  {\n"
   "4624\t    CALL_EXEP(\"ARJ: Failed in sending application event on ARJ 
sent\",cl);\n"
   "4625\t    success = FALSE;\n"
   "4626\t  }\n"
   "4627\t  success = ((cmRASClose(hsRas) >= 0) && success);\n"
   "4628\t  \n"
   "4629\t  if (VALID(cl))\n"
   "4630\t    releaseARQ(cl, side);\n"
   "4631\t  \n"
   "4632\t  if (handle && (reason != cmRASIncompleteAddress)) /* OVSP1 */\n"
   "4633\t  {\n"
   "4634\t  /* meir 8/2/99: Send release-complete message event only if Q.931 
\n"
   "4635\t    channels have been opened */\n"
   "4636\t    if (CL.setupArrived)\n"
   "4637\t    {\n"
   "4638\t      if(!sendMsgEvent(cl, gkcciMsgSendDisconnect, msgSide))\n"
   "4639\t      {       \n"
   "4640\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8619, cl, \"ARJ: Failed in sending disconnect send message notification to 
application\"));     \n"
   "4641\t      }\n"
   "4642\t      hookToCall((gkHCALL)CL.handle, (gkHAPPCALL *)&CL.appHandle, 
handle,\n"
   "4643\t        (HRAS)GKCCI_NO_HSRAS,  gkcciMsgSendDisconnect, msgSide);\n"
   "4644\t    }\n"
   "4645\t/*    appendSupplementaryServices(cl, side); */\n"
   "4646\t        \n"
   "4647\t    success = ((callDropParam(cl, 
side,handle,cmReasonTypeUndefinedReason)==0) && success);\n"
   "4648\t  }\n"
   "4649\t  return success;\n"
   "4650\t}\n"
   "4651\t\n"
   "4652\tBOOL getDRQAddress(IN  int             cl,\n"
   "4653\t\t\t\t\t   IN  side_t          side,\n"
   "4654\t\t\t\t\t   OUT cmRASTransport* trans)\n"
   "4655\t{\n"
   "4656\t\tmemset(trans, 0, sizeof(cmRASTransport));\n"
   "4657\t\tif (CL.SIDE.ARQ)\n"
   "4658\t\t{\n"
   "4659\t\t\tif (rgtblValid(CL.SIDE.reg))\n"
   "4660\t\t\t{\n"
   "4661\t\t\t\tif (!rgutilGetFirstDynamic(ADD_RAS,CL.SIDE.reg,trans))\n"
   "4662\t\t\t\t{\n"
   "4663\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8791, cl,\"error in rgutilGetFirstDynamic in getDRQAddress for reg 
%d\",CL.SIDE.reg ));\n"
   "4664\t\t\t\t\treturn FALSE;\n"
   "4665\t\t\t\t}\n"
   "4666\t\t\t\tif (!addEmptyTransport(trans))\n"
   "4667\t\t\t\t\treturn TRUE;\n"
   "4668\t\t\t}\n"
   "4669\t\t}\n"
   "4670\t\treturn FALSE;\n"
   "4671\t}\n"
   "4672\t\n"
   "4673\tBOOL sendDRQ(\n"
   "4674\t\t\t\t IN int cl)\n"
   "4675\t\t\t\t \n"
   "4676\t{\n"
   "4677\t\tside_t side;\n"
   "4678\t\tHRAS hsRas;\n"
   "4679\t\tHCALL hsCall;\n"
   "4680\t\tgkcciSide_t hside;\n"
   "4681\t\tBOOL retCode;\n"
   "4682\t\t\n"
   "4683\t\n"
   "4684\t\tif (!setDRQ(cl,&side,&hsRas))\n"
   "4685\t\t\treturn FALSE;\n"
   "4686\t  \n"
   "4687\t  /* inform the application about sending DRQ to the call. Don\'t 
wait up */\n"
   "4688\t  CL.SIDE.GKDRQ = hsRas;\n"
   "4689\t  CALL_NOTIFY(\"Sending notification to the application before 
sending DRQ\",GEN_NA, 31,cl);\n"
   "4690\t  \n"
   "4691\t  hside = (side == ORIGIN) ? gkcciSideOrig:gkcciSideDest;\n"
   "4692\t  \n"
   "4693\t  if(!sendMsgEvent(cl, gkcciMsgSendGKDRQ, hside))\n"
   "4694\t  {       \n"
   "4695\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8621, 
cl, \"sendDRQ: Failed in sending GKDRQ send message notification to 
application\"));\n"
   "4696\t  } \n"
   "4697\t  \n"
   "4698\t  /* let the app access the message before sending it */\n"
   "4699\t  if (!getCallHandle(cl, hside, &hsCall)) hsCall = NULL;\n"
   "4700\t  hookToCall((gkHCALL)CL.handle, (gkHAPPCALL *)&CL.appHandle, hsCall, 
hsRas, \n"
   "4701\t    gkcciMsgSendGKDRQ, hside);\n"
   "4702\t  \n"
   "4703\t  if(!sendStateEvent(cl, gkcciSttGKInitiatedDRQ,  
gkcciRsnUndefined))\n"
   "4704\t  {\n"
   "4705\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8622, 
cl,\"sendDRQ: Failed in sending gk initiated DRQ notification to the 
application\"));\n"
   "4706\t  } \n"
   "4707\t  /*set the DRQ time for that call*/\n"
   "4708\t   if(CL.timeOfDRQ == 0)   /*this is the first DRQ*/\n"
   "4709\t\t   CL.timeOfDRQ = gkTiSeconds();\n"
   "4710\t  \n"
   "4711\t  retCode = (cmRASRequest(hsRas) == 0 );\n"
   "4712\t  CL.SIDE.GKDRQ = (HRAS)NULL;\n"
   "4713\t  return retCode;\n"
   "4714\t}\n"
   "4715\t\n"
   "4716\tBOOL setDRQ(\n"
   "4717\t\t\t\tIN\tint\t\t\t\t\t\t\tcl,\n"
   "4718\t\t\t\tOUT\tside_t*\t\t\t\t\tsd,\n"
   "4719\t\t\t\tOUT HRAS*\t\t\t\t\t\thsRas)\n"
   "4720\t{\n"
   "4721\t\tHCALL hsCall;\n"
   "4722\t\tside_t side;\n"
   "4723\t\tcmRASTransport trans;\n"
   "4724\t\tcmRASAlias endpId;\n"
   "4725\t\tchar endpIdBuf[ADD_MAX_BUF];\n"
   "4726\t\tchar buf[120];\n"
   "4727\t\tBOOL answeredCall;\n"
   "4728\t\tcmuMessage_t message;\n"
   "4729\t\tendpId.string=endpIdBuf;\n"
   "4730\t\tendpId.type=cmRASAliasTypeEndpointID;\n"
   "4731\t\tendpId.length = 0;\n"
   "4732\t\ttrans.ip = 0;\n"
   "4733\t\n"
   "4734\t\tif (getDRQAddress(cl, ORIGIN, &trans))\n"
   "4735\t\t{\n"
   "4736\t\t\t*sd = ORIGIN;\n"
   "4737\t\t\tansweredCall = 0;\n"
   "4738\t\t}\n"
   "4739\t\telse if (getDRQAddress(cl, DESTINATION, &trans))\n"
   "4740\t\t{\n"
   "4741\t\t\t*sd = DESTINATION;\n"
   "4742\t\t\tansweredCall = 1;\n"
   "4743\t\t}\n"
   "4744\t\telse\n"
   "4745\t\t{\n"
   "4746\t\t\tCALL_NOTIFY(\"setDRQ: DRQ will not be sent to either 
side\",GEN_NA,30,cl);\n"
   "4747\t\t\treturn FALSE;\n"
   "4748\t\t}\n"
   "4749\t\tside = *sd;\n"
   "4750\t\tsprintf(buf,\"sending disengage request to %s. 
endpoint=%i\",addIpToString(&trans),CL.SIDE.reg);\n"
   "4751\t  CALL_NOTIFY(buf,GEN_NA,10,cl);\n"
   "4752\t  if (!rgtblEndpointId(RGTBL_GET,CL.SIDE.reg,&endpId))\n"
   "4753\t  {\n"
   "4754\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8791, 
cl,\"rgtblEndpointId failed at setDRQ for endpoint %d\",CL.SIDE.reg ));\n"
   "4755\t    return FALSE;\n"
   "4756\t  }\n"
   "4757\t\tif (CL.SIDE.recovered && CL.SIDE.dummyStack)\n"
   "4758\t\t\thsCall = (HCALL)NULL;\n"
   "4759\t\telse\n"
   "4760\t\t\thsCall = CL.SIDE.stack;\n"
   
"4761\t\tcmRASStartTransaction(dispStack,(HAPPRAS)&(CL.SIDE.callNo),hsRas,cmRASDisengage,&trans,hsCall);\n"
   "4762\t  cmuLoadParams(message,CMU_RAS,*hsRas,cmRASTrPartRequest,NULL);\n"
   "4763\t  
cmuSetParam(&message,cmRASParamEndpointID,0,sizeof(endpId),(char*)&(endpId));\n"
   "4764\t  
cmuSetParam(&message,cmRASParamDisengageReason,0,disconnectRsnToDRQRsn(CL.SIDE.disconnectReason),(char*)NULL);\n"
   "4765\t  
cmuSetParam(&message,cmRASParamAnsweredCall,0,answeredCall,(char*)NULL);\n"
   "4766\t\n"
   "4767\t  if (!cmuDownloadGkId(*hsRas,cmRASTrPartRequest))\n"
   "4768\t  {\n"
   "4769\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 0, 
cl,\"cmuDownloadGkId failed at setDRQ\" ));\n"
   "4770\t  }\n"
   "4771\t\tif (!hsCall) {\n"
   "4772\t\t\tUINT16 crv = CL.SIDE.CRVras ^ 0x8000;\n"
   
"4773\t\t\tcmuSetParam(&message,cmRASParamCallID,0,sizeof(guid_t),(char*)CL.SIDE.callID);\n"
   
"4774\t\t\tcmuSetParam(&message,cmRASParamCID,0,sizeof(guid_t),(char*)CL.cid);\n"
   "4775\t\t\tcmuSetParam(&message,cmRASParamCRV,0,crv,(char*)NULL);\n"
   "4776\t\t}\n"
   "4777\t\treturn TRUE;\n"
   "4778\t}\n"
   "4779\t\n"
   "4780\tBOOL DCF(\n"
   "4781\t         IN HRAS hsRas,\n"
   "4782\t         IN int cl,\n"
   "4783\t         IN side_t side)\n"
   "4784\t{\n"
   "4785\t  BOOL success;\n"
   "4786\t  gkcciSide_t hside;\n"
   "4787\t  HCALL hsCall = NULL;\n"
   "4788\t  \n"
   "4789\t  CALL_NOTIFY(\"DCF\",GEN_NA,10,cl);\n"
   "4790\t  rgrasSetReplyAddress(hsRas,cmRASTrPartConfirm);\n"
   "4791\t  \n"
   "4792\t  hside = ((side == ORIGIN)?gkcciSideOrig:gkcciSideDest);\n"
   "4793\t  \n"
   "4794\t  if(!sendMsgEvent(cl, gkcci"
<- "MsgSendDCF, hside))\n"
   "4795\t  {       \n"
   "4796\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8623, 
cl, \"DCF: Failed in sending DCF send message notification to 
application\"));\n"
   "4797\t    return FALSE;\n"
   "4798\t  }\n"
   "4799\t  \n"
   "4800\t  /* let the app access the DCF before sending it */\n"
   "4801\t  getCallHandle(cl, hside, &hsCall);\n"
   "4802\t  hookToCall((gkHCALL)CL.handle, (gkHAPPCALL *)&CL.appHandle, hsCall, 
\n"
   "4803\t    hsRas, gkcciMsgSendDCF, hside);\n"
   "4804\t  \n"
   "4805\t  success=cmuConfirm(hsRas);\n"
   "4806\t  if(!success)\n"
   "4807\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8624, 
cl,\"Error in DCF\"));\n"
   "4808\t\n"
   "4809\t  {\n"
   "4810\t  \tcmRASTransport\t\tsource;\n"
   "4811\t\n"
   "4812\t\t(void) memcpy((char *) &source, (char *) &(CL.srcCallSignal),\n"
   "4813\t\t\t\tsizeof(source));\n"
   "4814\t\n"
   "4815\t\tif(!source.ip)\n"
   "4816\t\t{\n"
   "4817\t\t\tGK_NOTIFY(\"!!!src ip is not set; retrieving it!!!\", 
GEN_NA,10);\n"
   "4818\t\t\tget_source_ip(hsRas, &source);\n"
   "4819\t\t}\n"
   "4820\t\n"
   "4821\t  }\n"
   "4822\t\n"
   "4823\t  return success;\n"
   "4824\t}\n"
   "4825\t\n"
   "4826\tBOOL DRJ(\n"
   "4827\t         IN HRAS hsRas,\n"
   "4828\t         IN cmRASReason reason,\n"
   "4829\t         IN int cl,\n"
   "4830\t         IN side_t side)\n"
   "4831\t{\n"
   "4832\t  BOOL success;\n"
   "4833\t  gkcciSide_t hside;\n"
   "4834\t  HCALL hsCall = (HCALL)NULL;\n"
   "4835\t  gkHCALL gkhCall = (gkHCALL)GKCCI_NO_GKHCALL;\n"
   "4836\t  gkHAPPCALL *gkhaCallAddr = NULL;\n"
   "4837\t  \n"
   "4838\t  CALL_NOTIFY(\"DRJ issued\",GEN_NA,10,cl);\n"
   "4839\t  hside = (side == ORIGIN) ? gkcciSideOrig:gkcciSideDest;\n"
   "4840\t  \n"
   "4841\t  if(VALID(cl))\n"
   "4842\t  {\n"
   "4843\t    if(!sendMsgEvent(cl, gkcciMsgSendDRJ, hside))      \n"
   "4844\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8625, cl, \"DRJ: Failed in sending DRJ send message notification to 
application\"));     \n"
   "4845\t    gkhCall = (gkHCALL)CL.handle;\n"
   "4846\t    gkhaCallAddr = &CL.appHandle;\n"
   "4847\t    getCallHandle(cl, hside, &hsCall);\n"
   "4848\t  }\n"
   "4849\t  rgrasSetReplyAddress(hsRas,cmRASTrPartReject);\n"
   "4850\t  \n"
   "4851\t  /* let the app access the DRJ before sending it */\n"
   "4852\t  hookToCall(gkhCall, gkhaCallAddr, hsCall, hsRas, gkcciMsgSendDRJ, 
hside);\n"
   "4853\t  \n"
   "4854\t  success=cmuReject(hsRas,reason);\n"
   "4855\t  if (!success)\n"
   "4856\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8626, 
cl,\"ERROR in DRJ\"));\n"
   "4857\t  \n"
   "4858\t  /* notify application */\n"
   "4859\t  if(!sendStateEvent(cl, gkcciSttDRJSent, \n"
   "4860\t    
((reason!=cmRASReasonNotRegistered)?gkcciRsnInvalidEndpoint:gkcciRsnCallNotRegister))
 )\n"
   "4861\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8627, 
cl,\"DRJ: Error calling the application callback\"));\n"
   "4862\t  \n"
   "4863\t  if (VALID(cl))\n"
   "4864\t    CL.SIDE.DRQ=(HRAS)NULL;\n"
   "4865\t  \n"
   "4866\t  return success;\n"
   "4867\t}\n"
   "4868\t\n"
   "4869\t  /*******************************************************/\n"
   "4870\t  /*      Call Associattion                              */\n"
   "4871\t  /*******************************************************/\n"
   "4872\t\n"
   "4873\t\tBOOL assocReqToCall(/*searces for the call side that the incoming 
message belongs to. If found,\n"
   "4874\t\t\t\t      call and side specify the matching call and TRUE 
returned. If not found, call is\n"
   "4875\t\t\t\t      set to NOT_CALL and FALSE returned*/\n"
   "4876\t\t\t\t\tIN\tHRAS\t\t\thsRas,\n"
   "4877\t\t\t\t\tIN\tint*\t\t\tcall,\n"
   "4878\t\t\t\t\tIN      side_t*                 side)\n"
   "4879\t\t{\n"
   "4880\t\t\tUINT16 CRVras;\n"
   "4881\t\t\tINT32 tmp;\n"
   "4882\t\t\tint answerCall;\n"
   "4883\t\t\tcmRASTransport udp;\n"
   "4884\t    int val,cl=-1;\n"
   "4885\t\t\tguid_t callID,confID;\n"
   "4886\t    cmuMessage_t message;\n"
   "4887\t    cmuLoadParams(message,CMU_RAS,hsRas,cmRASTrPartRequest,NULL);\n"
   "4888\t\t\tcmuGetParam(&message,cmRASParamCRV,FALSE,0,&tmp,NULL);CRVras = 
tmp;\n"
   
"4889\t\t\tcmuGetParam(&message,cmRASParamDestinationIpAddress,FALSE,0,&val,(char*)&udp);\n"
   
"4890\t\t\tcmuGetParam(&message,cmRASParamAnswerCall,FALSE,0,&answerCall,NULL); 
/* origin|destination */\n"
   "4891\t\t\tif (cmuGetParam(&message,cmRASParamCallID,FALSE,0,&val,callID) == 
ERROR)\n"
   "4892\t      memcpy(callID,emptyGuid,GUID_LEN);\n"
   "4893\t    if (cmuGetParam(&message,cmRASParamCID,FALSE,0,&val,confID) == 
ERROR)\n"
   "4894\t      memcpy(confID,emptyGuid,GUID_LEN);\n"
   "4895\t\t\t\n"
   "4896\t\t\t*side = (answerCall == TRUE)?DESTINATION:ORIGIN;\n"
   "4897\t    cl = locateCallByCRV(CRVras,&udp,callID,confID,*side);\n"
   "4898\t    if VALID(cl)\n"
   "4899\t    {\n"
   "4900\t      *call=cl;\n"
   "4901\t\t\t\treturn TRUE;\n"
   "4902\t    }\n"
   "4903\t    else \n"
   "4904\t\t\t{\n"
   "4905\t      *call = NOT_CALL;\n"
   "4906\t\t\t\treturn FALSE;\n"
   "4907\t\t\t}\n"
   "4908\t  }\n"
   "4909\t\n"
   "4910\t  void locateARQCall(/*locate call (if any) that is associate with an 
ARQ when function return a VALID(cl)\n"
   "4911\t                       indicate a match  */\n"
   "4912\t                       IN HRAS hsRas,\n"
   "4913\t                       IN HCALL hsCall,\n"
   "4914\t                       IN int * call)\n"
   "4915\t  {\n"
   "4916\t    cmRASTransport srcCs, destCs;\n"
   "4917\t    int val,cl=-1;\n"
   "4918\t    cmuMessage_t message;\n"
   "4919\t    guid_t cidARQ,callIDARQ;\n"
   "4920\t    if(hsCall);\n"
   "4921\t    cmuLoadParams(message,CMU_RAS,hsRas,cmRASTrPartRequest,NULL);\n"
   "4922\t    
cmuGetParam(&message,cmRASParamSrcCallSignalAddress,FALSE,0,&val,(char*)&srcCs);\n"
   "4923\t    
cmuGetParam(&message,cmRASParamDestCallSignalAddress,FALSE,0,&val,(char*)&destCs);\n"
   "4924\t    if (cmuGetParam(&message,cmRASParamCID,FALSE,0,&val,cidARQ) == 
ERROR)\n"
   "4925\t      memcpy(cidARQ,emptyGuid,GUID_LEN);\n"
   "4926\t    if (cmuGetParam(&message,cmRASParamCallID,FALSE,0,&val,callIDARQ) 
== ERROR)\n"
   "4927\t      memcpy(callIDARQ,emptyGuid,GUID_LEN);\n"
   "4928\t    \n"
   "4929\t    if (addEmptyTransport(&srcCs))\n"
   "4930\t      CALL_NOTIFY(\"destination ARQ w/o src  call signal address at 
locateARQCall\",GEN_NA,10,cl);\n"
   "4931\t    \n"
   "4932\t    \n"
   "4933\t    if (addEmptyTransport(&destCs))\n"
   "4934\t      CALL_NOTIFY(\"destination ARQ w/o message dest call signal 
address at locateARQCall\",GEN_NA,10,cl);\n"
   "4935\t    \n"
   "4936\t    \n"
   "4937\t    if (memcmp(callIDARQ,emptyGuid,GUID_LEN) != 0) /*the call came 
with a callID - first try to associate with it*/\n"
   "4938\t      cl = loacteARQByGuid(callIDARQ,TRUE,&destCs);\n"
   "4939\t    \n"
   "4940\t    if (cl == -1 && memcmp(cidARQ,emptyGuid,GUID_LEN) != 0) /*try to 
associate using cid*/\n"
   "4941\t      cl = loacteARQByGuid(cidARQ,FALSE,&destCs);\n"
   "4942\t    \n"
   "4943\t    if VALID(cl)\n"
   "4944\t    {\n"
   "4945\t      *call=cl;\n"
   "4946\t      \n"
   "4947\t      if(addEmptyTransport(&(CL.destCallSignal)))\n"
   "4948\t        CALL_NOTIFY(\"destination ARQ w/o local dest call signal 
address at locateARQCall\",GEN_NA,10,cl);\n"
   "4949\t    }\n"
   "4950\t    else\n"
   "4951\t      *call = NOT_CALL;\n"
   "4952\t  }\n"
   "4953\t  \n"
   "4954\t  static int loacteARQByGuid(/*if searchByCallID=TRUE, searches the 
table by the callID field.Otherwise by the \n"
   "4955\t                             cid fied.If a match is found, but 
clashes with destCs, then  the search continues.\n"
   "4956\t                             -1 returned if none found.*/\n"
   "4957\t                             IN guid_t guid,\n"
   "4958\t                             IN BOOL searchByCallID,\n"
   "4959\t                             cmRASTransport *destCs)\n"
   "4960\t  {\n"
   "4961\t    BOOL found = FALSE;\n"
   "4962\t    int cl = 0;\n"
   "4963\t    \n"
   "4964\t    if (searchByCallID)\n"
   "4965\t    {\n"
   "4966\t      CALL_NOTIFY(\"locating ARQ by callID\",GEN_NA,20,-1);\n"
   "4967\t    }\n"
   "4968\t    else\n"
   "4969\t    {\n"
   "4970\t      CALL_NOTIFY(\"locating ARQ by cid\",GEN_NA,20,-1);\n"
   "4971\t    }\n"
   "4972\t    while ((VALID(cl)) && (!found))\n"
   "4973\t    {\n"
   "4974\t      if (searchByCallID)\n"
   "4975\t        found = (memcmp(CL.ORIG.callID,guid,GUID_LEN) == 0);\n"
   "4976\t      else\n"
   "4977\t        found = (memcmp(CL.cid,guid,GUID_LEN) == 0);\n"
   "4978\t      if (found)\n"
   "4979\t        if ((found=addEqTransport(&(CL.destCallSignal),destCs) ||\n"
   "4980\t          addEmptyTransport(&CL.destCallSignal) ||\n"
   "4981\t          addEmptyTransport(destCs))== FALSE)\n"
   "4982\t        {\n"
   "4983\t          CALL_NOTIFY(\"arq with same guidID but different 
destCs.continuing search from cl \",cl,0,-1);\n"
   "4984\t        }\n"
   "4985\t        if (!found)\n"
   "4986\t          cl++;\n"
   "4987\t    }\n"
   "4988\t    if (found)\n"
   "4989\t      return cl;\n"
   "4990\t    else\n"
   "4991\t      return -1;\n"
   "4992\t  }\n"
   "4993\t\n"
   "4994\t\tstatic int locateCallByCRV(/*Searches for call side that matches 
the specified crv and udp values*/\n"
   "4995\t                             IN UINT16\t\t\t\t\tcrv,\n"
   "4996\t                             IN cmRASTransport* udp,\n"
   "4997\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t IN guid_t\t\t\t\t\tcallID,\n"
   "4998\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t IN guid_t\t\t\t\t\tconfID,\n"
   "4999\t                             IN side_t\t\t\t\t\tside)\t\t\n"
   "5000\t  {\n"
   "5001\t\t\tgkcciSide_t sd = gkcciSideOrig;\n"
   "5002\t    int cl = 0;\n"
   "5003\t\t\tif (side == ORIGIN)\n"
   "5004\t\t\t\tsd = gkcciSideOrig;\n"
   "5005\t\t\tif (side == DESTINATION)\n"
   "5006\t\t\t\tsd = gkcciSideDest;\n"
   "5007\t    while (VALID(cl)) {\n"
   "5008\t\t\t\tif (calMatch(cl,sd,crv,udp,callID,confID))\n"
   "5009\t\t\t\t\treturn cl;\t\n"
   "5010\t\t\t\telse\t\n"
   "5011\t\t\t\t\tcl++;\n"
   "5012\t\t\t}\n"
   "5013\t    return -1;\n"
   "5014\t  }\n"
   "5015\t\n"
   "5016\t\tBOOL calMatch(\n"
   "5017\t\t\t\t\t\t\tIN int\t\t\t\t\t\t\tcl,\n"
   "5018\t\t\t\t\t\t\tIN gkcciSide_t\t\t\tside,\n"
   "5019\t\t\t\t\t\t\tIN UINT16\t\t\t\t\t\tcrvInMsg,\n"
   "5020\t\t\t\t\t\t\tIN cmRASTransport*\tudpOfMsg,/*ignored if NULL*/\n"
   "5021\t\t\t\t\t\t\tIN guid_t\t\t\t\t\t\tcallIDinMsg,\n"
   "5022\t\t\t\t\t\t\tIN guid_t\t\t\t\t\t\tconfIDinMsg)\n"
   "5023\t\t{\n"
   "5024\t    BOOL match;\n"
   "5025\t\t\tif (!VALID(cl))\n"
   "5026\t\t\t\treturn FALSE;\n"
   "5027\t    \n"
   "5028\t    match = (crvInMsg == CL.API_SIDE.CRVras\n"
   "5029\t\t\t\t\t\t\t && memcmp(callIDinMsg,CL.API_SIDE.callID,GUID_LEN) == 0 
\n"
   "5030\t\t\t\t\t\t\t && memcmp(confIDinMsg,CL.cid,GUID_LEN) == 0);\n"
   "5031\t    if (udpOfMsg != NULL)\n"
   "5032\t      match = (match && udpOfMsg->ip  == CL.API_SIDE.UDPAddress.ip && 
udpOfMsg->port == CL.API_SIDE.UDPAddress.port);\n"
   "5033\t\n"
   "5034\t    return match;\n"
   "5035\t\t}\n"
   "5036\t\n"
   "5037\t\n"
   "5038\t  /*******************************************************/\n"
   "5039\t  /*      Call Setup process                             */\n"
   "5040\t  /*******************************************************/\n"
   "5041\t  int continueCall(/* continue the call as usual, whether after 
consulting the las app or not */\n"
   "5042\t                   IN  int cl,\n"
   "5043\t                   IN  BOOL fixDest)\n"
   "5044\t  {\n"
   "5045\t    int huntCount;\n"
   "5046\t    \n"
   "5047\t    if(fixDest)\n"
   "5048\t    {\n"
   "5049\t      if (!fixFinalDest(cl))\n"
   "5050\t      {\n"
   "5051\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8628, cl,\"error in fixFinalDest\"));\n"
   "5052\t        
disconnectCall(cl,cmReasonTypeUndefinedReason,cmReasonTypeUndefinedReason, \n"
   "5053\t          UNDEFINED_DROP_CAUSE,UNDEFINED_DROP_CAUSE,TRUE);\n"
   "5054\t        return ERROR;\n"
   "5055\t      }\n"
   "5056\t      \n"
   "5057\t      \n"
   "5058\t      if (!net3OutOfZoneService(CL.service)) /* check if services are 
allowed for out of zone calls */\n"
   "5059\t      {\n"
   "5060\t        CALL_NOTIFY(\"Disconnecting call lack of 
permission\",GEN_NA,10,cl); \n"
   "5061\t        if 
(!disconnectCall(cl,cmReasonTypeUnreachableDestination,cmReasonTypeUndefinedReason,\n"
   "5062\t          UNDEFINED_DROP_CAUSE,UNDEFINED_DROP_CAUSE, TRUE))/*maybe 
cmReasonTypeUndefinedReason ?*/\n"
   "5063\t          return ERROR;\n"
   "5064\t        return 0;\n"
   "5065\t      }\n"
   "5066\t      \n"
   "5067\t      if (forwardIsAForwardService(CL.service))\n"
   "5068\t      {\n"
   "5069\t        char buf[60];\n"
   "5070\t        sprintf(buf,\"handling GK SERVICE : 
%s\",net3ServiceName(CL.service));\n"
   "5071\t        CALL_NOTIFY(buf,GEN_NA,20,cl);\n"
   "5072\t        if (!forwardDispatch(cl))\n"
   "5073\t          return ERROR;\n"
   "5074\t        else\n"
   "5075\t          return 0;\n"
   "5076\t      }\n"
   "5077\t    }\n"
   "5078\t    /* xyx case where service indicated by admission is different 
that on in setup are not treated yet */\n"
   "5079\t    \n"
   "5080\t    CL.DEST.state=cmCallStateIdle;\n"
   "5081\t    if ((huntCount=lineHunt(cl, TRUE))==ERROR)\n"
   "5082\t      return ERROR;\n"
   "5083\t    if (huntCount==0)\n"
   "5084\t      if 
(!disconnectCall(cl,cmReasonTypeUnreachableDestination,cmReasonTypeUndefinedReason,
 \n"
   "5085\t      UNDEFINED_DROP_CAUSE,UNDEFINED_DROP_CAUSE,TRUE))/*xyx added 
param to disconnect.I prefer to use a more consice \n"
   "5086\t      reason but linehunt can return 0 due to various reasons - seems 
a problem*/\n"
   "5087\t      return ERROR;\n"
   "5088\t      return 0;\n"
   "5089\t  } /* of state change from origin */\n"
   "5090\t\n"
   
"5091\t/*----------------------------------------------------------------------------*/\n"
   "5092\t  int continueCallAfterSetup (/* send setup to destination after 
recieved approval of the application */\n"
   "5093\t                              IN int cl)\n"
   "5094\t  {   \n"
   "5095\t  /* meir GK-MC: If Call Proceeding has not been previously sent send 
it now with MC supplied\n"
   "5096\t\t\t\t\tH.245 address. */\n"
   "5097\t    if (CL.callProcSent == FALSE && CL.ORIG.stack != NULL)\n"
   "5098\t    {\n"
   "5099\t  \t  gkcfgiDelayCallProc_t *delayCallProc;\n"
   "5100\t\t  gkcfgGet(GKCFG_DELAY_CALLPROC, 0, (void**)&delayCallProc);\n"
   "5101\t\t  if ((*delayCallProc) != GKCFGI_AFTER_OVERLAPPED_SENDING)\n"
   "5102\t        sendCallProc(cl);\n"
   "5103\t    }\n"
   "5104\t\t\t\t\t\n"
   "5105\t    if (forwardIsAForwardService(CL.service))\n"
   "5106\t    {\n"
   "5107\t      char buf[60];\n"
   "5108\t      sprintf(buf,\"handling GK SERVICE : 
%s\",net3ServiceName(CL.service));\n"
   "5109\t      CALL_NOTIFY(buf,GEN_NA,20,cl);\n"
   "5110\t      /* notify the appli"
<- "cation the call is to a forward service and hence will be disconncted */\n"
   "5111\t      if(!sendStateEvent(cl, gkcciSttForwardService,  
gkcciRsnUndefined))\n"
   "5112\t      {       \n"
   "5113\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8629, cl, \"continueCallAfterSetup: Failed in sending notification to the 
application about call to forward service\"));\n"
   "5114\t        return FALSE;\n"
   "5115\t      }                                 \n"
   "5116\t      if (!forwardDispatch(cl))\n"
   "5117\t      {\n"
   "5118\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8630, cl,\"continueCallAfterSetup: Error in forwardDispatch\"));\n"
   "5119\t        return FALSE;\n"
   "5120\t      }\n"
   "5121\t      else\n"
   "5122\t        return TRUE;\n"
   "5123\t    }\n"
   "5124\t          \n"
   "5125\t\t\t/* Initialize 2 passes line hunting environment to the first pass 
(move state machine to the ST6 - LineHunting &) */\n"
   "5126\t\t\tif (CL.service != NET3_NOT_SERVICE)\n"
   "5127\t\t\t{\n"
   "5128\t\t\t\tUINT16* serviceCurrSupplier;\n"
   "5129\t\t\t\tif (gkcfgGet(GKCFG_SERVICE_SUPPLIER, CL.service, 
(void**)&serviceCurrSupplier) == FALSE) \n"
   "5130\t\t\t       CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8630, cl,\"continueCallAfterSetup: Error in v1 service\"));\n"
   "5131\t\t\t\tCL.lhStartSupplier = *serviceCurrSupplier;\n"
   "5132\t\t\t\tif (!rgtblValid(CL.lhStartSupplier)  ||  
rgtblRegistrationVacant(CL.lhStartSupplier)==TRUE)\n"
   "5133\t\t\t\t\tCL.lhStartSupplier = 0;\n"
   "5134\t\t\t}\n"
   "5135\t\t\tif (CL.callService != SRV_INVALID_SERV)\n"
   "5136\t\t\t{\n"
   "5137\t\t\t\tif (srvServiceGetCurrSupplier(CL.callService, 
&CL.lhStartGwServiceSupplier) == ERROR)\n"
   "5138\t\t\t\t\t/* Initialize lhStartGwServiceSupplier with head of the 
supplier list */\t\t\t\t\n"
   "5139\t\t\t\t\tif (srvServiceGetSupplier(CL.callService, 
&CL.lhStartGwServiceSupplier) == ERROR)\n"
   "5140\t\t\t\t\t{\n"
   "5141\t\t\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8630, cl,\"continueCallAfterSetup: Error in v2 
service\"))\n"
   "5142\t\t\t\t\t\t\treturn FALSE;\n"
   "5143\t\t\t\t\t}\n"
   "5144\t\t\t}\n"
   "5145\t\t\tCL.lhPass=1;\n"
   "5146\t\t\tCL.lhGwServicePass=1;\n"
   "5147\t\n"
   "5148\t    checkLineHunting(cl, TRUE); /* make first trial at destination 
*/\n"
   "5149\t    return TRUE;\n"
   "5150\t  }\n"
   "5151\t  \n"
   
"5152\t/*----------------------------------------------------------------------------*/
 \n"
   "5153\tint makeDestCall( /* send setup to destination */\n"
   "5154\t    IN int cl, IN BOOL isService) \n"
   "5155\t{\n"
   "5156\t    int setupNode;\n"
   "5157\t    /* Start sohan */\n"
   "5158\t#if 1\n"
   "5159\t    guid_t\tcall_id[2];\n"
   "5160\t    guid_t\tconf_id;\n"
   "5161\t    char buf[8*ADD_MAX_BUF];\n"
   "5162\t    int \ti=0;\n"
   "5163\t    HPROTCONN\thConn=NULL;\n"
   "5164\t    struct gk_to_mc_msg\tour_msg;\n"
   "5165\t#endif\n"
   "5166\t    /* End   sohan */\n"
   "5167\t  \n"
   "5168\t    CALL_NOTIFY(\"making new call to destination\",GEN_NA, 10,cl);\n"
   "5169\t    CHANGE_STATE(CAL_HUNTING, \"resume hunting after application 
approval\");\n"
   "5170\t    CL.wasAlertBeforeDisconnect = FALSE;\n"
   "5171\t    CL.setupSend = TRUE;\n"
   "5172\t\n"
   "5173\t\t/* Nullify all H.245 addresses that originate from the destination 
*/\n"
   "5174\t\tmemset(&CL.callProcH245Add, 0, sizeof(cmRASTransport));\n"
   "5175\t\tmemset(&CL.alertingH245Add, 0, sizeof(cmRASTransport));\n"
   "5176\t\tmemset(&CL.connectH245Add, 0, sizeof(cmRASTransport));\n"
   "5177\t\n"
   "5178\t    if (!CL.DEST.stack) {\n"
   "5179\t    if 
(cmCallNew(dispStack,(HAPPCALL)&(CL.DEST.callNo),(LPHCALL)&(CL.DEST.stack)) < 
0)\n"
   "5180\t      return ERROR;\n"
   "5181\t    }\n"
   "5182\t\n"
   "5183\t    setupNode = copySetup(cl);\n"
   "5184\t\n"
   "5185\t    /*SA_450 let the application change some parameters */\n"
   "5186\t    if(!sendStateEvent(cl, gkcciSttSendSetup,  gkcciRsnUndefined))\n"
   "5187\t    {       \n"
   "5188\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8631, cl, \"makeDestCall: Failed in sending notification to the application 
about sending setup\"));\n"
   "5189\t      return ERROR;\n"
   "5190\t    } \n"
   "5191\t\n"
   "5192\t    downloadToSetup(cl, setupNode, isService);\n"
   "5193\t/* Start sohan*/\n"
   "5194\t#if 1\n"
   "5195\t\tmemcpy(conf_id, CL.cid, GUID_LEN);\t\n"
   "5196\t\tmemcpy(call_id[0], CL.ORIG.callID, GUID_LEN);\t\n"
   "5197\t\tmemcpy(call_id[1], CL.DEST.callID, GUID_LEN);\t\n"
   "5198\t\tgenNotify(\"-----------------------------------------\", GEN_NA, 
10);\n"
   "5199\t       \tsprintf(message,\"Conference ID  = (%16s)\", 
StrToHex((char*) CL.cid, GUID_LEN));\n"
   "5200\t\tgenNotify(message, GEN_NA, 10);\n"
   "5201\t       \tsprintf(message,\"CL.ORIG.callID = (%16s)\", StrToH"
<- "ex((char*) CL.ORIG.callID, GUID_LEN));\n"
   "5202\t\tgenNotify(message, GEN_NA, 10);\n"
   "5203\t       \tsprintf(message,\"CL.DEST.callID = (%16s)\", 
StrToHex((char*) CL.DEST.callID, GUID_LEN));\n"
   "5204\t\tgenNotify(message, GEN_NA, 10);\n"
   "5205\t\n"
   "5206\t        sprintf(buf,\"SETUP   ...... Call is in state: 
%s\",stateName[CL.state]);\n"
   "5207\t        GK_NOTIFY(buf,GEN_NA,0);\n"
   "5208\t        sprintf(buf,\"%-4.4s 
%-20.20s\",\"From\",addIpToString(&(CL.srcCallSignal)));\n"
   "5209\t        GK_NOTIFY(buf,GEN_NA,0);\n"
   "5210\t        for(i=0;i<SOURCE_NUMBER;i++)\n"
   "5211\t        {\n"
   "5212\t          if (!addEmptyAlias(&(CL.srcInfo[i])))\n"
   "5213\t            sprintf(&(buf[strlen(buf)]),\" 
%s\",addAliasToString(&(CL.srcInfo[i])));\n"
   "5214\t        }\n"
   "5215\t        GK_NOTIFY(buf,GEN_NA,0);\n"
   "5216\t        \n"
   "5217\t        sprintf(buf,\"%-4.4s 
%-20.20s\",\"to\",addIpToString(&(CL.destCallSignal)));\n"
   "5218\t        GK_NOTIFY(buf,GEN_NA,0);\n"
   "5219\t        for(i=0;i<DESTINATION_NUMBER;i++)\n"
   "5220\t        {\n"
   "5221\t          if (!addEmptyAlias(&(CL.destInfo[i])) )\n"
   "5222\t            sprintf(&(buf[strlen(buf)]),\" 
%s\",addAliasToString(&(CL.destInfo[i])));\n"
   "5223\t        }\n"
   "5224\t        GK_NOTIFY(buf,GEN_NA,0);\n"
   "5225\t\tsprintf(message, \"CL.ORIG.mcCallHandle (0x%X)\",\n"
   "5226\t\t\tCL.ORIG.mcCallHandle);\n"
   "5227\t\tgenNotify(message, GEN_NA, 10);\n"
   "5228\t\tsprintf(message, \"CL.DEST.mcCallHandle (0x%X)\",\n"
   "5229\t\t\tCL.DEST.mcCallHandle);\n"
   "5230\t\tgenNotify(message, GEN_NA, 10);\n"
   "5231\t\n"
   "5232\t\tmemset(&our_msg, 0, sizeof(our_msg));\t\n"
   "5233\t\tif ((hConn = cmGetTpktChanHandle (CL.ORIG.stack, 
cmQ931TpktChannel)) != NULL)\t\n"
   "5234\t\t{\n"
   "5235\t\t\tUINT32\t\tip=0;\n"
   "5236\t\t\tUINT16\t\tport=0;\t\n"
   "5237\t\t\tcmGetTpktChanIpPort(hConn, &ip, &port);\n"
   "5238\t\t\t\tsprintf(message, \"CL.ORIG.stack (0x%X) - ip (%s), port(%d)\", 
\n"
   "5239\t\t\tCL.ORIG.stack, gkaddIp2String(ip, ip_address),port);\n"
   "5240\t\t\tgenNotify(message, GEN_NA, 10);\n"
   "5241\t\t\tour_msg.src_ip = ip;\n"
   "5242\t\t}\n"
   "5243\t\tour_msg.event = SETUP;\n"
   "5244\t\tour_msg.mcHConf = (UINT32)CL.mcConfHandle;\n"
   "5245\t\tour_msg.gkHCall = (UINT32)CL.handle;\n"
   "5246\t\tour_msg.call_index = cl;\n"
   "5247\t\tour_msg.src_mc_call_handle = CL.ORIG.mcCallHandle;\n"
   "5248\t        
strncpy(our_msg.src_number,addAliasToString(&(CL.srcInfo[0])), 
MAX_NUMBER_SIZE);\n"
   "5249\t\tour_msg.dest_mc_call_handle = CL.DEST.mcCallHandle;\n"
   "5250\t        
strncpy(our_msg.dest_number,addAliasToString(&(CL.destInfo[0])), 
MAX_NUMBER_SIZE);\n"
   "5251\t\tour_msg.dest_ip = CL.destCallSignal.ip;\n"
   "5252\t\tmemcpy(our_msg.conf_id, CL.cid, GUID_LEN);\t\n"
   "5253\t\n"
   "5254\t        CALL_NOTIFY(\"!!!(SETUP) before calling send_endpoint_info - 
DUMP message!!!\", GEN_NA,10,cl);\n"
   "5255\t\tsprintf(message, \"mcHConf(0x%x)\", our_msg.mcHConf);\n"
   "5256\t\tgenNotify(message, GEN_NA, 10);\n"
   "5257\t\tsprintf(message, \"gkHCall(0x%x)\", our_msg.gkHCall);\n"
   "5258\t\tgenNotify(message, GEN_NA, 10);\n"
   "5259\t\tsprintf(message, \"Source mc call handle 
(0x%x)\",our_msg.src_mc_call_handle);\n"
   "5260\t\tgenNotify(message, GEN_NA, 10);\n"
   "5261\t\tsprintf(message, \"Source IP (%s)\",\n"
   "5262\t\t\tgkaddIp2String(our_msg.src_ip, ip_address));\n"
   "5263\t\tgenNotify(message, GEN_NA, 10);\n"
   "5264\t\tsprintf(message, \"Source Number (%s)\",\n"
   "5265\t\t\tour_msg.src_number);\n"
   "5266\t\tgenNotify(message, GEN_NA, 10);\n"
   "5267\t\tsprintf(message, \"Destination mc call handle 
(0x%x)\",our_msg.dest_mc_call_handle);\n"
   "5268\t\tgenNotify(message, GEN_NA, 10);\n"
   "5269\t\tsprintf(message, \"Destination IP (%s)\",\n"
   "5270\t\t\tgkaddIp2String(our_msg.dest_ip, ip_address));\n"
   "5271\t\tgenNotify(message, GEN_NA, 10);\n"
   "5272\t\tsprintf(message, \"Destination Number (%s)\",\n"
   "5273\t\t\tour_msg.dest_number);\n"
   "5274\t\tgenNotify(message, GEN_NA, 10);\n"
   "5275\t\tsprintf(message, \"Call index (%d)\", our_msg.call_index);\n"
   "5276\t\tgenNotify(message, GEN_NA, 10);\n"
   "5277\t       \tsprintf(message,\"Conference ID  = (%16s)\", 
StrToHex((char*) our_msg.conf_id, GUID_LEN));\n"
   "5278\t\tgenNotify(message, GEN_NA, 10);\n"
   "5279\t\tsprintf(message, \"Call originator (%d)\", 
our_msg.call_originator);\n"
   "5280\t\tgenNotify(message, GEN_NA, 10);\n"
   "5281\t\tsprintf(message, \"Event (%s)\", 
our_msg.event?\"Setup\":\"Disconnect\");\n"
   "5282\t\tgenNotify(message, GEN_NA, 10);\n"
   "5283\t\n"
   "5284\t        CALL_NOTIFY(\"!!!(SETUP) calling send_endpoint_info!!!\", 
GEN_NA,10,cl);\n"
   "5285\t  \tsend_endpoint_info_to_mc(&our_msg);\n"
   "5286\t#endif\n"
   "5287\t/* End   sohan*/\n"
   "5288\t\n"
   "5289\t    \n"
   "5290\t    /* download to setup already copied the non standard param. We 
give the application chance\n"
   "5291\t    change it inside the callback */\n"
   "5292\t    if(!sendMsgEvent(cl, gkcciMsgSendSetup, gkcciSideDest))\n"
   "5293\t    {       \n"
   "5294\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8632, cl, \"makeDestCall: Failed in sending setup send message notification to 
the application\"));\n"
   "5295\t      return FALSE;\n"
   "5296\t    }\n"
   "5297\t    \n"
   "5298\t    /* let the app hook to the setup message before sending it to 
destination */\n"
   "5299\t    hookToCall((gkHCALL)CL.handle, (gkHAPPCALL *)&CL.appHandle, 
CL.DEST.stack, \n"
   "5300\t      (HRAS)GKCCI_NO_HSRAS,  gkcciMsgSendSetup, gkcciSideDest);\n"
   "5301\t    CL.setupPending=FALSE;\n"
   "5302\t\n"
   "5303\t    if (cmCallDial(CL.DEST.stack)==ERROR)\n"
   "5304\t    {\n"
   "5305\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8633, cl,\"cmCallDial failed at linehunt\"));\n"
   "5306\t      return FALSE;\n"
   "5307\t    }\n"
   "5308\t    return TRUE;\n"
   "5309\t  }\n"
   "5310\t\n"
   
"5311\t/*----------------------------------------------------------------------------*/
 \n"
   "5312\t/* SA_450_TR\n"
   "5313\t   create one sided call by connecting the gk back to the origin */\n"
   "5314\t  INT32 connectGKToOrigin(IN int cl)\n"
   "5315\t  {\n"
   "5316\t    int origConnectNode;\n"
   "5317\t    HPVT hpvt = cmGetValTree(dispStack);\n"
   "5318\t    cmuMessage_t message;\n"
   "5319\t\n"
   "5320\t    cmuLoadParams(message,CMU_Q931,(HRAS)0,(cmRASTrPart)0, 
CL.ORIG.stack);\n"
   "5321\t    CL.connectPending = TRUE;\n"
   "5322\t\tCL.sideMap |= ONE_SIDE_ORIG;\n"
   "5323\t    CL.wasAlertBeforeDisconnect = FALSE;\n"
   "5324\t\n"
   "5325\t    if (CL.ORIG.state==cmCallStateOffering || CL.ORIG.state == 
cmCallStateWaitAddressAck)\n"
   "5326\t\t{\n"
   "5327\t      origConnectNode = 
pvtGetNodeIdByPath(hpvt,cmGetProperty((HPROTOCOL)(CL.ORIG.stack)),\"connect\");\n"
   "5328\t      if (origConnectNode < 0) return gkcciFailure;\n"
   "5329\t\n"
   "5330\t      CHANGE_STATE(CAL_WAIT_DEST_CONNECT, \"requesting for 
application approval to connect to origin\");\n"
   "5331\t      if(!sendStateEvent(cl, gkcciSttWaitDestConnect, 
gkcciRsnGKConnectCall))\n"
   "5332\t      {\n"
   "5333\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8634, cl,\"gkcciConnect: Failed in sending destination connect request to the 
application\"));\n"
   "5334\t        (void)stopCall(cl, RSN_FAILURE_EVENT_HANDLER, 
cmReasonTypeUndefinedReason,cmReasonTypeUndefinedReason, cmRASReasonUndefined); 
\n"
   "5335\t        return gkcciFailure;\n"
   "5336\t      } \n"
   "5337\t    }\n"
   "5338\t    else\n"
   "5339\t      return gkcciFailure;\n"
   "5340\t\n"
   "5341\t    return gkcciOK;\n"
   "5342\t  }\n"
   
"5343\t/*----------------------------------------------------------------------------*/
 \n"
   "5344\t/* meir GK-MC: Offload H.245 address from call-proceeding message. 
Generate an appropriate\n"
   "5345\t\t state event */\n"
   "5346\tstatic BOOL handleCallProceeding(int cl)\n"
   "5347\t{\n"
   "5348\t  int val;\n"
   "5349\t  cmuMessage_t message;\n"
   "5350\t  
cmuLoadParams(message,CMU_Q931,(HRAS)0,(cmRASTrPart)0,CL.DEST.stack);\n"
   "5351\t  \n"
   "5352\t  
if(cmuGetParam(&message,cmParamCallProcH245Address,FALSE,0,&val,(char*)&(CL.callProcH245Add))
 < 0)\n"
   "5353\t  {\n"
   "5354\t    CL.callProcH245Add.type = cmTransportTypeIP;\n"
   "5355\t    CL.callProcH245Add.length = 0;\n"
   "5356\t    CL.setupH245Add.ip = 0;\n"
   "5357\t    CL.setupH245Add.port = 0;\n"
   "5358\t    CALL_NOTIFY(\"No call-proceeding H.245 address\",GEN_NA,20,cl);\n"
   "5359\t  }\n"
   "5360\t  else\n"
   "5361\t  {\n"
   "5362\t    CALL_NOTIFY(\"Getting the call-proceeding H.245 
address\",GEN_NA,20,cl);\n"
   "5363\t    CALL_NOTIFY(addIpToString(&CL.callProcH245Add),GEN_NA,20,cl);\n"
   "5364\t  }\n"
   "5365\t  \n"
   "5366\t  if(!sendStateEvent(cl, getAppState(cmCallStateProceeding), 
gkcciRsnUndefined)) {\n"
   "5367\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8635, 
cl,\"handleCallProceeding: Error calling the application callback\"));\n"
   "5368\t    return FALSE;\n"
   "5369\t  }\n"
   "5370\t\n"
   "5371\t  /* If call proceeding has not been previously sent to the origin, 
send it now */\n"
   "5372\t  if (!CL.callProcSent && CL.ORIG.stack)\n"
   "5373\t  {\n"
   "5374\t    if (!sendCallProc(cl))\n"
   "5375\t\t\t{\n"
   "5376\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 0, 
cl,\"handleCallProceeding: Error sending call proceeding to origin\"));\n"
   "5377\t\t\t\treturn FALSE;\n"
   "5378\t\t\t}\n"
   "5379\t  }\n"
   "5380\t  \n"
   "5381\t  return TRUE;\n"
   "5382\t}\n"
   "5383\t    \n"
   
"5384\t/*----------------------------------------------------------------------------*/
     "
<- "\n"
   "5385\tint sendCallProc(IN int cl)\n"
   "5386\t{\n"
   "5387\t  HPVT hpvt = cmGetValTree(dispStack);\n"
   "5388\t  CL.callProcSent = TRUE;\n"
   "5389\t\n"
   "5390\t  if (CL.ORIG.stack == NULL)\n"
   "5391\t    return TRUE;\n"
   "5392\t\n"
   "5393\t  if (CL.ORIG.state == cmCallStateWaitAddressAck)\n"
   "5394\t    cmCallAddressComplete(CL.ORIG.stack);\n"
   "5395\t  \n"
   "5396\t  if (CL.mcRoutedMode) \n"
   "5397\t  {\n"
   "5398\t    if (CL.ORIG.mcH245Addr.ip != 0) \n"
   "5399\t    {\n"
   "5400\t      if (cmuIpPortToNode(hpvt, \n"
   "5401\t        pvtBuildByPath(hpvt, 
cmGetProperty((HPROTOCOL)(CL.ORIG.stack)),\n"
   "5402\t        
\"callProceeding.message.*.userUser.h323-UserInformation.h323-uu-pdu.h323-message-body.*.h245Address\",\n"
   "5403\t        0, NULL), \n"
   "5404\t        CL.ORIG.mcH245Addr.ip, \n"
   "5405\t        CL.ORIG.mcH245Addr.port) == FALSE)\n"
   "5406\t      {\n"
   "5407\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8636, cl,\"error updating H245 address of call proceeding message\"));\n"
   "5408\t      }\n"
   "5409\t      else\n"
   "5410\t      {\n"
   "5411\t        CALL_NOTIFY(\"Setting MC supplied H.245 address in call 
proceeding\",GEN_NA,20,cl);\n"
   "5412\t        
CALL_NOTIFY(addIpToString(&CL.ORIG.mcH245Addr),GEN_NA,20,cl);\n"
   "5413\t      }\n"
   "5414\t    }\n"
   "5415\t    else\n"
   "5416\t    {\n"
   "5417\t      CALL_NOTIFY(\"MC supplied H.245 address = 0.Will not be sent 
with call proceeding\",GEN_NA,20,cl);\n"
   "5418\t    }\n"
   "5419\t  }\n"
   "5420\t  else \n"
   "5421\t  {\n"
   "5422\t    if (CL.callProcH245Add.ip != 0)\n"
   "5423\t    {\n"
   "5424\t      if (cmuIpPortToNode(hpvt, \n"
   "5425\t        pvtBuildByPath(hpvt, 
cmGetProperty((HPROTOCOL)(CL.ORIG.stack)),\n"
   "5426\t        
\"callProceeding.message.*.userUser.h323-UserInformation.h323-uu-pdu.h323-message-body.*.h245Address\",\n"
   "5427\t        0, NULL), \n"
   "5428\t        CL.callProcH245Add.ip, \n"
   "5429\t        CL.callProcH245Add.port) == FALSE)\n"
   "5430\t      {\n"
   "5431\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8637, cl,\"error updating H245 address for call-proceeding message\"));\n"
   "5432\t      }\n"
   "5433\t      else\n"
   "5434\t      {\n"
   "5435\t        CALL_NOTIFY(\"Updating Call-proceeding H.245 
address\",GEN_NA,20,cl);\n"
   "5436\t        
CALL_NOTIFY(addIpToString(&CL.callProcH245Add),GEN_NA,20,cl);\n"
   "5437\t      }\n"
   "5438\t    }\n"
   "5439\t  }\n"
   "5440\t  cmCallSendCallProceeding(CL.ORIG.stack);\n"
   "5441\t  appendSupplementaryServices(cl, ORIGIN);\n"
   "5442\t  clearSuppServBuffer(cl, ORIGIN);\n"
   "5443\t  return TRUE;\n"
   "5444\t}\n"
   "5445\t\n"
   
"5446\t/*----------------------------------------------------------------------------*/
     \n"
   "5447\t\n"
   "5448\tstatic BOOL handleRingback(int cl)\n"
   "5449\t{\n"
   "5450\t\tint origAlertingNode,destAlertingNode;\n"
   "5451\t\tint val;\n"
   "5452\t\tHPVT hpvt = cmGetValTree(dispStack);\n"
   "5453\t\tcmuMessage_t message;\n"
   
"5454\t\tcmuLoadParams(message,CMU_Q931,(HRAS)0,(cmRASTrPart)0,CL.ORIG.stack);\n"
   "5455\t\t\n"
   "5456\t  CL.callProcSent = TRUE;\n"
   "5457\t  if (CL.ORIG.state == cmCallStateWaitAddressAck && CL.ORIG.stack)\n"
   "5458\t    cmCallAddressComplete(CL.ORIG.stack);\n"
   "5459\t\n"
   "5460\t\tCL.alertingH245Add.type = cmTransportTypeIP;\n"
   "5461\t\tCL.alertingH245Add.length = 0;\n"
   "5462\t\tCL.alertingH245Add.ip = 0;\n"
   "5463\t\tCL.alertingH245Add.port = 0;\n"
   "5464\t\t\n"
   "5465\t\torigAlertingNode = 
pvtGetNodeIdByPath(hpvt,cmGetProperty((HPROTOCOL)(CL.ORIG.stack)),\"alerting\");\n"
   "5466\t\tdestAlertingNode = 
pvtGetNodeIdByPath(hpvt,cmGetProperty((HPROTOCOL)(CL.DEST.stack)),\"alerting\");\n"
   "5467\t\tif (!(origAlertingNode >= 0 && destAlertingNode >= 0))\n"
   "5468\t\t{\n"
   "5469\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8638, 
cl,\"pvtGetNodeIdByPath returned error when accessing alerting.will not 
copy\"));\n"
   "5470\t\t}\n"
   "5471\t\telse\n"
   "5472\t\t{\n"
   "5473\t\t\tpvtSetTree(hpvt,origAlertingNode,hpvt,destAlertingNode);\n"
   
"5474\t\t\tpvtSetTree(cmGetValTree(dispStack),cmCallGetLocalEndpointInfoHandle(CL.ORIG.stack),
     \n"
   
"5475\t\t\tcmGetValTree(dispStack),cmCallGetRemoteEndpointInfoHandle(CL.DEST.stack));\n"
   "5476\t\t}\n"
   "5477\t\n"
   "5478\t\t/* Delete all fastStart elements from Alerting message. 
Call-proceeding and alerting \n"
   "5479\t\tfastStart elements should be sent with the connect message. This 
behavior is \n"
   "5480\t\timplemented so as to allow line-hunting to proceed among different 
destination types\n"
   "5481\t\tsome of which might or might not support fastStart. */\n"
   "5482\t    /* Avi 10/2000 - Remove only when call is to a service */\n"
   "5483\t    if ((CL.service != NET3_NOT_SERVICE) ||  \n"
   "5484\t\t    (CL.callService != SRV_INVALID_SERV)) {\n"
   "5485\t    \tcmuDeleteTree(hpvt, origAlertingNode, 
\"message.*.userUser.h323-UserInformation.h323-uu-pdu.h323-message-body.*.fastStart\");\n"
   "5486\t    }\n"
   "5487\t\n"
   
"5488\t\tcmuGetParam(&message,cmParamAlertingH245Address,FALSE,0,&val,(char*)&CL.alertingH245Add);\n"
   "5489\t\tif (CL.alertingH245Add.ip == 0) \n"
   "5490\t\t{\n"
   "5491\t\t\tCL.alertingH245Add.ip = 0;\n"
   "5492\t\t\tCALL_NOTIFY(\"No alerting H.245 address\",GEN_NA,20,cl);\n"
   "5493\t\t}\n"
   "5494\t\telse\n"
   "5495\t\t{\n"
   "5496\t\t\tCALL_NOTIFY(\"Getting the alerting H.245 
address\",GEN_NA,20,cl);\n"
   "5497\t\t\tCALL_NOTIFY(addIpToString(&CL.alertingH245Add),GEN_NA,20,cl);\n"
   "5498\t\t}\n"
   "5499\t\t\n"
   "5500\t\tif(!sendMsgEvent(cl, gkcciMsgReceiveAlert, gkcciSideDest))\n"
   "5501\t\t{       \n"
   "5502\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8639, 
cl, \"handleDestinationStateChange: Failed in sending alert receive message 
notification to the application\"));\n"
   "5503\t\t\treturn FALSE;\n"
   "5504\t\t}\n"
   "5505\t\t\n"
   "5506\t\t/* If a timeout on alerting was requested for the call set alerting 
timer */\n"
   "5507\t\tif (CL.alertingTimeout > 0)\n"
   "5508\t\t\tgkTiTimerSet(alertingTimerExpired, (void*)cl, 
CL.alertingTimeout);\n"
   "5509\t\t\n"
   "5510\t\tif(!sendMsgEvent(cl, gkcciMsgSendAlert, gkcciSideOrig))\n"
   "5511\t\t{       \n"
   "5512\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8640, 
cl, \"handleDestinationStateChange: Failed in sending alert send message 
notification to the application\"));\n"
   "5513\t\t\treturn FALSE;\n"
   "5514\t\t}\n"
   "5515\t\t/* notify the application */\n"
   "5516\t\t/* the application better not answer this, but we protect ourselves 
anyway */\n"
   "5517\t\tif(!sendStateEvent(cl, getAppState(cmCallStateRingBack), 
gkcciRsnUndefined))\n"
   "5518\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8641, 
cl,\"handleDestinationStateChange: Error calling the application 
callback\"));\n"
   "5519\t\t\n"
   "5520\t\t/* meir GK-MC: In MC routed mode, send the MC supplied H.245 
address. */\n"
   "5521\t\tif (origAlertingNode >= 0) \n"
   "5522\t\t{\n"
   "5523\t\t\tif (CL.mcRoutedMode) \n"
   "5524\t\t\t{\n"
   "5525\t\t\t\tif (CL.ORIG.mcH245Addr.ip != 0) \n"
   "5526\t\t\t\t{\n"
   "5527\t\t\t\t\tint nodeId = pvtBuildByPath(hpvt, origAlertingNode,\n"
   
"5528\t\t\t\t\t\t\"message.*.userUser.h323-UserInformation.h323-uu-pdu.h323-message-body.*.h245Address\",\n"
   "5529\t\t\t\t\t\t0, NULL);\n"
   "5530\t\t\t\t\tCALL_NOTIFY(\"Sending MC supplied H.245 address with 
alerting\",GEN_NA,20,cl);\n"
   "5531\t\t\t\t\tif (cmuIpPortToNode(hpvt, nodeId, CL.ORIG.mcH245Addr.ip, 
CL.ORIG.mcH245Addr.port) == FALSE)\n"
   "5532\t\t\t\t\t{ \n"
   "5533\t\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8642, cl,\"error updating H245 address of alerting message\")); \n"
   "5534\t\t\t\t\t}\n"
   "5535\t\t\t\t\telse\n"
   "5536\t\t\t\t\t{\n"
   
"5537\t\t\t\t\t\tCALL_NOTIFY(addIpToString(&CL.ORIG.mcH245Addr),GEN_NA,20,cl);\n"
   "5538\t\t\t\t\t}\n"
   "5539\t\t\t\t} \n"
   "5540\t\t\t\telse\n"
   "5541\t\t\t\t{\n"
   "5542\t\t\t\t\tCALL_NOTIFY(\"MC supplied H.245 address = 0. Clearing H.245 
address from alerting\",GEN_NA,20,cl);\n"
   "5543\t\t\t\t\tpvtDelete(hpvt, pvtGetNodeIdByPath(hpvt, origAlertingNode, 
\"message.*.userUser.h323-UserInformation.h323-uu-pdu.h323-message-body.*.h245Address\"));\n"
   "5544\t\t\t\t}\n"
   "5545\t\t\t}\n"
   "5546\t\t\telse\n"
   "5547\t\t\t{\n"
   "5548\t\t\t\tif (CL.alertingH245Add.ip != 0)\n"
   "5549\t\t\t\t{\n"
   "5550\t\t\t\t\tif (cmuIpPortToNode(hpvt, \n"
   "5551\t\t\t\t\t\tpvtBuildByPath(hpvt, origAlertingNode,\n"
   
"5552\t\t\t\t\t\t\"message.*.userUser.h323-UserInformation.h323-uu-pdu.h323-message-body.*.h245Address\",\n"
   "5553\t\t\t\t\t\t0, NULL), \n"
   "5554\t\t\t\t\t\tCL.alertingH245Add.ip, \n"
   "5555\t\t\t\t\t\tCL.alertingH245Add.port) == FALSE)\n"
   "5556\t\t\t\t\t{\n"
   "5557\t\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8643, cl,\"error updating H245 address of alerting message\"));\n"
   "5558\t\t\t\t\t}\n"
   "5559\t\t\t\t\telse\n"
   "5560\t\t\t\t\t{\n"
   "5561\t\t\t\t\t\tCALL_NOTIFY(\"Forwarding alerting H.245 
address\",GEN_NA,20,cl);\n"
   
"5562\t\t\t\t\t\tCALL_NOTIFY(addIpToString(&CL.alertingH245Add),GEN_NA,20,cl);\n"
   "5563\t\t\t\t\t}\n"
   "5564\t\t\t\t}\n"
   "5565\t\t\t\telse\n"
   "5566\t\t\t\t{\n"
   "5567\t\t\t\t\tCALL_NOTIFY(\"alerting H.245 address = 0.Will not forward 
it\",GEN_NA,20,cl);\n"
   "5568\t\t\t\t}\n"
   "5569\t\t\t}\n"
   "5570\t\t}\n"
   "5571\t\t\n"
   "5572\t\t/* let the app hook to the alert message before sending it to 
origin - NL_9_26 */\n"
   "5573\t\thookToCall((gkHCALL)CL.handle, (gkHAPPCALL *)&CL.appHandle, 
CL.ORIG.stack, \n"
   "5574\t\t\t(HRAS)GKCCI_NO_HSRAS,  gkcciMsgSendAlert, gkcciSideOrig);\n"
   "5575\t\tCL.alertingPending = FALSE;\n"
   "5576\t\tcmCallAccept(CL.ORIG.stack);\n"
   "5577\t\treturn TRUE;\n"
   "5578\t}\n"
   "5579\t\t\t\n"
   "5580\t\n"
   "5581\t/*-------------"
<- "---------------------------------------------------------------*/           
 \n"
   "5582\t/* send connect to origin after getting application approval */\n"
   "5583\t  BOOL connectDestinationToOrigin(IN int cl)\n"
   "5584\t  {\n"
   "5585\t    \n"
   "5586\t    cmuMessage_t message;\n"
   "5587\t    
cmuLoadParams(message,CMU_Q931,(HRAS)0,(cmRASTrPart)0,CL.ORIG.stack);\n"
   "5588\t\n"
   "5589\t    if (DEST_ONLY_CALL(cl))\n"
   "5590\t    {\n"
   "5591\t      CHANGE_STATE(CAL_CONNECT,\"GK connected\");\n"
   "5592\t      CALL_NOTIFY(\"GK Call is formed\",GEN_NA,10,cl);\n"
   "5593\t      sendStateEvent(cl, gkcciSttConnected, 
gkcciRsnGKInitiatedCall);\n"
   "5594\t\t\t\t/* update current supplier for next call in order by RR 
algorithm */\n"
   "5595\t\t\t\tif (CL.service != NET3_NOT_SERVICE)\n"
   "5596\t\t\t\t\tif (gkcfgSet(GKCFG_SERVICE_SUPPLIER, CL.service, 
(void*)&CL.nextScan) == FALSE) \n"
   "5597\t\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8644, cl, \"connectDestinationToOrigin: Failed in update line hunting start 
supplier (for next call) of V1 service by RR order\"));\n"
   "5598\t\t\t\tif (CL.callService != SRV_INVALID_SERV)\n"
   "5599\t\t\t\t{\n"
   "5600\t\t\t\t\tif (srvServiceSetCurrSupplier(CL.callService, 
CL.nextGwServiceScan) == ERROR)\n"
   "5601\t\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8644, cl, \"connectDestinationToOrigin: Failed in update line hunting start 
supplier (for next call) of V2 service by RR order\"));\n"
   "5602\t\t\t\t}\n"
   "5603\t      return TRUE;\n"
   "5604\t    }\n"
   "5605\t    \n"
   "5606\t    CHANGE_STATE(CAL_HUNTING, \"Sending connect to origin\");\n"
   "5607\t    /* meir GK-MC: Send H.245 address to origin. If call is routed 
via MC send H.245 address\n"
   "5608\t    supplied by MC (if any). If not MC routed the H.245 address that 
arrived with the connect\n"
   "5609\t    message from destination is used */\n"
   "5610\t    if (CL.mcRoutedMode) \n"
   "5611\t    {\n"
   "5612\t      if (CL.ORIG.mcH245Addr.ip != 0)\n"
   "5613\t      {\n"
   "5614\t        CALL_NOTIFY(\"Forwarding MC supplied H.245 address to 
origin\",GEN_NA,20,cl);\n"
   "5615\t        CALL_NOTIFY(addIpToString(&CL.ORIG.mcH245Addr),GEN_NA,20,cl); 
\n"
   "5616\t        
cmuSetParam(&message,cmParamH245Address,0,sizeof(cmRASTransport),(char*)&CL.ORIG.mcH245Addr);\n"
   "5617\t      }\n"
   "5618\t      else\n"
   "5619\t      {\n"
   "5620\t        HPVT hpvt = cmGetValTree(dispStack);\n"
   "5621\t        int origConnectNode = 
pvtGetNodeIdByPath(hpvt,cmGetProperty((HPROTOCOL)(CL.ORIG.stack)),\"connect\");\n"
   "5622\t        CALL_NOTIFY(\"MC supplied H.245 address = 0. No H.245 in 
outgoing Connect message\",GEN_NA,20,cl);\n"
   "5623\t        pvtDelete(hpvt, pvtGetNodeIdByPath(hpvt, origConnectNode, 
\"message.*.userUser.h323-UserInformation.h323-uu-pdu.h323-message-body.*.h245Address\"));\n"
   "5624\t      }\n"
   "5625\t    }\n"
   "5626\t    else if (CL.connectH245Add.ip != 0)\n"
   "5627\t    {\n"
   "5628\t      CALL_NOTIFY(\"Forwarding connect H.245 
address\",GEN_NA,20,cl);\n"
   "5629\t      CALL_NOTIFY(addIpToString(&CL.connectH245Add),GEN_NA,20,cl); \n"
   "5630\t      
cmuSetParam(&message,cmParamH245Address,0,sizeof(cmRASTransport),(char*)&CL.connectH245Add);\n"
   "5631\t    }\n"
   "5632\t    else\n"
   "5633\t    {\n"
   "5634\t      CALL_NOTIFY(\"connect H.245 address = 0.Will not forward 
it\",GEN_NA,20,cl);\n"
   "5635\t    }\n"
   "5636\t\n"
   "5637\t    if (CL.DEST.stack) {\n"
   "5638\t    
pvtSetTree(cmGetValTree(dispStack),cmCallGetLocalEndpointInfoHandle(CL.ORIG.stack),\n"
   "5639\t               
cmGetValTree(dispStack),cmCallGetRemoteEndpointInfoHandle(CL.DEST.stack));\n"
   "5640\t    }\n"
   "5641\t\n"
   "5642\t\n"
   "5643\t    /* notify the application. I must do it here, before atually 
calling the function, otherwise\n"
   "5644\t    the connect notification comes first */\n"
   "5645\t    if(!sendMsgEvent(cl, gkcciMsgSendConnect, gkcciSideOrig))\n"
   "5646\t    {       \n"
   "5647\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8644, cl, \"connectDestinationToOrigin: Failed in sending connect send message 
notification to the application\"));\n"
   "5648\t      return FALSE;\n"
   "5649\t    }\n"
   "5650\t    if(!sendStateEvent(cl, gkcciSttSendConnectToOrig,  
gkcciRsnUndefined))\n"
   "5651\t    {       \n"
   "5652\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8645, cl, \"connectDestinationToOrigin: Failed in sending connect to orig 
notification to the application\"));\n"
   "5653\t      return FALSE;\n"
   "5654\t    }\n"
   "5655\t\n"
   "5656\t\t\t/* let the app hook to the connect message before sending it to 
origin - NL_9_26"
<- " */\n"
   "5657\t\t\thookToCall((gkHCALL)CL.handle, (gkHAPPCALL *)&CL.appHandle, 
CL.ORIG.stack, \n"
   "5658\t\t\t\t\t(HRAS)GKCCI_NO_HSRAS,  gkcciMsgSendConnect, gkcciSideOrig);\n"
   "5659\t\t\tCL.connectPending = FALSE;\n"
   "5660\t\n"
   "5661\t    if (cmCallAnswer(CL.ORIG.stack)!=0)\n"
   "5662\t      return FALSE;\t           \n"
   "5663\t    return TRUE;\n"
   "5664\t  }\n"
   "5665\t\n"
   
"5666\t/*----------------------------------------------------------------------------*/
            \n"
   "5667\t  BOOL newCallDisconnect (/* A new call cannot complete, notify the 
application\n"
   "5668\t    and don\'t wait for answer. Disconnect the call */\n"
   "5669\t    IN  int cl,\n"
   "5670\t    IN  HCALL         hsCall,\n"
   "5671\t    IN  cmReasonType  cmReason,\n"
   "5672\t    IN  HRAS          hsRas,\n"
   "5673\t    IN  cmRASReason   ARJReason,\n"
   "5674\t    IN  side_t        side,\n"
   "5675\t    IN  gkcciState_t  state,\n"
   "5676\t    IN  gkcciReason_t reason)\n"
   "5677\t  {\n"
   "5678\t    BOOL status = TRUE;\n"
   "5679\t    \n"
   "5680\t    if (!VALID(cl))  /* No call has been assigned */\n"
   "5681\t    {\n"
   "5682\t      cl = globalMaxCalls-1; /* use the last call in the call table 
*/\n"
   "5683\t      CL.handle = GKCCI_CALL_NOT_VALID;\n"
   "5684\t      CL.SIDE.stack = hsCall;\n"
   "5685\t      CL.SIDE.ARQ = hsRas;\n"
   "5686\t    }\n"
   "5687\t    if (hsRas != NULL)  /* We\'re rejecting a call attempt beginning 
with an ARQ */\n"
   "5688\t    {\n"
   "5689\t      if (CL.infoSrc == NO_INFORMATION)\n"
   "5690\t        loadFromARQ(hsRas, side, cl);\n"
   "5691\t\t  CL.SIDE.ARJReason = ARJRsnCm2App(ARJReason);\n"
   "5692\t      status = ARJ(hsRas,ARJReason,cl,side);\n"
   "5693\t    }\n"
   "5694\t    else /* We\'re rejecting a call attempt beginning with a Setup 
message */\n"
   "5695\t    {\n"
   "5696\t      if (CL.infoSrc==NO_INFORMATION) \n"
   "5697\t        loadFromSetup(hsCall, cl);\n"
   "5698\t      status = (callDropParam(cl, side,hsCall, cmReason) >= 0);\n"
   "5699\t    }\n"
   "5700\t    \n"
   "5701\t    switch (state) /* only new call reject states will be given. Any 
other state is\n"
   "5702\t      simply ignored */\n"
   "5703\t    {\n"
   "5704\t    case gkcciSttAdmissionReject:\n"
   "5705\t    case gkcciSttSetupReject:\n"
   "5706\t      if(!sendStateEvent(cl, state, reason) ) /* inform the 
application */\n"
   "5707\t        CALL_EXEP(\"newCallDisconnect: Error in sending state event 
to the application\",cl);\n"
   "5708\t      break;\n"
   "5709\t    default:\n"
   "5710\t      break;\n"
   "5711\t    }\n"
   "5712\t    \n"
   "5713\t    if (cl == globalMaxCalls-1) /* If call was allocated within this 
function */\n"
   "5714\t      status = freeCall(cl) && status;             /* Clear it */\n"
   "5715\t    \n"
   "5716\t    return status;\n"
   "5717\t  }\n"
   "5718\t\n"
   
"5719\t/*----------------------------------------------------------------------------*/\n"
   "5720\tBOOL appRerouteCall( /* The application changed the addresses when 
notified that\n"
   "5721\t                       the call cannot be completed or before a new 
line hunt. \n"
   "5722\t                       returning to address resolution state again 
*/\n"
   "5723\t                       IN   int                 cl ,\n"
   "5724\t                       IN   gkcciReplyReason_t  reason)\n"
   "5725\t{\n"
   "5726\t\tcmRASTransport setup_245adrs;\n"
   "5727\t    CHANGE_STATE(CAL_ADDRESS_RESOLUTION, \"the application set new 
addresses\");\n"
   "5728\t    if(reason == gkcciReplyRsnAliasChange)\n"
   "5729\t    {   \n"
   "5730\t\t  gktypeCallModel_t isRouted;\n"
   "5731\t      CALL_NOTIFY(\"The application changed aliases of call, ip 
addresses are deleted now\",GEN_NA, 10,cl);\n"
   "5732\t      CL.destCallSignal.ip = (UINT32)0;\n"
   "5733\t      CL.destCallSignal.port = (UINT16)0;                \n"
   "5734\t\t  if ((gkcciGetParameter(CL.handle, gkcciParamCallModel, 
gkcciSideOrig, 0, 0, &(isRouted))) < 0)\n"
   "5735\t\t\t  CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 0, 
cl,\"appRerouteCall: failed in geting parameters from CL.model\"));\n"
   "5736\t\t  if(isRouted == (gktypeCallModel_t)cmCallModelTypeGKRouted) /* the 
GK is in routed mode*/\n"
   "5737\t\t  {\n"
   "5738\t\t\t  
if(gkcfgFlagValue(GKCFG_REMOVE_H245ADRS_IN_CALL_HUNTING_OR_CFNR_OR_CFB)) 
/*shiri:returning H245 address which was removed\tfrom setup to previous e.p. 
in CFNR & CFB*/\n"
   "5739\t\t\t  {\t\n"
   "5740\t\t\t\tgkcciH450ForwardType_t type;\n"
   "5741\t\t\t\tgkcciGetH450Parameter(CL.handle, gkcciH450ParamForwardType, 
&type);  \n"
   "5742\t\t\t\tif((type == gkcciH450FwdTypeCFNR) || (type == 
gkcciH450FwdTypeCFB))\n"
   "5743\t\t\t\t{\n"
   "5744\t\t\t\t\tif((gkcciGetH450Parameter(CL.handle, 
gkcciH450ParamForward245, &setup_245adrs)) < 0)\n"
   "5745\t\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
0, cl,\"appRerouteCall: failed in geting H245 parameters from 
CL.h450Info\"));\n"
   "5746\t\t\t\t\tmemcpy(&CL.setupH245Add, &setup_245adrs, 
sizeof(cmRASTransport));\n"
   "5747\t\t\t\t}\n"
   "5748\t\t\t  }\n"
   "5749\t\t  }\n"
   "5750\t    }     \n"
   "5751\t    else\n"
   "5752\t      if(reason == gkcciReplyRsnAddressFinal)\n"
   "5753\t      {\n"
   "5754\t        CALL_NOTIFY(\"The application changed ip address of call, no 
actual address resolution will take place\",GEN_NA, 10,cl);\n"
   "5755\t        return appAddressFinal(cl);\n"
   "5756\t      }\n"
   "5757\t      return appAddressUpdated(cl);  \n"
   "5758\t  }\n"
   "5759\t\n"
   "5760\t\n"
   "5761\t\n"
   "5762\t\n"
   "5763\t  /*******************************************************/\n"
   "5764\t  /*  Overlapped Sending                                 */\n"
   "5765\t  /*******************************************************/\n"
   "5766\t  /* handle the Information Messages that carry addtional address 
information\n"
   "5767\t     after setupAck */\n"
   "5768\t  int calEvCallAdditionalAddress(IN\tHAPPCALL haCall, \n"
   "5769\t                                 IN\tHCALL hsCall,\n"
   "5770\t                                 char\t* address,\n"
   "5771\t                                 BOOL\tsendingComplete)\n"
   "5772\t  {\n"
   "5773\t    int cl;\n"
   "5774\t    side_t side;\n"
   "5775\t    gkcciReason_t reason;\n"
   "5776\t    \n"
   "5777\t    if(hsCall);\n"
   "5778\t    cl = getCall(haCall, &side);\n"
   "5779\t    if (!VALID(cl)) return ERROR;\n"
   "5780\t    \n"
   "5781\t    CALL_NOTIFY(\"Additional address from origin while Q.931 
overlapped sending\",GEN_NA,10,cl);\n"
   "5782\t    \n"
   "5783\t    /* if Setup has already been sent to the destination then 
overlapped sending has\n"
   "5784\t    been initiated by destination. Gatekeeper relays the Information 
message to the\n"
   "5785\t    destination without involving the application. */\n"
   "5786\t    if (CL.setupSend && CL.DEST.stack)\n"
   "5787\t    {\n"
   "5788\t      if (cmCallOverlapSendingExt(CL.DEST.stack, address, 
sendingComplete) < 0)\n"
   "5789\t      {\n"
   "5790\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 0, 
cl,\"calEvCallAdditionalAddress: Failed to relay additional address to 
destination\"));\n"
   "5791\t      }\n"
   "5792\t      else\n"
   "5793\t      {\n"
   "5794\t        CALL_NOTIFY(\"Additional address sent to destination 
(Information)\",GEN_NA,20,cl);\n"
   "5795\t      }\n"
   "5796\t      return 0;\n"
   "5797\t    }\n"
   "5798\t    \n"
   "5799\t    if (!checkCallState(cl, CAL_WAIT_SETUP_ADDRCMPLT, \"Wait For 
Address Complete\"))\n"
   "5800\t      return ERROR;\n"
   "5801\t    \n"
   "5802\t    CL.destInfo[0].type = cmAliasTypeE164;\n"
   "5803\t    CL.destInfo[0].length = strlen(address);\n"
   "5804\t    strcpy(CL.destInfo[0].string, address);\n"
   "5805\t    \n"
   "5806\t    \n"
   "5807\t    CL.infoSrc = SETUP_COMPLETE_INFORMATION;\n"
   "5808\t    CL.reason = RSN_NEW_ORIG;\n"
   "5809\t    CL.sendingCompleteFlag = sendingComplete;\n"
   "5810\t    reason = (sendingComplete ? gkcciRsnAdditionalAddressComplete : 
gkcciRsnAdditionalAddress);\n"
   "5811\t    \n"
   "5812\t    CALL_NOTIFY(\"Sending address resolution request to the 
application: \",GEN_NA,10,cl);\n"
   "5813\t    CHANGE_STATE(CAL_ADDRESS_RESOLUTION, \"Address resolution request 
was sent to application after setup\");                       \n"
   "5814\t    \n"
   "5815\t    if(!sendStateEvent(cl, gkcciSttAddressResolution, reason))\n"
   "5816\t    {\n"
   "5817\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8646, cl,\"AdditionalAddress: Failed in sending Address Resolution request to 
the application\"));\n"
   "5818\t      stopCall(cl, RSN_FAILURE_EVENT_HANDLER,\n"
   "5819\t        cmReasonTypeUndefinedReason,cmReasonTypeUndefinedReason, \n"
   "5820\t        cmRASReasonUndefined);\n"
   "5821\t      return ERROR;\n"
   "5822\t    }\n"
   "5823\t    return 0;\n"
   "5824\t  }\n"
   "5825\t\n"
   
"5826\t/*----------------------------------------------------------------------------*/
 \n"
   "5827\t  /* Recieve the setupAck from the destination GW */\n"
   "5828\t  /* Currently we can not pass this message because the GK always 
sends Call\n"
   "5829\t     Proceeding to the origin upon recieving SETUP. Hence, the origin 
can not \n"
   "5830\t     recieve the SetupAck after it recieve a C.P. This issue is a but 
in the\n"
   "5831\t     standard */\n"
   "5832\t  int calEvCallIncompleteAddress(\n"
   "5833\t    IN\tHAPPCALL haCall, \n"
   "5834\t    IN\tHCALL hsCall)\n"
   "5835\t  {\n"
   "5836\t    side_t side;\n"
   "5837\t    int cl = getCall(haCall, &side);\n"
   "5838\t    if(hsCall);\n"
   "5839\t    if (!VALID(cl)) return ERROR;\n"
   "5840\t\n"
   "5841\t    /* notify the application and terminate the overalp sending 
condition */\n"
   "5842\t    sendStateEvent(cl, gkcciSttSetupAck, gkcciRsnUndefined);\n"
   "5843\t\t\tif (!CL.callProcSent && CL.ORIG.stack)\n"
   "5844\t\t\t{\n"
   "5845\t\t\t\tif (cmCallIncompleteAddress(CL.ORIG.stack) < 0)\n"
   "5846\t\t\t\t{\n"
   "5847\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 0, 
cl,\"calEvCallIncompleteAddress: Failed to relay SetupAck to origin\"));\n"
   "5848\t\t\t\t}\n"
   "5849\t      else\n"
   "5850\t      {\n"
   "5851\t        CALL_NOTIFY(\"SetupAck recived from destination relayed to 
origin\",GEN_NA,10,cl);\n"
   "5852\t      }\n"
   "5853\t\t\t}\n"
   "5854\t\t\telse\n"
   "5855\t\t\t{\n"
   "5856\t      if (cmCallOverlapSendingExt(CL.DEST.stack, (char 
*)CL.destInfo[0].string, TRUE) < 0)\n"
   "5857\t\t\t\t{\n"
   "5858\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 0, 
cl,\"calEvCallIncompleteAddress: Failed to reply to destination SetupAck\"));\n"
   "5859\t\t\t\t}\n"
   "5860\t      else\n"
   "5861\t      {\n"
   "5862\t        CALL_NOTIFY(\"SetupAck recived from destination. Address 
complete returned\",GEN_NA,10,cl);\n"
   "5863\t      }\n"
   "5864\t\t\t}\n"
   "5865\t    return 0;\n"
   "5866\t  }\n"
   "5867\t\n"
   
"5868\t/*----------------------------------------------------------------------------*/
 \n"
   "5869\t  /* OVSP */\n"
   "5870\t  /* application want the GK to send an ARJ to origin with reason 
cmRASIncompleteAddress */\n"
   "5871\t  /* and keep the call handle for the next round of digit collection 
*/\n"
   "5872\t  BOOL appAddressIncomplete(IN int cl)\n"
   "5873\t  {\n"
   "5874\t    CL.round = 0; CL.appLineHuntingIndex = CAL_NULL_INDEX;\n"
   "5875\t    CL.setupSend = FALSE; CL.destState = DEST_NOT_CONNECTED;\n"
   "5876\t    CL.service = NET3_NOT_SERVICE;\n"
   "5877\t    CL.callService = SRV_INVALID_SERV;\n"
   "5878\t    CL.reason = RSN_OVLPSEND;\n"
   "5879\t    /* the first  case applies if the first message of the call was 
\n"
   "5880\t\t   a setup message. In this case we call cmCallIncompleteAddress 
which sends\n"
   "5881\t\t   setupack to the origin */\t\t  \n"
   "5882\t    if (CL.infoSrc == SETUP_INFORMATION)\n"
   "5883\t    {\n"
   "5884\t      CHANGE_STATE(CAL_WAIT_SETUP_ADDRCMPLT, \"Wait For Information 
Address Complete\");\n"
   "5885\t      return (cmCallIncompleteAddress(CL.ORIG.stack) >= 0);\n"
   "5886\t    }\n"
   "5887\t    \n"
   "5888\t    else\n"
   "5889\t      if (CL.infoSrc == SETUP_COMPLETE_INFORMATION)\n"
   "5890\t      {\n"
   "5891\t        if (CL.sendingCompleteFlag)\n"
   "5892\t        {\n"
   "5893\t        /* application can\'t decide to continue with overlapped 
Sending when \n"
   "5894\t          sending is complete */\n"
   "5895\t          return FALSE;\n"
   "5896\t        }\n"
   "5897\t        else\n"
   "5898\t        {\n"
   "5899\t          CHANGE_STATE(CAL_WAIT_SETUP_ADDRCMPLT, \"Wait For 
Information Address Complete\");\n"
   "5900\t          return TRUE; /* put TO here */\n"
   "5901\t        }\n"
   "5902\t      }\n"
   "5903\t      /*If the first message of the call was ARQ, return ARJ */\n"
   "5904\t      else\n"
   "5905\t      {              \n"
   "5906\t        CL.infoSrc = NO_INFORMATION; /* OVSP1 */             \n"
   "5907\t        CHANGE_STATE(CAL_WAIT_ADDRCMPLT, \"Wait For the next ARQ for 
the call\");\n"
   "5908\t        \n"
   "5909\t        if (IS_ARQ_ORIG)\n"
   "5910\t          return ARJ(CL.ORIG.ARQ, cmRASIncompleteAddress, cl, 
ORIGIN);\n"
   "5911\t      }\n"
   "5912\t      \n"
   "5913\t      return FALSE;\n"
   "5914\t  }           \n"
   "5915\t\n"
   "5916\t  /*******************************************************/\n"
   "5917\t  /*  Address Resolution                                 */\n"
   "5918\t  /*******************************************************/\n"
   "5919\t\n"
   "5920\t  /* an application callback. The application didn\'t updated the 
addresses.\n"
   "5921\t     The GK should proccess the addresses only if it\'s the first 
round of\n"
   "5922\t     address resolution or if the processing wasn\'t over at the 
previous\n"
   "5923\t     stage */\n"
   "5924\t  BOOL appAddressNotUpdated(IN   int cl)\n"
   "5925\t  {        \n"
   "5926\t    \n"
   "5927\t    if((CL.reason == RSN_NEW_ORIG) || (CL.reason == RSN_EMPTY_LCF) 
||\n"
   "5928\t      (CL.reason == RSN_NEW_GK_CALL) || (CL.reason == RSN_OVLPSEND) 
||\n"
   "5929\t      !((CL.addressChange == CHNG_NO_CHNG) || \n"
   "5930\t      (CL.addressChange == CHNG_IP_ADDRESS_SET) ||\n"
   "5931\t      (CL.addressChange == CHNG_NO_CHNG_SERVICE_NOT_ALLOWED) ||\n"
   "5932\t      (CL.addressChange == CHNG_EXIT_ZONE_PREFIX_REMOVED))) \n"
   "5933\t    { /* we still need to process the addresses and see what 
changed*/\n"
   "5934\t      return appAddressUpdated(cl);\n"
   "5935\t    }\n"
   "5936\t    else\n"
   "5937\t"
<- "    { /* nothing was changed we can go on in the call */\n"
   "5938\t      doneAddressResolution(cl);\n"
   "5939\t      return TRUE;\n"
   "5940\t    }      \n"
   "5941\t  }\n"
   "5942\t\n"
   
"5943\t/*----------------------------------------------------------------------------*/
 \n"
   "5944\tBOOL appAddressUpdated( /* an application callback. The application 
updated the addresses. \n"
   "5945\t                       The GK should proccess the new addresses again 
*/\n"
   "5946\t                       IN   int cl)\n"
   "5947\t{        \n"
   "5948\t  gkcciReason_t  reason = gkcciRsnUndefined;  /* I must initiliazed 
it because the compiler cries */\n"
   "5949\t  \n"
   "5950\t  if (!fixFinalDest(cl))\n"
   "5951\t  {\n"
   "5952\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8647, 
cl,\"error in fixFinalDest\"));\n"
   "5953\t    (void)stopCall(cl, RSN_FAILURE_INTERNAL, 
cmReasonTypeUndefinedReason,\n"
   "5954\t      cmReasonTypeUndefinedReason, cmRASReasonUndefined);\n"
   "5955\t    return FALSE;\n"
   "5956\t  }\n"
   "5957\t  switch(CL.addressChange)\n"
   "5958\t  {\n"
   "5959\t  case CHNG_NO_CHNG: /* no change was found we move to address done 
*/\n"
   "5960\t    doneAddressResolution(cl);\n"
   "5961\t    return TRUE;\n"
   "5962\t  case CHNG_NO_CHNG_SERVICE_NOT_ALLOWED:\n"
   "5963\t    reason = gkcciRsnNoChngServiceNotAllowed;       \n"
   "5964\t    break;\n"
   "5965\t  case CHNG_ZONE_PREFIX_REMOVED:\n"
   "5966\t    reason = gkcciRsnZonePrefixRemoved;       \n"
   "5967\t    break;\n"
   "5968\t  case CHNG_EXIT_ZONE_PREFIX_REMOVED:\n"
   "5969\t    reason = gkcciRsnExitZonePrefixRemoved;       \n"
   "5970\t    break;\n"
   "5971\t  case CHNG_IP_ADDRESS_SET:\n"
   "5972\t    reason = gkcciRsnIpAddresSet;\n"
   "5973\t    break;\n"
   "5974\t  case CHNG_ADDRESS_FOREWARDED:\n"
   "5975\t    reason = gkcciRsnAddressForewarded;       \n"
   "5976\t    break; \n"
   "5977\t  default:\n"
   "5978\t    break;\n"
   "5979\t  }\n"
   "5980\t  CL.reason = RSN_ADDRESS_UPDATED;\n"
   "5981\t  if(!sendStateEvent(cl, gkcciSttAddressResolution, reason))\n"
   "5982\t  {\n"
   "5983\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8648, 
cl,\"appAddressUpdated: Failed in sending Address Resolution request to the 
application\"));\n"
   "5984\t    (void)stopCall(cl, RSN_FAILURE_EVENT_HANDLER, 
cmReasonTypeUndefinedReason,\n"
   "5985\t      cmReasonTypeUndefinedReason, cmRASReasonUndefined); \n"
   "5986\t    return FALSE;\n"
   "5987\t  }         \n"
   "5988\t  return TRUE;\n"
   "5989\t}\n"
   "5990\t\n"
   
"5991\t/*-----------------------------------------------------------------------------\n"
   "5992\tsetDestZone\n"
   "5993\t------------\n"
   "5994\tsarit 25/6/00 if the destination doesn\'t have a valid registration 
and the call \n"
   "5995\tis not to a service then the call must be to out of zone endpoing\n"
   "5996\tThis information is important to the cdr plugin*/\n"
   "5997\tvoid setDestZone(IN int cl) {\n"
   "5998\t\tif(calls[cl].sideInfo[1].reg == RGTBL_REG_NOT_VALID && \n"
   "5999\t\t\tcalls[cl].service == NET3_NOT_SERVICE) \n"
   "6000\t\t\tcalls[cl].destZone = DEST_ZONE_EXTERNAL;\n"
   "6001\t}\n"
   "6002\t\n"
   
"6003\t/*----------------------------------------------------------------------------*/
 \n"
   "6004\tBOOL appAliasUpdated( /* an application callback. The application 
updated the aliases. The\n"
   "6005\t                     GK should erase the ip address and proccess the 
addresses again */\n"
   "6006\t                     IN   int cl)\n"
   "6007\t{        \n"
   "6008\t  \n"
   "6009\t  CL.destCallSignal.ip = (UINT32)0;\n"
   "6010\t  CL.destCallSignal.port = (UINT16)0;\n"
   "6011\t  CL.destZone = DEST_ZONE_UNDEFINED;\n"
   "6012\t  return appAddressUpdated(cl);\n"
   "6013\t}  \n"
   "6014\t\n"
   
"6015\t/*----------------------------------------------------------------------------*/
        \n"
   "6016\tBOOL appAddressFinal( /* an application callback. The application 
wants the call to go through \n"
   "6017\t                     without processing of the addresses by the GK 
*/\n"
   "6018\t                     IN  int cl)\n"
   "6019\t{  \n"
   "6020\t  CL.service = NET3_NOT_SERVICE; /* we can assume it\'s not a 
service, because the application cannot handle services without fixFinalDest 
*/\n"
   "6021\t  CL.callService = SRV_INVALID_SERV;\n"
   "6022\t  CL.destZone = DEST_ZONE_UNDEFINED;\n"
   "6023\t  doneAddressResolution(cl);\n"
   "6024\t  return TRUE;\n"
   "6025\t}\n"
   "6026\t\n"
   
"6027\t/*----------------------------------------------------------------------------*/
 \n"
   "6028\t\n"
   "6029\tBOOL appAddressDone( /* continue call after recieving address done 
confirmation from \n"
   "6030\t                    the application */\n"
   "6031\t                    IN int cl)\n"
   "6032\t{\n"
   "6033\t  gkcciState_t appState;\n"
   "6034\t  gkcciReason_t appReason = gkcciRsnUndefined;\n"
   "6035\t  char str[200];\n"
   "6036\t  \n"
   "6037\t  switch(CL.reason)\n"
   "6038\t  {\n"
   "6039\t  case RSN_NEED_ACF:\n"
   "6040\t    CHANGE_STATE(CAL_WAIT_ORIG_ADMISSION, \"Address resolution done. 
Wait for the application to confirm sending ACF\");\n"
   "6041\t    appState = gkcciSttWaitOrigAdmission;\n"
   "6042\t    sprintf(str, \"appAddressDone: Failed in sending ACF approval 
request to the application\");\n"
   "6043\t    break;\n"
   "6044\t\n"
   "6045\t  case RSN_NEED_SETUP:\n"
   "6046\t  case RSN_NEED_OFFERING:\n"
   "6047\t    {\n"
   "6048\t      if (CL.infoSrc == SETUP_INFORMATION && 
CL.setupAfterResolutionFlag == 0) \n"
   "6049\t      {\n"
   "6050\t        CL.setupAfterResolutionFlag++;\n"
   "6051\t        CHANGE_STATE(CAL_NW_SETUP, \"Setup Arrived from NW\");\n"
   "6052\t        appState = gkcciSttSetupArrived;\n"
   "6053\t        sprintf(str, \"appAddressDone: Failed in sending request to 
accept setup\");\n"
   "6054\t      }\n"
   "6055\t\n"
   "6056\t      else\n"
   "6057\t      {\n"
   "6058\t        CHANGE_STATE(CAL_WAIT_OFFERING, \"Address resolution done. 
Wait for the application to confirm sending setup to destination\");\n"
   "6059\t        appState = gkcciSttWaitOrigOffering;\n"
   "6060\t        if (DEST_ONLY_CALL(cl))\n"
   "6061\t          appReason = gkcciRsnGKInitiatedCall;\n"
   "6062\t        sprintf(str, \"appAddressDone: Failed in sending request to 
continue call to the application\");\n"
   "6063\t      }\n"
   "6064\t    }\n"
   "6065\t    break;\n"
   "6066\t\n"
   "6067\t  case RSN_NEED_LRQ:\n"
   "6068\t    CHANGE_STATE(CAL_WAIT_LRQ, \"Address resolution done. Wait for 
the application to confirm sending LRQ\");\n"
   "6069\t    appState = gkcciSttWaitLRQ;  \n"
   "6070\t    sprintf(str, \"appAddressDone: Failed in sending LRQ approval 
request to the application\");\n"
   "6071\t    break;\n"
   "6072\t    \n"
   "6073\t/*  case RSN_NEED_OFFERING:\n"
   "6074\t      return (cmCallAddressComplete(CL.ORIG.stack) >= 0);*/\n"
   "6075\t    \n"
   "6076\t  default:\n"
   "6077\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8649, 
cl,\"appAddressDone: Unexpected reason\"));\n"
   "6078\t    return FALSE;\n"
   "6079\t  }\n"
   "6080\t  if(!sendStateEvent(cl, appState, appReason))\n"
   "6081\t  {\n"
   "6082\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8650, 
cl,str));\n"
   "6083\t    (void)stopCall(cl, RSN_FAILURE_EVENT_HANDLER, 
cmReasonTypeUndefinedReason,\n"
   "6084\t      cmReasonTypeUndefinedReason, cmRASReasonUndefined); \n"
   "6085\t    return FALSE;\n"
   "6086\t  }         \n"
   "6087\t  return TRUE;\n"
   "6088\t}\n"
   "6089\t\n"
   
"6090\t/*----------------------------------------------------------------------------*/
 \n"
   "6091\tBOOL doneAddressResolution( /* Address resolution is done. If it\'s 
service check permission.\n"
   "6092\t                            If it\'s forward message, execute it. See 
if we need to send LRQ. \n"
   "6093\t                            Change state and notify the application 
about it and wait \n"
   "6094\t                            for its answer */\n"
   "6095\t                            IN int cl )\n"
   "6096\t{\n"
   "6097\t  BOOL servicePermitted = TRUE;\n"
   "6098\t  BOOL callServicePermitted = TRUE;\n"
   "6099\t/* the next three lines are reseting the variables for line hunting\n"
   "6100\t  before a new one begins (maybe because of application reroute) */\n"
   "6101\t  CL.round = 0;\n"
   "6102\t  CL.destState = DEST_NOT_CONNECTED;\n"
   "6103\t  CL.setupSend = FALSE;\n"
   "6104\t  CL.appLineHuntingIndex = -1;\n"
   "6105\t  \n"
   "6106\t  if(IS_ARQ_ORIG) /* an ARQ event */\n"
   "6107\t    CL.reason = RSN_NEED_ACF;  /* need to send ACF after application 
approval */\n"
   "6108\t  else\n"
   "6109\t  {\n"
   "6110\t    if (CL.overlappedSendSetup)\n"
   "6111\t      CL.reason = RSN_NEED_OFFERING;\n"
   "6112\t    else\n"
   "6113\t      CL.reason = RSN_NEED_SETUP; /* need to complete the call after 
application approval */\n"
   "6114\t  }\n"
   "6115\t  \n"
   "6116\t  if(CL.service != NET3_NOT_SERVICE) /* the call is to a service */\n"
   "6117\t  {\n"
   "6118\t    if (rgtblValid(CL.ORIG.reg))\n"
   "6119\t    {\n"
   "6120\t      if (rgutilSrvcInAccessPrivilages(CL.ORIG.reg,CL.service))\n"
   "6121\t        CL.model=cmRASCallModelTypeGKRouted;\n"
   "6122\t      else\n"
   "6123\t      {\n"
   "6124\t        servicePermitted = FALSE;\n"
   "6125\t        CALL_NOTIFY(\"endpoint not entitled to requested V1 
service\",GEN_NA,10,cl);\n"
   "6126\t      }\n"
   "6127\t    }\n"
   "6128\t    else /* Origin of call cannot be identified within zone */\n"
   "6129\t    {\n"
   "6130\t      if (!net3OutOfZoneService(CL.service)) /* check if services are 
allowed for out of zone calls */\n"
   "6131\t      {\n"
   "6132\t        servicePermitted = FALSE;\n"
   "6133\t        CALL_NOTIFY(\"Call cannot be completed because of lack of 
permission to V1 service\",GEN_NA,10,cl); \n"
   "6134\t      }\n"
   "6135\t    }\n"
   "6136\t  }\n"
   "6137\t  if (CL.callService != SRV_INVALID_SERV)\n"
   "6138\t  {\n"
   "6139\t    if (rgutilDynSrvcAllowed(CL.ORIG.reg, CL.callService))\n"
   "6140\t      CL.model=cmRASCallModelTypeGKRouted;\n"
   "6141\t    else\n"
   "6142\t    {\n"
   "6143\t      callServicePermitted = FALSE;\n"
   "6144\t      CALL_NOTIFY(\"endpoint not entitled to requested V2 
service\",GEN_NA,10,cl);\n"
   "6145\t    }\n"
   "6146\t  }\n"
   "6147\t  if (servicePermitted == FALSE  &&  callServicePermitted == FALSE)\n"
   "6148\t    {\n"
   "6149\t      DBGL_CONDITION(30,gkPR(CL.ORIG.reg));\n"
   "6150\t      /* cannot complete the call because of lack of permmisions */\n"
   "6151\t      return handleCannotComplete(cl, RSN_SERVICE_NOT_ALLOWED, \n"
   "6152\t        gkcciRsnServiceNotAllowed, \"Service not allowed\");\n"
   "6153\t    }\n"
   "6154\t  \n"
   "6155\t  if (CL.service == NET3_NOT_SERVICE  &&  CL.callService == 
SRV_INVALID_SERV)\n"
   "6156\t  {\n"
   "6157\t    if(IS_ARQ_ORIG) /* ARQ */\n"
   "6158\t    {\n"
   "6159\t      /* newnatan 19/8 the callmodel is set in assignCall and may 
have later been cahnged by app*/\n"
   "6160\t      if (CL.appLineHunting)\n"
   "6161\t        CL.model=cmRASCallModelTypeGKRouted;\n"
   "6162\t    }\n"
   "6163\t    if(!CL.appLineHunting)\n"
   "6164\t    {\n"
   "6165\t      if (addEmptyTransport(&(CL.destCallSignal)))\n"
   "6166\t      {\n"
   "6167\t        return handleEmptyTransport(cl);\n"
   "6168\t      }\n"
   "6169\t    }\n"
   "6170\t    else /* application wants to control line hunting */\n"
   "6171\t    {\n"
   "6172\t      INT32 numAddress,  lastAddress;\n"
   "6173\t      if((numAddress = countAddresses(CL.appLineHuntingCallSignal, 
APP_LINE_HUNTING_NUMBER, &lastAddress)) == 0)\n"
   "6174\t      {\n"
   "6175\t        return handleCannotComplete(cl, RSN_NO_DESTINATION, \n"
   "6176\t          gkcciRsnNoAppLineHuntingAddresses, \"application line 
hunting addresses are not supplied\");\n"
   "6177\t      }\n"
   "6178\t    }                     \n"
   "6179\t  }\n"
   "6180\t  if(!sendStateEvent(cl, gkcciSttAddressResolutionDone, 
gkcciRsnAddressFound))\n"
   "6181\t  {\n"
   "6182\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8651, 
cl,\"doneAddressResolution: Failed in sending Address Resolution Done request 
to the application\"));\n"
   "6183\t    (void)stopCall(cl, RSN_FAILURE_EVENT_HANDLER, 
cmReasonTypeUndefinedReason,\n"
   "6184\t      cmReasonTypeUndefinedReason, cmRASReasonUndefined); \n"
   "6185\t    return FALSE;\n"
   "6186\t  }         \n"
   "6187\t  return TRUE;\n"
   "6188\t}\n"
   "6189\t\n"
   
"6190\t/*----------------------------------------------------------------------------*/
  \n"
   "6191\tBOOL fixFinalDest(/* decides type of call - whether it is zoned 
prefixed, to service, to forwarded endp, or regular.\n"
   "6192\t\t\t\t\t  Accordingly, performs address manipulation so the dest 
addresses are set properly and updates the \n"
   "6193\t\t\t\t\t  relevant fields in cl.*/\n"
   "6194\t\t\t\t\t  IN int cl)\n"
   "6195\t\t\t\t\t  \n"
   "6196\t{\n"
   "6197\t\t/*neweli*/ BOOL destFound = FALSE; /* does alias refer to an 
existing endpoint ? */\n"
   "6198\t    CL.recursionCounter++;\n"
   "6199\t    CL.addressChange = CHNG_NO_CHNG;\n"
   "6200\t\n"
   "6201\t    \n"
   "6202\t\tif (CL.recursionCounter > (FIXFINALDEST_RECURSION_LIMIT))\n"
   "6203\t    {\n"
   "6204\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8652, 
cl,\"exceeded the recursion limit in fixFinalDest\"));\n"
   "6205\t\t\treturn FALSE;\n"
   "6206\t    }\n"
   "6207\t    CALL_NOTIFY(\"recursionCounter value in fixFinalDest : 
\",CL.recursionCounter,45,cl);\n"
   "6208\t\n"
   "6209\t\n"
   "6210\t\tif (addEmptyTransport(&(CL.destCallSignal))) {\n"
   "6211\t\t\tlocateDestInZone(cl);\n"
   "6212\t\t}\n"
   "6213\t    else\n"
   "6214\t    {\n"
   "6215\t\t\tINT32 hash_found;\n"
   "6216\t\t\trgtblRecord_t dummyRecord;\n"
   "6217\t\t\tif 
(!rgsrFindAddress(ADD_IP_PORT_PRCSN,ADD_IP,&(CL.destCallSignal),rgtblDynamicMask(),-1,&hash_found,&(CL.DEST.reg),&dummyRecord))\n"
   "6218\t\t\t{\n"
   "6219\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8654, cl,\"rgsrFindAddress failed at fixFinalDest\"));\n"
   "6220\t\t\t\treturn FALSE;\n"
   "6221\t\t\t}\n"
   "6222\t    }\n"
   "6223\t\n"
   "6224\t\t/*neweli*/\n"
   "6225\t\t/*if destCallSignal is filled then destination exists and is 
registered */\n"
   "6226\t\tif (CL.destCallSignal.ip != 0) {\n"
   "6227\t\t\tdestFound = TRUE;\n"
   "6228\t\t\tCL.destZone = DEST_ZONE_LOCAL; /*newSarit 23.4.00*/\n"
   "6229\t\t}\n"
   "6230\t\t/*neweli*/\n"
   "6231\t\n"
   "6232\t\t/*neweli*/\n"
   "6233\t\tif (!destFound) {/* look for services only if alias was not 
associated with true detination */\n"
   "6234\t\t\tlocateService(cl);\n"
   "6235\t\t\tif (rgutilSrvcProhibited(CL.ORIG.reg,CL.service) || 
rgutilDynSrvcProhibited(CL.ORIG.reg, CL.callService))\n"
   "6236\t\t\t{\n"
   "6237\t\t\t\tCL.addressChange = CHNG_NO_CHNG_SERVICE_NOT_ALLOWED;\n"
   "6238\t\t\t\treturn TRUE;\n"
   "6239\t\t\t}\n"
   "6240\t\t\t\n"
   "6241\t\t\tif (net3IsZoneOrExitZonePrefix(CL.service))  /* check if it\'s 
the GK zone prefix, or out of zone prefix */\n"
   "6242\t\t\t{\n"
   "6243\t\t\t\tCALL_NOTIFY(\"call is zone Prefixed\",GEN_NA,40,cl);\n"
   "6244\t\t\t\tif (!handleZonePrefixedCall(cl))\n"
   "6245\t\t\t\t{\n"
   "6246\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8653, cl,\"error in handleZonePrefixedCall\"));\n"
   "6247\t\t\t\t\treturn FALSE;\n"
   "6248\t\t\t\t}\n"
   "6249\t\t\t\tif (CL.destZone == DEST_ZONE_EXTERNAL)\n"
   "6250\t\t\t\t{\n"
   "6251\t\t\t\t\tCALL_NOTIFY(\"call is to out of zone\",GEN_NA,10,cl);\n"
   "6252\t\t\t\t\treturn TRUE;\n"
   "6253\t\t\t\t}\n"
   "6254\t\t\t\treturn TRUE; /* don\'t get into recursion. Wait for the 
application reply. fixFinalDest(cl,recursionCounter); */\n"
   "6255\t\t\t}\n"
   "6256\t\t\t\n"
   "6257\t\t\tif  (CL.service != NET3_NOT_SERVICE || CL.callService != 
SRV_INVALID_SERV)\n"
   "6258\t\t\t\treturn TRUE;\n"
   "6259\t\t}\n"
   "6260\t\n"
   "6261\t\t/*neweli*/\n"
   "6262\t\t/* this check has been moved to before trying to locate services 
*/\n"
   "6263\t\t/*\n"
   "6264\t\tif (addEmptyTransport(&(CL.destCallSignal)))\n"
   "6265\t\t\tlocateDestInZone(cl);\n"
   "6266\t    else\n"
   "6267\t    {\n"
   "6268\t\t\tINT32 hash_found;\n"
   "6269\t\t\trgtblRecord_t dummyRecord;\n"
   "6270\t\t\tif 
(!rgsrFindAddress(ADD_IP_PORT_PRCSN,ADD_IP,&(CL.destCallSignal),rgtblDynamicMask(),-1,&hash_found,&(CL.DEST.reg),&dummyRecord))\n"
   "6271\t\t\t{\n"
   "6272\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8654, cl,\"rgsrFindAddress failed at fixFinalDest\"));\n"
   "6273\t\t\t\treturn FALSE;\n"
   "6274\t\t\t}\n"
   "6275\t    }\n"
   "6276\t\t*/\n"
   "6277\t\t/*neweli*/\n"
   "6278\t\n"
   "6279\t    if (CL.DEST.reg != RGTBL_REG_NOT_VALID)\n"
   "6280\t\t\trgtblEndpointType(RGTBL_GET, CL.DEST.reg, 
&(CL.DEST.endpointType));\n"
   "6281\t    if (rgtblIsForwarded(CL.DEST.reg))\n"
   "6282\t    {\n"
   "6283\t\t\tCALL_NOTIFY(\"handling a call to a forwarded terminal. forwarded 
terminal=\",CL.DEST.reg,10,cl);\n"
   "6284\t\t\tCL.model=cmRASCallModelTypeGKRouted;\n"
   "6285\t\t\tif (!exchangeForwardInfo(cl))\n"
   "6286\t\t\t{\n"
   "6287\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8655, cl,\"error in exchangeForwardInfo\"));\n"
   "6288\t\t\t\treturn FALSE;\n"
   "6289\t\t\t}\n"
   "6290\t\t\t/* I don\'t care what change was there before, forewarding is 
more important */\n"
   "6291\t\t\tCL.addressChange = CHNG_ADDRESS_FOREWARDED;\t\n"
   "6292\t\t\treturn TRUE; /* don\'t get into recursion. Wait for the 
application reply. fixFinalDest(cl,recursionCounter); */\n"
   "6293\t    }\n"
   "6294\t    \n"
   "6295\t\treturn TRUE;\n"
   "6296\t}\n"
   
"6297\t/*----------------------------------------------------------------------------*/
 \n"
   "6298\t  \n"
   "6299\t\n"
   "6300\t  /*******************************************************/\n"
   "6301\t  /*  Parameters                                         */\n"
   "6302\t  /*******************************************************/ \n"
   "6303\t  \n"
   "6304\t  INT32 calAppGetParameterNumber(/* returns the number of items of 
type \'parameter\' present.\n"
   "6305\t                                    return negative values on 
failure, 0 on success. */\n"
   "6306\t                                    IN   gkHCALL             hCall,\n"
   "6307\t                                    IN   gkcciParameter_t    
parameter,\n"
   "6308\t                                    IN   gkcciSide_t         side,\n"
   "6309\t                                    OUT  INT32*              
parameterNumber)\n"
   "6310\t    \n"
   "6311\t  {\n"
   "6312\t    int cl;\n"
   "6313\t    INT32 lastAddress, lastAlias;\n"
   "6314\t    HPVT hpvt;\n"
   "6315\t    int node;\n"
   "6316\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "6317\t    {\n"
   "6318\t      CALL_NOTIFY(\"calAppGetParameterNumber: Illegal handle: \", 
(UINT32)hCall, 30,-1);\n"
   "6319\t      return gkcciInvalidHandle;\n"
   "6320\t    } \n"
   "6321\t    if(!checkParameterLegal(cl, parameter, side, OP_GET))\n"
   "6322\t    {   \n"
   "6323\t      char str[200];\n"
   "6324\t      sprintf(str, \"calAppGetParameterNumber: Illegal parameter %s 
of side %s at state %s\", \n"
   "6325\t        gkcciParameterName(parameter), gkcciSideName(side), 
stateName[CL.state]);\n"
   "6326\t      CALL_NOTIFY(str, GEN_NA, 40,cl);\n"
   "6327\t      return gkcciInvalidParam;\n"
   "6328\t    } \n"
   "6329\t\n"
   "6330\t\n"
   "6331\t    switch (parameter)\n"
   "6332\t    {\n"
   "6333\t    case gkcciParam"
<- "AppLineHuntingIp: \n"
   "6334\t      *parameterNumber = countAddresses(CL.appLineHuntingCallSignal, 
APP_LINE_HUNTING_NUMBER, &lastAddress);\n"
   "6335\t      return gkcciOK;\n"
   "6336\t\n"
   "6337\t    case gkcciParamConnectH245Address:\n"
   "6338\t      *parameterNumber = 
(INT32)(addEmptyTransport(&(CL.connectH245Add))? 0: 1);\n"
   "6339\t      return gkcciOK;  \n"
   "6340\t\n"
   "6341\t    case gkcciParamSetupH245Address:\n"
   "6342\t      *parameterNumber = 
(INT32)(addEmptyTransport(&(CL.setupH245Add))? 0: 1);\n"
   "6343\t      return gkcciOK;  \n"
   "6344\t\n"
   "6345\t    case gkcciParamAlertingH245Address:\n"
   "6346\t      *parameterNumber = 
(INT32)(addEmptyTransport(&(CL.alertingH245Add))? 0: 1);\n"
   "6347\t      return gkcciOK;  \n"
   "6348\t\n"
   "6349\t    case gkcciParamCallSignal:   \n"
   "6350\t      if(side == gkcciSideOrig)\n"
   "6351\t        *parameterNumber = 
(INT32)(addEmptyTransport(&(CL.srcCallSignal))? 0:1);\n"
   "6352\t      else\n"
   "6353\t        *parameterNumber = 
(INT32)(addEmptyTransport(&(CL.destCallSignal))? 0: 1);\n"
   "6354\t      return gkcciOK;\n"
   "6355\t\n"
   "6356\t    case gkcciParamResolvedAlias:\n"
   "6357\t    case gkcciParamCallModel:\n"
   "6358\t    case gkcciParamCallMultirate:\n"
   "6359\t    case gkcciParamCallRate:\n"
   "6360\t    case gkcciParamCid:\n"
   "6361\t    case gkcciParamCallID:\n"
   "6362\t    case gkcciParamAlertingTimeout:\n"
   "6363\t    case gkcciParamConferenceGoal:\n"
   "6364\t    case gkcciParamCallState:\n"
   "6365\t    case gkcciParamCallStateReason:\n"
   "6366\t    case gkcciParamRequestedBandwidth:\n"
   "6367\t    case gkcciParamApprovedBandwidth:\n"
   "6368\t    case gkcciParamTotalBandwidth:\n"
   "6369\t    case gkcciParamDestZone:\n"
   "6370\t    case gkcciParamARJAltGKisPermanent:\n"
   "6371\t    case gkcciParamBRJAltGKisPermanent:\n"
   "6372\t    case gkcciParamDRJAltGKisPermanent:\n"
   "6373\t    case gkcciParamLRJAltGKisPermanent:\n"
   "6374\t    case gkcciParamEndpointType:\n"
   "6375\t    case gkcciParamLCFDestinationType:\n"
   "6376\t    case gkcciParamLCFEndpointVendor:\n"
   "6377\t    case gkcciParamReleaseCompleteCause:\n"
   "6378\t\t\t*parameterNumber = 1;\n"
   "6379\t      return gkcciOK;\n"
   "6380\t     \n"
   "6381\t    case gkcciParamAlias:\n"
   "6382\t    case gkcciParamAliasBMP:    /*countAliases */\n"
   "6383\t      if(side == gkcciSideOrig)\n"
   "6384\t        *parameterNumber = countAliases(CL.srcInfo, SOURCE_NUMBER, 
&lastAlias);\n"
   "6385\t      else\n"
   "6386\t        *parameterNumber =  countAliases(CL.destInfo, 
DESTINATION_NUMBER, &lastAlias);\n"
   "6387\t      return gkcciOK;  \n"
   "6388\t    case gkcciParamAdditionalNumber:\n"
   "6389\t      *parameterNumber =  countAliases(CL.destExtra, 
DESTINATION_NUMBER, &lastAlias);\n"
   "6390\t      return gkcciOK;\n"
   "6391\t      \n"
   "6392\t    case gkcciParamRemoteExtensionAliasBMP: /*countAliases */\n"
   "6393\t    case gkcciParamRemoteExtensionAlias: \n"
   "6394\t      *parameterNumber = 0;\n"
   "6395\t      if(!addEmptyAlias(&(CL.remoteExtension))) \n"
   "6396\t        *parameterNumber = 1;\n"
   "6397\t      return gkcciOK;\n"
   "6398\t\n"
   "6399\t    case gkcciParamAlternateEP:\n"
   "6400\t      *parameterNumber = countAlternateEp(CL.API_SIDE.ARQ);\n"
   "6401\t      return gkcciOK;\n"
   "6402\t\n"
   "6403\t    case gkcciParamARJAlternateGk:\n"
   "6404\t      *parameterNumber = countAlternateGk(cl,CL.API_SIDE.ARQ);\n"
   "6405\t      return gkcciOK;\n"
   "6406\t\n"
   "6407\t    case gkcciParamBRJAlternateGk:\n"
   "6408\t      *parameterNumber = countAlternateGk(cl,CL.API_SIDE.bw.hsRas);\n"
   "6409\t      return gkcciOK;\n"
   "6410\t\n"
   "6411\t    case gkcciParamDRJAlternateGk:\n"
   "6412\t      *parameterNumber = countAlternateGk(cl,CL.API_SIDE.DRQ);\n"
   "6413\t      return gkcciOK;\n"
   "6414\t\n"
   "6415\t    case gkcciParamLRJAlternateGk:\n"
   "6416\t      *parameterNumber = countAlternateGk(cl,CL.EPLRJ);\n"
   "6417\t      return gkcciOK;\n"
   "6418\t\n"
   "6419\t    case gkcciParamLRQSourceInfo:\n"
   "6420\t      hpvt = cmGetValTree(dispStack);\n"
   "6421\t      if ((node = pvtGetNodeIdByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.GKLRQ), \"request.*.sourceInfo\")) < 0)\n"
   "6422\t        *parameterNumber = 0;\n"
   "6423\t      else if ((*parameterNumber = pvtNumChilds(hpvt, node)) < 0)\n"
   "6424\t        return gkcciGKFailure;\n"
   "6425\t      return gkcciOK;\n"
   "6426\t\n"
   "6427\t    case gkcciParamLCFGatewayProtocol:\n"
   "6428\t      hpvt = cmGetValTree(dispStack);\n"
   "6429\t      if ((node = pvtGetNodeIdByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.EPLCF), 
\"response.*.destinationType.gateway.protocol\")) < 0)\n"
   "6430\t        *parameterNumber = 0;\n"
   "6431\t      else if ((*parameterNumber = pvtNumChilds(hpvt, node)) < 0)\n"
   "6432\t        return gkcciGKFailure;\n"
   "6433\t      return gkcciOK;\n"
   "6434\t\n"
   "6435\t    case gkcciParamLCFDestInfo:\n"
   "6436\t      hpvt = cmGetValTree(dispStack);\n"
   "6437\t      if ((node = pvtGetNodeIdByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.EPLCF), \"response.*.destinationInfo\")) < 0)\n"
   "6438\t        *parameterNumber = 0;\n"
   "6439\t      else if ((*parameterNumber = pvtNumChilds(hpvt, node)) < 0)\n"
   "6440\t        return gkcciGKFailure;\n"
   "6441\t      return gkcciOK;\n"
   "6442\t\n"
   "6443\t    case gkcciParamLCFDestExtra:\n"
   "6444\t      hpvt = cmGetValTree(dispStack);\n"
   "6445\t      if ((node = pvtGetNodeIdByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.EPLCF), \"response.*.destExtraCallInfo\")) < 0)\n"
   "6446\t        *parameterNumber = 0;\n"
   "6447\t      else if ((*parameterNumber = pvtNumChilds(hpvt, node)) < 0)\n"
   "6448\t        return gkcciGKFailure;\n"
   "6449\t      return gkcciOK;\n"
   "6450\t\n"
   "6451\t    case gkcciParamLCFRemoteExtension:\n"
   "6452\t      hpvt = cmGetValTree(dispStack);\n"
   "6453\t      if ((node = pvtGetNodeIdByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.EPLCF), \"response.*.remoteExtensionAddress\")) < 
0)\n"
   "6454\t        *parameterNumber = 0;\n"
   "6455\t      else if ((*parameterNumber = pvtNumChilds(hpvt, node)) < 0)\n"
   "6456\t        return gkcciGKFailure;\n"
   "6457\t      return gkcciOK;\n"
   "6458\t      \n"
   "6459\t    case gkcciParamAppLineHuntingAlias:\n"
   "6460\t    default:\n"
   "6461\t      return gkcciInvalidParam;\n"
   "6462\t    }\n"
   "6463\t  }\n"
   "6464\t\n"
   
"6465\t/*----------------------------------------------------------------------------*/
 \n"
   "6466\t  INT32 calAppGetParameter(/* returns the values of the items at 
places firstIndex to lastIndex of type \'parameter\'.\n"
   "6467\t                           the application must supply the suitable 
structure array.\n"
   "6468\t                           return negative values on failure, 0 on 
success.*/\n"
   "6469\t                           IN   gkHCALL             hCall,\n"
   "6470\t                           IN   gkcciParameter_t    parameter,\n"
   "6471\t                           IN   gkcciSide_t         side,\n"
   "6472\t                           IN   INT32               firstIndex, /* 
where only one such paramater exists the index is irrelevant.\n"
   "6473\t                                                                
otherwise data will be taken from the range between firstIndex \n"
   "6474\t                                                                to 
lastIndex (including lastIndex). */\n"
   "6475\t                           IN   INT32               lastIndex,  /* 
where only one such paramater exists the index is irrelevant.\n"
   "6476\t                                                                if 
lastIndex is gktypeLAST_PARAM, the data will be retrieved\n"
   "6477\t                                                                till 
the last available (in the GK database). The \'data\' paramater \n"
   "6478\t                                                                must 
be large enough for the returned data */\n"
   "6479\t                           OUT  void  *             data)\n"
   "6480\t  {\n"
   "6481\t    int cl;\n"
   "6482\t    int node;\n"
   "6483\t    HPVT hpvt;\n"
   "6484\t\n"
   "6485\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "6486\t    {\n"
   "6487\t      CALL_NOTIFY(\"calAppGetParameter: Illegal handle: \", 
(UINT32)hCall, 30,-1);\n"
   "6488\t      return gkcciInvalidHandle;\n"
   "6489\t    } \n"
   "6490\t    if(!checkParameterLegal(cl, parameter, side, OP_GET))\n"
   "6491\t    {   \n"
   "6492\t      char str[200];\n"
   "6493\t      sprintf(str, \"calAppGetParameter: Illegal parameter %s of side 
%s at state %s\", \n"
   "6494\t        gkcciParameterName(parameter), gkcciSideName(side), 
stateName[CL.state]);\n"
   "6495\t      CALL_NOTIFY(str, GEN_NA, 40,cl);\n"
   "6496\t      return gkcciInvalidParam;\n"
   "6497\t    } \n"
   "6498\t\n"
   "6499\t\n"
   "6500\t    switch (parameter)\n"
   "6501\t    {\n"
   "6502\t    case gkcciParamSetupNonStandard:\n"
   "6503\t    case gkcciParamAlertingNonStandard:\n"
   "6504\t    case gkcciParamConnectNonStandard:\n"
   "6505\t    case gkcciParamReleaseCompleteNonStandard:\n"
   "6506\t    case gkcciParamARQNonStandard:            \n"
   "6507\t    case gkcciParamACFNonStandard:\t         \n"
   "6508\t    case gkcciParamARJNonStandard:\t         \n"
   "6509\t    case gkcciParamDRQNonStandard:              \n"
   "6510\t    case gkcciParamDCFNonStandard:\t         \n"
   "6511\t    case gkcciParamDRJNonStandard:\n"
   "6512\t    case gkcciParamBRQNonStandard:\n"
   "6513\t    case gkcciParamBCFNonStandard:\n"
   "6514\t    case gkcciParamBRJNonStandard:\n"
   "6515\t    case gkcciParamGKDRQNonStandard:            \n"
   "6516\t    case gkcciParamEndpointDCFNonStandard:\t \n"
   "6517\t    case gkcciParamEndpointDRJNonStandard:\t \n"
   "6518\t    case gkcciParamGKLRQNonStandard:          \n"
   "6519\t    case gkcciParamEndpointLCFNonStandard:\t \n"
   "6520\t    case gkcciParamEndpointLRJNonStandard:\n"
   "6521\t      return getNSParam(parameter, cl, side, data);\n"
   "6522\t\n"
   "6523\t\n"
   "6524\t    case gkcciParamConnectH245Address:\n"
   "6525\t      if(!iutilGkIp2AppIp((gkaddTransport_t *)data, 
&(CL.connectH245Add)))\n"
   "6526\t        return gkcciNotFound;\n"
   "6527\t      else \n"
   "6528\t        return gkcciOK;  \n"
   "6529\t      \n"
   "6530\t\n"
   "6531\t    case gkcciParamSetupH245Address:\n"
   "6532\t      if(!iutilGkIp2AppIp((gkaddTransport_t *)data, 
&(CL.setupH245Add)))\n"
   "6533\t        return gkcciNotFound;\n"
   "6534\t      else \n"
   "6535\t        return gkcciOK;\n"
   "6536\t\n"
   "6537\t\n"
   "6538\t    case gkcciParamAlertingH245Address:\n"
   "6539\t      if(!iutilGkIp2AppIp((gkaddTransport_t *)data, 
&(CL.alertingH245Add)))\n"
   "6540\t        return gkcciNotFound;\n"
   "6541\t      else \n"
   "6542\t        return gkcciOK;\n"
   "6543\t\n"
   "6544\t\n"
   "6545\t    case gkcciParamCallProcH245Address:\n"
   "6546\t      if(!iutilGkIp2AppIp((gkaddTransport_t *)data, 
&(CL.callProcH245Add)))\n"
   "6547\t        return gkcciNotFound;\n"
   "6548\t      else \n"
   "6549\t        return gkcciOK;\n"
   "6550\t      \n"
   "6551\t    case gkcciParamAppLineHuntingIp: \n"
   "6552\t      return 
lnhGetAppLineHuntingCallSignal(cl,CL.appLineHuntingCallSignal, 
APP_LINE_HUNTING_NUMBER, data, firstIndex, lastIndex);\n"
   "6553\t    \n"
   "6554\t    \n"
   "6555\t    case gkcciParamCallSignal:   \n"
   "6556\t      if(side == gkcciSideOrig)\n"
   "6557\t      {\n"
   "6558\t        if(!iutilGkIp2AppIp((gkaddTransport_t *)data, 
&(CL.srcCallSignal)))\n"
   "6559\t          return gkcciNotFound;\n"
   "6560\t        else \n"
   "6561\t          return gkcciOK;\n"
   "6562\t      }\n"
   "6563\t      else if(!iutilGkIp2AppIp((gkaddTransport_t *)data, 
&(CL.destCallSignal)))\n"
   "6564\t        return gkcciNotFound;\n"
   "6565\t      else \n"
   "6566\t        return gkcciOK;        \n"
   "6567\t      break;\n"
   "6568\t \n"
   "6569\t    case gkcciParamResolvedAlias:\n"
   "6570\t      if (!iutilGkAlias2AppAlias((gkaddAlias_t *)data, 
STRING_TYPE_ANSI, &CL.destInfo[(UINT8)CL.resolvedIdx]))\n"
   "6571\t        return gkcciGKFailure;\n"
   "6572\t      return gkcciOK;  \n"
   "6573\t\n"
   "6574\t    case gkcciParamCallModel:  \n"
   "6575\t      /*shiri 10/2000*/\n"
   "6576\t\t    if(!iutilGkCallModel2AppCallModel((gktypeCallModel_t *)data, 
CL.model))\n"
   "6577\t\t\t\treturn gkcciGKFailure;\n"
   "6578\t\t\tif(*(gktypeCallModel_t *)data == gktypeCallModelTypeDirect)\n"
   "6579\t\t\t\treturn gkcciOK;\n"
   "6580\t\t\telse if (CL.mcRoutedMode)\n"
   "6581\t          *(gktypeCallModel_t *)data = 
gktypeCallModelTypeH245Routed;\n"
   "6582\t      return gkcciOK;  \n"
   "6583\t\n"
   "6584\t    case gkcciParamCallRate:\n"
   "6585\t      *(UINT32 *)data = CL.rate;\n"
   "6586\t      return gkcciOK;\n"
   "6587\t    \n"
   "6588\t    case gkcciParamAccessTokenNodeID:\n"
   "6589\t      *(INT32 *)data = CL.accessTokenNodeID;\n"
   "6590\t      return gkcciOK;\n"
   "6591\t\n"
   "6592\t\tcase gkcciParamCallMultirate:\n"
   "6593\t      *(INT32 *)data = CL.multirate;\n"
   "6594\t      return gkcciOK;\n"
   "6595\t    \n"
   "6596\t    case gkcciParamCid:\n"
   "6597\t      iutilGkCid2AppCid((char*)data,(char*)CL.cid);\n"
   "6598\t      return gkcciOK;  \n"
   "6599\t    \n"
   "6600\t    case gkcciParamCallID:\n"
   "6601\t      iutilGkCallID2AppCallID((char*)data,(char*)CL.SIDE.callID);\n"
   "6602\t      return gkcciOK;  \n"
   "6603\t    \n"
   "6604\t    case gkcciParamConferenceGoal:\n"
   "6605\t      
if(!iutilGkConferenceGoal2AppConferenceGoal((gktypeConferenceGoal_t *)data, 
CL.confGoal))\n"
   "6606\t        return gkcciGKFailure;\n"
   "6607\t      return gkcciOK; \n"
   "6608\t    \n"
   "6609\t    case gkcciParamCallState:\n"
   "6610\t      *(gkcciState_t *)data = CL.appState;\n"
   "6611\t      return gkcciOK;  \n"
   "6612\t    \n"
   "6613\t    case gkcciParamCallStateReason:\n"
   "6614\t      *(gkcciReason_t *)data = CL.appReason;\n"
   "6615\t      return gkcciOK;  \n"
   "6616\t    \n"
   "6617\t\t/*timing parameters*/  \n"
   "6618\t    case gkcciParamTimeOfStart:\n"
   "6619\t      *(UINT32*)data = CL.timeOfStart;\n"
   "6620\t      return gkcciOK;  \n"
   "6621\t    \n"
   "6622\t    case gkcciParamTimeOfArj:\n"
   "6623\t\t  *(UINT32*)data = CL.timeOfARJ;\n"
   "6624\t      return gkcciOK;  \n"
   "6625\t\n"
   "6626\t\tcase gkcciParamTimeOfDRQ:\n"
   "6627\t      *(UINT32*)data = CL.timeOfDRQ;\n"
   "6628\t      return gkcciOK;  \n"
   "6629\t   \n"
   "6630\t    case gkcciParamTimeOfACF:\n"
   "6631\t\t\t*(UINT32*)data = CL.timeOfACF;\n"
   "6632\t\t\treturn gkcciOK;  \n"
   "6633\t\t\n"
   "6634\t\tcase gkcciParamTimeOfRelease:\n"
   "6635\t\t\t*(UINT32*)data = CL.timeOfRelease;\n"
   "6636\t\t\treturn gkcciOK;  \n"
   "6637\t\t\n"
   "6638\t\tcase gkcciParamUsecRingTime: \n"
   "6639\t\t\t\n"
   "6640\t\t\t*(UINT32*)data = CL.usecTimeOfStart - CL.usecTimeOfAlert;\n"
   "6641\t\t\treturn gkcciOK;\n"
   "6642\t\t\t\t\t\t\t\t\t \n"
   "6643\t\tcase gkcciParamUsecEstablishmentTime:\n"
   "6644\t\t\t*(UINT32*)data = CL.usecTimeOfStart - CL.usecTimeOfACF;\n"
   "6645\t\t\treturn gkcciOK;\t\n"
   "6646\t\t\n"
   "6647\t\t\t\n"
   "6648\t    case gkcciParamARJReason:\n"
   "6649\t      if(side == gkcciSideOrig)\n"
   "6650\t        *(UINT32 *)data = CL.ORIG.ARJReason;\n"
   "6651\t      else\n"
   "6652\t        *(UINT32 *)data = CL.DEST.ARJReason;\n"
   "6653\t      return gkcciOK;\n"
   "6654\t\n"
   "6655\t\tcase gkcciParamReleaseCompleteCause:\n"
   "6656\t      if(side == gkcciSideOrig)\n"
   "6657\t        *(UINT32 *)data = CL.ORIG.dropCause;\n"
   "6658\t      else\n"
   "6659\t        *(UINT32 *)data = CL.DEST.dropCause;\n"
   "6660\t      return gkcciOK;\n"
   "6661\t\t/*--------------------*/\n"
   "6662\t\tcase gkcciParamAlertingTimeout:\n"
   "6663\t      *(UINT32*)data = (UINT32)(CL.alertingTimeout/1000);\n"
   "6664\t      return gkcciOK;\n"
   "6665\t\n"
   "6666\t    case gkcciParamRequestedBandwidth:\n"
   "6667\t      if(side == gkcciSideOrig)\n"
   "6668\t        iutilGkBw2AppBw((gktypeBw_t *)data, CL.ORIG.bw.bwReq);\n"
   "6669\t      else\n"
   "6670\t        iutilGkBw2AppBw((gktypeBw_t *)data, CL.DEST.bw.bwReq);\n"
   "6671\t      return gkcciOK;  \n"
   "6672\t    \n"
   "6673\t    \n"
   "6674\t    case gkcciParamApprovedBandwidth:\n"
   "6675\t      if(side == gkcciSideOrig)\n"
   "6676\t        iutilGkBw2AppBw((gktypeBw_t *)data, CL.ORIG.bw.bwApp);\n"
   "6677\t      else\n"
   "6678\t        iutilGkBw2AppBw((gktypeBw_t *)data, CL.DEST.bw.bwApp);\n"
   "6679\t      return gkcciOK;  \n"
   "6680\t    \n"
   "6681\t    case gkcciParamTotalBandwidth:\n"
   "6682\t      iutilGkBw2AppBw((gktypeBw_t *)data, max(CL.ORIG.bw.bwApp, 
CL.DEST.bw.bwApp));\n"
   "6683\t      return gkcciOK;  \n"
   "6684\t         \n"
   "6685\t    case gkcciParamDestZone:\n"
   "6686\t      /* iutilGkDestZone2AppDestZone((gktypeDestZone_t*)data, 
CL.destZone);*/\n"
   "6687\t\t\t*(gktypeDestZone_t*)data =  (gktypeDestZone_t)CL.destZone;\n"
   "6688\t\t\treturn gkcciOK;\n"
   "6689\t    case gkcciParamDisconnectReasonInComing:\n"
   "6690\t      if (side == gkcciSideOrig)\n"
   "6691\t        
disconnectRsnCM2App(cl,(gkcciDisconnectReason_t*)data,CL.ORIG.dropReason);\n"
   "6692\t      else\n"
   "6693\t        
disconnectRsnCM2App(cl,(gkcciDisconnectReason_t*)data,CL.DEST.dropReason);\n"
   "6694\t      return gkcciOK;\n"
   "6695\t\n"
   "6696\t      \n"
   "6697\t    case gkcciParamAlias:\n"
   "6698\t      if(side == gkcciSideOrig)\n"
   "6699\t        return getAliases(cl,CL.srcInfo, SOURCE_NUMBER, data, 
firstIndex, \n"
   "6700\t        lastIndex,STRING_TYPE_ANSI);\n"
   "6701\t      else\n"
   "6702\t        return getAliases(cl,CL.destInfo, DESTINATION_NUMBER, data, 
firstIndex, \n"
   "6703\t        lastIndex,STRING_TYPE_ANSI);\n"
   "6704\t      break;\n"
   "6705\t\n"
   "6706\t\n"
   "6707\t    case gkcciParamAliasBMP:\n"
   "6708\t      if(side == gkcciSideOrig)\n"
   "6709\t        return getAliases(cl, CL.srcInfo, SOURCE_NUMBER, data, 
firstIndex, \n"
   "6710\t        lastIndex,STRING_TYPE_BMP);\n"
   "6711\t      else\n"
   "6712\t        return getAliases(cl, CL.destInfo, DESTINATION_NUMBER, data, 
firstIndex, \n"
   "6713\t        lastIndex,STRING_TYPE_BMP);\n"
   "6714\t      break;\n"
   "6715\t\n"
   "6716\t\n"
   "6717\t    case gkcciParamAdditionalNumber:\n"
   "6718\t      return getAliases(cl, CL.destExtra, DESTINATION_NUMBER, data, 
firstIndex, \n"
   "6719\t        lastIndex,STRING_TYPE_ANSI);\n"
   "6720\t\n"
   "6721\t    case gkcciParamRemoteExtensionAlias:  \n"
   "6722\t    case gkcciParamRemoteExtensionAliasBMP:\n"
   "6723\t      if(!addEmptyAlias(&CL.remoteExtension))  \n"
   "6724\t      {\n"
   "6725\t        stringType_t stringType = cciGetStringType(parameter);\n"
   "6726\t        \n"
   "6727\t        (void)iutilGkAlias2AppAlias((gkaddAlias_t *)data ,\n"
   "6728\t          stringType,&(CL.remoteExtension));\n"
   "6729\t        return gkcciOK;\n"
   "6730\t      }\n"
   "6731\t      return gkcciNotFound;\n"
   "6732\t\n"
   "6733\t    case gkcciParamMCConfHandle:\n"
   "6734\t      *(UINT32 *)data = CL.mcConfHandle;\n"
   "6735\t      return gkcciOK;  \n"
   "6736\t    case gkcciParamMCConnHandle:\n"
   "6737\t      *(UINT32 *)data = CL.mcConnHandle;\n"
   "6738\t      return gkcciOK;  \n"
   "6739\t    case gkcciParamMCCallHandle:\n"
   "6740\t      if(side == gkcciSideOrig)\n"
   "6741\t        *(UINT32 *)data = CL.ORIG.mcCallHandle;\n"
   "6742\t      else\n"
   "6743\t        *(UINT32 *)"
<- "data = CL.DEST.mcCallHandle;\n"
   "6744\t      return gkcciOK;\n"
   "6745\t    case gkcciParamMCH245Address:\n"
   "6746\t      if(side == gkcciSideOrig)\n"
   "6747\t      {\n"
   "6748\t        if(!iutilGkIp2AppIp((gkaddTransport_t *)data, 
&(CL.ORIG.mcH245Addr)))\n"
   "6749\t          return gkcciNotFound;\n"
   "6750\t      }\n"
   "6751\t      else\n"
   "6752\t      {\n"
   "6753\t        if(!iutilGkIp2AppIp((gkaddTransport_t *)data, 
&(CL.DEST.mcH245Addr)))\n"
   "6754\t          return gkcciNotFound;\n"
   "6755\t      }\n"
   "6756\t      return gkcciOK;\n"
   "6757\t\n"
   "6758\t    case gkcciParamTunneledH245:\n"
   "6759\t      *(BOOL *)data = CL.tunneledH245;\n"
   "6760\t      return gkcciOK;\n"
   "6761\t\n"
   "6762\t    case gkcciParamFastStart:\n"
   "6763\t      *(BOOL *)data = CL.fastStart;\n"
   "6764\t      return gkcciOK;\n"
   "6765\t      \n"
   "6766\t    case gkcciParamARJAlternateGk:\n"
   "6767\t    case gkcciParamARJAltGKisPermanent:\n"
   "6768\t      return getAlternateGkParam(cl,CL.API_SIDE.ARQ, parameter, 
firstIndex, lastIndex, data);\n"
   "6769\t    case gkcciParamBRJAlternateGk:\n"
   "6770\t    case gkcciParamBRJAltGKisPermanent:\n"
   "6771\t      return getAlternateGkParam(cl,CL.API_SIDE.bw.hsRas, parameter, 
firstIndex, lastIndex, data);\n"
   "6772\t    case gkcciParamDRJAlternateGk:\n"
   "6773\t    case gkcciParamDRJAltGKisPermanent:\n"
   "6774\t      return getAlternateGkParam(cl,CL.API_SIDE.DRQ, parameter, 
firstIndex, lastIndex, data);\n"
   "6775\t    case gkcciParamLRJAlternateGk:\n"
   "6776\t    case gkcciParamLRJAltGKisPermanent:\n"
   "6777\t      return getAlternateGkParam(cl,CL.EPLRJ, parameter, firstIndex, 
lastIndex, data);\n"
   "6778\t\n"
   "6779\t    case gkcciParamAlternateEP:\n"
   "6780\t      return getAlternateEpParam(cl,CL.API_SIDE.ARQ, parameter, 
firstIndex, lastIndex, data);\n"
   "6781\t      \n"
   "6782\t\n"
   "6783\t    case gkcciParamCanOverlapSend:\n"
   "6784\t      *(BOOL*)data = CL.canOverlapSend;\n"
   "6785\t      return gkcciOK;\n"
   "6786\t\n"
   "6787\t    case gkcciParamCDRHandle:\n"
   "6788\t      *(gkHCDR*)data = CL.cdrHandle;\n"
   "6789\t      return gkcciOK;\n"
   "6790\t\n"
   "6791\t    case gkcciParamMediaWaitForConnect:\n"
   "6792\t      *(BOOL*)data = CL.mediaWaitForConnect;\n"
   "6793\t      return gkcciOK;\n"
   "6794\t\n"
   "6795\t    case gkcciParamCanMapAlias:\n"
   "6796\t      *(BOOL*)data = CL.canMapAliasForCall;\n"
   "6797\t      return gkcciOK;\n"
   "6798\t      \n"
   "6799\t\n"
   "6800\t    case gkcciParamLRQSourceInfo:\n"
   "6801\t      hpvt = cmGetValTree(dispStack);\n"
   "6802\t      if ((node = pvtGetNodeIdByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.GKLRQ), \"request.*.sourceInfo\")) < 0)\n"
   "6803\t        return gkcciNotFound;\n"
   "6804\t      if (iutilGetVtAliasList(hpvt, node, firstIndex, lastIndex, 
(gkaddAlias_t*)data) < 0)\n"
   "6805\t        return gkcciGKFailure;\n"
   "6806\t      return gkcciOK;\n"
   "6807\t\n"
   "6808\t    case gkcciParamLCFDestInfo:\n"
   "6809\t      hpvt = cmGetValTree(dispStack);\n"
   "6810\t      if ((node = pvtGetNodeIdByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.EPLCF), \"response.*.destinationInfo\")) < 0)\n"
   "6811\t        return gkcciNotFound;\n"
   "6812\t      if (iutilGetVtAliasList(hpvt, node, firstIndex, lastIndex, 
(gkaddAlias_t*)data) < 0)\n"
   "6813\t        return gkcciGKFailure;\n"
   "6814\t      return gkcciOK;\n"
   "6815\t\n"
   "6816\t    case gkcciParamLCFDestExtra:\n"
   "6817\t      hpvt = cmGetValTree(dispStack);\n"
   "6818\t      if ((node = pvtGetNodeIdByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.EPLCF), \"response.*.destExtraCallInfo\")) < 0)\n"
   "6819\t        return gkcciNotFound;\n"
   "6820\t      if (iutilGetVtAliasList(hpvt, node, firstIndex, lastIndex, 
(gkaddAlias_t*)data) < 0)\n"
   "6821\t        return gkcciGKFailure;\n"
   "6822\t      return gkcciOK;\n"
   "6823\t\n"
   "6824\t    case gkcciParamLCFRemoteExtension:\n"
   "6825\t      hpvt = cmGetValTree(dispStack);\n"
   "6826\t      if ((node = pvtGetNodeIdByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.EPLCF), \"response.*.remoteExtensionAddress\")) < 
0)\n"
   "6827\t        return gkcciNotFound;\n"
   "6828\t      if (iutilGetVtAliasList(hpvt, node, firstIndex, lastIndex, 
(gkaddAlias_t*)data) < 0)\n"
   "6829\t        return gkcciGKFailure;\n"
   "6830\t      return gkcciOK;\n"
   "6831\t\n"
   "6832\t    case gkcciParamEndpointType:\n"
   "6833\t      if (!iutilGkEndpType2AppEndpType((gkaddEndpointType*)data, 
CL.API_SIDE.endpointType))\n"
   "6834\t        return gkcciInvalidParam;\n"
   "6835\t      return gkcciOK;\n"
   "6836\t\n"
   "6837\t    case gkcciParamLCFDestinationType:\n"
   "6838\t      hpvt = cmGetValTree(dispStack);\n"
   "6839\t      if ((node = pvtGetNodeIdByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.EPLCF), \"response.*.destinationType\")) < 0)\n"
   "6840\t        return gkcciNotFound;\n"
   "6841\t      if (iutilGetEndpointType(hpvt, node, 
(gktypeEndpointTraits*)data) < 0)\n"
   "6842\t        return gkcciNotFound;\n"
   "6843\t      return gkcciOK;\n"
   "6844\t\n"
   "6845\t    case gkcciParamLCFEndpointVendor:\n"
   "6846\t      hpvt = cmGetValTree(dispStack);\n"
   "6847\t      if ((node = pvtGetNodeIdByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.EPLCF), \"response.*.destinationType.vendor\")) < 
0)\n"
   "6848\t        return gkcciNotFound;\n"
   "6849\t      if (iutilGetVendorId(hpvt, node, (gktypeVendorId*)data) < 0)\n"
   "6850\t        return gkcciNotFound;\n"
   "6851\t      return gkcciOK;\n"
   "6852\t\n"
   "6853\t    case gkcciParamLCFGatewayProtocol:\n"
   "6854\t      hpvt = cmGetValTree(dispStack);\n"
   "6855\t      if ((node = pvtGetNodeIdByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.EPLCF), 
\"response.*.destinationType.gateway.protocol\")) < 0)\n"
   "6856\t        return gkcciNotFound;\n"
   "6857\t      if 
(iutilGetGWProtocols(hpvt,node,firstIndex,lastIndex,(gkaddGatewayProtocol*)data)
 < 0)\n"
   "6858\t        return gkcciFailure;\n"
   "6859\t      return gkcciOK;\n"
   "6860\t    default:\n"
   "6861\t      return gkcciInvalidParam;\n"
   "6862\t      \n"
   "6863\t    }   \n"
   "6864\t  }\n"
   "6865\t\n"
   
"6866\t/*----------------------------------------------------------------------------*/
 \n"
   "6867\t  INT32 calAppSetParameter(/* sets the values of the items at places 
firstIndex to lastIndex of type \'parameter\'.\n"
   "6868\t                           the application must supply the suitable 
structure array. If setting of this\n"
   "6869\t                           parameter is not (yet) supported 
gkcciInvalidOperation will be returned \n"
   "6870\t                           return negative values on failure, 0 on 
success. */\n"
   "6871\t                           IN   gkHCALL             hCall,\n"
   "6872\t                           IN   gkcciParameter_t    parameter,\n"
   "6873\t                           IN   gkcciSide_t         side,\n"
   "6874\t                           IN   INT32               firstIndex,  /*  
where only one such paramater exists the index is irrelevant.\n"
   "6875\t                                                                 
otherwise data will be set in the range between firstIndex \n"
   "6876\t                                                                 to 
lastIndex  (including lastIndex).\n"
   "6877\t                                                                 if 
firstIndex is gktypeADD_PARAM, the data will be added\n"
   "6878\t                                                                 at 
the end of the list, regarding lastIndex as the number of addresses \n"
   "6879\t                                                                 to 
be added. \n"
   "6880\t                                                                 If 
the indeces are outside of the array bounds, gkcciOutOfBounds will be\n"
   "6881\t                                                                 
returned. If an error occured while setting one alias all aliases in the\n"
   "6882\t                                                                 
range will be deleted and errorIndex will be set to the (application) index 
of\n"
   "6883\t                                                                 the 
wrong alias */\n"
   "6884\t                           IN   INT32               lastIndex,   /* 
where only one such paramater exists the index is irrelevant.\n"
   "6885\t                                                                 if 
lastIndex is gktypeLAST_PARAM, the data will be set\n"
   "6886\t                                                                 till 
the last existing alias (in the GK database). The \'data\' \n"
   "6887\t                                                                 
paramater must contain all necessary data */\n"
   "6888\t                           IN  void  *             data)\n"
   "6889\t  {\n"
   "6890\t    int cl;\n"
   "6891\t    char str[200], strIp[200];\n"
   "6892\t    HPVT hpvt;\n"
   "6893\t    int node;\n"
   "6894\t\n"
   "6895\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "6896\t    {\n"
   "6897\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8792, -1, \"calAppSetParameter: Illegal handle: %d\", (UINT32)hCall ));\n"
   "6898\t      return gkcciInvalidHandle;\n"
   "6899\t    } \n"
   "6900\t    if(!checkParameterLegal(cl, parameter, side, OP_SET))\n"
   "6901\t    {   \n"
   "6902\t      sprintf(str, \"calAppSetP"
<- "arameter: Illegal parameter %s of side %s for call %d at state %s\", \n"
   "6903\t        gkcciParameterName(parameter), gkcciSideName(side), cl, 
stateName[CL.state]);\n"
   "6904\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8657, cl,str));\n"
   "6905\t      return gkcciInvalidParam;\n"
   "6906\t    } \n"
   "6907\t    if(!checkOperationLegal(cl, parameter, side))\n"
   "6908\t    {   \n"
   "6909\t      sprintf(str, \"calAppSetParameter: Illegal set operation of 
parameter %s of side %s for call %d at state %s\", \n"
   "6910\t        gkcciParameterName(parameter), gkcciSideName(side), cl, 
stateName[CL.state]);\n"
   "6911\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8658, cl,str));\n"
   "6912\t      return gkcciInvalidOperation;\n"
   "6913\t    } \n"
   "6914\t\n"
   "6915\t\n"
   "6916\t    switch (parameter)\n"
   "6917\t    {\n"
   "6918\t    case gkcciParamSetupNonStandard:\n"
   "6919\t    case gkcciParamAlertingNonStandard:\n"
   "6920\t    case gkcciParamConnectNonStandard:\n"
   "6921\t    case gkcciParamReleaseCompleteNonStandard:\n"
   "6922\t    case gkcciParamACFNonStandard:\t         \n"
   "6923\t    case gkcciParamARJNonStandard:\t         \n"
   "6924\t    case gkcciParamDCFNonStandard:\t         \n"
   "6925\t    case gkcciParamDRJNonStandard:\n"
   "6926\t    case gkcciParamBCFNonStandard:\n"
   "6927\t    case gkcciParamBRJNonStandard:\n"
   "6928\t    case gkcciParamGKDRQNonStandard:            \n"
   "6929\t    case gkcciParamGKLRQNonStandard:          \n"
   "6930\t      return setNSParam(parameter, cl, side, data);\n"
   "6931\t\n"
   "6932\t\n"
   "6933\t    case gkcciParamConnectH245Address:\n"
   "6934\t      liIpToString(((gkaddTransport_t *)data)->ip, strIp);        \n"
   "6935\t      sprintf (str, \"setting h245 ip of destination side to: 
%s:%d\", strIp, ((gkaddTransport_t *)data)->port);\n"
   "6936\t      CALL_NOTIFY(str, GEN_NA, 10,cl);\n"
   "6937\t      if(!iutilAppIp2GkIp(&(CL.connectH245Add), (gkaddTransport_t 
*)data ))\n"
   "6938\t        return gkcciGKFailure;\n"
   "6939\t      else \n"
   "6940\t        return gkcciOK;   \n"
   "6941\t\n"
   "6942\t\n"
   "6943\t    case gkcciParamSetupH245Address:\n"
   "6944\t      liIpToString(((gkaddTransport_t *)data)->ip, strIp);        \n"
   "6945\t      sprintf (str, \"setting h245 ip of origin side to: %s:%d\", 
strIp, ((gkaddTransport_t *)data)->port);\n"
   "6946\t      CALL_NOTIFY(str, GEN_NA, 10,cl);\n"
   "6947\t      if(!iutilAppIp2GkIp(&(CL.setupH245Add), (gkaddTransport_t 
*)data ))\n"
   "6948\t        return gkcciGKFailure;\n"
   "6949\t      else \n"
   "6950\t        return gkcciOK;\n"
   "6951\t\n"
   "6952\t    case gkcciParamCallProcH245Address:\n"
   "6953\t      liIpToString(((gkaddTransport_t *)data)->ip, strIp);        \n"
   "6954\t      sprintf (str, \"setting h245 ip of destination side to: 
%s:%d\", strIp, ((gkaddTransport_t *)data)->port);\n"
   "6955\t      CALL_NOTIFY(str, GEN_NA, 10,cl);\n"
   "6956\t      if(!iutilAppIp2GkIp(&(CL.callProcH245Add), (gkaddTransport_t 
*)data ))\n"
   "6957\t        return gkcciGKFailure;\n"
   "6958\t      else \n"
   "6959\t        return gkcciOK;\n"
   "6960\t\n"
   "6961\t    case gkcciParamAlertingH245Address:\n"
   "6962\t      liIpToString(((gkaddTransport_t *)data)->ip, strIp);        \n"
   "6963\t      sprintf (str, \"setting alerting h245 ip of destination side 
to: %s:%d\", strIp, ((gkaddTransport_t *)data)->port);\n"
   "6964\t      CALL_NOTIFY(str, GEN_NA, 10,cl);\n"
   "6965\t      if(!iutilAppIp2GkIp(&(CL.alertingH245Add), (gkaddTransport_t 
*)data ))\n"
   "6966\t        return gkcciGKFailure;\n"
   "6967\t      else \n"
   "6968\t        return gkcciOK;\n"
   "6969\t\n"
   "6970\t    case gkcciParamMCConfHandle:\n"
   "6971\t      CL.mcConfHandle = *(UINT32 *)data;\n"
   "6972\t      return gkcciOK;  \n"
   "6973\t    case gkcciParamMCConnHandle:\n"
   "6974\t      CL.mcConnHandle = *(UINT32 *)data;\n"
   "6975\t      return gkcciOK;  \n"
   "6976\t    case gkcciParamMCCallHandle:\n"
   "6977\t      if(side == gkcciSideOrig)\n"
   "6978\t        CL.ORIG.mcCallHandle = *(UINT32 *)data;\n"
   "6979\t      else\n"
   "6980\t        CL.DEST.mcCallHandle = *(UINT32 *)data;\n"
   "6981\t      return gkcciOK;\n"
   "6982\t    case gkcciParamMCH245Address:\n"
   "6983\t      if(side == gkcciSideOrig)\n"
   "6984\t      {\n"
   "6985\t        if(!iutilAppIp2GkIp(&(CL.ORIG.mcH245Addr), (gkaddTransport_t 
*)data ))\n"
   "6986\t          return gkcciGKFailure;\n"
   "6987\t      }\n"
   "6988\t      else\n"
   "6989\t      {\n"
   "6990\t        if(!iutilAppIp2GkIp(&(CL.DEST.mcH245Addr), (gkaddTransport_t 
*)data ))\n"
   "6991\t          return gkcciGKFailure;\n"
   "6992\t      }\n"
   "6993\t      return gkcciOK;\n"
   "6994\t\n"
   "6995\t    case gkcciParamAlertingTimeo"
<- "ut:\n"
   "6996\t      CL.alertingTimeout = (*(UINT32*)data*1000);\n"
   "6997\t      return gkcciOK;\n"
   "6998\t\n"
   "6999\t    case gkcciParamAppLineHuntingAliasBMP:\n"
   "7000\t    case gkcciParamAppLineHuntingAlias:\n"
   "7001\t      return 
lnhTranslateAndSetAppLineHuntingCallSignal(cl,CL.appLineHuntingCallSignal, 
APP_LINE_HUNTING_NUMBER, data, firstIndex, lastIndex);\n"
   "7002\t    \n"
   "7003\t    case gkcciParamAppLineHuntingIp: \n"
   "7004\t      return 
lnhSetAppLineHuntingCallSignal(cl,CL.appLineHuntingCallSignal, 
APP_LINE_HUNTING_NUMBER, data, firstIndex, lastIndex);\n"
   "7005\t    \n"
   "7006\t    case gkcciParamCallSignal:   \n"
   "7007\t      liIpToString(((gkaddTransport_t *)data)->ip, strIp);\n"
   "7008\t      if(side == gkcciSideOrig)\n"
   "7009\t      {              \n"
   "7010\t        sprintf (str, \"setting call signalling ip of origin side to: 
%s:%d\", strIp, ((gkaddTransport_t *)data)->port);\n"
   "7011\t        CALL_NOTIFY(str, GEN_NA, 10,cl);\n"
   "7012\t        if(!iutilAppIp2GkIp(&(CL.srcCallSignal), (gkaddTransport_t 
*)data ))\n"
   "7013\t          return gkcciGKFailure;\n"
   "7014\t        else \n"
   "7015\t          return gkcciOK;   \n"
   "7016\t      }\n"
   "7017\t      else\n"
   "7018\t      {\n"
   "7019\t        sprintf (str, \"setting call signalling ip of destination 
side to: %s:%d\", strIp, ((gkaddTransport_t *)data)->port);\n"
   "7020\t        CALL_NOTIFY(str, GEN_NA, 10,cl);\n"
   "7021\t        if(!iutilAppIp2GkIp(&(CL.destCallSignal), (gkaddTransport_t 
*)data ))\n"
   "7022\t          return gkcciGKFailure;\n"
   "7023\t        else \n"
   "7024\t          return gkcciOK;   \n"
   "7025\t      }\n"
   "7026\t      break;\n"
   "7027\t    \n"
   "7028\t    \n"
   "7029\t    case gkcciParamCallModel:\n"
   "7030\t      return setCallModel(cl, *(gktypeCallModel_t *)data);\n"
   "7031\t    \n"
   "7032\t    case gkcciParamCid:\n"
   "7033\t    case gkcciParamConferenceGoal:\n"
   "7034\t    case gkcciParamCallState:\n"
   "7035\t    case gkcciParamCallStateReason:\n"
   "7036\t    case gkcciParamRequestedBandwidth:\n"
   "7037\t    case gkcciParamApprovedBandwidth:\n"
   "7038\t    case gkcciParamTotalBandwidth:\n"
   "7039\t    case gkcciParamDestZone:\n"
   "7040\t    case gkcciParamTimeOfStart:\n"
   "7041\t\tcase gkcciParamTimeOfArj:\n"
   "7042\t\tcase gkcciParamTimeOfDRQ:\n"
   "7043\t\tcase gkcciParamTimeOfACF:            \n"
   "7044\t\tcase gkcciParamTimeOfRelease:\n"
   "7045\t\tcase gkcciParamUsecRingTime:            \n"
   "7046\t\tcase gkcciParamUsecEstablishmentTime:\n"
   "7047\t    case gkcciParamReleaseCompleteCause:\n"
   "7048\t\t\t/* we should never reach here */\n"
   "7049\t      \n"
   "7050\t      sprintf(str, \"calAppSetParameter: Unexpected set operation of 
parameter %s of side %s for call %d at state %s\", \n"
   "7051\t        gkcciParameterName(parameter), gkcciSideName(side), cl, 
stateName[CL.state]);\n"
   "7052\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8659, cl,str));\n"
   "7053\t      return gkcciInvalidOperation;\n"
   "7054\t      \n"
   "7055\t    case gkcciParamCallID:\n"
   "7056\t      iutilAppCallID2GkCallID((char*)CL.SIDE.callID,(char*)data);\n"
   "7057\t      return gkcciOK;  \n"
   "7058\t      \n"
   "7059\t    case gkcciParamAliasBMP:\n"
   "7060\t    case gkcciParamAlias:\n"
   "7061\t      if(side == gkcciSideOrig)\n"
   "7062\t      {                \n"
   "7063\t        CALL_NOTIFY(\"setting aliases of origin\",GEN_NA, 10,cl);\n"
   "7064\t        return setAliases(cl,CL.srcInfo, SOURCE_NUMBER, data, 
firstIndex, lastIndex);\n"
   "7065\t      }\n"
   "7066\t      else\n"
   "7067\t      {\n"
   "7068\t        CALL_NOTIFY(\"setting aliases of destination\",GEN_NA, 
10,cl);\n"
   "7069\t        return setAliases(cl,CL.destInfo, DESTINATION_NUMBER, data, 
firstIndex, lastIndex);\n"
   "7070\t      }\n"
   "7071\t      break;\n"
   "7072\t    case gkcciParamAdditionalNumber:\n"
   "7073\t      CALL_NOTIFY(\"setting additional numbers\",GEN_NA, 10,cl);\n"
   "7074\t      return setAliases(cl,CL.destExtra,  DESTINATION_NUMBER, \n"
   "7075\t        data, firstIndex, lastIndex);\n"
   "7076\t      \n"
   "7077\t    case gkcciParamRemoteExtensionAliasBMP:  \n"
   "7078\t    case gkcciParamRemoteExtensionAlias:  \n"
   "7079\t      CALL_NOTIFY(\"setting remote extension alias\",GEN_NA, 
10,cl);\n"
   "7080\t      if(!iutilAppAlias2GkAlias( &(CL.remoteExtension), 
(gkaddAlias_t*)data))\n"
   "7081\t      {\n"
   "7082\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8660, cl,\"calAppSetParameter: error calling iutilAppAlias2GkAlias while 
setting remote extension\"));\n"
   "7083\t        CL.remoteExtension.length = 0; /* delete the alias */\n"
   "7084\t        return gkcciGKFailure;\n"
   "7085\t      }\n"
   "7086"
<- "\t      return gkcciOK;\n"
   "7087\t\n"
   "7088\t    case gkcciParamCanMapAlias:\n"
   "7089\t       CL.canMapAliasForCall = *(BOOL*)data;\n"
   "7090\t       return gkcciOK;\n"
   "7091\t      \n"
   "7092\t    case gkcciParamAlternateEP:\n"
   "7093\t      return setAlternateEpParam(cl,CL.API_SIDE.ARQ, parameter, 
firstIndex, lastIndex, data);\n"
   "7094\t      \n"
   "7095\t    case gkcciParamARJAlternateGk:\n"
   "7096\t    case gkcciParamARJAltGKisPermanent:\n"
   "7097\t      return setAlternateGkParam(cl,CL.API_SIDE.ARQ, parameter, 
firstIndex, lastIndex, data);\n"
   "7098\t    case gkcciParamBRJAlternateGk:\n"
   "7099\t    case gkcciParamBRJAltGKisPermanent:\n"
   "7100\t      return setAlternateGkParam(cl,CL.API_SIDE.bw.hsRas, parameter, 
firstIndex, lastIndex, data);\n"
   "7101\t    case gkcciParamDRJAlternateGk:\n"
   "7102\t    case gkcciParamDRJAltGKisPermanent:\n"
   "7103\t      return setAlternateGkParam(cl,CL.API_SIDE.DRQ, parameter, 
firstIndex, lastIndex, data);\n"
   "7104\t    case gkcciParamLRJAlternateGk:\n"
   "7105\t    case gkcciParamLRJAltGKisPermanent:\n"
   "7106\t      return setAlternateGkParam(cl,CL.EPLRJ, parameter, firstIndex, 
lastIndex, data);\n"
   "7107\t      \n"
   "7108\t    case gkcciParamLRQSourceInfo:\n"
   "7109\t      hpvt = cmGetValTree(dispStack);\n"
   "7110\t      if ((node = pvtBuildByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.GKLRQ), \"request.*.sourceInfo\", 0, NULL)) < 0)\n"
   "7111\t        return gkcciGKFailure;\n"
   "7112\t      if (iutilSetVtAliasList(hpvt, node, firstIndex, lastIndex, 
(gkaddAlias_t*)data) < 0)\n"
   "7113\t        return gkcciGKFailure;\n"
   "7114\t      return gkcciOK;\n"
   "7115\t    case gkcciParamLRQCanMapAlias:\n"
   "7116\t      hpvt = cmGetValTree(dispStack);\n"
   "7117\t      if ((node = pvtBuildByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.GKLRQ), \"request.*.canMapAlias\", *(BOOL*)data, 
NULL)) < 0)\n"
   "7118\t        return gkcciGKFailure;\n"
   "7119\t      return gkcciOK;\n"
   "7120\t    case gkcciParamEndpointType:\n"
   "7121\t      if (!iutilAppEndpType2GkEndpType(&(CL.API_SIDE.endpointType), 
*(gkaddEndpointType*)data))\n"
   "7122\t        return gkcciInvalidParam;\n"
   "7123\t      return gkcciOK;\n"
   "7124\t      \n"
   "7125\t    case gkcciParamACFDestinationType:\n"
   "7126\t      hpvt = cmGetValTree(dispStack);\n"
   "7127\t      cmRASSetParam(CL.API_SIDE.ARQ, cmRASTrPartConfirm, 
cmRASParamEmpty, 1, 0, NULL);\n"
   "7128\t      if ((node = pvtBuildByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.API_SIDE.ARQ), 
\"response.admissionConfirm.destinationType\", 0, NULL)) < 0)\n"
   "7129\t        return gkcciFailure;\n"
   "7130\t      if (iutilSetEndpointType(hpvt, node, 
(gktypeEndpointTraits*)data) < 0)\n"
   "7131\t        return gkcciFailure;\n"
   "7132\t      return gkcciOK;\n"
   "7133\t      \n"
   "7134\t    case gkcciParamACFEndpointVendor:\n"
   "7135\t\t  cmRASSetParam(CL.API_SIDE.ARQ, cmRASTrPartConfirm, 
cmRASParamEmpty, 1, 0, NULL);\n"
   "7136\t      hpvt = cmGetValTree(dispStack);\n"
   "7137\t      if ((node = pvtGetNodeIdByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.API_SIDE.ARQ), 
\"response.admissionConfirm.destinationType\")) < 0)\n"
   "7138\t      {\n"
   "7139\t        gktypeEndpointTraits epType;\n"
   "7140\t        memset(&epType, 0, sizeof(gktypeEndpointTraits));\n"
   "7141\t        node = pvtBuildByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.API_SIDE.ARQ), 
\"response.admissionConfirm.destinationType\", 0, NULL);\n"
   "7142\t        iutilSetEndpointType(hpvt, node, &epType);\n"
   "7143\t      }\n"
   "7144\t      if ((node = pvtBuildByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.API_SIDE.ARQ), 
\"response.admissionConfirm.destinationType.vendor\", 0, NULL)) < 0)\n"
   "7145\t        return gkcciFailure;\n"
   "7146\t      if (iutilSetVendorId(hpvt, node, (gktypeVendorId*)data) < 0)\n"
   "7147\t        return gkcciFailure;\n"
   "7148\t      return gkcciOK;\n"
   "7149\t      \n"
   "7150\t    case gkcciParamACFGatewayProtocol:\n"
   "7151\t\t  cmRASSetParam(CL.API_SIDE.ARQ, cmRASTrPartConfirm, 
cmRASParamEmpty, 1, 0, NULL);\n"
   "7152\t      hpvt = cmGetValTree(dispStack);\n"
   "7153\t      if ((node = pvtBuildByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.API_SIDE.ARQ), 
\"response.admissionConfirm.destinationType\", 0, NULL)) < 0)\n"
   "7154\t        return gkcciFailure;\n"
   "7155\t      if (!cmuRASSetDestinationType(hpvt, node, 
cmEndpointTypeGateway))\n"
   "7156\t        return gkcciFailure;\n"
   "7157\t      if ((node = pvtBuildByPath(hpvt, 
cmGetProperty((HPROTOCOL)CL.API_SIDE.ARQ), 
\"response.*.destinationType.gateway.protocol\", 0, NULL)) < 0)\n"
   "7158\t        return gkcciNotFound;\n"
   "7159\t      i"
<- "f 
(iutilSetGWProtocols(hpvt,node,firstIndex,lastIndex,(gkaddGatewayProtocol*)data)
 < 0)\n"
   "7160\t        return gkcciFailure;\n"
   "7161\t      return gkcciOK;\n"
   "7162\t      \n"
   "7163\t    case gkcciParamARJReason:\n"
   "7164\t      CL.API_SIDE.ARJReason = *((gkcciARJReason_t*)data);\n"
   "7165\t      return gkcciOK;\n"
   "7166\t      \n"
   "7167\t    case gkcciParamDisconnectReasonOutGoing:\n"
   "7168\t      CL.API_SIDE.disconnectReason = 
*((gkcciDisconnectReason_t*)data);\n"
   "7169\t      return gkcciOK;\n"
   "7170\t      \n"
   "7171\t    case gkcciParamCanOverlapSend:\n"
   "7172\t      CL.canOverlapSend = *(BOOL *)data;\n"
   "7173\t      return gkcciOK;\n"
   "7174\t\n"
   "7175\t    case gkcciParamSendingComplete:\n"
   "7176\t        CL.sendingCompleteFlag = *(BOOL *)data;\n"
   "7177\t        return gkcciOK;\n"
   "7178\t\n"
   "7179\t    case gkcciParamCDRHandle:\n"
   "7180\t      CL.cdrHandle = *(gkHCDR*)data;\n"
   "7181\t      return gkcciOK;\n"
   "7182\t\n"
   "7183\t    case gkcciParamMediaWaitForConnect:\n"
   "7184\t      CL.mediaWaitForConnect = *(BOOL *)data;\n"
   "7185\t      return gkcciOK;\n"
   "7186\t\n"
   "7187\t    case gkcciParamCallRate:\n"
   "7188\t      CL.rate = *(UINT32 *)data;\n"
   "7189\t      return gkcciOK;\n"
   "7190\t\n"
   "7191\t    case gkcciParamCallMultirate:\n"
   "7192\t      CL.multirate = *(UINT32 *)data;\n"
   "7193\t      return gkcciOK;\n"
   "7194\t\n"
   "7195\t\tcase gkcciParamAccessTokenNodeID:\n"
   "7196\t      CL.accessTokenNodeID = *(INT32 *)data;\n"
   "7197\t      return gkcciOK;\n"
   "7198\t      \n"
   "7199\t    default:\n"
   "7200\t      return gkcciInvalidParam;\n"
   "7201\t    }   \n"
   "7202\t  }\n"
   "7203\t\n"
   "7204\t/*---------------------------------------------------------------\n"
   "7205\tcalAppSetH450Parameter (sarit)\n"
   "7206\t----------------------\n"
   "7207\tset the values of an h450 information in the a call record \n"
   "7208\tIf an error occured during the get operation it will be stopped \n"
   "7209\tand a negative number will be returned.\n"
   
"7210\t------------------------------------------------------------------*/\n"
   "7211\tINT32  calAppSetH450Parameter(IN   gkHCALL             hCall,\n"
   "7212\t\t\t\t\t\t\t\t  gkcciH450Parameter_t    parameter,\n"
   "7213\t\t\t\t\t\t\t\t  OUT  void  *             data) {\n"
   "7214\t\t\n"
   "7215\t\tint cl;\n"
   "7216\t    \n"
   "7217\t    if(!getCallCheckAuth((UINT32)hCall, &cl)) {\n"
   "7218\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8792, 
-1, \"calAppSetParameter: Illegal handle: %d\", (UINT32)hCall ));\n"
   "7219\t\t\treturn gkcciInvalidHandle;\n"
   "7220\t    } \n"
   "7221\t\tswitch(parameter) {\n"
   "7222\t\tcase gkcciH450ParamTransferEndedCall:\n"
   "7223\t\t\tcalls[cl].h450Info.transferEndedCall = *(BOOL *)data;\n"
   "7224\t\t\tbreak;\n"
   "7225\t\tcase gkcciH450ParamTransferStartedCall:\n"
   "7226\t\t\tcalls[cl].h450Info.transferStartedCall = *(BOOL *)data;\n"
   "7227\t\t\tbreak;\n"
   "7228\t\tcase gkcciH450ParamTransferedFromTransportAddress:\n"
   
"7229\t\t\tif(!iutilAppIp2GkIp(&(calls[cl].h450Info.transferedFromTransportAddress),
 (gkaddTransport_t *)data ))\n"
   "7230\t\t\t\treturn gkcciGKFailure;\n"
   "7231\t\t\tbreak;\n"
   "7232\t\tcase gkcciH450ParamTransferedToTransportAddress:\n"
   
"7233\t\t\tif(!iutilAppIp2GkIp(&(calls[cl].h450Info.transferedToTransportAddress),
 (gkaddTransport_t *)data ))\n"
   "7234\t\t\t\treturn gkcciGKFailure;\n"
   "7235\t\t\tbreak;\n"
   "7236\t\tcase gkcciH450ParamTransferedFromCallId:\n"
   
"7237\t\t\tiutilAppCallID2GkCallID((char*)calls[cl].h450Info.transferedFromCallID,(char*)data);\n"
   "7238\t\t\tbreak;\n"
   "7239\t\tcase gkcciH450ParamTransferedFromAlias:\n"
   
"7240\t\t\tif(!iutilAppAlias2GkAlias(&(calls[cl].h450Info.transferedFromAlias), 
(gkaddAlias_t*)data))\n"
   "7241\t\t\t\treturn gkcciGKFailure;\n"
   "7242\t\tbreak;\n"
   "7243\t\t\tcase gkcciH450ParamForwadedCall:\n"
   "7244\t\t\tcalls[cl].h450Info.forwadedCall = *(BOOL *)data;\n"
   "7245\t\t\tbreak;\n"
   "7246\t\tcase gkcciH450ParamForward245: \n"
   "7247\t\t\tcalls[cl].h450Info.savedH245Add = *(cmRASTransport *)data;\n"
   "7248\t\t\tbreak;\n"
   "7249\t\tcase gkcciH450ParamForwardType:\n"
   "7250\t\t\tcalls[cl].h450Info.forwardType = 
*(gkcciH450ForwardType_t*)data;\n"
   "7251\t\t\tbreak;\n"
   "7252\t\tcase gkcciH450ParamForwardedFromTransportAddress:\n"
   
"7253\t\t\tif(!iutilAppIp2GkIp(&(calls[cl].h450Info.originalTransportAddress),(gkaddTransport_t
 *)data))\n"
   "7254\t\t\t\treturn gkcciGKFailure;\n"
   "7255\t\t\tbreak;\n"
   "7256\t\tcase gkcciH450ParamForwardedFromAlias:\n"
   
"7257\t\t\tif(!iutilAppAlias2GkAlias(&(calls[cl].h450Info.originalAliases),(gkaddAlias_t*)data))\n"
   "7258\t\t\t\treturn gkcciGKFailure;\n"
   "7259\t\t\tbreak;\n"
   "7260\t\tcase gkcciH450ParamRecordType:\n"
   "7261\t\t\tcalls[cl].h450Info.recordType = *(gkcciH450CallRecord_t *)data;\n"
   "7262\t\t\tbreak;\n"
   "7263\t\td"
<- "efault: \n"
   "7264\t\t\treturn gkcciInvalidParam;\n"
   "7265\t    }    \n"
   "7266\t\treturn gkcciOK;\n"
   "7267\t\t\n"
   "7268\t}\n"
   "7269\t/*---------------------------------------------------------------\n"
   "7270\tcalAppGetH450Parameter (sarit)\n"
   "7271\t----------------------\n"
   "7272\treturns the values of an h450 information stored in a call record \n"
   "7273\tIf an error occured during the get operation it will be stopped and 
\n"
   "7274\ta negative number will be returned.\n"
   
"7275\t------------------------------------------------------------------*/\n"
   "7276\tINT32  calAppGetH450Parameter(IN   gkHCALL             hCall,\n"
   "7277\t\t\t\t\t\t\t\t  gkcciH450Parameter_t    parameter,\n"
   "7278\t                              OUT  void  *             data) {\n"
   "7279\t\n"
   "7280\t\tint cl;\n"
   "7281\t    \n"
   "7282\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "7283\t    {\n"
   "7284\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8792, -1, \"calAppSetParameter: Illegal handle: %d\", (UINT32)hCall ));\n"
   "7285\t      return gkcciInvalidHandle;\n"
   "7286\t    } \n"
   "7287\t\tswitch(parameter) {\n"
   "7288\t\tcase gkcciH450ParamTransferEndedCall:\n"
   "7289\t\t\t*(BOOL *)data = calls[cl].h450Info.transferEndedCall;\n"
   "7290\t\t\tbreak;\n"
   "7291\t\tcase gkcciH450ParamTransferStartedCall:\n"
   "7292\t\t\t*(BOOL *)data = calls[cl].h450Info.transferStartedCall;\n"
   "7293\t\t\tbreak;\n"
   "7294\t\tcase gkcciH450ParamTransferedFromTransportAddress:\n"
   "7295\t\t\tif(!iutilGkIp2AppIp((gkaddTransport_t *)data, 
&(calls[cl].h450Info.transferedFromTransportAddress)))\n"
   "7296\t\t\t\treturn gkcciGKFailure;\n"
   "7297\t\t\tbreak;\n"
   "7298\t\tcase gkcciH450ParamTransferedToTransportAddress:\n"
   "7299\t\t\tif(!iutilGkIp2AppIp((gkaddTransport_t *)data, 
&(calls[cl].h450Info.transferedToTransportAddress)))\n"
   "7300\t\t\t\treturn gkcciGKFailure;\n"
   "7301\t\t\tbreak;\n"
   "7302\t\tcase gkcciH450ParamTransferedFromCallId:\n"
   
"7303\t\t\tiutilGkCallID2AppCallID((char*)data,(char*)calls[cl].h450Info.transferedFromCallID);\n"
   "7304\t\t\tbreak;\n"
   "7305\t\tcase gkcciH450ParamTransferedFromAlias:\n"
   "7306\t        
if(!iutilGkAlias2AppAlias((gkaddAlias_t*)data,STRING_TYPE_ANSI, 
&(calls[cl].h450Info.transferedFromAlias)))\n"
   "7307\t\t\t\treturn gkcciGKFailure;\n"
   "7308\t\t\tbreak;\n"
   "7309\t\tcase gkcciH450ParamForwadedCall:\n"
   "7310\t\t\t*(BOOL *)data = calls[cl].h450Info.forwadedCall;\n"
   "7311\t\t\tbreak;\n"
   "7312\t\tcase gkcciH450ParamForward245: \n"
   "7313\t\t\t*(cmRASTransport *)data = calls[cl].h450Info.savedH245Add;\n"
   "7314\t\t\tbreak;\n"
   "7315\t\tcase gkcciH450ParamForwardType:\n"
   "7316\t\t\t*(gkcciH450ForwardType_t*)data = 
calls[cl].h450Info.forwardType;\n"
   "7317\t\t\tbreak;\n"
   "7318\t\tcase gkcciH450ParamForwardedFromTransportAddress:\n"
   "7319\t\t\tif(!iutilGkIp2AppIp((gkaddTransport_t *)data, 
&(calls[cl].h450Info.originalTransportAddress)))\n"
   "7320\t\t\t\treturn gkcciGKFailure;\n"
   "7321\t\t\tbreak;\n"
   "7322\t\tcase gkcciH450ParamForwardedFromAlias:\n"
   "7323\t\t\tif(!iutilGkAlias2AppAlias((gkaddAlias_t*)data,STRING_TYPE_ANSI, 
&(calls[cl].h450Info.originalAliases)))\n"
   "7324\t\t\t\treturn gkcciGKFailure;\n"
   "7325\t\t\tbreak;\n"
   "7326\t\tcase gkcciH450ParamRecordType:\n"
   "7327\t\t\t*(gkcciH450CallRecord_t *)data = calls[cl].h450Info.recordType;\n"
   "7328\t\t\tbreak;\n"
   "7329\t \tdefault: \n"
   "7330\t\t\treturn gkcciInvalidParam;\n"
   "7331\t    }    \n"
   "7332\t\treturn gkcciOK;\n"
   "7333\t\n"
   "7334\t}\n"
   "7335\t\n"
   "7336\t\n"
   "7337\t\n"
   "7338\t\n"
   "7339\t\n"
   "7340\t  INT32 setCallModel(\n"
   "7341\t    IN int cl,\n"
   "7342\t    IN gktypeCallModel_t model)\n"
   "7343\t  {\n"
   "7344\t    char str[64];\n"
   "7345\t    sprintf(str, \"setting call model to \");\n"
   "7346\t    switch (model)\n"
   "7347\t    {\n"
   "7348\t    case gktypeCallModelTypeDirect:\n"
   "7349\t      if (!IS_ARQ_ORIG && !IS_ARQ_DEST)\n"
   "7350\t        return gkcciInvalidOperation;\n"
   "7351\t      strcat(str,\"direct\");\n"
   "7352\t      CL.model = cmRASCallModelTypeDirect;\n"
   "7353\t      CL.mcRoutedMode = FALSE;\n"
   "7354\t      break;\n"
   "7355\t    case gktypeCallModelTypeGKRouted:\n"
   "7356\t      if (!IS_ARQ_ORIG && CL.mcRoutedMode == FALSE)\n"
   "7357\t        return gkcciInvalidOperation;\n"
   "7358\t      strcat(str, \"routed\");\n"
   "7359\t      CL.model = cmRASCallModelTypeGKRouted;\n"
   "7360\t      CL.mcRoutedMode = FALSE;\n"
   "7361\t      break;\n"
   "7362\t    case gktypeCallModelTypeH245Routed:\n"
   "7363\t      strcat(str, \"H245 routed\");\n"
   "7364\t      CL.model = cmRASCallModelTypeGKRouted;\n"
   "7365\t      CL.mcRoutedMode = TRUE;\n"
   "7366\t      break;\n"
   "7367\t    default:\n"
   "7368\t      return gkcciGKFailure;\n"
   "7369\t    }\n"
   "7370\t    CALL_NOTIFY(str, GEN_NA, 10,cl);\n"
   "7371\t    return gkcciOK;  \n"
   "7372\t  }      \n"
   "7373\t\n"
   "7374\t  /*******************************************************/\n"
   "7375\t  /*  Message Parameters                                 */\n"
   "7376\t  /*******************************************************/ \n"
   "7377\t  void getNonStandardRequestArguments(/* arrange the requset to pass 
to the stack */\n"
   "7378\t    IN int               cl,\n"
   "7379\t    IN gkcciParameter_t  parameter,\n"
   "7380\t    IN cmuMessage_t     *message,\n"
   "7381\t    IN gkcciSide_t       side)\n"
   "7382\t  {\n"
   "7383\t    switch (parameter)\n"
   "7384\t    {\n"
   "7385\t    case gkcciParamSetupNonStandard:\n"
   "7386\t    case gkcciParamAlertingNonStandard:\n"
   "7387\t    case gkcciParamConnectNonStandard:\n"
   "7388\t    case gkcciParamReleaseCompleteNonStandard:\n"
   "7389\t      message->type = CMU_Q931;\n"
   "7390\t      message->part = (cmRASTrPart)0;\n"
   "7391\t      message->hsCall = CL.API_SIDE.stack;\n"
   "7392\t      break;\n"
   "7393\t    case gkcciParamARQNonStandard:   \n"
   "7394\t      message->hsRas = CL.API_SIDE.ARQ;\n"
   "7395\t      break;                             \n"
   "7396\t    case gkcciParamACFNonStandard:\t \n"
   "7397\t      message->hsRas = CL.API_SIDE.ARQ;\n"
   "7398\t      message->part = cmRASTrPartConfirm;\n"
   "7399\t      break;                 \n"
   "7400\t    case gkcciParamARJNonStandard:\n"
   "7401\t      message->hsRas = CL.API_SIDE.ARQ;\n"
   "7402\t      message->part = cmRASTrPartReject;\n"
   "7403\t      break;                  \n"
   "7404\t    case gkcciParamDRQNonStandard:\n"
   "7405\t      message->hsRas = CL.API_SIDE.DRQ;\n"
   "7406\t      break;   \n"
   "7407\t    case gkcciParamDCFNonStandard:\t         \n"
   "7408\t      message->hsRas = CL.API_SIDE.DRQ;\n"
   "7409\t      message->part = cmRASTrPartConfirm;\n"
   "7410\t      break;   \n"
   "7411\t    case gkcciParamDRJNonStandard:\n"
   "7412\t      message->hsRas = CL.API_SIDE.DRQ;\n"
   "7413\t      message->part = cmRASTrPartReject;\n"
   "7414\t      break;\n"
   "7415\t    case gkcciParamBRQNonStandard:\n"
   "7416\t      message->hsRas = CL.API_SIDE.bw.hsRas;\n"
   "7417\t      break;   \n"
   "7418\t    case gkcciParamBCFNonStandard:\t         \n"
   "7419\t      message->hsRas = CL.API_SIDE.bw.hsRas;\n"
   "7420\t      message->part = cmRASTrPartConfirm;\n"
   "7421\t      break;   \n"
   "7422\t    case gkcciParamBRJNonStandard:\n"
   "7423\t      message->hsRas = CL.API_SIDE.bw.hsRas;\n"
   "7424\t      message->part = cmRASTrPartReject;\n"
   "7425\t      break;                   \n"
   "7426\t    case gkcciParamGKDRQNonStandard:  \n"
   "7427\t      message->hsRas = CL.API_SIDE.GKDRQ;\n"
   "7428\t      break;                  \n"
   "7429\t    case gkcciParamEndpointDCFNonStandard:\t\n"
   "7430\t      message->hsRas = CL.API_SIDE.EPDCF;\n"
   "7431\t      message->part = cmRASTrPartConfirm;\n"
   "7432\t      break; \n"
   "7433\t    case gkcciParamEndpointDRJNonStandard:\n"
   "7434\t      message->hsRas = CL.API_SIDE.EPDRJ;\n"
   "7435\t      message->part = cmRASTrPartReject;\n"
   "7436\t      break;               \n"
   "7437\t    case gkcciParamGKLRQNonStandard:   \n"
   "7438\t      message->hsRas = CL.GKLRQ;\n"
   "7439\t      break;   \n"
   "7440\t    case gkcciParamEndpointLCFNonStandard:\t \n"
   "7441\t      message->hsRas = CL.EPLCF;\n"
   "7442\t      message->part = cmRASTrPartConfirm;\n"
   "7443\t      break; \n"
   "7444\t    case gkcciParamEndpointLRJNonStandard:\n"
   "7445\t      message->hsRas = CL.EPLRJ;\n"
   "7446\t      message->part = cmRASTrPartReject;\n"
   "7447\t      break; \n"
   "7448\t    default:\n"
   "7449\t      break;\n"
   "7450\t    }\n"
   "7451\t  }\n"
   "7452\t\n"
   "7453\t  
/*----------------------------------------------------------------------------*/
 \n"
   "7454\t  \n"
   "7455\t  INT32 getNSParam( /* gets the non standard param of a message part 
*/\n"
   "7456\t    IN   gkcciParameter_t  parameter, \n"
   "7457\t    IN   int               cl, \n"
   "7458\t    IN   gkcciSide_t       side, \n"
   "7459\t    IN   void*             data)\n"
   "7460\t    \n"
   "7461\t  {\n"
   "7462\t    gktypeNonStandardParam  *nonStandardData = 
(gktypeNonStandardParam  *)data;\n"
   "7463\t    cmNonStandardParam      nonStandardInfo;\n"
   "7464\t    int val;\n"
   "7465\t    cmuMessage_t message; \n"
   "7466\t    cmuLoadParams(message, 
CMU_RAS,(HRAS)NULL,cmRASTrPartRequest,(HCALL)NULL);/*initial values only*/\n"
   "7467\t    \n"
   "7468\t    nonStandardInfo.data = nonStandardData->data;\n"
   "7469\t    nonStandardInfo.length = nonStandardData->dataLength;\n"
   "7470\t    \n"
   "7471\t    getNonStandardRequestArguments(cl, parameter, &message, side);\n"
   "7472\t    \n"
   "7473\t    
if(cmuGetParam(&message,getCmParam(parameter),FALSE,0,&val,(char*)&nonStandardInfo)
 < 0)\n"
   "7474\t    {\n"
   "7475\t      /*CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8661, cl,\"getNSParam: Failed in getting non standard param\"));*/\n"
   "7476\t      return gkcciGKFailure;\n"
   "7477\t    }                                        \n"
   "7478\t    if 
(!iutilGkNSParam2AppNSParam(nonStandardData,&nonStandardInfo))\n"
   "7479\t      return gkcciGKFailure;\n"
   "7480\t    if(iutilEmptyNonStandardParam(nonStandardData))\n"
   "7481\t      return gkcciNotFound;\n"
   "7482\t    return gkcciOK;\n"
   "7483\t  }\n"
   "7484\t\n"
   "7485\t  
/*----------------------------------------------------------------------------*/
 \n"
   "7486\t  \n"
   "7487\t  INT32 setNSParam( /* sets the non standard param of a message part 
*/\n"
   "7488\t    IN   gkcciParameter_t  parameter, \n"
   "7489\t    IN   int               cl, \n"
   "7490\t    IN   gkcciSide_t       side, \n"
   "7491\t    IN   void*             data)\n"
   "7492\t    \n"
   "7493\t  {\n"
   "7494\t    gktypeNonStandardParam  *nonStandardData = 
(gktypeNonStandardParam  *)data;\n"
   "7495\t    cmNonStandardParam      nonStandardInfo;\n"
   "7496\t    char str[500];\n"
   "7497\t    cmuMessage_t message;\n"
   "7498\t    
cmuLoadParams(message,CMU_RAS,(HRAS)NULL,cmRASTrPartRequest,(HCALL)NULL); /* 
initial values only */ \n"
   "7499\t    \n"
   "7500\t    if (!data)\n"
   "7501\t      return gkcciOK;\n"
   "7502\t    sprintf (str, \"setting non standard parameter %s of side %s\", 
gkcciParameterName(parameter), gkcciSideName(side));\n"
   "7503\t    CALL_NOTIFY(str, GEN_NA, 10,cl);\n"
   "7504\t    getNonStandardRequestArguments(cl, parameter, &message, side);\n"
   "7505\t    \n"
   "7506\t    nonStandardInfo.data = nonStandardData->data;\n"
   "7507\t    nonStandardInfo.length = nonStandardData->dataLength;\n"
   "7508\t    \n"
   "7509\t    if (!iutilAppNSParam2GkNSParam(&nonStandardInfo, 
nonStandardData))\n"
   "7510\t      return gkcciGKFailure;\n"
   "7511\t    
if(cmuSetParam(&message,getCmParam(parameter),0,sizeof(cmNonStandardParam),(char*)&nonStandardInfo)
 < 0 )\n"
   "7512\t    {\n"
   "7513\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8662, cl,\"setNSParam: Failed in setting non standard param\"));\n"
   "7514\t      return gkcciGKFailure;\n"
   "7515\t    }\n"
   "7516\t    return gkcciOK;\n"
   "7517\t  }\n"
   "7518\t  \n"
   "7519\t  INT32 setAlternateEpParam(IN int cl,\n"
   "7520\t\t\t\t    IN   HRAS              hsRas, /* RAS handle for rejection 
message */\n"
   "7521\t\t\t\t    IN   gkcciParameter_t  parameter,  /* The parameter to set 
(AlternateGk/AltGKisPermanent) */\n"
   "7522\t\t\t\t    IN   INT32             firstIndex, /* The same as in 
calAppSetParameter */\n"
   "7523\t\t\t\t    IN   INT32             lastIndex,  /* The same as in 
calAppSetParameter */\n"
   "7524\t\t\t\t    IN   void *            data)\n"
   "7525\t       {\n"
   "7526\t         int nodeId, i, numItems, chNodeId;\n"
   "7527\t         char buf[4];\n"
   "7528\t         BOOL succ = TRUE;\n"
   "7529\t         HPVT hpvt = cmGetValTree(dispStack);\n"
   "7530\t         gkaddAlternateEp_t *altEp = (gkaddAlternateEp_t *)data;\n"
   "7531\t\n"
   "7532\t\t if(cl);\n"
   "7533\t\t if(parameter);\n"
   "7534\t         if (hsRas == NULL) return gkcciInvalidParam;\n"
   "7535\t\n"
   "7536\t\t  cmRASSetParam(hsRas, cmRASTrPartConfirm, cmRASParamEmpty, 1, 0, 
NULL);\n"
   "7537\t         if ((nodeId = pvtBuildByPath(hpvt, 
cmGetProperty((HPROTOCOL)hsRas), \"response.*.alternateEndpoints\", 0, NULL)) < 
0)\n"
   "7538\t           return gkcciGKFailure;\n"
   "7539\t\n"
   "7540\t         if ((numItems = pvtNumChilds(hpvt, nodeId)) < 0)\n"
   "7541\t             return gkcciGKFailure;\n"
   "7542\t         \n"
   "7543\t         if (firstIndex == gktypeADD_PARAM)\n"
   "7544\t         {\n"
   "7545\t           firstIndex = numItems+1;\n"
   "7546\t           lastIndex += numItems;\n"
   "7547\t         }\n"
   "7548\t         if ((firstIndex < 0) || (lastIndex-firstIndex < 0))\n"
   "7549\t           return gkcciOutOfBounds;\n"
   "7550\t         \n"
   "7551\t         /* store all fields into the SEQUENCE of AlternateEp */\n"
   "7552\t         for (i = firstIndex; (i <= lastIndex) && succ; i++)\n"
   "7553\t         {\n"
   "7554\t           sprintf(buf, \"%d\", i+1);\n"
   "7555\t           if ((chNodeId = pvtBuildByPath(hpvt, nodeId, buf, 0, 
NULL)) >= 0)\n"
   "7556\t           {\n"
   "7557\t             if (iutilSetAlternateEp(hpvt, chNodeId, altEp) < 0)\n"
   "7558\t               succ = FALSE;\n"
   "7559\t           }\n"
   "7560\t           else succ = FALSE;\n"
   "7561\t\n"
   "7562\t           altEp++;\n"
   "7563\t         }\n"
   "7564\t         \n"
   "7565\t         if (succ)\n"
   "7566\t           return gkcciOK;\n"
   "7567\t         else\n"
   "7568\t           return gkcciGKFailure;\n"
   "7569\t       }\n"
   "7570\t  \n"
   "7571\t  INT32 setAlternateGkP"
<- "aram(/* Set the alternateGk parameter type into the RAS message. Called 
from calAppSetParameter */\n"
   "7572\t                                 IN int cl,\n"
   "7573\t                                 IN   HRAS              hsRas, /* RAS 
handle for rejection message */\n"
   "7574\t                                 IN   gkcciParameter_t  parameter,  
/* The parameter to set (AlternateGk/AltGKisPermanent) */\n"
   "7575\t                                 IN   INT32             firstIndex, 
/* The same as in calAppSetParameter */\n"
   "7576\t                                 IN   INT32             lastIndex,  
/* The same as in calAppSetParameter */\n"
   "7577\t                                 IN   void *            data)\n"
   "7578\t       {\n"
   "7579\t         int nodeId, chNodeId;\n"
   "7580\t         HPVT hpvt;\n"
   "7581\t         gkaddAlternateGk_t* altGk = (gkaddAlternateGk_t*)data;\n"
   "7582\t         int i, length, numItems;\n"
   "7583\t         BOOL success = TRUE;\n"
   "7584\t         char buf[5];\n"
   "7585\t\n"
   "7586\t         if (hsRas == NULL) return gkcciInvalidParam;\n"
   "7587\t         hpvt = cmGetValTree(dispStack);\n"
   "7588\t\n"
   "7589\t\t  cmRASSetParam(hsRas, cmRASTrPartReject, cmRASParamEmpty, 1, 0, 
NULL);\n"
   "7590\t\n"
   "7591\t         /* build the PVT path for the alternateGatekeeper fields 
*/\n"
   "7592\t         if ((nodeId = pvtBuildByPath(hpvt, 
cmGetProperty((HPROTOCOL)hsRas), \"response.*.altGKInfo\", 0, NULL)) < 0)\n"
   "7593\t         {\n"
   "7594\t           CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8663, cl,\"Error building alternateGatekeeper field in 
setAlternateGkParam\"));\n"
   "7595\t           return gkcciGKFailure;\n"
   "7596\t         }\n"
   "7597\t\n"
   "7598\t         switch (parameter)\n"
   "7599\t         {\n"
   "7600\t         case gkcciParamARJAlternateGk:\n"
   "7601\t         case gkcciParamBRJAlternateGk:\n"
   "7602\t         case gkcciParamDRJAlternateGk:\n"
   "7603\t           /* calculate the number of items to set */\n"
   "7604\t           nodeId = pvtBuildByPath(hpvt, nodeId, 
\"alternateGatekeeper\", 0, NULL);\n"
   "7605\t           if ((numItems = pvtNumChilds(hpvt, nodeId)) < 0)\n"
   "7606\t           {\n"
   "7607\t             CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8664, cl,\"Error building alternateGatekeeper field in 
setAlternateGkParam\"));\n"
   "7608\t             return gkcciGKFailure;\n"
   "7609\t           };\n"
   "7610\t           if (firstIndex == gktypeADD_PARAM)\n"
   "7611\t           {\n"
   "7612\t             firstIndex = numItems+1;\n"
   "7613\t             lastIndex += numItems;\n"
   "7614\t           }\n"
   "7615\t           if ((firstIndex < 0) || (lastIndex-firstIndex < 0))\n"
   "7616\t             return gkcciOutOfBounds;\n"
   "7617\t         \n"
   "7618\t           /* store all fields into the SEQUENCE of 
AlternateGatekeeper */\n"
   "7619\t           for (i = firstIndex; (i <= lastIndex) && success; i++)\n"
   "7620\t           {\n"
   "7621\t             sprintf(buf, \"%d\", i+1);\n"
   "7622\t             if ((chNodeId = pvtBuildByPath(hpvt, nodeId, buf, 0, 
NULL)) >= 0)\n"
   "7623\t             {          \n"
   "7624\t               if ((length = strlen(altGk->gatekeeperId)) > 0) \n"
   "7625\t               {\n"
   "7626\t                 char buf[GKADD_GKID_LEN*2];\n"
   "7627\t                 addCharToBMP(altGk->gatekeeperId, buf);\n"
   "7628\t                 pvtBuildByPath(hpvt, chNodeId, 
\"gatekeeperIdentifier\", length*2, buf);\n"
   "7629\t               }\n"
   "7630\t               success = (pvtBuildByPath(hpvt, chNodeId, 
\"needToRegister\", altGk->needToRegister, NULL) >= 0) && success;\n"
   "7631\t               success = (pvtBuildByPath(hpvt, chNodeId, 
\"priority\", altGk->priority, NULL) >= 0) && success;\n"
   "7632\t               chNodeId = pvtBuildByPath(hpvt, chNodeId, 
\"rasAddress\", 0, NULL);\n"
   "7633\t               success = (chNodeId >= 0) && (cmuIpPortToNode(hpvt, 
chNodeId, altGk->rasAddress.ip, altGk->rasAddress.port) == TRUE);\n"
   "7634\t             }\n"
   "7635\t             else\n"
   "7636\t               success = FALSE;\n"
   "7637\t\n"
   "7638\t             altGk++;\n"
   "7639\t           }\n"
   "7640\t\n"
   "7641\t           if (success)\n"
   "7642\t             return gkcciOK;\n"
   "7643\t           else\n"
   "7644\t             return gkcciGKFailure;\n"
   "7645\t           break;\n"
   "7646\t\n"
   "7647\t         case gkcciParamARJAltGKisPermanent:\n"
   "7648\t         case gkcciParamBRJAltGKisPermanent:\n"
   "7649\t         case gkcciParamDRJAltGKisPermanent:\n"
   "7650\t           if (pvtBuildByPath(hpvt, nodeId, \"altGKisPermanent\", "
<- "*(BOOL*)data, NULL) < 0)\n"
   "7651\t             return gkcciGKFailure;\n"
   "7652\t           else\n"
   "7653\t             return gkcciOK;\n"
   "7654\t\n"
   "7655\t         default:\n"
   "7656\t           /* should never reach here */\n"
   "7657\t           CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8665, cl,\"Unknown parameter in setAlternateGkParam\"));\n"
   "7658\t           return gkcciGKFailure;\n"
   "7659\t         }\n"
   "7660\t       }\n"
   "7661\t  \n"
   "7662\t  INT32 getCanMapAlias(IN HRAS    hsRas,\n"
   "7663\t    OUT void   *data)\n"
   "7664\t  {\n"
   "7665\t    HPVT hpvt;\n"
   "7666\t    int nodeId;\n"
   "7667\t    \n"
   "7668\t    if (hsRas == NULL) return gkcciInvalidParam;\n"
   "7669\t    \n"
   "7670\t    hpvt = cmGetValTree(dispStack);\n"
   "7671\t    if ((nodeId = pvtGetNodeIdByPath(hpvt, 
cmGetProperty((HPROTOCOL)hsRas), \"request.admissionRequest\")) >= 0)\n"
   "7672\t      if (pvtGetByPath(hpvt, nodeId, \"canMapAlias\", NULL, 
(int*)data, NULL) >= 0)\n"
   "7673\t        return gkcciOK;\n"
   "7674\t      \n"
   "7675\t      return gkcciFailure;\n"
   "7676\t  }\n"
   "7677\t  \n"
   "7678\t  INT32 getAlternateEpParam(IN int cl,\n"
   "7679\t                                 IN   HRAS              hsRas, /* RAS 
handle for rejection message */\n"
   "7680\t                                 IN   gkcciParameter_t  parameter,  
/* The parameter to set (AlternateGk/AltGKisPermanent) */\n"
   "7681\t                                 IN   INT32             firstIndex, 
/* The same as in calAppGetParameter */\n"
   "7682\t                                 IN   INT32             lastIndex,  
/* The same as in calAppGetParameter */\n"
   "7683\t                                 OUT  void *            data)\n"
   "7684\t       {\n"
   "7685\t         int nodeId;\n"
   "7686\t         char buf[32];\n"
   "7687\t         HPVT hpvt = cmGetValTree(dispStack);\n"
   "7688\t         gkaddAlternateEp_t *altEp = (gkaddAlternateEp_t *)data;\n"
   "7689\t\n"
   "7690\t\t if(cl);\n"
   "7691\t\t if(parameter);\n"
   "7692\t         if (hsRas == NULL) return gkcciInvalidParam;\n"
   "7693\t\n"
   "7694\t         if ((nodeId = pvtGetNodeIdByPath(hpvt, 
cmGetProperty((HPROTOCOL)hsRas), \"response.*.alternateEndpoints\")) < 0)\n"
   "7695\t           return gkcciGKFailure;\n"
   "7696\t\n"
   "7697\t         if (lastIndex == gktypeLAST_PARAM)\n"
   "7698\t           lastIndex = pvtNumChilds(hpvt, nodeId);\n"
   "7699\t         if ((lastIndex < 0) || (lastIndex-firstIndex < 0))\n"
   "7700\t           return gkcciOutOfBounds;\n"
   "7701\t\n"
   "7702\t         sprintf(buf, \"%d\", firstIndex+1);\n"
   "7703\t         if ((nodeId = pvtGetNodeIdByPath(hpvt, nodeId, buf)) < 0)\n"
   "7704\t           return gkcciGKFailure;\n"
   "7705\t\n"
   "7706\t         if (iutilGetAlternateEp(hpvt, nodeId, firstIndex, lastIndex, 
altEp) > 0)\n"
   "7707\t           return gkcciOK;\n"
   "7708\t         else\n"
   "7709\t           return gkcciNotFound;\n"
   "7710\t       }\n"
   "7711\t  \n"
   "7712\t  INT32 getAlternateGkParam(/* Get the alternateGk parameter type 
from the RAS message. Called from calAppGetParameter */\n"
   "7713\t                                 IN int cl,\n"
   "7714\t                                 IN   HRAS              hsRas, /* RAS 
handle for rejection message */\n"
   "7715\t                                 IN   gkcciParameter_t  parameter,  
/* The parameter to set (AlternateGk/AltGKisPermanent) */\n"
   "7716\t                                 IN   INT32             firstIndex, 
/* The same as in calAppGetParameter */\n"
   "7717\t                                 IN   INT32             lastIndex,  
/* The same as in calAppGetParameter */\n"
   "7718\t                                 OUT  void *            data)\n"
   "7719\t       {\n"
   "7720\t         int nodeId, chNodeId;\n"
   "7721\t         HPVT hpvt;\n"
   "7722\t         gkaddAlternateGk_t* altGk = (gkaddAlternateGk_t*)data;\n"
   "7723\t         int i, value = 0;\n"
   "7724\t         BOOL success = TRUE;\n"
   "7725\t         char buf[25];\n"
   "7726\t\n"
   "7727\t         if (hsRas == NULL) return gkcciInvalidParam;\n"
   "7728\t         hpvt = cmGetValTree(dispStack);\n"
   "7729\t\n"
   "7730\t         /* find the PVT node for the alternateGatekeeper */\n"
   "7731\t         if ((nodeId = pvtGetNodeIdByPath(hpvt, 
cmGetProperty((HPROTOCOL)hsRas), \"response.*.altGKInfo\")) < 0)\n"
   "7732\t         {\n"
   "7733\t           CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8666, cl,\"Error reading alternateGatekeeper field in 
getAlternateGkParam\"));\n"
   "7734\t           return gkcciGKFailure;\n"
   "7735\t         }\n"
   "7736\t\n"
   "7737\t         switch (parameter)\n"
   "7738\t         {\n"
   "7739\t         case gkcciParamARJAlternateGk:\n"
   "7740\t         case gkcciParamBRJAlternateGk:\n"
   "7741\t         case gkcciParamDRJAlternateGk:\n"
   "7742\t         case gkcciParamLRJAlternateGk:\n"
   "7743\t           /* calculate the number of items to get */\n"
   "7744\t           if (lastIndex == gktypeLAST_PARAM)\n"
   "7745\t             lastIndex = pvtNumChilds(hpvt, nodeId);\n"
   "7746\t           if ((lastIndex < 0) || (lastIndex-firstIndex < 0))\n"
   "7747\t             return gkcciOutOfBounds;\n"
   "7748\t\n"
   "7749\t           sprintf(buf, \"alternateGatekeeper.%d\", firstIndex+1);\n"
   "7750\t           if ((nodeId = pvtGetNodeIdByPath(hpvt, nodeId, buf)) < 
0)\n"
   "7751\t           {\n"
   "7752\t             CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8667, cl,\"Error accessing firstIndex PVT node in 
getAlternateGkParam\"));\n"
   "7753\t             return gkcciGKFailure;\n"
   "7754\t           }\n"
   "7755\t         \n"
   "7756\t           for (i=firstIndex+1; i <= lastIndex; i++)\n"
   "7757\t           {\n"
   "7758\t             /* set the structure of one record at a time */\n"
   "7759\t             chNodeId = pvtGetByPath(hpvt, nodeId, 
\"gatekeeperIdentifier\", NULL, &value, NULL);\n"
   "7760\t             altGk->gatekeeperId[0] = 0;\n"
   "7761\t             if (chNodeId >= 0 && (value > 0))\n"
   "7762\t             {\n"
   "7763\t               char buf[GKADD_GKID_LEN*2];\n"
   "7764\t               if (pvtGetString(hpvt, chNodeId, GKADD_GKID_LEN*2, 
buf) >= 0)\n"
   "7765\t                 addBmpToChar(altGk->gatekeeperId, GKADD_GKID_LEN-1, 
buf, value);\n"
   "7766\t             }\n"
   "7767\t             success = pvtGetByPath(hpvt, nodeId, \"needToRegister\", 
NULL, &value, NULL) >= 0;\n"
   "7768\t             altGk->needToRegister = value;\n"
   "7769\t             success = (pvtGetByPath(hpvt, nodeId, \"priority\", 
NULL, &value, NULL) >= 0) && success;\n"
   "7770\t             altGk->priority = (INT8)value;\n"
   "7771\t             chNodeId = pvtGetNodeIdByPath(hpvt, nodeId, 
\"rasAddress\");\n"
   "7772\t             if (!success || (chNodeId < 0) || (cmuNodeToIpPort(hpvt, 
chNodeId, &(altGk->rasAddress.ip), &(altGk->rasAddress.port)) == FALSE))\n"
   "7773\t               return gkcciGKFailure;\n"
   "7774\t\n"
   "7775\t             /* get to the next node in the sequence */\n"
   "7776\t             if ((nodeId = pvtBrother(hpvt, nodeId)) < 0)\n"
   "7777\t               return gkcciOutOfBounds;\n"
   "7778\t\n"
   "7779\t             altGk++;\n"
   "7780\t           }\n"
   "7781\t\n"
   "7782\t           if (success)\n"
   "7783\t             return gkcciOK;\n"
   "7784\t           else\n"
   "7785\t             return gkcciGKFailure;\n"
   "7786\t           break;\n"
   "7787\t\n"
   "7788\t         case gkcciParamARJAltGKisPermanent:\n"
   "7789\t         case gkcciParamBRJAltGKisPermanent:\n"
   "7790\t         case gkcciParamDRJAltGKisPermanent:\n"
   "7791\t         case gkcciParamLRJAltGKisPermanent:\n"
   "7792\t           if ((pvtGetByPath(hpvt, nodeId, \"altGKisPermanent\", 
NULL, (INT32*)data, NULL)) < 0)\n"
   "7793\t             return gkcciGKFailure;\n"
   "7794\t           else\n"
   "7795\t             return gkcciOK;\n"
   "7796\t\n"
   "7797\t         default:\n"
   "7798\t           /* should never reach here */\n"
   "7799\t           CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8668, cl,\"Unknown parameter in setAlternateGkParam\"));\n"
   "7800\t           return gkcciGKFailure;\n"
   "7801\t         }\n"
   "7802\t       }\n"
   "7803\t \n"
   "7804\t  int countAlternateEp(IN HRAS hsRas)\n"
   "7805\t  {\n"
   "7806\t    int nodeId;\n"
   "7807\t    HPVT hpvt;\n"
   "7808\t    \n"
   "7809\t    if (hsRas == NULL) return 0;\n"
   "7810\t    hpvt = cmGetValTree(dispStack);\n"
   "7811\t    \n"
   "7812\t    /* find the PVT node for the alternateEp */\n"
   "7813\t    if ((nodeId = pvtGetNodeIdByPath(hpvt, 
cmGetProperty((HPROTOCOL)hsRas), \"response.*.alternateEndpoints\")) < 0)\n"
   "7814\t      return 0;\n"
   "7815\t    \n"
   "7816\t    return iutilCountAlternateEp(hpvt, nodeId);\n"
   "7817\t  }\n"
   "7818\t\n"
   "7819\t  int countAlternateGk(/* Count number of alternateGatekeeper records 
in RAS reject message. Called from calAppGetParameterNumber */\n"
   "7820\t    IN int cl,\n"
   "7821\t    IN HRAS hsRas)\n"
   "7822\t  {\n"
   "7823\t    int nodeId, count;\n"
   "7824\t    HPVT hpvt;\n"
   "7825\t    \n"
   "7826\t    if (hsRas == NULL) return 0;\n"
   "7827\t    hpvt = cmGetValTree(dispStack);\n"
   "7828\t    \n"
   "7829\t    /* find the PVT node for the alternateGatekeeper */\n"
   "7830\t    if ((nodeId = pvtGetNodeIdByPath(hpvt, 
cmGetProperty((HPROTOCOL)hsRas), \"response.*.altGKInfo.alternateGatekeeper\")) 
< 0)\n"
   "7831\t    {\n"
   "7832\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8669, cl,\"Error reading alternateGatekeeper field in 
getAlternateGkParam\"));\n"
   "7833\t      return 0;\n"
   "7834\t    }\n"
   "7835\t    \n"
   "7836\t    count = pvtNumChilds(hpvt, nodeId);\n"
   "7837\t    if (count > 0)\n"
   "7838\t      return count;\n"
   "7839\t    else\n"
   "7840\t      return 0;\n"
   "7841\t  }\n"
   "7842\t\n"
   "7843\t\n"
   "7844\t  /*******************************************************/\n"
   "7845\t  /*  Alias Manipulation                                 */\n"
   "7846\t  /*******************************************************/ \n"
   "7847\t\n"
   "7848\t  INT32  calAppDeleteAlias(/* deletes aliases at places firstIndex to 
lastIndex only of parameters:\n"
   "7849\t                           1) gkcciParamAlias.\n"
   "7850\t                           2) gkcciParamAdditionalNumber.\n"
   "7851\t                           3) gkcciParamRemoteExtensionAlias.\n"
   "7852\t                           4) gkcciParamAppLineHuntingIp\n"
   "7853\t                           for all other parameters the function is 
not supported and gkcciInvalidParam will be returned.\n"
   "7854\t                           deleting aliases is only supported before 
sending setup to destination or when \n"
   "7855\t                           call didn\'t connect and the application 
wants to set another destination, \n"
   "7856\t                           otherwise gkcciInvalidOperation will be 
returned. When deleting aliases \n"
   "7857\t                           */\n"
   "7858\t                           IN   gkHCALL             hCall,\n"
   "7859\t                           IN   gkcciParameter_t    parameter,\n"
   "7860\t                           IN   gkcciSide_t         side,\n"
   "7861\t                           IN   INT32               firstIndex,  /* 
delete in the range between firstIndex \n"
   "7862\t                                                                 to 
lastIndex  (including lastIndex).\n"
   "7863\t                                                                 If 
firstIndex is not in the array bounds\n"
   "7864\t                                                                 
gkcciOutOfBounds will be returned */\n"
   "7865\t                           IN   INT32               lastIndex)   /* 
if lastIndex is gktypeLAST_PARAM, the aliases will be deleted\n"
   "7866\t                                                                 till 
the last available place (in the GK database). If lastIndex\n"
   "7867\t                                                                 is 
not in the array bounds aliasesgkcciOutOfBounds \n"
   "7868\t                                                                 will 
be returned */ \n"
   "7869\t  {\n"
   "7870\t    int cl;\n"
   "7871\t    char str[200];\n"
   "7872\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "7873\t    {\n"
   "7874\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8793,-1, \"calAppDeleteAlias: Illegal handle: %d\", (UINT32)hCall ));\n"
   "7875\t      return gkcciInvalidHandle;\n"
   "7876\t    } \n"
   "7877\t    if(!checkParameterLegalForDelete(cl, parameter))\n"
   "7878\t    {   \n"
   "7879\t      sprintf(str, \"calAppDeleteAlias: Illegal parameter %s of side 
%s for call %d at state %s\", \n"
   "7880\t        gkcciParameterName(parameter), gkcciSideName(side), cl, 
stateName[CL.state]);\n"
   "7881\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8670, cl,str));\n"
   "7882\t      return gkcciInvalidParam;\n"
   "7883\t    } \n"
   "7884\t    if(!checkOperationLegal(cl, parameter, side))\n"
   "7885\t    {   \n"
   "7886\t      sprintf(str, \"calAppDeleteAlias: Illegal delete operation of 
parameter %s of side %s for call %d at state %s\", \n"
   "7887\t        gkcciParameterName(parameter), gkcciSideName(side), cl, 
stateName[CL.state]);\n"
   "7888\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8671, cl,str));\n"
   "7889\t      return gkcciInvalidOperation;\n"
   "7890\t    } \n"
   "7891\t    switch (parameter)\n"
   "7892\t    {\n"
   "7893\t      \n"
   "7894\t    case gkcciParamAliasBMP:\n"
   "7895\t    case gkcciParamAlias:\n"
   "7896\t      if(side == gkcciSideOrig)\n"
   "7897\t      {\n"
   "7898\t        CALL_NOTIFY(\"deleting aliases of origin side\",GEN_NA, 
10,cl);\n"
   "7899\t        return deleteAliases(CL.srcInfo, SOURCE_NUMBER, firstIndex, 
lastIndex);\n"
   "7900\t      }\n"
   "7901\t      else\n"
   "7902\t      {\n"
   "7903\t        CALL_NOTIFY(\"deleting aliases of destination side\",GEN_NA, 
10,cl);\n"
   "7904\t        return deleteAliases(CL.destInfo, DESTINATION_NUMBER, 
firstIndex, lastIndex);\n"
   "7905\t      }\n"
   "7906\t      break;\n"
   "7907\t    case gkcciParamAdditionalNumber:\n"
   "7908\t      CALL_NOTIFY(\"deleting additional numbers\",GEN_NA, 10,cl);\n"
   "7909\t      return deleteAliases(CL.destExtra, DESTINATION_NUMBER, \n"
   "7910\t        firstIndex, lastIndex);\n"
   "7911\t      \n"
   "7912\t    case gkcciParamRemoteExtensionAliasBMP:\n"
   "7913\t    case gkcciParamRemoteExtensionAlias:  \n"
   "7914\t      CALL_NOTIFY(\"deleting remote extension alias\",GEN_NA, 
10,cl);\n"
   "7915\t      CL.remoteExtension.length = 0; /* CL.remoteExtension is 
cmRASAlias */\n"
   "7916\t      return gkcciOK;\n"
   "7917\t    case gkcciParamAppLineHuntingIp:\n"
   "7918\t      CALL_NOTIFY(\"deleting application line hunting 
addresses\",GEN_NA, 10,cl);\n"
   "7919\t      return 
lnhDeleteAppLineHuntingCallSignal(CL.appLineHuntingCallSignal, 
APP_LINE_HUNTING_NUMBER, \n"
   "7920\t        firstIndex, lastIndex);\n"
   "7921\t    default:\n"
   "7922\t      return gkcciInvalidParam;\n"
   "7923\t      \n"
   "7924\t    }\n"
   "7925\t  }\n"
   "7926\t \n"
   "7927\t 
/*----------------------------------------------------------------------------*/
 \n"
   "7928\t\n"
   "7929\t INT32 findNextAlias(/* find next alias in array of type \'type\'. \n"
   "7930\t   Returns array index or -1 if no alias found */\n"
   "7931\t   IN cmRASAlias aliasArray[], \n"
   "7932\t   IN cmRASAliasType type, \n"
   "7933\t   IN int arraySize) \n"
   "7934\t {\n"
   "7935\t   int i;\n"
   "7936\t   \n"
   "7937\t   for (i=0;i<arraySize;i++)\n"
   "7938\t   {\n"
   "7939\t     if(addEmptyAlias(&aliasArray[i]))\n"
   "7940\t       return -1;\n"
   "7941\t     if(aliasArray[i].type == type )\n"
   "7942\t       return i;\n"
   "7943\t   }\n"
   "7944\t   return -1;\n"
   "7945\t }\n"
   "7946\t\n"
   
"7947\t/*----------------------------------------------------------------------------*/\n"
   "7948\t int findFirstE164(/*returns index of first E164 alias in the 
\'aliasArray\' of size arraySize.\n"
   "7949\t                   returns arraySize (an invalid index number because 
array begins at 0)\n"
   "7950\t                   if no E164 alias exists in the array*/\n"
   "7951\t                   IN cmRASAlias * aliasArray,\n"
   "7952\t                   IN int arraySize)\n"
   "7953\t {\n"
   "7954\t   int i;\n"
   "7955\t   for (i=0;i<arraySize;i++)\n"
   "7956\t   {\n"
   "7957\t     if(!addEmptyAlias(&aliasArray[i]))\n"
   "7958\t       if (aliasArray[i].type == cmRASAliasTypeE164)\n"
   "7959\t         return i;\n"
   "7960\t   }\n"
   "7961\t   return arraySize;\n"
   "7962\t } \n"
   "7963\t\n"
   
"7964\t/*----------------------------------------------------------------------------*/
 \n"
   "7965\t  INT32 countAddresses( /* count the number of ip addresses in the 
array.\n"
   "7966\t                        the function will not stop at empty address, 
but \n"
   "7967\t                        will not count it.  in lastAddress will be 
returned \n"
   "7968\t                        the last index where a non empty address was 
found, \n"
   "7969\t                        or -1 if no address exists */\n"
   "7970\t                        IN cmRASTransport addressArray[], \n"
   "7971\t                        IN INT32 arraySize, \n"
   "7972\t                        OUT INT32 *lastAddress)\n"
   "7973\t  {\n"
   "7974\t    INT32 i, count = 0;\n"
   "7975\t    \n"
   "7976\t    *lastAddress = -1;\n"
   "7977\t    for (i=0; i<arraySize; i++)\n"
   "7978\t    {\n"
   "7979\t      if(addressArray[i].ip != 0) \n"
   "7980\t      {\n"
   "7981\t        count++;\n"
   "7982\t        *lastAddress = i;\n"
   "7983\t      }\n"
   "7984\t    }          \n"
   "7985\t    return count;\n"
   "7986\t  }\n"
   "7987\t\n"
   "7988\t 
/*----------------------------------------------------------------------------*/
 \n"
   "7989\t  INT32 countAliases(/* count the number of aliases in the array */\n"
   "7990\t    IN cmRASAlias aliasArray[],\n"
   "7991\t    IN int arraySize,\n"
   "7992\t    IN INT32 *lastAlias) \n"
   "7993\t  {\n"
   "7994\t    int i, count = 0;\n"
   "7995\t    \n"
   "7996\t    *lastAlias = -1;\n"
   "7997\t    for (i=0;i<arraySize;i++)\n"
   "7998\t    {\n"
   "7999\t      if(!addEmptyAlias(&aliasArray[i]))\n"
   "8000\t      {\n"
   "8001\t        count++;\n"
   "8002\t        *lastAlias = i;\n"
   "8003\t      }\n"
   "8004\t    }\n"
   "8005\t    return count;\n"
   "8006\t  }\n"
   
"8007\t/*----------------------------------------------------------------------------*/
 \n"
   "8008\t\n"
   "8009\t INT32 getAliases(/* retrieve all aliases between firstIndex and 
lastIndex into data.\n"
   "8010\t                  if lastIndex equals gktypeLAST_PARAM, all aliases 
from firstIndex\n"
   "8011\t                  to the last exists will be retrieved. If the 
firstIndex is less than 0\n"
   "8012\t                  or lastIndex is greater than the array size,"
<- " or lastIndex < firstIndex\n"
   "8013\t                  gkcciOutOfBounds will be returned. if an error 
occured, getting the next \n"
   "8014\t                  alias will not continue. errorIndex will give the 
index  (0-based) , \n"
   "8015\t                  where the error occured and gkcciGKFailure will be 
returned. */ \n"
   "8016\t                  IN int cl,\n"
   "8017\t                  IN cmRASAlias aliasArray[], \n"
   "8018\t                  IN int arraySize, \n"
   "8019\t                  OUT void *data, \n"
   "8020\t                  IN INT32 firstIndex, \n"
   "8021\t                  IN INT32 lastIndex,\n"
   "8022\t                  IN stringType_t dataType )\n"
   "8023\t {\n"
   "8024\t   return setOrGetAliases(cl,aliasArray, arraySize, data, firstIndex, 
lastIndex, FALSE,dataType);\n"
   "8025\t }\n"
   "8026\t\n"
   "8027\t  
/*----------------------------------------------------------------------------*/
 \n"
   "8028\t \n"
   "8029\t  INT32 setAliases(/* sets all aliases between firstIndex and 
lastIndex from data into aliasArray.\n"
   "8030\t                   if firstIndex equals gktypeADD_PARAM new aliases 
will be added\n"
   "8031\t                   at the end regarding lastIndex as the number of 
aliases to be added.                           \n"
   "8032\t                   if lastIndex equals gktypeLAST_PARAM, all aliases 
from firstIndex\n"
   "8033\t                   to the last exists will be set. \n"
   "8034\t                   If the indeces are outside of the array bounds, 
gkcciOutOfBounds will be\n"
   "8035\t                   returned. If an error occured while setting one 
alias all aliases in the\n"
   "8036\t                   range will be deleted and errorIndex will be set 
to the (application) index of\n"
   "8037\t                   the wrong alias */ \n"
   "8038\t                   IN int cl,\n"
   "8039\t                   IN cmRASAlias aliasArray[], \n"
   "8040\t                   IN int arraySize, \n"
   "8041\t                   IN void *data, \n"
   "8042\t                   IN INT32 firstIndex, \n"
   "8043\t                   IN INT32 lastIndex)\n"
   "8044\t  {\n"
   "8045\t    INT32 numAliases, lastAlias, j=0, count, saveCount, i;\n"
   "8046\t    gkaddAlias_t *aliasData; \n"
   "8047\t    \n"
   "8048\t    \n"
   "8049\t    if(firstIndex == gktypeADD_PARAM)\n"
   "8050\t    {\n"
   "8051\t      aliasData = (gkaddAlias_t*)data;\n"
   "8052\t      numAliases = countAliases(aliasArray, arraySize, &lastAlias);\n"
   "8053\t      firstIndex =  lastAlias + 1 ;\n"
   "8054\t      /* lastIndex should be used as the count of aliases to set but 
we still allow this*/\n"
   "8055\t      count = lastIndex;\n"
   "8056\t      if(lastIndex == gktypeLAST_PARAM)\n"
   "8057\t        count = arraySize - firstIndex ;\n"
   "8058\t      \n"
   "8059\t      if(count < 0 )\n"
   "8060\t        return gkcciOutOfBounds;\n"
   "8061\t      if((firstIndex + count) > arraySize )\n"
   "8062\t      {\n"
   "8063\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8672, cl,\"setAliases: error setting is out of bounds\"));\n"
   "8064\t        return deleteAndSetErrorInAliases(aliasArray, arraySize, 
firstIndex, lastIndex,\n"
   "8065\t          (arraySize - firstIndex) ,  gkcciOutOfBounds, FALSE);\n"
   "8066\t      }\n"
   "8067\t      saveCount = count; \n"
   "8068\t      i = firstIndex;            \n"
   "8069\t      while(count) /* adds \'count\' number of aliases from 
\'firstIndex\' to the array */\n"
   "8070\t      {\n"
   "8071\t        if(!iutilAppAlias2GkAlias(&aliasArray[i], &aliasData[j]))\n"
   "8072\t        {\n"
   "8073\t          CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8794, cl,\"setAlias: error calling iutilAppAlias2GkAlias. At alias #: %d\", 
(saveCount - count) ));\n"
   "8074\t          return deleteAndSetErrorInAliases(aliasArray, arraySize, 
firstIndex, gktypeLAST_PARAM , (saveCount - count) ,\n"
   "8075\t            gkcciGKFailure, TRUE);\n"
   "8076\t        }\n"
   "8077\t        i++; j++; count--;\n"
   "8078\t      }\n"
   "8079\t      return gkcciOK;\n"
   "8080\t    }\n"
   "8081\t    /* if we reached here it\'s a true overwrite operation */\n"
   "8082\t    return setOrGetAliases(cl,aliasArray, arraySize, data, 
firstIndex, lastIndex, TRUE,STRING_TYPE_NONE);\n"
   "8083\t  }\n"
   "8084\t\n"
   "8085\t   
/*----------------------------------------------------------------------------*/
 \n"
   "8086\t   INT32 setOrGetAliases(/* sets/gets all aliases between firstIndex 
and lastIndex into data.                      \n"
   "8087\t                         if lastIndex equals gktypeLAST_PARAM, all 
aliases from firstIndex\n"
   "8088\t    "
<- "                     to the last exists will be set/get. If the firstIndex 
is less than 0\n"
   "8089\t                         or lastIndex is greater than the array size, 
or lastIndex < firstIndex\n"
   "8090\t                         gkcciOutOfBounds will be returned and no 
alias will be set/get. \n"
   "8091\t                         Upon setting if an error occured in one of 
the aliases, all aliases \n"
   "8092\t                         in the range will be set to empty ones. The 
global variable errorIndex \n"
   "8093\t                         will give the index  (0-based) , where the 
error occured (of the API \n"
   "8094\t                         addresses, not of the table) and 
gkcciGKFailure will be returned. \n"
   "8095\t                         Upon getting, if an error occured, getting 
the next alias will \n"
   "8096\t                         not continue. errorIndex will give the index 
 (0-based) , where the error \n"
   "8097\t                         occured and gkcciGKFailure will be returned. 
*/ \n"
   "8098\t                         IN int cl,\n"
   "8099\t                         IN cmRASAlias aliasArray[], \n"
   "8100\t                         IN int arraySize, \n"
   "8101\t                         IN void *data, \n"
   "8102\t                         IN INT32 firstIndex, \n"
   "8103\t                         IN INT32 lastIndex,\n"
   "8104\t                         IN BOOL setMode, /* TRUE when set is 
requested */\n"
   "8105\t                         IN stringType_t dataType  /* relevant only 
when setMode is FALSE*/ )\n"
   "8106\t   {\n"
   "8107\t     INT32 numAliases, lastAlias, i, j=0 ;\n"
   "8108\t     gkaddAlias_t *aliasData;\n"
   "8109\t     \n"
   "8110\t     aliasData = (gkaddAlias_t*)data;\n"
   "8111\t     \n"
   "8112\t     \n"
   "8113\t     /* if(numAliases == 0) newnaomi. bug fix. must see that it is 
set mode here */\n"
   "8114\t     numAliases = countAliases(aliasArray, arraySize, &lastAlias);\n"
   "8115\t     \n"
   "8116\t     \n"
   "8117\t     if((firstIndex < 0) ||  (firstIndex >= arraySize) ||\n"
   "8118\t       ((firstIndex > lastIndex) && (lastIndex != gktypeLAST_PARAM)) 
||\n"
   "8119\t       ((lastIndex < 0 ) && (lastIndex != gktypeLAST_PARAM)) ||\n"
   "8120\t       (lastIndex >= arraySize))\n"
   "8121\t     {\n"
   "8122\t       CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8673, cl,\"setOrGetAliases: error in indeces or array boundaries while 
accessing aliases\"));\n"
   "8123\t       errorIndex = 0;\n"
   "8124\t       if((lastIndex >= arraySize) && (firstIndex < arraySize) && 
(firstIndex >= 0))\n"
   "8125\t         errorIndex = lastIndex - firstIndex;\n"
   "8126\t       return gkcciOutOfBounds;\n"
   "8127\t     }\n"
   "8128\t     \n"
   "8129\t     \n"
   "8130\t     if(lastIndex == gktypeLAST_PARAM)\n"
   "8131\t       lastIndex = lastAlias; /* lastAlias may be -1 if no address 
exists */\n"
   "8132\t     \n"
   "8133\t     /*reset data in get mode */\n"
   "8134\t     if(!setMode)\n"
   "8135\t     {\n"
   "8136\t       for(i = 0; i <= (lastIndex-firstIndex); i++)\n"
   "8137\t         iutilResetAlias(&aliasData[i]);\n"
   "8138\t     }           \n"
   "8139\t     \n"
   "8140\t     \n"
   "8141\t     for(i=firstIndex; i<=lastIndex; i++, j++) /* copy all aliases 
from firstIndex to lastIndex */\n"
   "8142\t     {\n"
   "8143\t       if(setMode)\n"
   "8144\t       {\n"
   "8145\t         if(!iutilAppAlias2GkAlias(&aliasArray[i], &aliasData[j]))\n"
   "8146\t         {\n"
   "8147\t           CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8795, cl,\"setOrGetAliases: error calling iutilAppAlias2GkAlias. At alias #: 
%d\", (i-firstIndex) ));\n"
   "8148\t           return deleteAndSetErrorInAliases(aliasArray, arraySize, 
firstIndex, lastIndex, \n"
   "8149\t             (i-firstIndex),gkcciGKFailure, TRUE);\n"
   "8150\t         }\n"
   "8151\t       }\n"
   "8152\t       else /* get aliases */\n"
   "8153\t       {\n"
   "8154\t         if(!iutilGkAlias2AppAlias(&aliasData[j],dataType, 
&aliasArray[i]))\n"
   "8155\t         {\n"
   "8156\t           CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8796, cl,\"setOrGetAppLineHuntingCallSignal: error calling iutilGkIp2AppIp. At 
alias #: %d\", (i-firstIndex) ));\n"
   "8157\t           return deleteAndSetErrorInAliases(aliasArray, arraySize, 
firstIndex, lastIndex, \n"
   "8158\t             (i-firstIndex),gkcciGKFailure, FALSE);\n"
   "8159\t         }              \n"
   "8160\t       }\n"
   "8161\t     }\n"
   "8162\t     return gkcciOK;\n"
   "8163\t   }\n"
   "8164\t   
/*----------------------------------------------------------------------------*/
   \n"
   "8165\t   INT32 deleteAliases(/* deletes all aliases between firstIndex and 
lastIndex of array.                      \n"
   "8166\t                       if lastIndex equals gktypeLAST_PARAM, all 
aliases from firstIndex\n"
   "8167\t                       to the last exists will be deleted. */ \n"
   "8168\t                       IN cmRASAlias aliasArray[], \n"
   "8169\t                       IN int arraySize, \n"
   "8170\t                       IN INT32 firstIndex, \n"
   "8171\t                       IN INT32 lastIndex )\n"
   "8172\t   {\n"
   "8173\t     \n"
   "8174\t     INT32 numAliases, lastAlias, i;\n"
   "8175\t     \n"
   "8176\t     numAliases = countAliases(aliasArray, arraySize, &lastAlias);\n"
   "8177\t     \n"
   "8178\t     if((firstIndex < 0) || (firstIndex >= arraySize ) ||\n"
   "8179\t       ((firstIndex > lastIndex) && (lastIndex != gktypeLAST_PARAM)) 
||\n"
   "8180\t       ((lastIndex < 0 ) && (lastIndex != gktypeLAST_PARAM)) ||\n"
   "8181\t       (lastIndex >= arraySize))\n"
   "8182\t       return gkcciOutOfBounds;\n"
   "8183\t     \n"
   "8184\t     if(lastIndex == gktypeLAST_PARAM)\n"
   "8185\t     {\n"
   "8186\t       lastIndex =  lastAlias;\n"
   "8187\t       if(lastIndex < 0) /* no such aliases at all */\n"
   "8188\t         return gkcciOK;\n"
   "8189\t     }\n"
   "8190\t     \n"
   "8191\t     \n"
   "8192\t     for(i = firstIndex; i <= lastIndex; i++) /* deletes all aliases 
form firstIndex to lastIndex */\n"
   "8193\t\t {\n"
   "8194\t       aliasArray[i].length = 0;\n"
   "8195\t\t   aliasArray[i].transport.ip = 0;\n"
   "8196\t\t }\n"
   "8197\t     \n"
   "8198\t     return gkcciOK;\n"
   "8199\t   }\n"
   "8200\t\n"
   "8201\t 
/*----------------------------------------------------------------------------*/
 \n"
   "8202\t   \n"
   "8203\t\n"
   "8204\t  /*******************************************************/\n"
   "8205\t  /*  Error and reason trnaslation                       */\n"
   "8206\t  /*******************************************************/ \n"
   "8207\t   \n"
   "8208\t  INT32 calGetErrorIndex( /* returns the index of the last alias or 
address that caused an error\n"
   "8209\t    while a set operation */)\n"
   "8210\t  {\n"
   "8211\t    INT32 saveErrorIndex;\n"
   "8212\t    \n"
   "8213\t    saveErrorIndex = errorIndex;\n"
   "8214\t    errorIndex = gkcciNoErrorIndex;\n"
   "8215\t    return saveErrorIndex;\n"
   "8216\t  }\n"
   "8217\t\n"
   "8218\t  
/*----------------------------------------------------------------------------*/\n"
   "8219\t  INT32 deleteAndSetErrorInAliases( /*  deletes all new addresses 
when an error occured. \n"
   "8220\t                                    Sets errorIndex to the index \n"
   "8221\t                                    where the error occured, and 
returns the retCode */\n"
   "8222\t                                    IN cmRASAlias aliasArray[], \n"
   "8223\t                                    IN int arraySize, \n"
   "8224\t                                    IN INT32 firstIndex, \n"
   "8225\t                                    IN INT32 lastIndex,\n"
   "8226\t                                    IN INT32 index, \n"
   "8227\t                                    gkcciReturnValue_t retCode,\n"
   "8228\t                                    IN BOOL delAliases)\n"
   "8229\t                                    \n"
   "8230\t  {  \n"
   "8231\t    INT32 numAlias;\n"
   "8232\t    \n"
   "8233\t    errorIndex = index;\n"
   "8234\t    if(delAliases)\n"
   "8235\t    {\n"
   "8236\t      if(lastIndex == gktypeLAST_PARAM)\n"
   "8237\t        numAlias = countAliases(aliasArray, arraySize, &lastIndex);\n"
   "8238\t      \n"
   "8239\t      (void)deleteAliases(aliasArray, arraySize, firstIndex, 
lastIndex);\n"
   "8240\t    }\n"
   "8241\t    return retCode;\n"
   "8242\t  }  \n"
   "8243\t\n"
   
"8244\t/*----------------------------------------------------------------------------*/\n"
   "8245\t  cmRASReason ARJRsnApp2cm(\n"
   "8246\t    IN int cl,\n"
   "8247\t    IN gkcciARJReason_t app)\n"
   "8248\t  {\n"
   "8249\t    switch(app)\n"
   "8250\t    {\n"
   "8251\t    case gkcciARJRsnUndefined: return cmRASReasonUndefined;\n"
   "8252\t    case gkcciARJRsnCalledPartyNotRegistered: return 
cmRASReasonCalledPartyNotRegistered;\n"
   "8253\t    case gkcciARJRsnInvalidPermission: return 
cmRASReasonInvalidPermission;\n"
   "8254\t    case gkcciARJRsnRequestDenied: return cmRASReasonRequestDenied; 
\n"
   "8255\t    case gkcciARJRsnCallerNotRegistered: return 
cmRASReasonCallerNotRegistered;\n"
   "8256\t    case gkcciARJRsnRouteCallToGK: return 
cmRASReasonRouteCallToGatekeeper;\n"
   "8257\t    case gkcciARJRsnInvalidEndpointIdentifier: return 
cmRASReasonInvalidEndpointID;\n"
   "8258\t    case gkcciARJRsnResourceUnavailable: return 
cmRASResourceUnavailable;\n"
   "8259\t    case gkcciARJRsnSecurityDenial: return 
cmRASReasonSecurityDenial;\n"
   "8260\t    case gkcciARJRsnQosControlNotSupported: return 
cmRASQOSControlNotSupported;\n"
   "8261\t    case gkcciARJRsnIncompleteAddress: return 
cmRASIncompleteAddress;\n"
   "8262\t    }\n"
   "8263\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8797, 
cl,\"unhandled gkcciARJReason_t in ARJRsnApp2cm: %d\",app ));\n"
   "8264\t    return cmRASReasonUndefined;\n"
   "8265\t  }\n"
   "8266\t  \n"
   
"8267\t/*----------------------------------------------------------------------------*/\n"
   "8268\t  gkcciARJReason_t ARJRsnCm2App(\n"
   "8269\t    IN cmRASReason cmReason)\n"
   "8270\t  {\n"
   "8271\t    switch(cmReason)\n"
   "8272\t    {\n"
   "8273\t    case cmRASReasonUndefined: return gkcciARJRsnUndefined;\n"
   "8274\t    case cmRASReasonCalledPartyNotRegistered: return 
gkcciARJRsnCalledPartyNotRegistered;\n"
   "8275\t    case cmRASReasonInvalidPermission: return 
gkcciARJRsnInvalidPermission;\n"
   "8276\t    case cmRASReasonRequestDenied : return 
gkcciARJRsnRequestDenied;\n"
   "8277\t    case cmRASReasonCallerNotRegistered : return 
gkcciARJRsnCallerNotRegistered;\n"
   "8278\t    case cmRASReasonRouteCallToGatekeeper : return 
gkcciARJRsnRouteCallToGK;\n"
   "8279\t    case cmRASReasonInvalidEndpointID : return 
gkcciARJRsnInvalidEndpointIdentifier;\n"
   "8280\t    case cmRASResourceUnavailable : return 
gkcciARJRsnResourceUnavailable;\n"
   "8281\t    case cmRASReasonSecurityDenial : return 
gkcciARJRsnSecurityDenial;\n"
   "8282\t    case cmRASQOSControlNotSupported : return 
gkcciARJRsnQosControlNotSupported;\n"
   "8283\t    case cmRASIncompleteAddress : return 
gkcciARJRsnIncompleteAddress;\n"
   "8284\t    default:\n"
   "8285\t      break;\n"
   "8286\t    }\n"
   "8287\t    return gkcciARJRsnUndefined;\n"
   "8288\t  }\n"
   "8289\t\n"
   "8290\t\n"
   
"8291\t/*----------------------------------------------------------------------------*/\n"
   "8292\t  int disconnectRsnToDRQRsn(IN gkcciDisconnectReason_t reason)\n"
   "8293\t  {\n"
   "8294\t    switch(reason)\n"
   "8295\t    {\n"
   "8296\t    case gkcciRsnUndefined:            return 
cmRASDisengageReasonUndefinedReason;\n"
   "8297\t    case gkcciDisconnectRsnForcedDrop: return 
cmRASDisengageReasonForcedDrop;\n"
   "8298\t    case gkcciDisconnectRsnNormalDrop: return 
cmRASDisengageReasonNormalDrop;\n"
   "8299\t    default:\n"
   "8300\t      return cmRASDisengageReasonForcedDrop;\n"
   "8301\t    }\n"
   "8302\t  }\n"
   
"8303\t/*----------------------------------------------------------------------------*/\n"
   "8304\tgkcciReason_t dropRsnToAppRsn( /* translate the drop reason of the 
origin to the \n"
   "8305\t                              respective reason for the application 
*/\n"
   "8306\t                              IN int cl)\n"
   "8307\t{\n"
   "8308\t  switch (CL.DEST.dropReason)\n"
   "8309\t  {\n"
   "8310\t  case cmReasonTypeUnreachableDestination:\n"
   "8311\t    /*if (CL.wasAlertBeforeDisconnect == TRUE)*/\n"
   "8312\t    if (CL.reason == RSN_NEED_ALERT)\n"
   "8313\t      return gkcciRsnNoAnswer; \n"
   "8314\t    else\n"
   "8315\t    if (CL.reason == RSN_DESTINATION_BUSY)\n"
   "8316\t      return gkcciRsnDestBusy; \n"
   "8317\t    else\n"
   "8318\t      return gkcciRsnOutOfService;\n"
   "8319\t  case cmReasonTypeDestinationRejection:\n"
   "8320\t    return gkcciRsnDestReject;\n"
   "8321\t  case cmReasonTypeInConf:\n"
   "8322\t    return gkcciRsnDestBusy;\n"
   "8323\t  case cmReasonTypeUndefinedReason:\n"
   "8324\t    if (CL.wasAlertBeforeDisconnect == TRUE)\n"
   "8325\t      return gkcciRsnNoAnswer; \n"
   "8326\t    else\n"
   "8327\t      return gkcciRsnUndefined; \n"
   "8328\t    break;\n"
   "8329\t  default: return gkcciRsnUndefined;\n"
   "8330\t  }\n"
   "8331\t}\n"
   
"8332\t/*----------------------------------------------------------------------------*/\n"
   "8333\tBOOL disconnectRsnApp2CM(/*if an improper rsn is used, cmRsn will be 
set to cmReasonTypeUndefinedReason and FALSE returned*/\n"
   "8334\t                         IN int cl,\n"
   "8335\t                         OUT  cmReasonType*             cmRsn,\n"
   "8336\t                         IN   gkcciDisconnectReason_t   appRsn)\n"
   "8337\t{\n"
   "8338\t  if(cl);\n"
   "8339\t  switch (appRsn)\n"
   "8340\t  {\n"
   "8341\t  case gkcciDisconnectRsnUndefined: *cmRsn = 
cmReasonTypeUndefinedReason;break;\n"
   "8342\t  case gkcciDisconnectRsnNoBandwidth: *cmRsn = 
cmReasonTypeNoBandwidth;break;\n"
   "8343\t  case gkcciDisconnectRsnGKResources: *cmRsn = 
cmReasonTypeGatekeeperResource;break;\n"
   "8344\t  case gkcciDisconnectRsnUnreachableDest: *cmRsn = 
cmReasonTypeUnreachableDestination;break;\n"
   "8345\t  case gkcciDisconnectRsnDestRejection: *cmRsn ="
<- " cmReasonTypeDestinationRejection;break;\n"
   "8346\t  case gkcciDisconnectRsnInvalidRevision: *cmRsn = 
cmReasonTypeInvalidRevision;break;\n"
   "8347\t  case gkcciDisconnectRsnNoPermission: *cmRsn = 
cmReasonTypeNoPermision;break;\n"
   "8348\t  case gkcciDisconnectRsnUnreachableGK: *cmRsn = 
cmReasonTypeUnreachableGatekeeper;break;\n"
   "8349\t  case gkcciDisconnectRsnGWResources: *cmRsn = 
cmReasonTypeGatewayResource;break;\n"
   "8350\t  case gkcciDisconnectRsnBadFormatAddress: *cmRsn = 
cmReasonTypeBadFormatAddress;break;\n"
   "8351\t  case gkcciDisconnectRsnAdaptiveBusy: *cmRsn = 
cmReasonTypeAdaptiveBusy;break;\n"
   "8352\t  case gkcciDisconnectRsnInConf: *cmRsn = cmReasonTypeInConf;break;\n"
   "8353\t  case gkcciDisconnectRsnFacilityCallDeflection: *cmRsn = 
cmReasonTypeFacilityCallDeflection;break;\n"
   "8354\t  case gkcciDisconnectRsnSecurityDenied: *cmRsn = 
cmReasonTypeSecurityDenied;break;\n"
   "8355\t  case gkcciDisconnectRsnCalledPartyNotRegistered: *cmRsn = 
cmReasonTypeCalledPartyNotRegistered;break;\n"
   "8356\t  case gkcciDisconnectRsnCallerNotRegistered: *cmRsn = 
cmReasonTypeCallerNotregistered;break;\n"
   "8357\t  default: \n"
   "8358\t    *cmRsn = cmReasonTypeUndefinedReason;\n"
   "8359\t    return FALSE;\n"
   "8360\t  }\n"
   "8361\t  return TRUE;\n"
   "8362\t}\n"
   
"8363\t/*----------------------------------------------------------------------------*/\n"
   "8364\tBOOL disconnectRsnCM2App(/*if an improper rsn is used, cmRsn will be 
set to cmReasonTypeUndefinedReason and FALSE returned*/\n"
   "8365\t                         IN int cl,\n"
   "8366\t                         OUT  gkcciDisconnectReason_t* appRsn,\n"
   "8367\t                         IN   cmReasonType cmRsn)\n"
   "8368\t{\n"
   "8369\t  switch (cmRsn)\n"
   "8370\t  {\n"
   "8371\t  case cmReasonTypeUndefinedReason: *appRsn = 
gkcciDisconnectRsnUndefined;break;\n"
   "8372\t  case cmReasonTypeNoBandwidth: *appRsn = 
gkcciDisconnectRsnNoBandwidth;break;\n"
   "8373\t  case cmReasonTypeGatekeeperResource: *appRsn = 
gkcciDisconnectRsnGKResources;break;\n"
   "8374\t  case cmReasonTypeUnreachableDestination: *appRsn = 
gkcciDisconnectRsnUnreachableDest;break;\n"
   "8375\t  case cmReasonTypeDestinationRejection: *appRsn = 
gkcciDisconnectRsnDestRejection;break;\n"
   "8376\t  case cmReasonTypeInvalidRevision: *appRsn = 
gkcciDisconnectRsnInvalidRevision;break;\n"
   "8377\t  case cmReasonTypeNoPermision: *appRsn = 
gkcciDisconnectRsnNoPermission;break;\n"
   "8378\t  case cmReasonTypeUnreachableGatekeeper: *appRsn = 
gkcciDisconnectRsnUnreachableGK;break;\n"
   "8379\t  case cmReasonTypeGatewayResource: *appRsn = 
gkcciDisconnectRsnGWResources;break;\n"
   "8380\t  case cmReasonTypeBadFormatAddress: *appRsn = 
gkcciDisconnectRsnBadFormatAddress;break;\n"
   "8381\t  case cmReasonTypeAdaptiveBusy: *appRsn = 
gkcciDisconnectRsnAdaptiveBusy;break;\n"
   "8382\t  case cmReasonTypeInConf: *appRsn = 
gkcciDisconnectRsnInConf;break;\n"
   "8383\t  case cmReasonTypeFacilityCallDeflection: *appRsn = 
gkcciDisconnectRsnFacilityCallDeflection;break;\n"
   "8384\t  case cmReasonTypeSecurityDenied: *appRsn = 
gkcciDisconnectRsnSecurityDenied;break;\n"
   "8385\t  case cmReasonTypeCalledPartyNotRegistered: *appRsn = 
gkcciDisconnectRsnCalledPartyNotRegistered;break;\n"
   "8386\t  case cmReasonTypeCallerNotregistered: *appRsn = 
gkcciDisconnectRsnCallerNotRegistered;break;\n"
   "8387\t  default: \n"
   "8388\t    /*CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8798, cl,\"unhandled cmRsn in disconnectRsn2CM : %d\",cmRsn ));*/\n"
   "8389\t    *appRsn = gkcciDisconnectRsnUndefined;\n"
   "8390\t    return FALSE;\n"
   "8391\t  }\n"
   "8392\t  return TRUE;\n"
   "8393\t}\n"
   "8394\t\n"
   "8395\t  /*******************************************************/\n"
   "8396\tBOOL clearSuppServBuffer(IN int cl,\n"
   "8397\t                         IN side_t side) \n"
   "8398\t{\n"
   "8399\t  sseH450Record_t record;\n"
   "8400\t  while((record = CL.SIDE.h450.queueHead) != SSE_INVALID_BUF)\n"
   "8401\t  {\n"
   "8402\t    if (!memGetNextRecord(&memHandler, record, 
&CL.SIDE.h450.queueHead))\n"
   "8403\t      return FALSE;\n"
   "8404\t    memDeleteRecord(&memHandler, record);\n"
   "8405\t  }\n"
   "8406\t  CL.SIDE.h450.queueTail = SSE_INVALID_BUF;\n"
   "8407\t  return TRUE;\n"
   "8408\t}\n"
   "8409\t  /*  Call Handles and Call Assignment                   */\n"
   "8410\t  /*******************************************************/ \n"
   "8411\t\n"
   "8412\t  INT32 calAppExchangeHandles( /* Exchanges handles with the 
application. haCall will be stored as the \n"
   "8413\t          "
<- "                                  application handle to the call, and 
returned in each future reference\n"
   "8414\t                                            to the call */\n"
   "8415\t                                            IN  gkHCALL          
hCall,\n"
   "8416\t                                            IN  gkHAPPCALL       
haCall)\n"
   "8417\t  {\n"
   "8418\t    int cl;\n"
   "8419\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "8420\t    {\n"
   "8421\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8799, -1, \"calAppExchangeHandles: Illegal handle: %d\", (UINT32)hCall ));\n"
   "8422\t      return gkcciInvalidHandle;\n"
   "8423\t    } \n"
   "8424\t    CL.appHandle = haCall;\n"
   "8425\t    return gkcciOK;\n"
   "8426\t  }\n"
   "8427\t\n"
   "8428\t  INT32 calAppGetApplHandle( /* Get application handle based on 
supplied GK Call handle */\n"
   "8429\t                            IN  gkHCALL          hCall,\n"
   "8430\t                            IN  gkHAPPCALL*      haCall)\n"
   "8431\t  {\n"
   "8432\t    int cl;\n"
   "8433\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "8434\t    {\n"
   "8435\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8799, -1, \"calAppGetApplHandle: Illegal handle: %d\", (UINT32)hCall ));\n"
   "8436\t      return gkcciInvalidHandle;\n"
   "8437\t    } \n"
   "8438\t    *haCall = CL.appHandle;\n"
   "8439\t    return gkcciOK;\n"
   "8440\t  }\n"
   "8441\t\n"
   
"8442\t/*----------------------------------------------------------------------------*/
    \n"
   "8443\t  INT32  calAppHandle2CallNum(/* gets a call number that can be used 
to identifiy the call in the gk\n"
   "8444\t    messages. returns negative error values for failure*/\n"
   "8445\t    IN  gkHCALL hCall,\n"
   "8446\t    OUT gktypeCallNum_t* callNum)\n"
   "8447\t  {\n"
   "8448\t    int cl;\n"
   "8449\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "8450\t    {\n"
   "8451\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
9200, -1, \"calAppHandle2CallNum: Illegal handle: %d\", (UINT32)hCall ));\n"
   "8452\t      return gkcciInvalidHandle;\n"
   "8453\t    }  \n"
   "8454\t    *callNum = cl;\n"
   "8455\t    return gkcciOK;\n"
   "8456\t  }\n"
   "8457\t\n"
   
"8458\t/*----------------------------------------------------------------------------*/
 \n"
   "8459\t  INT32 CALLCONV calAppGetCallHandle(/* return the stack call handle 
of the origin \n"
   "8460\t                                     or the destination of the call. 
If the call\n"
   "8461\t                                     is not routed or if the side of 
the call is \n"
   "8462\t                                     already in a disconnected state 
or it is not\n"
   "8463\t                                     started yet, an error 
(gkcciNotFound) is returned */\n"
   "8464\t                                     IN   gkHCALL       hCall,\n"
   "8465\t                                     IN   gkcciSide_t   side,\n"
   "8466\t                                     OUT  HCALL         *hsCall)\n"
   "8467\t  {\n"
   "8468\t    int cl;\n"
   "8469\t    *hsCall = (HCALL)NULL; \n"
   "8470\t    \n"
   "8471\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "8472\t    {\n"
   "8473\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
9201, -1, \"calAppGetRegHandles: Illegal handle: %d\", (UINT32)hCall ));\n"
   "8474\t      return gkcciInvalidHandle;\n"
   "8475\t    }\n"
   "8476\t    \n"
   "8477\t    if (getCallHandle(cl, side, hsCall))\n"
   "8478\t      return gkcciOK;\n"
   "8479\t    else\n"
   "8480\t      return gkcciNotFound;\n"
   "8481\t  }\n"
   "8482\t  \n"
   
"8483\t/*----------------------------------------------------------------------------*/
 \n"
   "8484\t  INT32 CALLCONV calAppGetCallRASHandle( /* sss return the stack 
handle of the RAS msg which is\n"
   "8485\t                                         associated with the side of 
the call. return an error \n"
   "8486\t                                         code if the requested handle 
do not exist */\n"
   "8487\t                                         IN   gkHCALL       hCall,\n"
   "8488\t                                         IN   gkcciSide_t   side,\n"
   "8489\t                                         IN   gkcciMsg_t    msg,\n"
   "8490\t                                         OUT  HRAS          *hsRas)\n"
   "8491\t  {\n"
   "8492\t    int cl;\n"
   "8493\t    perSideInfo_t *info;\n"
   "8494\t    *hsRas = (HRAS)NULL;\n"
   "8495\t    \n"
   "8496\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "8497\t    {\n"
   "8498\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
9202, -1, \"calAppGetCallRASHandle: Illegal handle: %d\", (UINT32)hCall ));\n"
   "8499\t      return gkcciInvalidHandle;\n"
   "8500\t    }\n"
   "8501\t    \n"
   "8502\t    if (side == gkcciSideOrig)\n"
   "8503\t      info = &CL.ORIG;\n"
   "8504\t    else\n"
   "8505\t      info = &CL.DEST;\n"
   "8506\t    \n"
   "8507\t    switch(msg) {\n"
   "8508\t    case gkcciMsgReceiveSetup:\n"
   "8509\t    case gkcciMsgSendSetup:   \n"
   "8510\t    case gkcciMsgReceiveAlert:\n"
   "8511\t    case gkcciMsgSendAlert:   \n"
   "8512\t    case gkcciMsgReceiveConnect: \n"
   "8513\t    case gkcciMsgSendConnect: \n"
   "8514\t    case gkcciMsgReceiveDisconnect: \n"
   "8515\t    case gkcciMsgSendDisconnect: \n"
   "8516\t    case gkcciMsgReceiveFacility:\n"
   "8517\t    case gkcciMsgSendFacility:\n"
   "8518\t    case gkcciMsgReceiveInfoMsg:\n"
   "8519\t    case gkcciMsgSendInfoMsg:\n"
   "8520\t\t\tcase gkcciMsgSendRIP:\n"
   "8521\t      return gkcciInvalidParam;\n"
   "8522\t      \n"
   "8523\t    case gkcciMsgReceiveARQ: \n"
   "8524\t    case gkcciMsgSendACF:     \n"
   "8525\t    case gkcciMsgSendARJ:  \n"
   "8526\t      if (info->ARQ == (HRAS)NULL)\n"
   "8527\t        return gkcciNotFound;\n"
   "8528\t      *hsRas = info->ARQ;\n"
   "8529\t      break;\n"
   "8530\t      \n"
   "8531\t      \n"
   "8532\t    case gkcciMsgReceiveDRQ: \n"
   "8533\t    case gkcciMsgSendDCF:     \n"
   "8534\t    case gkcciMsgSendDRJ: \n"
   "8535\t      if (info->DRQ == (HRAS)NULL)\n"
   "8536\t        return gkcciNotFound;\n"
   "8537\t      *hsRas = info->DRQ;\n"
   "8538\t      break;\n"
   "8539\t      \n"
   "8540\t    case gkcciMsgSendGKDRQ:   \n"
   "8541\t      if (info->GKDRQ == (HRAS)NULL)\n"
   "8542\t        return gkcciNotFound;\n"
   "8543\t      *hsRas = info->GKDRQ;\n"
   "8544\t      break;\n"
   "8545\t      \n"
   "8546\t    case gkcciMsgReceiveDCF:  \n"
   "8547\t      if (info->EPDCF == (HRAS)NULL)\n"
   "8548\t        return gkcciNotFound;\n"
   "8549\t      *hsRas = info->EPDCF;\n"
   "8550\t      break;\n"
   "8551\t      \n"
   "8552\t    case gkcciMsgReceiveDRJ:  \n"
   "8553\t      if (info->EPDRJ == (HRAS)NULL)\n"
   "8554\t        return gkcciNotFound;\n"
   "8555\t      *hsRas = info->EPDRJ;\n"
   "8556\t      break;\n"
   "8557\t      \n"
   "8558\t    case gkcciMsgSendGKLRQ:  \n"
   "8559\t      if (CL.GKLRQ == (HRAS)NULL)\n"
   "8560\t        return gkcciNotFound;\n"
   "8561\t      *hsRas = CL.GKLRQ;\n"
   "8562\t      break;\n"
   "8563\t      \n"
   "8564\t    case gkcciMsgReceiveLCF: \n"
   "8565\t      if (CL.EPLCF == (HRAS)NULL)\n"
   "8566\t        return gkcciNotFound;\n"
   "8567\t      *hsRas = CL.EPLCF;\n"
   "8568\t      break;\n"
   "8569\t      \n"
   "8570\t    case gkcciMsgReceiveLRJ:  \n"
   "8571\t      if (CL.EPLRJ == (HRAS)NULL)\n"
   "8572\t        return gkcciNotFound;\n"
   "8573\t      *hsRas = CL.EPLRJ;\n"
   "8574\t      break;\n"
   "8575\t      \n"
   "8576\t    case gkcciMsgReceiveBRQ: \n"
   "8577\t    case gkcciMsgSendBCF:\n"
   "8578\t    case gkcciMsgSendBRJ:\n"
   "8579\t      if (info->bw.hsRas == (HRAS)NULL)\n"
   "8580\t        return gkcciNotFound;\n"
   "8581\t      *hsRas = info->bw.hsRas;\n"
   "8582\t      break;\n"
   "8583\t    }\n"
   "8584\t    return gkcciOK;\n"
   "8585\t  }\n"
   "8586\t\n"
   
"8587\t/*----------------------------------------------------------------------------*/
 \n"
   "8588\t  INT32 calAppGetRegHandles( /* return the handles of the 
registration of the origin endpoint\n"
   "8589\t                             or the destination endpoint. If the 
registration has no handle,\n"
   "8590\t                             it will be created. The application 
handle will be\n"
   "8591\t                             set to GKRGI_HAPPREG_NULL if no 
application handle exists for the\n"
   "8592\t                             registration.Retruns gkcciGKFailure if 
no registration is associated \n"
   "8593\t                             with the specified side of the call*/\n"
   "8594\t                             IN  gkHCALL      hCall,\n"
   "8595\t                             IN  gkcciSide_t  side,\n"
   "8596\t                             OUT gkHREG       *hreg,\n"
   "8597\t                             OUT gkHAPPREG    *happreg)\n"
   "8598\t  {\n"
   "8599\t    int cl;\n"
   "8600\t    UINT16 reg;\n"
   "8601\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "8602\t    {\n"
   "8603\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
9203,-1, \"calAppGetRegHandles: Illegal handle: %d\", (UINT32)hCall ));\n"
   "8604\t      return gkcciInvalidHandle;\n"
   "8605\t    }\n"
   "8606\t    if(side == gkcciSideOrig)\n"
   "8607\t      reg = CL.ORIG.reg;\n"
   "8608\t    else\n"
   "8609\t      reg = CL.DEST.reg;\n"
   "8610\t    if (!rgtblValid(reg))\n"
   "8611\t      return gkcciGKFailure;\n"
   "8612\t    if(!rgutilGetOrCreateRegHandle(reg,hreg))\n"
   "8613\t      return gkcciGKFailure;\n"
   "8614\t    if(!rgtblEndpointAppHandle(RGTBL_GET, reg, happreg))\n"
   "8615\t      return gkcciGKFailure;\n"
   "8616\t    return gkcciOK;\n"
   "8617\t  }\n"
   "8618\t\n"
   
"8619\t/*----------------------------------------------------------------------------*/
 \n"
   "8620\t  INT32 calAppGetFirstEntryHandle( /* gets handles to the first call 
that contains data \n"
   "8621\t    If none exists gkcciNotFound is returned */\n"
   "8622\t    OUT gkHAPPCALL*     haCall,\n"
   "8623\t    OUT gkHCALL*        hCall)\n"
   "8624\t  {\n"
   "8625\t    return findEntry(0, haCall, hCall);\n"
   "8626\t  }\n"
   "8627\t\n"
   
"8628\t/*----------------------------------------------------------------------------*/
 \n"
   "8629\t  INT32 calAppGetNextEntryHandle( /* gets handles to the next call 
that contains data after hCall.\n"
   "8630\t    If none exists gkcciNotFound is returned */\n"
   "8631\t    IN  gkHCALL          hCall,\n"
   "8632\t    OUT gkHAPPCALL*      haNextCall,\n"
   "8633\t    OUT gkHCALL*         hNextCall) \n"
   "8634\t  {\n"
   "8635\t    int cl;\n"
   "8636\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "8637\t    {\n"
   "8638\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
9204,-1 ,\"calAppGetNextEntryHandle: Illegal handle: %d\", (UINT32)hCall ));\n"
   "8639\t      return gkcciInvalidHandle;\n"
   "8640\t    } \n"
   "8641\t    return findEntry(cl+1, haNextCall, hNextCall);\n"
   "8642\t  }\n"
   "8643\t\n"
   
"8644\t/*----------------------------------------------------------------------------*/
 \n"
   "8645\t  INT32 findEntry( /* find the entry from \'firstCall\' that contains 
non-vacant call,\n"
   "8646\t    returns handles to the application */\n"
   "8647\t    IN  int              firstCall,\n"
   "8648\t    OUT gkHAPPCALL*      haCall,\n"
   "8649\t    OUT gkHCALL *        hCall)\n"
   "8650\t  {\n"
   "8651\t    \n"
   "8652\t    int cl;\n"
   "8653\t    \n"
   "8654\t    for (cl=firstCall;cl<globalMaxCalls-1;cl++)\n"
   "8655\t    {\n"
   "8656\t      if(!VACENT(cl))\n"
   "8657\t      {\n"
   "8658\t        if(haCall != NULL)\n"
   "8659\t          *haCall = CL.appHandle;\n"
   "8660\t        *hCall = (gkHCALL)CL.handle;\n"
   "8661\t        return gkcciOK;\n"
   "8662\t      }\n"
   "8663\t    }  \n"
   "8664\t    *hCall = (gkHCALL)GKCCI_CALL_NOT_VALID;\n"
   "8665\t    return gkcciNotFound;\n"
   "8666\t  }\n"
   "8667\t\n"
   
"8668\t/*----------------------------------------------------------------------------*/
 \n"
   "8669\t  INT32 calAppCloseHandle( /* The application closes the application 
call handle. The handle \n"
   "8670\t                           will be closed only if the call state is 
CAL_APP_HANDLE, else \n"
   "8671\t                           FALSE will be returned */                  
              \n"
   "8672\t                           IN   gkHCALL   hCall)\n"
   "8673\t  {\n"
   "8674\t    int cl;\n"
   "8675\t    \n"
   "8676\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "8677\t    {\n"
   "8678\t      /* this can happen because the application may get the state 
idle seveal times */\n"
   "8679\t      CALL_NOTIFY(\"calAppCloseHandle: Illegal handle: \", 
(UINT32)hCall, 30,-1);\n"
   "8680\t      return gkcciInvalidHandle;\n"
   "8681\t    }\n"
   "8682\t    CALL_NOTIFY(\"Application approved to close handle\",GEN_NA, 
30,cl);\n"
   "8683\t    if(!checkCallState(cl, CAL_APP_HANDLE, \"Closing call 
handle\"))\n"
   "8684\t      return gkcciInvalidOperation;\n"
   "8685\t    if(!freeCall(cl))\n"
   "8686\t      return gkcciGKFailure;\n"
   "8687\t    return gkcciOK;\n"
   "8688\t  }\n"
   "8689\t\n"
   "8690\t\n"
   "8691\t\n"
   
"8692\t/*----------------------------------------------------------------------------*/
 \n"
   "8693\t  BOOL getCallCheckAuth( /* find the call and auth from handle and 
check\n"
   "8694\t                            to see the match with the calls table 
info */\n"
   "8695\t                            IN UINT32 hCall, \n"
   "8696\t                            OUT int   *call)\n"
   "8697\t  {\n"
   "8698\t    UINT16 auth;\n"
   "8699\t    UINT16 callNo;\n"
   "8700\t    int  cl = 0;\n"
   "8701\t\n"
   "8702\t    if (hCall == (UINT32)GKCCI_CALL_NOT_VALID)\n"
   "8703\t    {\n"
   "8704\t      *call = globalMaxCalls-1;\n"
   "8705\t      return TRUE;\n"
   "8706\t    }\n"
   "8707\t    else\n"
   "8708\t    {\n"
   "8709\t      genDecodeHandle(hCall, &callNo, &auth);\n"
   "8710\t      cl = callNo;\n"
   "8711\t      if (VALID(cl))\n"
   "8712\t      {            \n"
   "8713\t        if((auth == CL.auth))\n"
   "8714\t        {\n"
   "8715\t          CL.appTOCounter = 0;\n"
   "8716\t          *call = cl;\n"
   "8717\t          return TRUE;\n"
   "8718\t        }\n"
   "8719\t      }\n"
   "8720\t    }\n"
   "8721\t    return FALSE;\n"
   "8722\t  }\n"
   "8723\t\n"
   
"8724\t/*----------------------------------------------------------------------------*/
  \n"
   "8725\t  gkHCALL generateHandle( /* Generates an identifier handle for the 
call, also sets the auth field */\n"
   "8726\t                         IN  int cl)\n"
   "8727\t  {\n"
   "8728\t    static UINT16 unique = 1;\n"
   "8729\t    \n"
   "8730\t    if(unique == 0)\n"
   "8731\t      unique++;\n"
   "8732\t    CL.auth = unique;\n"
   "8733\t    unique++;\n"
   "8734\t    \n"
   "8735\t    return((gkHCALL)genEncodeHandle((UINT16)cl, CL.auth));\n"
   "8736\t  }\n"
   
"8737\t/*-----------------------------------------------------------------------------\n"
   "8738\tnoEmpyCallRecord\n"
   "8739\t----------------\n"
   "8740\treturn TRUE if all the call records are used.\n"
   "8741\t*/\n"
   "8742\tBOOL noEmpyCallRecord() {\n"
   "8743\t  return (usedCalls < maxRegularCalls)? FALSE:TRUE;\n"
   "8744\t}\n"
   
"8745\t/*----------------------------------------------------------------------------*/
  \n"
   "8746\tBOOL assignCall(/*assign new call from call pool return FALSE if no 
call is availble*/\n"
   "8747\t\t  OUT int *call)\n"
   "8748\t{\n"
   "8749\t\tint cl=0;\n"
   "8750\t\tnetpCall_t demandCall=1;\n"
   "8751\t\tCALL_NOTIFY(\"pvtCurSize in assign new 
call\",pvtCurSize(cmGetValTree(dispStack)),40,-1); \n"
   "8752\t\t*call=-1;\n"
   "8753\t\t/*sarit - 23/5/00 check that there are free calls before entering 
the loop\n"
   "8754\t\tI added this since globalMaxCalls includes backup calls that cannot 
be used\n"
   "8755\t\tfor regular calls*/\n"
   "8756\t\tif(noEmpyCallRecord())\n"
   "8757\t\t\treturn FALSE;\n"
   "8758\t\twhile (cl<globalMaxCalls-1)\n"
   "8759\t\t{\n"
   "8760\t\t\tif (VACENT(cl))\n"
   "8761\t\t\t{\n"
   "8762\t\t\t\t\tCL.lhPass = 1;\n"
   "8763\t\t\t\t\tCL.lhGwServicePass = 1;\n"
   "8764\t\t\t\t\tCL.nextScan = RGTBL_REG_NOT_VALID;\n"
   "8765\t        CL.nextGwServiceScan = SRV_INVALID_SUPP;\n"
   "8766\t\t\t\tif (gkcfgFlagValue(GKCFG_CALL_INDIRECT)) /*newnatan 19/8*/\n"
   "8767\t\t\t\t\tCL.model = cmRASCallModelTypeGKRouted;\n"
   "8768\t\t\t\telse\n"
   "8769\t\t\t\t\tCL.model = cmRASCallModelTypeDirect;\n"
   "8770\t\t\t\t/*shiri 10/2000 - update mcRoutedMode*/\n"
   "8771\t\t\t\tif(!gkcfgiZonePropertiesGet(GKCFGI_IS_H245_ROUTED))\n"
   "8772\t\t\t\t\tCL.mcRoutedMode = FALSE;\n"
   "8773\t\t\t\telse\n"
   "8774\t\t\t\t\tCL.mcRoutedMode = TRUE;\n"
   "8775\t\t\t\t\n"
   "8776\t\n"
   "8777\t\t\t\tnetpCalls(GEN_ALLOCATE,&demandCall);\n"
   "8778\t\t\t\tif (demandCall==0)\n"
   "8779\t\t\t\t\treturn FALSE;\n"
   "8780\t\t\t\t*call=cl;\n"
   "8781\t\t\t\tCALL_NOTIFY(\"assignCall\",GEN_NA,20,cl);\n"
   "8782\t\t\t\tusedCalls++; /*sarit 2/5/00 counting the total number of used 
records*/\n"
   "8783\t\t\t\treturn TRUE;\n"
   "8784\t\t\t}\n"
   "8785\t\t\tcl++;\n"
   "8786\t\t}\n"
   "8787\t\treturn FALSE;\n"
   "8788\t}\n"
   "8789\t\n"
   
"8790\t/*----------------------------------------------------------------------------*/\n"
   "8791\t  int getCall(/* return call number, and set side to ORIGIN | 
DESTINATION */\n"
   "8792\t             IN HAPPCALL haCall,\n"
   "8793\t             OUT side_t * side)\n"
   "8794\t  {\n"
   "8795\t    int cl;\n"
   "8796\t    *side=NO_SIDE;\n"
   "8797\t    if (haCall==(HAPPCALL)NULL)\n"
   "8798\t      cl=NOT_CALL;\n"
   "8799\t    else\n"
   "8800\t      cl=GET_CALL(haCall);\n"
   "8801\t    if (VALID(cl)) \n"
   "8802\t    {\n"
   "8803\t      if (&(CL.sideInfo[ORIGIN].callNo)==(int*)haCall) \n"
   "8804\t        *side=ORIGIN;\n"
   "8805\t      else\n"
   "8806\t        if (&(CL.sideInfo[DESTINATION].callNo)==(int*)haCall)\n"
   "8807\t          *side=DESTINATION;\n"
   "8808\t        else\n"
   "8809\t        {\n"
   "8810\t          CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8674, cl,\"call with in-valid side\"));\n"
   "8811\t          *side=NO_SIDE;\n"
   "8812\t        }\n"
   "8813\t    }\n"
   "8814\t    else\n"
   "8815\t      *side=NO_SIDE;\n"
   "8816\t    if (*side==ORIGIN)\n"
   "8817\t      CALL_NOTIFY(\"Origin message identified\",GEN_NA,45,cl);\n"
   "8818\t    if (*side==DESTINATION)\n"
   "8819\t      CALL_NOTIFY(\"Destination message identified\",GEN_NA,45,cl);\n"
   "8820\t    return cl;\n"
   "8821\t  }\n"
   "8822\t  \n"
   
"8823\t/*----------------------------------------------------------------------------*/
 \n"
   "8824\t  BOOL getCallHandle(IN  int         cl,\n"
   "8825\t    IN  gkcciSide_t side,\n"
   "8826\t    OUT HCALL       *hsCall)\n"
   "8827\t  {\n"
   "8828\t    if (side == gkcciSideOrig)\n"
   "8829\t    {\n"
   "8830\t      if ((CL.ORIG.stack != NULL) && CL.setupArrived) \n"
   "8831\t        /* origin call is routed and valid */\n"
   "8832\t        *hsCall = CL.ORIG.stack;\n"
   "8833\t      else\n"
   "8834\t      {\n"
   "8835\t        return FALSE;\n"
   "8836\t      }\n"
   "8837\t    }\n"
   "8838\t    else\n"
   "8839\t    {\n"
   "8840\t      if ((CL.DEST.stack != NULL) && CL.setupSend)\n"
   "8841\t        /* destination call is routed and connected */\n"
   "8842\t        /* Note: the hsCall continue to \"live\" in the stack after 
setupSend */\n"
   "8843\t        /* flag becomes off but the GK is beyond the 
cmCallDestDisconnected */\n"
   "8844\t        /* state so the application should not tamper with the call 
in this */\n"
   "8845\t        /* state */\n"
   "8846\t        *hsCall = CL.DEST.stack;\n"
   "8847\t     "
<- " else\n"
   "8848\t      {\n"
   "8849\t        return FALSE;\n"
   "8850\t      }\n"
   "8851\t    }\n"
   "8852\t    return TRUE;\n"
   "8853\t  }\n"
   
"8854\t/*----------------------------------------------------------------------------*/
 \n"
   "8855\t  BOOL closeCallHandle(/*close \'handleToClose\' if it is not NULL 
and is different from\n"
   "8856\t                              \'handleNotToClose\'. Note that setting 
handleNotToClose=NULL,handleToClose\n"
   "8857\t                              will always be closed if it is not 
NULL*/\n"
   "8858\t                              IN HCALL handleToClose,\n"
   "8859\t                              IN HCALL handleNotToClose)\n"
   "8860\t  {\n"
   "8861\t    if ((handleToClose == NULL) || (handleToClose == 
handleNotToClose))\n"
   "8862\t\t\t\t\t\t\treturn TRUE;\n"
   "8863\t    return (cmCallClose(handleToClose) == 0);\n"
   "8864\t  }\n"
   "8865\t\n"
   
"8866\t/*----------------------------------------------------------------------------*/
 \n"
   "8867\t  BOOL calAppCallExists(IN gkHCALL hCall) /* returns TRUE if hCall is 
still valid */\n"
   "8868\t  {\n"
   "8869\t    int cl;\n"
   "8870\t    if (!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "8871\t      return FALSE;\n"
   "8872\t\n"
   "8873\t    if((CL.state == CAL_NO_CALL) || (CL.state == CAL_DISCONNECT) || 
(CL.state == CAL_APP_HANDLE) ||\n"
   "8874\t      (CL.state == CAL_HANDLES))\n"
   "8875\t      return FALSE;\n"
   "8876\t\n"
   "8877\t    return TRUE;\n"
   "8878\t  }\n"
   "8879\t\n"
   "8880\t  /*******************************************************/\n"
   "8881\t  /*  Application CallBacks and Reply functions          */\n"
   "8882\t  /*******************************************************/\n"
   "8883\t  \n"
   "8884\t  INT32 calAppSetEventHandler(/* set the event handlers of the 
application */\n"
   "8885\t                              IN GKCCIEVENT *gkcciEventHandlers,\n"
   "8886\t                              IN INT32       size)\n"
   "8887\t    \n"
   "8888\t  {\n"
   "8889\t    INT32 partialSize = sizeof(gkcciStateEvent_t);\n"
   "8890\t    if((size >= partialSize) && (gkcciEventHandlers->gkcciStateEvent 
!= NULL))\n"
   "8891\t      stateEventCb = gkcciEventHandlers->gkcciStateEvent;  /* set the 
state event handler */\n"
   "8892\t    \n"
   "8893\t    partialSize += sizeof(gkcciMsgEvent_t);\n"
   "8894\t    if((size >= partialSize) && (gkcciEventHandlers->gkcciMsgEvent != 
NULL))\n"
   "8895\t      msgEventCb = gkcciEventHandlers->gkcciMsgEvent;  /* set the 
message event handler */\n"
   "8896\t    \n"
   "8897\t    partialSize += sizeof(gkcciHook_t);\n"
   "8898\t    if((size >= partialSize) && (gkcciEventHandlers->gkcciHook != 
NULL))\n"
   "8899\t      callHandleHookCb = gkcciEventHandlers->gkcciHook; /* set the 
call hook Handler */\n"
   "8900\t    \n"
   "8901\t    partialSize += sizeof(gkcciBandwidthEventHandler_t);\n"
   "8902\t    if((size >= partialSize) && 
(gkcciEventHandlers->gkcciBandwidthEvent != NULL))\n"
   "8903\t      bandwidthEventCb = gkcciEventHandlers->gkcciBandwidthEvent; /* 
set the bandwidth event handler */\n"
   "8904\t    \n"
   "8905\t    partialSize += sizeof(gkcciFacilityEventHandler_t);\n"
   "8906\t    if((size >= partialSize) && 
(gkcciEventHandlers->gkcciFacilityEvent != NULL))\n"
   "8907\t      facilityEventCb = gkcciEventHandlers->gkcciFacilityEvent; /* 
set the facility event handler */\n"
   "8908\t    \n"
   "8909\t    partialSize += sizeof(gkcciInfoMsgEventHandler_t);\n"
   "8910\t    if ((size >= partialSize) && 
(gkcciEventHandlers->gkcciInfoMsgEvent != NULL))\n"
   "8911\t      infoMsgEventCb = gkcciEventHandlers->gkcciInfoMsgEvent; /* set 
the infoMsg event*/\n"
   "8912\t\n"
   "8913\t    return gkcciOK;\n"
   "8914\t  }\n"
   "8915\t \n"
   
"8916\t/*----------------------------------------------------------------------------*/
 \n"
   "8917\t  INT32 calAppReplyConfirm( /* The application confirmed the 
request*/\n"
   "8918\t                           IN   gkHCALL             hCall,\n"
   "8919\t                           IN   gkcciReply_t        reply ,\n"
   "8920\t                           IN   gkcciReplyReason_t  reason)\n"
   "8921\t    \n"
   "8922\t  {\n"
   "8923\t    int cl;\n"
   "8924\t    BOOL retCode = TRUE;\n"
   "8925\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "8926\t    {\n"
   "8927\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
9205,-1, \"calAppReplyConfirm: Illegal handle: %d\", (UINT32)hCall ));\n"
   "8928\t      return gkcciInvalidHandle;\n"
   "8929\t    }\n"
   "8930\t    \n"
   "8931\t    switch (reply)\n"
   "8932\t    {\n"
   "8933\t    case gkcciAddressNotUpdated:\n"
   "8934\t      CALL_NOTIFY(\"calAppReplyConfirm: Confirmation recieved to 
continue address resolution\",GEN_NA, 31,cl);\n"
   "8935\t      CALL_NOTIFY(\"calAppReplyConfirm: Address was not updated by 
the application\",GEN_NA, 19,cl);\n"
   "8936\t      /* we \"manually\" check for one of two possible correct 
states. checkCallState() is not\n"
   "8937\t         used because it will notify a \"wrong state\" when it checks 
the \"other\" state */\n"
   "8938\t      if(CL.state != CAL_ADDRESS_RESOLUTION && CL.state != 
CAL_WAIT_ADDRCMPLT)\n"
   "8939\t        return gkcciInvalidOperation;\n"
   "8940\t      \n"
   "8941\t      /* check OVPS */\n"
   "8942\t      if (reason == gkcciReplyRsnIncompleteAddr)\n"
   "8943\t        retCode = appAddressIncomplete(cl);\n"
   "8944\t      \n"
   "8945\t      else /* continue with address resolution */\n"
   "8946\t      {\n"
   "8947\t        if(!CL.appLineHunting)\n"
   "8948\t          retCode = appAddressNotUpdated(cl);\n"
   "8949\t        else\n"
   "8950\t          retCode = appAddressFinal(cl);\n"
   "8951\t      }\n"
   "8952\t      break;\n"
   "8953\t      \n"
   "8954\t    case gkcciAddressUpdated:\n"
   "8955\t      CALL_NOTIFY(\"calAppReplyConfirm: Confirmation recieved to 
continue address resolution\",GEN_NA, 31,cl);\n"
   "8956\t      CALL_NOTIFY(\"calAppReplyConfirm: Address was updated by the 
application\",GEN_NA, 19,cl);\n"
   "8957\t      if(!checkCallState(cl, CAL_ADDRESS_RESOLUTION, \"Address 
resoultion\"))\n"
   "8958\t          return gkcciInvalidOperation;\n"
   "8959\t      \n"
   "8960\t      /* OVPS - is the overlappedd address reason legall here ? */\n"
   "8961\t      if(!CL.appLineHunting)\n"
   "8962\t      {\n"
   "8963\t        if(reason == gkcciReplyRsnAliasChange)\n"
   "8964\t          retCode = appAliasUpdated(cl);\n"
   "8965\t        else\n"
   "8966\t          retCode = appAddressUpdated(cl);\n"
   "8967\t      }\n"
   "8968\t      else\n"
   "8969\t        retCode = appAddressFinal(cl);\n"
   "8970\t      break;\n"
   "8971\t      \n"
   "8972\t    case gkcciAddressFinal:\n"
   "8973\t      CALL_NOTIFY(\"calAppReplyConfirm: Confirmation recieved to 
continue address resolution\",GEN_NA, 31,cl);\n"
   "8974\t      CALL_NOTIFY(\"calAppReplyConfirm: Address was determined final 
by the application\",GEN_NA, 31,cl);\n"
   "8975\t      if(!checkCallState(cl, CAL_ADDRESS_RESOLUTION, \"Address 
resoultion\"))\n"
   "8976\t          return gkcciInvalidOperation;\n"
   "8977\t      \n"
   "8978\t      /* check OVSP */\n"
   "8979\t      if (reason == gkcciReplyRsnIncompleteAddr)\n"
   "8980\t        retCode = appAddressIncomplete(cl);\n"
   "8981\t      \n"
   "8982\t      else\n"
   "8983\t        retCode = appAddressFinal(cl);\n"
   "8984\t      break;\n"
   "8985\t      \n"
   "8986\t    case gkcciConfirmAddressDone:\n"
   "8987\t      CALL_NOTIFY(\"calAppReplyConfirm:  Address resolution 
done\",GEN_NA, 31,cl);\n"
   "8988\t      if(CL.state != CAL_ADDRESS_RESOLUTION && CL.state != 
CAL_WAIT_ADDRCMPLT)\n"
   "8989\t          return gkcciInvalidOperation;\n"
   "8990\t      \n"
   "8991\t      /* check OVSP */\n"
   "8992\t      if (reason == gkcciReplyRsnIncompleteAddr)\n"
   "8993\t      {\n"
   "8994\t        /* A change in No Answer Reason */\n"
   "8995\t        if (CL.reason == RSN_NEED_ACF || CL.reason == RSN_NEED_ALERT  
|| CL.reason == RSN_DESTINATION_BUSY || CL.reason == RSN_NEED_SETUP || 
CL.reason == RSN_NEED_OFFERING || CL.reason == RSN_NEW_GK_CALL)\n"
   "8996\t        {\n"
   "8997\t          CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8675, cl,\"calAppReplyConfirm: trying to overlapped send a complete 
address\"));\n"
   "8998\t          return gkcciInvalidOperation;\n"
   "8999\t        }\n"
   "9000\t        else\n"
   "9001\t          retCode = appAddressIncomplete(cl);     \n"
   "9002\t      }\n"
   "9003\t      \n"
   "9004\t      else /* address was found */\n"
   "9005\t        retCode = appAddressDone(cl);\n"
   "9006\t      break;\n"
   "9007\t      \n"
   "9008\t    case gkcciDontDoneStartAddressResolution:\n"
   "9009\t      CALL_NOTIFY(\"calAppReplyConfirm: The application set new 
addresses after address done\", GEN_NA, 31,cl);\n"
   "9010\t      CALL_NOTIFY(\"resolving the call adddress again\",GEN_NA, 
31,cl);\n"
   "9011\t      if(CL.state != CAL_ADDRESS_RESOLUTION && CL.state != 
CAL_WAIT_ADDRCMPLT)\n"
   "9012\t        return gkcciInvalidOperation;\n"
   "9013\t      retCode = appRerouteCall(cl, reason);\n"
   "9014\t      break;\n"
   "9015\t\n"
   "9016\t    case gkcciConfirmOrigACF:\n"
   "9017\t      CALL_NOTIFY(\"calAppReplyConfirm: Confirmation recieved for 
sending ACF to origin\",GEN_NA, 31,cl);\n"
   "9018\t      if(!checkCallState(cl, CAL_WAIT_ORIG_ADMISSION, \"ACF 
sending\"))\n"
   "9019\t        return gkcciInvalidOperation;\n"
   "9020\t      retCode = ACF(CL.ORIG.ARQ,cl,ORIGIN);\n"
   "9021\t      break;\n"
   "9022\t\n"
   "9023\t    case gkcciConfirmSetup: \n"
   "9024\t      CALL_NOTIFY(\"calAppReplyConfirm: proceed to orig offering 
after setup\", GEN_NA, 31,cl);\n"
   "9025\t      if (!checkCallState(cl, CAL_NW_SETUP, \"setup processing\"))\n"
   "9026\t        return gkcciInvalidOperation;\n"
   "9027\t\t\t\tif (addEmptyTransport(&(CL.destCallSignal)))\n"
   "9028\t\t\t\t{\n"
   "9029\t\t\t\t\tCHANGE_STATE(CAL_ADDRESS_RESOLUTION, \"Empty destination 
address. Return to address resolution for setup\");\n"
   "9030\t\t\t\t\tretCode = appRerouteCall(cl, reason);\n"
   "9031\t\t\t\t}\n"
   "9032\t      else\n"
   "9033\t      {\n"
   "9034\t        if (CL.reason == RSN_NEED_OFFERING)\n"
   "9035\t\t\t\t\t{\n"
   "9036\t          CHANGE_STATE(CAL_WAIT_OFFERING, \"offering request was sent 
to application after setup\");\n"
   "9037\t\t\t\t\t}\n"
   "9038\t        else\n"
   "9039\t\t\t\t\t{\n"
   "9040\t          CHANGE_STATE(CAL_WAIT_OFFERING, \"Retry of Address 
resolution done. Wait for the application to confirm sending setup to 
destination\");\n"
   "9041\t\t\t\t\t}\n"
   "9042\t        retCode = sendStateEvent(cl, gkcciSttWaitOrigOffering, 
gkcciRsnOrigSetup);\n"
   "9043\t      }\n"
   "9044\t      break;\n"
   "9045\t      \n"
   "9046\t    case gkcciConfirmOrigOffering:\n"
   "9047\t      CALL_NOTIFY(\"calAppReplyConfirm: Confirmation recieved to try 
to connect to destination\",GEN_NA, 31,cl);\n"
   "9048\t      if(!checkCallState(cl, CAL_WAIT_OFFERING, \"Call 
connecting\"))\n"
   "9049\t        return gkcciInvalidOperation;\n"
   "9050\t      retCode = continueCallAfterSetup(cl);\n"
   "9051\t      break;\n"
   "9052\t\n"
   "9053\t    case gkcciRestartAddressResolution: \n"
   "9054\t      CALL_NOTIFY(\"calAppReplyConfirm: The application restarted 
address resolution after setup\", GEN_NA, 31, cl);\n"
   "9055\t      if (!checkCallState(cl, CAL_NW_SETUP, \"Resolving new addresses 
after NW setup\"))\n"
   "9056\t        return gkcciInvalidOperation;\n"
   "9057\t\n"
   "9058\t      CHANGE_STATE(CAL_ADDRESS_RESOLUTION, \"return to address 
resolution for setup\");\n"
   "9059\t      return appRerouteCall(cl, reason);\n"
   "9060\t\n"
   "9061\t    case gkcciConfirmOrigConnect:\n"
   "9062\t     CALL_NOTIFY(\"calAppReplyConfirm: connecting the GK to the 
origin\", GEN_NA, 31, cl);\n"
   "9063\t     if (!checkCallState(cl, CAL_NW_SETUP, \"connect origin to 
GK\"))\n"
   "9064\t        return gkcciInvalidOperation;\n"
   "9065\t     retCode = (connectGKToOrigin(cl) == gkcciOK);\n"
   "9066\t     break;\n"
   "9067\t\n"
   "9068\t    case gkcciConfirmLRQ:\n"
   "9069\t      CALL_NOTIFY(\"calAppReplyConfirm: Confirmation recieved for 
sending LRQ\",GEN_NA, 31,cl);\n"
   "9070\t      if(!checkCallState(cl, CAL_WAIT_LRQ, \"LRQ sending\"))\n"
   "9071\t        return gkcciInvalidOperation;\n"
   "9072\t      retCode = LRQ(cl);\n"
   "9073\t      break;\n"
   "9074\t      \n"
   "9075\t    case gkcciConfirmDestConnect:\n"
   "9076\t      CALL_NOTIFY(\"calAppReplyConfirm: Confirmation recieved for 
connecting destination to origin\",GEN_NA, 31,cl);\n"
   "9077\t      if(!checkCallState(cl, CAL_WAIT_DEST_CONNECT, \"connecting 
destination to origin\"))\n"
   "9078\t        return gkcciInvalidOperation;\n"
   "9079\t      clearSuppServBuffer(cl, DESTINATION);\n"
   "9080\t      retCode = connectDestinationToOrigin(cl);\n"
   "9081\t      break;\n"
   "9082\t      \n"
   "9083\t    case gkcciDontConnectStartAddressResolution:\n"
   "9084\t      CALL_NOTIFY(\"calAppReplyConfirm: The application set new 
addresses before connecting destination to origin\", GEN_NA, 31,cl);\n"
   "9085\t      CALL_NOTIFY(\"resolving the call address again (after 
disconnecting destination)\",GEN_NA, 31,cl);\n"
   "9086\t      if(!checkCallState(cl, CAL_WAIT_DEST_CONNECT, \"reroute call 
before connecting destination to origin\"))\n"
   "9087\t        return gkcciInvalidOperation;\n"
   "9088\t      retCode = appDisconnectDestination(cl, reason);\n"
   "9089\t      break;\n"
   "9090\t      \n"
   "9091\t    case gkcciConfirmDisconnect:\n"
   "9092\t      CALL_NOTIFY(\"calAppReplyConfirm: Confirmation recieved for 
disconnecting\",GEN_NA, 31,cl);\n"
   "9093\t      if(!checkCallState(cl, CAL_CANNOT_COMPLETE, \"Call 
disconnecting\"))\n"
   "9094\t        return gkcciInvalidOperation;\n"
   "9095\t      retCode = appConfirmDisconnect(cl);\n"
   "9096\t      break;\n"
   "9097\t      \n"
   "9098\t    case gkcciDontDisconnectStartAddressResolution:\n"
   "9099\t      CALL_NOTIFY(\"calAppReplyConfirm: The application set new 
addresses before disconnecting, resolving the call adddress again\",GEN_NA, 
31,cl);\n"
   "9100\t      if(!checkCallState(cl, CAL_CANNOT_COMPLETE, \"Resolving new 
addresses\"))\n"
   "9101\t        return gkcciInvalidOperation;\n"
   "9102\t\t  CL.setupPending = TRUE;\n"
   "9103\t      retCode = appRerouteCall(cl, reason);\n"
   "9104\t      break;\n"
   "9105\t      \n"
   "9106\t    case gkcciDontHuntStartAddressResolution:\n"
   "9107\t      CALL_NOTIFY(\"calAppReplyConfirm: The application set new 
addresses in hunting state, resolving the call adddress again\",GEN_NA, 
31,cl);\n"
   "9108\t      if(!checkCallState(cl, CAL_WAIT_HUNTING, \"Resolving new 
addresses\"))\n"
   "9109\t        return gkcciInvalidOperation;\n"
   "9110\t      retCode = appRerouteCall(cl, reason);\n"
   "9111\t      break;\n"
   "9112\t      \n"
   "9113\t    case gkcciConfirmLineHunting:\n"
   "9114\t      CALL_NOTIFY(\"calAppReplyConfirm: The application confirmed to 
make new trial at destination\",GEN_NA, 31,cl);\n"
   "9115\t      if(!checkCallState(cl, CAL_WAIT_HUNTING, \"line hunting\"))\n"
   "9116\t        return gkcciInvalidOperation;\n"
   "9117\t      retCode =  (makeDestCall(cl, 1) == 1);\n"
   "9118\t      break;\n"
   "9119\t      \n"
   "9120\t    case gkcciConfirmDestACF:\n"
   "9121\t      CALL_NOTIFY(\"calAppReplyConfirm: Confirmation recieved for 
sending ACF to destination\",GEN_NA, 31,cl);\n"
   "9122\t      if(!checkCallState(cl, CAL_WAIT_DEST_ADMISSION, \"ACF 
sending\"))\n"
   "9123\t        return gkcciInvalidOperation;\n"
   "9124\t      CHANGE_STATE(CL.previousState, \"sending ACF to 
destination\");\n"
   "9125\t      retCode = ACF(CL.DEST.ARQ,cl,DESTINATION); \n"
   "9126\t      break;\n"
   "9127\t      \n"
   "9128\t    case gkcciDontACFStartAddressResolution:\n"
   "9129\t      CALL_NOTIFY(\"calAppReplyConfirm: The application set new 
addresses instead of sending ACF to destination\", GEN_NA, 31,cl);\n"
   "9130\t      CALL_NOTIFY(\"resolving the call adddress again (after 
disconnecting destination)\",GEN_NA, 31,cl);               \n"
   "9131\t      if(!checkCallState(cl, CAL_WAIT_DEST_ADMISSION, \"reroute call 
before ACF\"))\n"
   "9132\t        return gkcciInvalidOperation;\n"
   "9133\t      retCode = appDisconnectDestination(cl, reason);        \n"
   "9134\t      break;\n"
   "9135\t      \n"
   "9136\t    default:\n"
   "9137\t      break;\n"
   "9138\t    }\n"
   "9139\t              \n"
   "9140\t    if(retCode == FALSE)\n"
   "9141\t      return gkcciGKFailure;\n"
   "9142\t    return gkcciOK;\n"
   "9143\t  }\n"
   "9144\t            \n"
   "9145\t            \n"
   
"9146\t/*----------------------------------------------------------------------------*/
 \n"
   "9147\t  INT32 calAppReplyReject( /* The application rejected the 
request*/\n"
   "9148\t                         IN   gkHCALL             hCall,\n"
   "9149\t                         IN   gkcciReplyReason_t  reason)\n"
   "9150\t    \n"
   "9151\t  {\n"
   "9152\t    int cl;\n"
   "9153\t    cmReasonType cmReasonOrig,cmReasonDest;\n"
   "9154\t    \n"
   "9155\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "9156\t    {\n"
   "9157\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
9206,-1, \"calAppReplyReject: Illegal handle: %d\", (UINT32)hCall ));\n"
   "9158\t      return gkcciInvalidHandle;\n"
   "9159\t    }\n"
   "9160\t    \n"
   "9161\t    if(!waitingForApp(cl))\n"
   "9162\t    {\n"
   "9163\t      char str[200];\n"
   "9164\t      sprintf(str, \"calAppReplyReject: call state %s is not suitable 
for request, for call: %d\", \n"
   "9165\t        stateName[CL.state],cl);\n"
   "9166\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8676, cl,str));\n"
   "9167\t      return gkcciInvalidOperation;\n"
   "9168\t    }\n"
   "9169\t    CALL_NOTIFY(\"Disconnecting call or rejecting admission because 
of application rejection\",GEN_NA,10,cl);\n"
   "9170\t    disconnectRsnApp2CM(cl,&cmReasonOrig,CL.ORIG.disconnectReason);\n"
   "9171\t    disconnectRsnApp2CM(cl,&cmReasonDest,CL.DEST.disconnectReason);\n"
   "9172\t    if(reason == gkcciReplyRsnUndefined)\n"
   "9173\t    {\n"
   "9174\t      
if(!stopCall(cl,CL.reason,cmReasonOrig,cmReasonDest,cmRASReasonUndefined))\n"
   "9175\t        return gkcciGKFailure;\n"
   "9176\t    }\n"
   "9177\t    else\n"
   "9178\t    {\n"
   "9179\t      if (cmReasonOrig == (cmReasonType)gkcciReplyRsnUndefined)\n"
   "9180\t        cmReasonOrig = cmReasonTypeGatekeeperResource;\n"
   "9181\t      if (cmReasonDest == (cmReasonType)gkcciReplyRsnUndefined)\n"
   "9182\t        cmReasonDest = cmReasonTypeGatekeeperResource;\n"
   "9183\t      /*to retain the former logic, in which stop call was called 
with gkResources value*/\n"
   "9184\t      if(!stopCall(cl, 
CL.reason,cmReasonOrig,cmReasonDest,cmRASReasonResourceUnavailable))\n"
   "9185\t        return gkcciGKFailure;\n"
   "9186\t    }\n"
   "9187\t    \n"
   "9188\t    return gkcciOK;\n"
   "9189\t  }  \n"
   "9190\t  \n"
   
"9191\t/*----------------------------------------------------------------------------*/
   \n"
   "9192\t  BOOL calAppContinue( /* the continue callback. Continue the call 
with\n"
   "9193\t                          no change to the original paramaters */\n"
   "9194\t                          IN   gkCALLHANDLE     hCall)\n"
   "9195\t  {\n"
   "9196\t    int cl;\n"
   "9197\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "9198\t    {\n"
   "9199\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 9207 
,-1, \"calAppContinue: Illegal handle: %d \", (UINT32)hCall ));\n"
   "9200\t      return TRUE;\n"
   "9201\t    }\n"
   "9202\t    CALL_NOTIFY(\"calAppContinue\",GEN_NA,31,cl);\n"
   "9203\t    /* continue call with fixing final dest */\n"
   "9204\t    continueCall(cl, TRUE);\n"
   "9205\t    return TRUE;\n"
   "9206\t  }\n"
   "9207\t\n"
   
"9208\t/*----------------------------------------------------------------------------*/
 \n"
   "9209\t  BOOL calAppReject( /* the reject callback. Discontinue the call 
*/\n"
   "9210\t    IN   gkCALLHANDLE     hCall,\n"
   "9211\t    IN   char *           reason)\n"
   "9212\t  {\n"
   "9213\t    int cl;\n"
   "9214\t    char str[250];\n"
   "9215\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "9216\t    {\n"
   "9217\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
9208,-1, \"calAppReject: Illegal handle: %d\", (UINT32)hCall ));\n"
   "9218\t      return TRUE;\n"
   "9219\t    }\n"
   "9220\t    sprintf(str, \"calAppReject: Reject call %d with reason %s\", 
(UINT32)cl, reason);\n"
   "9221\t    CALL_NOTIFY(str, GEN_NA, 31,cl);       \n"
   "9222\t    
disconnectCall(cl,cmReasonTypeUndefinedReason,cmReasonTypeUndefinedReason, \n"
   "9223\t      UNDEFINED_DROP_CAUSE,UNDEFINED_DROP_CAUSE,TRUE);\n"
   "9224\t    return TRUE;\n"
   "9225\t  }\n"
   "9226\t  \n"
   "9227\t\n"
   
"9228\t/*----------------------------------------------------------------------------*/
 \n"
   "9229\t  BOOL calAppConfirm( /* the confirmation callback. Sets the data to 
it\'s right place\n"
   "9230\t    and resume taking care of the waiting call */\n"
   "9231\t    IN   gkCALLHANDLE     hCall,\n"
   "9232\t    IN   char*\t\t       dial,\n"
   "9233\t    IN   char*\t\t       srcName,\n"
   "9234\t    IN   char*\t\t       token,\n"
   "9235\t    IN   UINT32\t\t       nextIp,\n"
   "9236\t    IN   UINT16\t\t       nextPort)\n"
   "9237\t  {\n"
   "9238\t    int cl;\n"
   "9239\t    cmRASTransport gkCallSignal;\n"
   "9240\t    char str[1000], strIp[100];\n"
   "9241\t    \n"
   "9242\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "9243\t    {\n"
   "9244\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
9209,-1, \"calAppConfirm: Illegal handle: %d\", (UINT32)hCall ));\n"
   "9245\t      return TRUE;\n"
   "9246\t    }\n"
   "9247\t    CALL_NOTIFY(\"calAppConfirm\",GEN_NA,31,cl);    \n"
   "9248\t    liIpToString(nextIp, strIp);\n"
   "9249\t    sprintf(str, \"With following parameters: NextHopIp: %s:%d Dial: 
%s SrcName: %s Token: %s\",\n"
   "9250\t      strIp, nextPort, dial, srcName, token);\n"
   "9251\t    CALL_NOTIFY(str, GEN_NA, 31,cl);\n"
   "9252\t    rgrasGKCallSignalAddress(&gkCallSignal);\n"
   "9253\t    /* check to see that the ip that we got from LAS is not ours. 
Otherwise\n"
   "9254\t    make it zero, so we\'ll only go by alias */\n"
   "9255\t    (void)addSetAlias(&(CL.destInfo[0]), cmRASAliasTypeE164, dial);\n"
   "9256\t    (void)addSetAlias(&(CL.destInfo[1]), cmRASAliasTypeH323ID, 
token);\n"
   "9257\t    (void)addSetAlias(&(CL.srcInfo[0]), cmRASAliasTypeH323ID, 
srcName);\n"
   "9258\t    if((gkCallSignal.ip == nextIp) && (gkCallSignal.port == 
nextPort))\n"
   "9259\t    {\n"
   "9260\t      CL.destCallSignal.ip = (UINT32)0;\n"
   "9261\t      CL.destCallSignal.port = (UINT16)0;\n"
   "9262\t      CL.destCallSignal.type = cmRASTransportTypeIP;\n"
   "9263\t      /* continue call with fixing final dest */\n"
   "9264\t      continueCall(cl, TRUE);\n"
   "9265\t    }\n"
   "9266\t    else\n"
   "9267\t    {\n"
   "9268\t      CL.destCallSignal.ip = nextIp;\n"
   "9269\t      CL.destCallSignal.port = nextPort;\n"
   "9270\t      CL.destCallSignal.type = cmRASTransportTypeIP;\n"
   "9271\t      CL.callService = SRV_INVALID_SERV;\n"
   "9272\t      CL.service = NET3_NOT_SERVICE;\n"
   "9273\t      /* continue call without fixing final dest */\n"
   "9274\t      continueCall(cl, FALSE);\n"
   "9275\t    }\n"
   "9276\t    return TRUE;\n"
   "9277\t  }\n"
   "9278\t\n"
   "9279\t\n"
   "9280\t  /*******************************************************/\n"
   "9281\t  /*  Timeouts                                           */\n"
   "9282\t  /*******************************************************/\n"
   "9283\t\n"
   "9284\t  BOOL  waitingForApp( /* returns TRUE if call is waiting for 
application response */\n"
   "9285\t\t\t    IN int cl)\n"
   "9286\t{\n"
   "9287\t  if((CL.state == CAL_ADDRESS_RESOLUTION) || (CL.state == CAL"
<- "_ADDRESS_DONE) ||\n"
   "9288\t     (CL.state == CAL_WAIT_ORIG_ADMISSION) || (CL.state == 
CAL_WAIT_OFFERING) ||\n"
   "9289\t     (CL.state == CAL_WAIT_DEST_ADMISSION) || \n"
   "9290\t     (CL.state == CAL_WAIT_LRQ) || (CL.state == CAL_CANNOT_COMPLETE) 
||\n"
   "9291\t     (CL.state == CAL_WAIT_DEST_CONNECT) || (CL.state == 
CAL_WAIT_HUNTING) ||\n"
   "9292\t\t\t (CL.state == CAL_NW_SETUP)/*NL_11_3*/\n"
   "9293\t\t\t )\n"
   "9294\t    return TRUE;\n"
   "9295\t  return FALSE;\n"
   "9296\t}\n"
   "9297\t\n"
   
"9298\t/*----------------------------------------------------------------------------*/
 \n"
   "9299\tvoid CALLCONV applicationTimeoutCheck(/* goes over all calls and if 
they\'re in state of waiting to the application\n"
   "9300\t\t\t\t\t                         and the call timeout counter is 0 
increament the counter. If the counter is 1 \n"
   "9301\t                                 stop waiting and disconnect the call 
*/\n"
   "9302\t                                 void *dummy)\n"
   "9303\t{\n"
   "9304\t  int cl,s;\n"
   "9305\t  side_t side;\n"
   "9306\t  \n"
   "9307\t  if(dummy);\n"
   "9308\t  semSemaphoreTake();\n"
   "9309\t  GK_NOTIFY(\"Checking application timeouts\" ,GEN_NA, 40);\n"
   "9310\t  for (cl=0;cl<globalMaxCalls-1;cl++)\n"
   "9311\t  {\n"
   "9312\t    if(waitingForApp(cl))\n"
   "9313\t    {\n"
   "9314\t      if(CL.appTOCounter == 0)\n"
   "9315\t        CL.appTOCounter++;\n"
   "9316\t      else\n"
   "9317\t      {\n"
   "9318\t        char str[200];\n"
   "9319\t        sprintf(str, \"Call cannot continue because of application 
timeout in state %s\",stateName[CL.state]);\n"
   "9320\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8677, cl,str));\n"
   "9321\t        (void)stopCall(cl, RSN_APP_TO, cmReasonTypeUndefinedReason, 
cmReasonTypeUndefinedReason, \n"
   "9322\t          cmRASReasonUndefined);\n"
   "9323\t      }\n"
   "9324\t      \n"
   "9325\t    }\n"
   "9326\t    \n"
   "9327\t    for (s=0;s<2;s++)\n"
   "9328\t    {\n"
   "9329\t      int handle;\n"
   "9330\t      if (s == 0)\n"
   "9331\t        side = ORIGIN;\n"
   "9332\t      else\n"
   "9333\t        side = DESTINATION;\n"
   "9334\t      if (bwBRQIsPending(cl,side))\n"
   "9335\t      {\n"
   "9336\t        if(CL.SIDE.bw.TOCounter == 0)\n"
   "9337\t          CL.SIDE.bw.TOCounter++;\n"
   "9338\t        else\n"
   "9339\t        {\t\n"
   "9340\t          char str[200];\n"
   "9341\t          sprintf(str, \"timeout on brqReply expired-using gk default 
reply\");\n"
   "9342\t          CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8678, cl,str));\n"
   "9343\t          bwDefaultBRQReply(cl,side);\n"
   "9344\t        }\n"
   "9345\t      }\n"
   "9346\t      \n"
   "9347\t      for (handle=0;handle < FACILITY_STORAGE_SIZE;handle++)\n"
   "9348\t      {\n"
   "9349\t        if (CL.SIDE.facility.f[handle].occupied)\n"
   "9350\t        {\n"
   "9351\t          if(CL.SIDE.facility.f[handle].TOCounter == 0)\n"
   "9352\t            CL.SIDE.facility.f[handle].TOCounter++;\n"
   "9353\t          else\n"
   "9354\t          {\t\n"
   "9355\t            char str[256];\n"
   "9356\t            sprintf(str, \"timeout on facility handle %i - using gk 
default reply\",handle);\n"
   "9357\t            CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8679, cl,str));\n"
   "9358\t            facilityDelete(cl,side,handle);\n"
   "9359\t          }\n"
   "9360\t        }\n"
   "9361\t      } \n"
   "9362\t\n"
   "9363\t      for (handle=0; handle < INFO_MSG_STORAGE_SIZE; handle++)\n"
   "9364\t      {\n"
   "9365\t        if (CL.SIDE.infoMsg.info[handle].occupied)\n"
   "9366\t        {\n"
   "9367\t          if (CL.SIDE.infoMsg.info[handle].TOCounter == 0)\n"
   "9368\t            CL.SIDE.infoMsg.info[handle].TOCounter++;\n"
   "9369\t          else\n"
   "9370\t          {\n"
   "9371\t            char buf[256];\n"
   "9372\t            sprintf(buf, \"timeout on infoMsg handle %i is 
expired-using gk default reply\", handle);\n"
   "9373\t            CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8680, cl,buf));\n"
   "9374\t            infoMsgRemove(cl,side,handle);\n"
   "9375\t          }\n"
   "9376\t        }\n"
   "9377\t      }\n"
   "9378\t    }\n"
   "9379\t    /* check that the call is not stuck in the CAL_RAS_CONNECT 
state*/\n"
   "9380\t    /* check that the call is not stuck in CAL_WAIT_ADDRCMPLT state 
*/\n"
   "9381\t    /* meir bug-fix: Check for CAL_WAIT_ADDRCMPLT required call to be 
in routed mode. */\n"
   "9382\t    if((CL.state == CAL_RAS_CONNECT && CL.model != 
cmRASCallModelTypeDirect) || \n"
   "9383\t\t\t\t (CL.state == CAL_WAIT_ADDRCMPLT) ||\n"
   "9384\t\t\t\t (CL.state == CAL_WAIT_SETUP_ADDRCMPLT))\n"
   "9385\t    {\n"
   "9386\t      if(CL.callsTOCounter == 0)\n"
   "9387\t        CL.callsTOCounter++;\n"
   "9388\t      else\n"
   "9389\t      {\n"
   "9390\t        if (CL.state == CAL_RAS_CONNECT)\n"
   "9391\t        {\n"
   "9392\t          char str[256];\n"
   "9393\t          sprintf(str, \"Call cannot continue because of timeout in 
state %s\",stateName[CL.state]);\n"
   "9394\t          CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8681, cl,str));\n"
   "9395\t          (void)stopCall(cl, RSN_APP_TO, cmReasonTypeUndefinedReason, 
cmReasonTypeUndefinedReason, \n"
   "9396\t          cmRASReasonUndefined);\n"
   "9397\t\n"
   "9398\t        }\n"
   "9399\t        else if (CL.state == CAL_WAIT_ADDRCMPLT)\n"
   "9400\t\t\t\t\t{\n"
   "9401\t\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8682, cl,\"Clearing due to T.O. while waiting for ARQ with complete 
address\"));\n"
   "9402\t\t\t\t\t  teardownCall(cl, ORIGIN);\n"
   "9403\t\t\t\t\t}\n"
   "9404\t\t\t\t\telse if (CL.state == CAL_WAIT_SETUP_ADDRCMPLT)\n"
   "9405\t\t\t\t\t{\n"
   "9406\t\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8682, cl,\"Disconnecting due to T.O. while waiting for Setup with complete 
address\"));\n"
   "9407\t\t\t\t\t  
disconnectCall(cl,cmReasonTypeUndefinedReason,cmReasonTypeUndefinedReason,\n"
   "9408\t\t\t\t\t\tUNDEFINED_DROP_CAUSE, UNDEFINED_DROP_CAUSE, TRUE);\n"
   "9409\t\t\t\t\t}\n"
   "9410\t      }\n"
   "9411\t    }\n"
   "9412\t  }\n"
   "9413\t  semSemaphoreGive();\n"
   "9414\t}\n"
   "9415\t\n"
   
"9416\t/*----------------------------------------------------------------------------*/
 \n"
   "9417\tvoid CALLCONV expectDRQTOForOrigin(/*terminates origin as if recieved 
a drq from origin*/\n"
   "9418\t                          void * call)\n"
   "9419\t                          \n"
   "9420\t{\n"
   "9421\t  BOOL error;\n"
   "9422\t  int cl = (int)call;\n"
   "9423\t  CALL_NOTIFY(\"executing 
expectDRQTOForOrigin\",GEN_NA,10,(int)call);\n"
   "9424\t  CALL_NOTIFY(\"killing expecting_DRQ timer\",GEN_NA,40,(int)call);\n"
   "9425\t  /*\n"
   "9426\t  gkTiTimerKill(expectDRQTOForOrigin,call);\n"
   "9427\t  */\n"
   "9428\t  semSemaphoreTake();\n"
   "9429\t  releaseARQ(cl,ORIGIN); \n"
   "9430\t  error = !terminateOrigin(cl);\n"
   "9431\t  semSemaphoreGive();\n"
   "9432\t  if (error)\n"
   "9433\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8683, 
cl,\"error in expectDRQTOForOrigin when terminating origin\"));\n"
   "9434\t}\n"
   "9435\t\n"
   
"9436\t/*----------------------------------------------------------------------------*/
                 \n"
   "9437\tvoid CALLCONV expectDRQTOForDest(/*terminates destination as if 
recieved a drq from destination*/\n"
   "9438\t                        void * call)\n"
   "9439\t                        \n"
   "9440\t{\n"
   "9441\t  BOOL error;\n"
   "9442\t  int cl = (int)call;\n"
   "9443\t  CALL_NOTIFY(\"executing 
expectDRQTOForDest\",GEN_NA,10,(int)call);\n"
   "9444\t  CALL_NOTIFY(\"killing expecting_DRQ timer\",GEN_NA,40,(int)call);\n"
   "9445\t  /*\n"
   "9446\t  gkTiTimerKill(expectDRQTOForDest,call);\n"
   "9447\t  */\n"
   "9448\t  semSemaphoreTake();        \n"
   "9449\t  releaseARQ(cl,DESTINATION);  \n"
   "9450\t  error = !terminateDestination(cl);\n"
   "9451\t  semSemaphoreGive();\n"
   "9452\t  if (error)\n"
   "9453\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8684, 
cl,\"error in expectDRQTOForDest when terminating destination\"));\n"
   "9454\t}\n"
   "9455\t\n"
   "9456\t\n"
   "9457\t\n"
   "9458\t            \n"
   "9459\t \n"
   "9460\t\n"
   "9461\t\n"
   "9462\t  /*******************************************************/\n"
   "9463\t  /*  Call Disconnection                                 */\n"
   "9464\t  /*******************************************************/ \n"
   "9465\t    \n"
   "9466\t   INT32 calAppDisconnect( /* the application requests to disconnect 
the call via H323\n"
   "9467\t                              messages */                             
   \n"
   "9468\t                              IN   gkHCALL   hCall,\n"
   "9469\t                              IN   gkcciDisconnectReason_t   
originReason,\n"
   "9470\t                              IN   gkcciDisconnectReason_t   
destinationReason)\n"
   "9471\t   {\n"
   "9472\t     int cl;\n"
   "9473\t     \n"
   "9474\t     if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "9475\t     {\n"
   "9476\t       CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE,9210,-1, \"calAppDisconnect: Illegal handle: \", 
(UINT32)hCall ));\n"
   "9477\t       return gkcciInvalidHandle;\n"
   "9478\t     }\n"
   "9479\t     if((CL.state == CAL_NO_CALL) || (CL.state == CAL_DISCONNECT) || 
(CL.state == CAL_APP_HANDLE))\n"
   "9480\t     { \n"
   "9481\t       CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8685, cl,\"calAppDisconnect: call already disconnected\"));\n"
   "9482\t       return gkcciInvalidOperation;  \n"
   "9483\t     }\n"
   "9484\t     CALL_NOTIFY(\"Application requested disconnection\",GEN_NA, 
30,cl);\n"
   "9485\t     if(!disengageCall(cl,originReason,destinationReason))\n"
   "9486\t       return gkcciGKFailure;\n"
   "9487\t     return gkcciOK;\n"
   "9488\t   }        \n"
   "9489\t    \n"
   
"9490\t/*----------------------------------------------------------------------------*/
 \n"
   "9491\t   INT32 calAppDisconnectAll( /* disconnect all calls using H.323 
messages.\n"
   "9492\t     return negative values on failure, 0 on success. */              
                \n"
   "9493\t     IN   gkcciDisconnectReason_t   originReason,\n"
   "9494\t     IN   gkcciDisconnectReason_t   destinationReason)\n"
   "9495\t   {\n"
   "9496\t     if(calZoneDisengage(originReason,destinationReason) == 0)\n"
   "9497\t       return gkcciGKFailure;\n"
   "9498\t     return gkcciOK;\n"
   "9499\t   }\n"
   "9500\t\n"
   
"9501\t/*----------------------------------------------------------------------------*/
    \n"
   "9502\t   INT32 calAppClear( /*  the application requests to unilateraly 
clear the call */                                \n"
   "9503\t     IN   gkHCALL   hCall)\n"
   "9504\t   {\n"
   "9505\t     int cl;\n"
   "9506\t     \n"
   "9507\t     if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "9508\t     {\n"
   "9509\t       CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
9211,-1, \"calAppClear: Illegal handle: %d\", (UINT32)hCall ));\n"
   "9510\t       return gkcciInvalidHandle;\n"
   "9511\t     }\n"
   "9512\t     CALL_NOTIFY(\"Application requested clear\",GEN_NA, 30,cl);\n"
   "9513\t     freeCall(cl);\n"
   "9514\t     return gkcciOK;\n"
   "9515\t   }\n"
   "9516\t   \n"
   
"9517\t/*----------------------------------------------------------------------------*/
     \n"
   "9518\t   INT32 calAppClearAll( /*  the application requests to unilateraly 
clear the call */                                \n"
   "9519\t     void)\n"
   "9520\t   {\n"
   "9521\t     int cl;\n"
   "9522\t     CALL_NOTIFY(\"gk clears all calls\",GEN_NA,10,-1);\n"
   "9523\t     for (cl=0;cl<globalMaxCalls;cl++)\n"
   "9524\t       freeCall(cl);\n"
   "9525\t     return gkcciOK; \n"
   "9526\t   }\n"
   "9527\t    \n"
   
"9528\t/*----------------------------------------------------------------------------*/
         \n"
   "9529\t   INT32 calAppDisconnectDestination( /* the application asked to 
disconnect the destination of the call\n"
   "9530\t                                      (usally for rerouting).\n"
   "9531\t                                      check that origin is offering 
and call\n"
   "9532\t                                      state is after sending setup 
and call is\n"
   "9533\t                                      not connected yet (meaning 
setup was sent to destination\n"
   "9534\t                                      but connect was not passed to 
origin yet)  */\n"
   "9535\t                                      \n"
   "9536\t                                      IN  gkHCALL  hCall,\n"
   "9537\t                                      IN  gkcciDisconnectReason_t   
disconnectReason)\n"
   "9538\t   {\n"
   "9539\t     int cl;\n"
   "9540\t     cmReasonType cmRsn;\n"
   "9541\t     \n"
   "9542\t     if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "9543\t     {\n"
   "9544\t       CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
9212,-1,\"calAppDisconnectDestination: Illegal handle: \", (UINT32)hCall ));\n"
   "9545\t       return gkcciInvalidHandle;\n"
   "9546\t     }\n"
   "9547\t\n"
   "9548\t     disconnectRsnApp2CM(cl,&cmRsn,disconnectReason);\n"
   "9549\t\n"
   "9550\t     /* SA_450_TR This function is suitable only for joined call line 
hunting */\n"
   "9551\t     /* For one-sided calls we should make another criteria */\n"
   "9552\t     if (CL.sideMap != JOINED)\n"
   "9553\t       return gkcciInvalidOperation;\n"
   "9554\t\n"
   "9555\t\t if( ( (CL.state != CAL_HUNTING) && (CL.state != 
CAL_WAIT_DEST_ADMISSION) && \n"
   "9556\t           (CL.state != CAL_WAIT_DEST_CONNECT) ) || \n"
   "9557\t\t\t   (((CL.ORIG.state!=cmCallStateOffering) && CL.ORIG.stack ) &&\n"
   "9558\t\t\t   ((CL.ORIG.state!=cmCallStateWaitAddressAck) && CL.ORIG.stack 
)) ) /*sarit 13/6/00 - address ack is also a posibile state here*/\n"
   "9559\t     {\n"
   "9560\t       CALL_NOTIFY(\"calAppDisconnectDestination: Connot complete 
rerouting because no destination in call yet\", GEN_NA, 10,cl);\n"
   "9561\t       CALL_NOTIFY(\"or origin is not offering\",GEN_NA, 10,cl);\n"
   "9562\t       return gkcciInvalidOperation;\n"
   "9563\t     }\n"
   "9564\t     /* we have sent connect to destination already, but didn\'t get 
an answer.\n"
   "9565\t     Stack will be able to support this in next version */\n"
   "9566\t     CHANGE_STATE(CAL_WAIT_DEST_DISCONNECT, \"applica"
<- "tion initiated disconnection of destination\");\n"
   "9567\t     CL.destState = DEST_APP_INITIATED_DISCONNECT;\n"
   "9568\t     CL.round=HUNT_DONE;\n"
   "9569\t     if(IS_ARQ_DEST)\n"
   "9570\t       ARJ(CL.DEST.ARQ, cmRASReasonUndefined, cl, DESTINATION);\n"
   "9571\t     if (CL.DEST.stack!=(HCALL)NULL)\n"
   "9572\t     {\n"
   "9573\t       if(!sendMsgEvent(cl, gkcciMsgSendDisconnect, gkcciSideDest))\n"
   "9574\t       {       \n"
   "9575\t         CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8686, cl, \"calAppDisconnectDestination: Failed in sending disconnect send 
message notification for destination\"));     \n"
   "9576\t       }\n"
   "9577\t       if (((CL.DEST.state!=cmCallStateDisconnected) && 
(CL.DEST.state!=cmCallStateIdle)) ||\n"
   "9578\t         ((CL.DEST.state==cmCallStateIdle) && (CL.setupSend)))\n"
   "9579\t       {\n"
   "9580\t\n"
   "9581\t\t\t\t\t /* let the app hook to the disconnect message before sending 
it - NL_9_26 */\n"
   "9582\t\t\t\t\t hookToCall((gkHCALL)CL.handle, (gkHAPPCALL *)&CL.appHandle, 
CL.DEST.stack,\n"
   "9583\t\t\t\t\t\t(HRAS)GKCCI_NO_HSRAS,  gkcciMsgSendDisconnect, 
gkcciSideDest);\n"
   "9584\t\n"
   "9585\t         if(callDropParam(cl, DESTINATION,CL.DEST.stack,cmRsn)!=0)\n"
   "9586\t           CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8687, cl,\"error in disconnecting destination\"));\n"
   "9587\t       }\n"
   "9588\t     }\n"
   "9589\t     return gkcciOK;\n"
   "9590\t   }\n"
   "9591\t            \n"
   
"9592\t/*----------------------------------------------------------------------------*/\n"
   "9593\t   BOOL calCentralizedShutdown()/*closes all call stack handles and 
frees calls*/\n"
   "9594\t     \n"
   "9595\t   {\n"
   "9596\t     int cl = -1;\n"
   "9597\t     BOOL success=TRUE;\n"
   "9598\t     CALL_NOTIFY(\"centralized closing of all call stack handles and 
freeing calls\",GEN_NA,10,cl);\n"
   "9599\t     for (cl=0;cl<globalMaxCalls;cl++)\n"
   "9600\t       if (!VACENT(cl))\n"
   "9601\t       {\n"
   "9602\t         /* Possibly call is being disconnected and DRQ timers have 
been set.\n"
   "9603\t            Kill timers if they exist and free call */\n"
   "9604\t         gkTiTimerKill(expectDRQTOForOrigin, (void*)cl);\n"
   "9605\t         gkTiTimerKill(expectDRQTOForDest, (void*)cl);\n"
   "9606\t         success = freeCall(cl) && success;\n"
   "9607\t       }\n"
   "9608\t       return success;\n"
   "9609\t   }\n"
   "9610\t\n"
   
"9611\t/*----------------------------------------------------------------------------*/\n"
   "9612\t   INT32 calDisengageEndpoint(/*drops and sende drq to all calls in 
which endpoint is involved */\n"
   "9613\t     IN   gkHREG                    hReg,\n"
   "9614\t     IN   gkcciDisconnectReason_t   originReason,\n"
   "9615\t     IN   gkcciDisconnectReason_t   destinationReason)\n"
   "9616\t     \n"
   "9617\t   {\n"
   "9618\t     UINT16 reg;\n"
   "9619\t     /* find the corresponding registration */\n"
   "9620\t     if (!rgtblDecodeAndCheckRegHandle(hReg, &reg))\n"
   "9621\t       return gkcciInvalidHandle;\n"
   "9622\t\t return calDisengageReg(reg,originReason,destinationReason);     \n"
   "9623\t   }\n"
   "9624\t\n"
   
"9625\t/*----------------------------------------------------------------------------*/\n"
   "9626\t  INT32 calDisengageReg(/*drops and sende drq to all calls in which 
endpoint is involved */\n"
   "9627\t     IN   UINT16                    reg,\n"
   "9628\t     IN   gkcciDisconnectReason_t   originReason,\n"
   "9629\t     IN   gkcciDisconnectReason_t   destinationReason)\n"
   "9630\t     \n"
   "9631\t   {\n"
   "9632\t     gkcciReturnValue_t retCode = gkcciOK;\n"
   "9633\t     int cl;\n"
   "9634\t     \n"
   "9635\t     GK_NOTIFY(\"gk sending disengage requests to all calls of 
reg\",reg,10);\n"
   "9636\t     for (cl=0;cl<globalMaxCalls-1;cl++)\n"
   "9637\t     {\n"
   "9638\t       if (CL.ORIG.reg == reg || CL.DEST.reg == reg)\n"
   "9639\t         if (!disengageCall(cl,originReason,destinationReason))\n"
   "9640\t           retCode = gkcciGKFailure;\n"
   "9641\t     }\n"
   "9642\t     return retCode; \n"
   "9643\t   }\n"
   "9644\t\n"
   
"9645\t/*----------------------------------------------------------------------------*/\n"
   "9646\t   void calResetRegInCalls(/*resets the reg field in all calls in 
which reg is involved */\n"
   "9647\t     IN   UINT16 reg)\n"
   "9648\t   {\n"
   "9649\t     int cl;\n"
   "9650\t     \n"
   "9651\t     for (cl=0;cl<globalMaxCalls-1;cl++)\n"
   "9652\t\t\t {\n"
   "9653\t       if (CL.ORIG.reg == reg)\n"
   "9654\t\t\t\t\t CL.ORIG.reg = RGTBL_REG_NOT_VALID;\n"
   "9655\t\t\t\t if (CL.DEST.reg == reg)\n"
   "9656\t\t\t\t\t CL.DEST.reg = RGTBL_REG_NOT_VALID;\n"
   "9657\t\t\t }\n"
   "9658\t   }\n"
   "9659\t\n"
   "9660\t\n"
   "9661\t\n"
   "9662\t/*------------------------------------------------"
<- "----------------------------*/\n"
   "9663\t   BOOL calZoneDisengage(/*drops and sende drq to all endpoints that 
are engaged*/\n"
   "9664\t     IN   gkcciDisconnectReason_t   originReason,\n"
   "9665\t     IN   gkcciDisconnectReason_t   destinationReason)\n"
   "9666\t     \n"
   "9667\t   {\n"
   "9668\t     BOOL status = TRUE;\n"
   "9669\t     int cl;\n"
   "9670\t     GK_NOTIFY(\"gk sending disengage requests to all calls in 
zone\",GEN_NA,10);\n"
   "9671\t     for (cl=0;cl<globalMaxCalls-1;cl++)\n"
   "9672\t     {\n"
   "9673\t       if (CL.state != CAL_NO_CALL && CL.state != CAL_APP_HANDLE)\n"
   "9674\t         status = disengageCall(cl,originReason,destinationReason) && 
status;\n"
   "9675\t     }\n"
   "9676\t     return status; \n"
   "9677\t   }\n"
   
"9678\t/*----------------------------------------------------------------------------*/\n"
   "9679\t   BOOL disengageCall( /* disconnect call using H323 messages */\n"
   "9680\t                      IN int cl,\n"
   "9681\t                      IN gkcciDisconnectReason_t 
disconnectReasonOrig,\n"
   "9682\t                      IN gkcciDisconnectReason_t 
disconnectReasonDest)\n"
   "9683\t   {\n"
   "9684\t     cmReasonType cmReasonOrig,cmReasonDest;\n"
   "9685\t\n"
   "9686\t     disconnectRsnApp2CM(cl,&cmReasonOrig,disconnectReasonOrig);\n"
   "9687\t     disconnectRsnApp2CM(cl,&cmReasonDest,disconnectReasonDest);\n"
   "9688\t     return 
stopCall(cl,CL.reason,cmReasonOrig,cmReasonDest,cmRASReasonUndefined);\n"
   "9689\t   }                \n"
   
"9690\t/*----------------------------------------------------------------------------*/
 \n"
   "9691\t\n"
   "9692\t   /* stop the call according to its state.NOTE that this function 
also ensures to\n"
   "9693\t\t\t\tinform the application about disconnecting the call. Local 
function */\n"
   "9694\t   BOOL stopCall(\n"
   "9695\t     IN int           cl, \n"
   "9696\t     IN calReason_t   reason,\n"
   "9697\t     IN cmReasonType  disconnectOrigReason,\n"
   "9698\t     IN cmReasonType  disconnectDestReason,\n"
   "9699\t     IN cmRASReason   ARJReason)\n"
   "9700\t   {\n"
   "9701\t     BOOL retCode = TRUE;\n"
   "9702\t     BOOL sendDisconnectMessage = TRUE;\n"
   "9703\t\t\n"
   "9704\t\t   if (CL.state == CAL_APP_HANDLE || CL.state == CAL_NO_CALL)\n"
   "9705\t\t     return FALSE;\n"
   "9706\t\n"
   "9707\t     CL.reason = reason;\n"
   "9708\t     if(IS_ARQ_ORIG)\n"
   "9709\t     {\t\n"
   "9710\t       CALL_NOTIFY(\"Sending notification to the application before 
disconnecting\",GEN_NA, 31,cl);\n"
   "9711\t       if(!sendStateEvent(cl, gkcciSttGKDisconnectCall,  
getAppReason(cl)))\n"
   "9712\t       {\n"
   "9713\t\t\t\t\t\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8688, cl,\"disconnectCall: Failed in sending disconnect 
notification to the application\"));\n"
   "9714\t       }\n"
   "9715\t       sendDisconnectMessage = FALSE;\n"
   "9716\t       return ARJ(CL.ORIG.ARQ,ARJReason,cl,ORIGIN);\n"
   "9717\t     }\n"
   "9718\t     if(IS_ARQ_DEST)\n"
   "9719\t     {\n"
   "9720\t       CL.round = HUNT_DONE;\n"
   "9721\t       CALL_NOTIFY(\"Sending notification to the application before 
disconnecting\",GEN_NA, 31,cl);\n"
   "9722\t       if(!sendStateEvent(cl, gkcciSttGKDisconnectCall,  
getAppReason(cl)))\n"
   "9723\t       {\n"
   "9724\t\t\t\t\t\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8689, cl,\"disconnectCall: Failed in sending disconnect 
notification to the application\"));\n"
   "9725\t       }\n"
   "9726\t       sendDisconnectMessage = FALSE;\n"
   "9727\t       retCode = ARJ(CL.DEST.ARQ, ARJReason, cl, DESTINATION);\n"
   "9728\t       if (CL.model == cmRASCallModelTypeDirect)\n"
   "9729\t\t\t\t\t\t\t\t\t\treturn retCode;\n"
   "9730\t     }\n"
   "9731\t\n"
   "9732\t     /* in one sided call originated from the GK there will be no 
stack events */\n"
   "9733\t     /* if address resolution phase fails. */\n"
   "9734\t     if (CL.sideMap == ONE_SIDE_DEST && CL.DEST.stack != NULL && 
CL.DEST.state==cmCallStateIdle) \n"
   "9735\t       return disconnectCall(cl, 
disconnectOrigReason,disconnectDestReason,\n"
   "9736\t       UNDEFINED_DROP_CAUSE, UNDEFINED_DROP_CAUSE, 
sendDisconnectMessage);\n"
   "9737\t\n"
   "9738\t\n"
   "9739\t\n"
   "9740\t\n"
   "9741\t     if (((CL.ORIG.stack) && (CL.ORIG.state!=cmCallStateDisconnected) 
&& (CL.ORIG.state!=cmCallStateIdle)) || \n"
   "9742\t       ((CL.DEST.stack) && (CL.DEST.state!=cmCallStateDisconnected) 
&& (CL.DEST.state!=cmCallStateIdle)))\n"
   "9743\t       return disconnectCall(cl, 
disconnectOrigReason,disconnectDestReason,\n"
   "9744\t       UNDEFINED_DROP_CAUSE, UNDEFINED_DROP_CAUSE, 
sendDisconnectMessage);\n"
   "9745\t     else\n"
   "9746\t     {\n"
   "9747\t       CALL_NOTIFY(\"Sending notification to the application before 
disconnecting\",GEN_NA, 31,cl);\n"
   "9748\t       if(!sendStateEvent(cl, gkcciSttGKDisconnectCall,  
getAppReason(cl)))\n"
   "9749\t       {\n"
   "9750\t\t\t\t\t\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8690, cl,\"disconnectCall: Failed in sending disconnect 
notification to the application\"));\n"
   "9751\t       }\n"
   "9752\t       sendDisconnectMessage = FALSE;\n"
   "9753\t     }\n"
   "9754\t\n"
   "9755\t     if (CL.ORIG.ARQ || CL.DEST.ARQ)\n"
   "9756\t     {\n"
   "9757\t       if (!(retCode = sendDRQ(cl)))\n"
   "9758\t\t\t\t {\n"
   "9759\t\t\t\t\t if (CL.ORIG.stack)\n"
   "9760\t\t\t\t\t\t teardownCall(cl, ORIGIN);\n"
   "9761\t\t\t\t\t if (CL.DEST.stack)\n"
   "9762\t\t\t\t\t\t teardownCall(cl, DESTINATION);\n"
   "9763\t\t\t\t }\n"
   "9764\t     }\n"
   "9765\t\n"
   "9766\t     else\n"
   "9767\t     if (!CL.ORIG.stack && !CL.DEST.stack) \n"
   "9768\t     {\n"
   "9769\t       CHANGE_STATE(CAL_APP_HANDLE, \"wait for the application to 
free call\");\n"
   "9770\t       if(!sendStateEvent(cl,gkcciSttIdle,gkcciRsnUndefined))\n"
   "9771\t       {\n"
   "9772\t         CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8698, cl,\"stopCall: Failed in sending idle request to the application\"));\n"
   "9773\t         CL.reason = RSN_FAILURE_EVENT_HANDLER;\n"
   "9774\t         (void)freeCall(cl);\n"
   "9775\t         return FALSE;\n"
   "9776\t       }           \n"
   "9777\t     }\n"
   "9778\t\n"
   "9779\t\n"
   "9780\t     return retCode;\n"
   "9781\t   }\n"
   
"9782\t/*----------------------------------------------------------------------------*/\n"
   "9783\tBOOL closeCall(/*if cl.side has open BRQ then they are handled and 
then closeCallHandle is called.\n"
   "9784\t                      FALSE returned if cl is invalid*/\n"
   "9785\t                      IN int cl,\n"
   "9786\t                      IN side_t side)\n"
   "9787\t{\n"
   "9788\t  HRAS hsRas;\n"
   "9789\t  BOOL success = TRUE;\n"
   "9790\t  if (!VALID(cl))\n"
   "9791\t  {\n"
   "9792\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8691, 
cl,\"closeCall called with invalid call\"));\n"
   "9793\t    return FALSE;\n"
   "9794\t  }\n"
   "9795\t  while(bwBRQFifoPop(&(CL.SIDE.bw.fifo),&hsRas))/*precedes BRJ so BRJ 
wont pop and handle these BRQ\'s*/\n"
   "9796\t  {\n"
   "9797\t  /*since app didn\'t receive any notification of these BRQ\'s they 
are closed\n"
   "9798\t    without sending a message to application - for app they are 
unexistant. Yet, they still seserve\n"
   "9799\t\t\ta hook. NL9_26*/\n"
   "9800\t    CALL_NOTIFY(\"BRJ to BRQ from BRQ que\",GEN_NA,10,cl);\n"
   "9801\t\t\tif (!bwBRJ(NOT_CALL,side,hsRas,cmRASReasonUndefined))\n"
   "9802\t\t\t\tsuccess = FALSE;\n"
   "9803\t  }\n"
   "9804\t  if (CL.SIDE.bw.hsRas != NULL)\n"
   "9805\t    if (!bwBRJ(cl,side,CL.SIDE.bw.hsRas,cmRASReasonUndefined))\n"
   "9806\t    {\n"
   "9807\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8692, cl,\"BRJ failed in function closeCall\"));\n"
   "9808\t      success = FALSE;\n"
   "9809\t    }\n"
   "9810\t    if (!closeCallHandle(CL.SIDE.stack,NULL))\n"
   "9811\t\t\t\t\t\t\tsuccess = FALSE;\n"
   "9812\t    return success;\n"
   "9813\t}\n"
   "9814\t\n"
   
"9815\t/*----------------------------------------------------------------------------*/\n"
   "9816\t   void clearCall( /* clear call */\n"
   "9817\t     IN int cl)\n"
   "9818\t   {\n"
   "9819\t     CALL_NOTIFY(\"clearing\",GEN_NA,10,cl);\n"
   "9820\t     CHANGE_STATE(CAL_NO_CALL,\"Clear Call\");\n"
   "9821\t\t if (CL.mcastLRQ)\n"
   "9822\t\t   gkTiTimerKill(calLRQaudit, (void*)cl);\n"
   "9823\t     memDeleteRecord(&memHandler, CL.appMemblockHandle); \n"
   "9824\t     memset(&(CL),0,sizeof(callInfo_t));\n"
   "9825\t     CL.ORIG.callNo=CL.DEST.callNo=cl;\n"
   "9826\t     CL.ORIG.dropReason = CL.DEST.dropReason = 
cmReasonTypeUndefinedReason;\n"
   "9827\t     CL.ORIG.dropCause = CL.DEST.dropCause = UNDEFINED_DROP_CAUSE; /* 
xyx I put 16 since I don\'t have enum for that */\n"
   "9828\t     CL.ORIG.reg=CL.DEST.reg=RGTBL_REG_NOT_VALID;\n"
   "9829\t     
CL.ORIG.endpointType=CL.DEST.endpointType=cmEndpointTypeUndefined;\n"
   "9830\t     CL.ORIG.state=CL.DEST.state=cmCallStateIdle;\n"
   "9831\t     
CL.ORIG.bw.recommendedReply=CL.DEST.bw.recommendedReply=nextBWReplyNone;\n"
   "9832\t     bwBRQFifoInit(&(CL.ORIG.bw.fifo));\n"
   "9833\t     bwBRQFifoInit(&(CL.DEST.bw.fifo));\n"
   "9834\t     CL.ORIG.facility.mostRecent = CL.DEST.facility.mostRecent = 
INVALID_FACILITY_HANDLE;\n"
   "9835\t     CL.ORIG.facility.beingSent = CL.DEST.facility.beingSent = 
INVALID_FACILITY_HANDLE;\n"
   "9836\t     CL.ORIG.infoMsg.mostRecent = CL.DEST.infoMsg.mostRecent = 
INVALID_INFO_MSG_HANDLE;\n"
   "9837\t     CL.ORIG.infoMsg.beingSent = CL.DEST.infoMsg.beingSent = 
INVALID_INFO_MSG_HANDLE;\n"
   "9838\t     CL.ORIG.ARJReason = CL.DEST.ARJReason = gkcciARJRsnUndefined;\n"
   "9839\t     CL.ORIG.disconnectReason = CL.DEST.disconnectReason = 
gkcciDisconnectRsnUndefined;\n"
   "9840\t     CL.state=CAL_NO_CALL;\n"
   "9841\t     CL.service=NET3_NOT_SERVICE;\n"
   "9842\t     CL.callService = SRV_INVALID_SERV;              \n"
   "9843\t     CL.servicePlace=DESTINATION_NUMBER+1;\n"
   "9844\t     CL.infoSrc=NO_INFORMATION;\n"
   "9845\t     CL.model=cmRASCallModelTypeDirect;\n"
   "9846\t     CL.appHandle=(gkHAPPCALL)0;\n"
   "9847\t     CL.reason=RSN_NO_RSN;\n"
   "9848\t     CL.isARQ=NO_ARQ;\n"
   "9849\t     CL.addressChange = CHNG_NO_CHNG;\n"
   "9850\t     CL.destState = DEST_NOT_CONNECTED;\n"
   "9851\t     CL.previousState = CAL_NO_CALL;\n"
   "9852\t     CL.setupArrived =FALSE;\n"
   "9853\t     CL.setupSend =FALSE;\n"
   "9854\t     CL.setupPending =FALSE;\n"
   "9855\t     CL.connectPending =FALSE;\n"
   "9856\t     CL.alertingPending =FALSE;\n"
   "9857\t     CL.appDisconnectReason = gkcciReplyRsnUndefined;\n"
   "9858\t     CL.appLineHuntingIndex = -1; \n"
   "9859\t     CL.appMemblockHandle = INVALID_CELL;\n"
   "9860\t     CL.gksusHandle=(gkHSuS)GKCCI_NO_GKSuS_HANDLE;\n"
   "9861\t     CL.resolvedIdx = -1;\n"
   "9862\t\t\tCL.lhPass=1;\n"
   "9863\t     CL.lhGwServicePass=1;\n"
   "9864\t\t\tCL.nextScan = RGTBL_REG_NOT_VALID;\n"
   "9865\t\t\tCL.nextGwServiceScan = SRV_INVALID_SUPP;\n"
   "9866\t        CL.sendingCompleteFlag=FALSE;\n"
   "9867\t   }\n"
   "9868\t\n"
   
"9869\t/*----------------------------------------------------------------------------*/\n"
   "9870\tBOOL teardownCall(/*pending aggressive call shut down */\n"
   "9871\t\t\t  IN int cl,\n"
   "9872\t\t\t  IN side_t side)\n"
   "9873\t  \n"
   "9874\t{\n"
   "9875\t  BOOL error=FALSE;\n"
   "9876\t  \n"
   "9877\t  if (side == ORIGIN) \n"
   "9878\t    CALL_NOTIFY(\"disengaging origin\",GEN_NA,30,cl);\n"
   "9879\t  if (side == DESTINATION) \n"
   "9880\t       CALL_NOTIFY(\"disengaging destination\",GEN_NA,30,cl);\n"
   "9881\t  if (!VALID(cl))\n"
   "9882\t  {\n"
   "9883\t    CALL_NOTIFY(\"disengage for invalid call\",GEN_NA,30,cl);\n"
   "9884\t    return !error;\n"
   "9885\t  }\n"
   "9886\t  releaseARQ(cl,side);\n"
   "9887\t  CL.round=HUNT_DONE;\n"
   "9888\t     \n"
   "9889\t     \n"
   "9890\t  if ( (CL.model== cmRASCallModelTypeDirect) || \n"
   "9891\t       (CL.state == CAL_RAS_CONNECT)         || \n"
   "9892\t       (CL.state == CAL_LRQ_SENT)            ||\n"
   "9893\t       (CL.state == CAL_WAIT_ADDRCMPLT) )\n"
   "9894\t  {\n"
   "9895\t    if (CL.SIDE.stack != NULL)\n"
   "9896\t    {\n"
   "9897\t      if(!sendMsgEvent(cl, gkcciMsgSendDisconnect, (side == 
ORIGIN?gkcciSideOrig:gkcciSideDest)))\n"
   "9898\t      {       \n"
   "9899\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8693, 
cl, \"teardownCall: Failed in sending disconnect send message notification to 
application\"));\n"
   "9900\t      }\n"
   "9901\t\n"
   "9902\t      /* let the app hook to the disconnect message before sending it 
- NL_9_26 */\n"
   "9903\t      hookToCall((gkHCALL)CL.handle, (gkHAPPCALL *)&CL.appHandle, 
CL.SIDE.stack,\n"
   "9904\t\t\t (HRAS)GKCCI_NO_HSRAS,  gkcciMsgSendDisconnect, (side == 
ORIGIN?gkcciSideOrig:gkcciSideDest));\n"
   "9905\t\n"
   "9906\t      error=((callDropParam(cl, 
side,CL.SIDE.stack,cmReasonTypeUndefinedReason)!=0) || error);\n"
   "9907\t    }\n"
   "9908\t    else return !error;\n"
   "9909\t  }\n"
   "9910\t  else /* indirect */\n"
   "9911\t    if ((CL.state == CAL_EXPECTING_DRQ) || (CL.state 
==CAL_EXPECTING_DRQ_TO_HUNT) ) \n"
   "9912\t    {\n"
   "9913\t      if (side==ORIGIN)\n"
   "9914\t\terror=(!terminateOrigin(cl))||error;\n"
   "9915\t      else\n"
   "9916\t\terror=(!terminateDestination(cl))||error;  \n"
   "9917\t    }\n"
   "9918\t  return !error;\n"
   "9919\t}\n"
   "9920\t   \n"
   
"9921\t/*----------------------------------------------------------------------------*/
            \n"
   "9922\t   BOOL disconnectCall(/* initiate call disconnect sequnce */\n"
   "9923\t     IN int cl,\n"
   "9924\t     IN cmReasonType origReason,\n"
   "9925\t     IN cmReasonType destReason,\n"
   "9926\t     IN int\t\t\torigCause,\n"
   "9927\t     IN int\t\t\tdestCause,\n"
   "9928\t     IN BOOL gkInitiated)\n"
   "9929\t   {\n"
   "9930\t     BOOL error=FALSE;\n"
   "9931\t#if 1\n"
   "9932\t    guid_t\tconf_id;\n"
   "9933\t    int \ti=0;\n"
   "9934\t    HPROTCONN\thConn=NULL;\n"
   "9935\t    struct gk_to_mc_msg\tour_msg;\n"
   "9936\t#endif\n"
   "9937\t\n"
   "9938\t     /* SA_450_TR this function is not suitable for splited calls 
*/\n"
   "9939\t     if (CALL_IS_EMPTY(cl)) return FALSE;\n"
   "9940\t     \n"
   "9941\t\t/* AVI  7/2000 */\n"
   "9942\t\t/* check that a call was to a service, and was connected */\n"
   "9943\t\t/* and if so, do the clean up */\n"
   "9944\t\n"
   "9945\t\tif (CL.state == CAL_CONNECT) {\n"
   "9946\t\t\t\t\t\n"
   "9947\t\t\tif (ConferenceHunt"
<- "ingService(cl)) {\n"
   "9948\t\t\t\tdisconnectCallMCUHash(cl);\n"
   "9949\t\t\t\t/* printHash(); */\n"
   "9950\t\t\t}\n"
   "9951\t\t}\n"
   "9952\t\n"
   "9953\t     /* newnaomi. I must change state here, because when we\'ll have 
pipes\n"
   "9954\t     the application might return with some action after the call was 
\n"
   "9955\t     disconnected */\n"
   "9956\t     CL.round=HUNT_DONE;\n"
   "9957\t     CALL_NOTIFY(\"disconnecting\",GEN_NA,10,cl);\n"
   "9958\t     CHANGE_STATE(CAL_DISCONNECT, \"call was disconnected\");\n"
   "9959\t     \n"
   "9960\t     if(gkInitiated)\n"
   "9961\t     {\n"
   "9962\t     /* inform the application about disconnectiong the call. Don\'t 
wait up.\n"
   "9963\t       Because no answer is needed I can do it in the middle of the 
function. */\n"
   "9964\t       CALL_NOTIFY(\"Sending notification to the application before 
disconnecting\",GEN_NA, 31,cl);\n"
   "9965\t       if(!sendStateEvent(cl, gkcciSttGKDisconnectCall,  
getAppReason(cl)))\n"
   "9966\t       {\n"
   "9967\t         CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8694, cl,\"disconnectCall: Failed in sending disconnect notification to the 
application\"));\n"
   "9968\t       }        \n"
   "9969\t     }\n"
   "9970\t     \n"
   "9971\t/* Start sohan */\n"
   "9972\t// Trigger from GK to MC on a disconnect\n"
   "9973\t// Call send_endpoint_info \n"
   "9974\t#if 1\n"
   "9975\t\tif ((hConn = cmGetTpktChanHandle (CL.ORIG.stack, 
cmQ931TpktChannel)) != NULL)\t\n"
   "9976\t\t{\n"
   "9977\t\t\tUINT32\t\tip=0;\n"
   "9978\t\t\tUINT16\t\tport=0;\t\n"
   "9979\t\t\tcmGetTpktChanIpPort(hConn, &ip, &port);\n"
   "9980\t\t\t\tsprintf(message, \"CL.ORIG.stack (0x%X) - ip (%s), port(%d)\", 
\n"
   "9981\t\t\tCL.ORIG.stack, gkaddIp2String(ip, ip_address),port);\n"
   "9982\t\t\tgenNotify(message, GEN_NA, 10);\n"
   "9983\t\t\tour_msg.src_ip = ip;\n"
   "9984\t\t}\n"
   "9985\t\tour_msg.event = DISCONNECT;\n"
   "9986\t\tour_msg.mcHConf = (UINT32)CL.mcConfHandle;\n"
   "9987\t\tour_msg.src_mc_call_handle = CL.ORIG.mcCallHandle;\n"
   "9988\t        
strncpy(our_msg.src_number,addAliasToString(&(CL.srcInfo[0])), 
MAX_NUMBER_SIZE);\n"
   "9989\t\tour_msg.dest_mc_call_handle = CL.DEST.mcCallHandle;\n"
   "9990\t        
strncpy(our_msg.dest_number,addAliasToString(&(CL.destInfo[0])), 
MAX_NUMBER_SIZE);\n"
   "9991\t\tour_msg.dest_ip = CL.destCallSignal.ip;\n"
   "9992\t\tmemcpy(our_msg.conf_id, CL.cid, GUID_LEN);\t\n"
   "9993\t\tour_msg.gkHCall = (UINT32)CL.handle;\n"
   "9994\t\tour_msg.call_index = cl;\n"
   "9995\t\n"
   "9996\t        CALL_NOTIFY(\"!!!(DISCONNECT) calling 
send_endpoint_info!!!\", GEN_NA,10,cl);\n"
   "9997\t  \tsend_endpoint_info_to_mc(&our_msg);\n"
   "9998\t/* End   sohan */ \n"
   "9999\t#endif\n"
   "10000\t     if (CL.ORIG.stack!=(HCALL)NULL)\n"
   "10001\t     {\n"
   "10002\t       if (((CL.ORIG.state!=cmCallStateDisconnected) && 
(CL.ORIG.state!=cmCallStateIdle)) ||\n"
   "10003\t         (CL.state == CAL_WAIT_ADDRCMPLT))\n"
   "10004\t       {\n"
   "10005\t         if(!sendMsgEvent(cl, gkcciMsgSendDisconnect, 
gkcciSideOrig))\n"
   "10006\t         {       \n"
   "10007\t           CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8695, cl, \"disconnectCall: Failed in sending disconnect 
send message notification for origin\"));\n"
   "10008\t         }\n"
   "10009\t         
cmCallSetParam(CL.ORIG.stack,cmParamReleaseCompleteCause,0,origCause,NULL);\n"
   "10010\t\n"
   "10011\t\t\t\t\t /* let the app hook to the disconnect message before 
sending it - NL_9_26 */\n"
   "10012\t\t\t\t\t hookToCall((gkHCALL)CL.handle, (gkHAPPCALL *)&CL.appHandle, 
CL.ORIG.stack,\n"
   "10013\t\t\t\t\t\t(HRAS)GKCCI_NO_HSRAS,  gkcciMsgSendDisconnect, 
gkcciSideOrig);\n"
   "10014\t\n"
   "10015\t         error=(callDropParam(cl, 
ORIGIN,CL.ORIG.stack,origReason)!=0) || error;\n"
   "10016\t         CALL_NOTIFY(\"dropping origin \",GEN_NA,20,cl);\n"
   "10017\t       }\n"
   "10018\t     }\n"
   "10019\t\n"
   "10020\t     /* Support call disconnect during failure of address resolution 
or line hunting */\n"
   "10021\t     /* for a GK initiated one-sided call */\n"
   "10022\t     if (CL.sideMap == ONE_SIDE_DEST && 
CL.DEST.state==cmCallStateIdle) \n"
   "10023\t         return terminateDestination(cl);\n"
   "10024\t\n"
   "10025\t     if (CL.DEST.stack!=(HCALL)NULL)\n"
   "10026\t     {\n"
   "10027\t       if (((CL.DEST.state!=cmCallStateDisconnected) && 
(CL.DEST.state!=cmCallStateIdle)) \n"
   "10028\t         || ((CL.setupSend) && (CL.DEST.state==cmCallStateIdle)))\n"
   "10029\t         \n"
   "10030\t       {\n"
   "10031\t         if(!sendMsgEvent(cl, gkcciMsgSendDisconnect, 
gkcciSideDest))\n"
   "10032\t         {       \n"
   "10033\t           CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8696, cl, \"disconnectCall: Failed in sending disconnect 
send message notification for destination\"));\n"
   "10034\t         }\n"
   "10035\t         
cmCallSetParam(CL.DEST.stack,cmParamReleaseCompleteCause,0,destCause,NULL);\n"
   "10036\t\n"
   "10037\t\t\t\t\t /* let the app hook to the disconnect message before 
sending it - NL_9_26 */\n"
   "10038\t\t\t\t\t hookToCall((gkHCALL)CL.handle, (gkHAPPCALL *)&CL.appHandle, 
CL.DEST.stack,\n"
   "10039\t\t\t\t\t\t(HRAS)GKCCI_NO_HSRAS,  gkcciMsgSendDisconnect, 
gkcciSideDest);\n"
   "10040\t\n"
   "10041\t         error=(callDropParam(cl, 
DESTINATION,CL.DEST.stack,destReason)!=0);\n"
   "10042\t\t\t CALL_NOTIFY(\"dropping destination\",GEN_NA,20,cl);\n"
   "10043\t       }\n"
   "10044\t     }\n"
   "10045\t\n"
   "10046\t     return !error;\n"
   "10047\t   }\n"
   "10048\t   \n"
   
"10049\t/*-----------------------------------------------------------------------------\n"
   "10050\tfreeBackupCall  (sarit 23/5/00)\n"
   "10051\t--------------\n"
   "10052\tGets a call record, checks if this call has a backup record and if 
so, free \n"
   "10053\tthe backup and decrease the number of used backups\n"
   
"10054\t------------------------------------------------------------------------------*/\n"
   "10055\tstatic BOOL freeBackupCall(IN int cl) {\n"
   "10056\t\tint back = -1; /*the index for the backup record*/\n"
   "10057\t\t/*there is no back up*/\n"
   "10058\t\tif(calls[cl].hBackup == NULL) \n"
   "10059\t\t\treturn FALSE;\n"
   "10060\t\t/*getting the backup index*/\n"
   "10061\t\tif (!getCallCheckAuth((UINT32)calls[cl].hBackup, &back))\n"
   "10062\t\t\t\treturn FALSE;\n"
   "10063\t\tclearCall(back);  \n"
   "10064\t\tusedBackups--;\n"
   "10065\t\treturn TRUE;\n"
   "10066\t}\n"
   "10067\t\n"
   
"10068\t/*----------------------------------------------------------------------------*/
            \n"
   "10069\tBOOL freeCall(/*free call resources */\n"
   "10070\t\t\t\t  IN int cl) {\n"
   "10071\t    BOOL success=TRUE;\n"
   "10072\t\tint i;\n"
   "10073\t\tnetpCall_t demandCall=1;\n"
   "10074\t\tBOOL pli;\n"
   "10075\t\t\n"
   "10076\t\tCALL_NOTIFY(\"freeing\",GEN_NA,45,cl);\n"
   "10077\t\tclearSuppServBuffer(cl, DESTINATION);\n"
   "10078\t\tclearSuppServBuffer(cl, ORIGIN);\n"
   "10079\t\tif (CL.ORIG.stack!=NULL)\n"
   "10080\t\t\tsuccess=closeCall(cl,ORIGIN); \n"
   "10081\t\tif (CL.DEST.stack!=NULL)\n"
   "10082\t\t\tsuccess=closeCall(cl,DESTINATION) && success;\n"
   "10083\t\tbwFreeBandwidthOfCall(cl,ORIGIN);\n"
   "10084\t\tbwFreeBandwidthOfCall(cl,DESTINATION);\n"
   "10085\t\tfor (i=0; i<DESTINATION_NUMBER;i++)\n"
   "10086\t\t{\n"
   "10087\t\t\tcmuFreeAlias(&(CL.destInfo[i]));\n"
   "10088\t\t\tcmuFreeAlias(&(CL.destExtra[i]));\n"
   "10089\t\t}\n"
   "10090\t\tfor (i=0;i<SOURCE_NUMBER;i++)\n"
   "10091\t\t\tcmuFreeAlias(&(CL.srcInfo[i]));\n"
   "10092\t\tcmuFreeAlias(&(CL.remoteExtension));\n"
   "10093\t\t cmuFreeAlias(&(CL.callingPartyNumber)); /*sarit 15/6/00 - bug fix 
- free alias*/\n"
   "10094\t\t/*sarit - free the h450 aliases information*/\n"
   "10095\t\tcmuFreeAlias(&(calls[cl].h450Info.transferedFromAlias));\n"
   "10096\t\tcmuFreeAlias(&(calls[cl].h450Info.originalAliases));\n"
   "10097\t\t\n"
   "10098\t\tgkpliIsInitialized(&pli);\n"
   "10099\t\tif (pli)\n"
   "10100\t\t{\n"
   "10101\t\t\tgkpliTransaction transaction;\n"
   "10102\t\t\tgkpliCallTransaction(CL.handle, CL.appState, CL.appReason, 
&transaction);\n"
   "10103\t\t\tgkpliTransactionRemove(&transaction);\n"
   "10104\t\t}\n"
   "10105\t\t\n"
   "10106\t\tfor (i=0;i < INFO_MSG_STORAGE_SIZE;i++)\n"
   "10107\t\t{\n"
   "10108\t\t\tif (!infoMsgDelete(cl, ORIGIN, i))\n"
   "10109\t\t\t\tsuccess = FALSE;\n"
   "10110\t\t\tif (!infoMsgDelete(cl, DESTINATION, i))\n"
   "10111\t\t\t\tsuccess = FALSE;\n"
   "10112\t\t}\n"
   "10113\t\tfor (i=0;i < FACILITY_STORAGE_SIZE;i++)\n"
   "10114\t\t{\n"
   "10115\t\t\tif (!facilityDelete(cl, ORIGIN, i))\n"
   "10116\t\t\t\tsuccess = FALSE;\n"
   "10117\t\t\tif (!facilityDelete(cl, DESTINATION, i))\n"
   "10118\t\t\t\tsuccess = FALSE;\n"
   "10119\t\t}\n"
   "10120\t\tif (cl < globalMaxCalls-1)\n"
   "10121\t\t\tnetpCalls(GEN_FREE,&demandCall);\n"
   "10122\t\t\n"
   "10123\t\tfreeBackupCall(cl); /*23/5/00 sarit - release the back up call 
record is it exists*/\n"
   "10124\t\tclearCall(cl);\n"
   "10125\t\tif (cl != globalMaxCalls-1)\n"
   "10126\t\t\tusedCalls--; /*22/5/00 sarit, decrease number of used regular 
call recoeds*/\n"
   "10127\t\tif (success)\n"
   "10128\t\t{\n"
   "10129\t\t\tCALL_NOTIFY(\"succesfull close\",GEN_NA,40,cl);\n"
   "10130\t\t\treturn TRUE;\n"
   "10131\t\t}\n"
   "10132\t\telse\n"
   "10133\t\t{\n"
   "10134\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8697, 
cl,\"Error in closing the call\"));\n"
   "10135\t\t\treturn FALSE;\n"
   "10136\t\t}\n"
   "10137\t}\n"
   "10138\t\n"
   
"10139\t/*----------------------------------------------------------------------------*/\n"
   "10140\t   BOOL terminateOrigin( /*terminate call from origin event return 
true/false on success */\n"
   "10141\t     IN int cl)\n"
   "10142\t     \n"
   "10143\t   {\n"
   "10144\t     BOOL error=FALSE;\n"
   "10145\t     \n"
   "10146\t     gkTiTimerKill(expectDRQTOForOrigin, (void*)cl);\n"
   "10147\t     if(CL.ORIG.stack != NULL)\n"
   "10148\t       error=!closeCall(cl,ORIGIN);\n"
   "10149\t     CL.ORIG.stack=(HCALL)NULL;\n"
   "10150\t     \n"
   "10151\t     if (CL.DEST.stack==(HCALL)NULL)\n"
   "10152\t     {\n"
   "10153\t       CHANGE_STATE(CAL_APP_HANDLE, \"wait for the application to 
free call\");\n"
   "10154\t       if(!sendStateEvent(cl,gkcciSttIdle,gkcciRsnUndefined))\n"
   "10155\t       {\n"
   "10156\t         CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8698, cl,\"terminateOrigin: Failed in sending idle request to the 
application\"));\n"
   "10157\t         CL.reason = RSN_FAILURE_EVENT_HANDLER;\n"
   "10158\t         (void)freeCall(cl);\n"
   "10159\t         return FALSE;\n"
   "10160\t       }            \n"
   "10161\t     }\n"
   "10162\t\t\t else if (CL.DEST.ARQ != NULL)\n"
   "10163\t\t\t {\n"
   "10164\t\t\t\t CALL_NOTIFY(\"setting expectDRQTOForDest timer (for 
destination)\",GEN_NA,30,cl);\n"
   "10165\t\t\t\t 
gkTiTimerSet(expectDRQTOForDest,(void*)cl,EXPECT_DRQ_TO_DELAY);\n"
   "10166\t       CHANGE_STATE(CAL_EXPECTING_DRQ,\"Origin terminated\");        
        \n"
   "10167\t\n"
   "10168\t\t\t }\n"
   "10169\t\n"
   "10170\t     return !error;\n"
   "10171\t   }\n"
   "10172\t\n"
   
"10173\t/*----------------------------------------------------------------------------*/\n"
   "10174\t   BOOL terminateDestination( /*terminate call from dest event 
return true/false on success */\n"
   "10175\t     IN int cl)\n"
   "10176\t     \n"
   "10177\t   {\n"
   "10178\t     BOOL error = FALSE;\n"
   "10179\t     \n"
   "10180\t     gkTiTimerKill(expectDRQTOForDest,(void*)cl);\n"
   "10181\t\t/*closing destination*/\n"
   "10182\t     if(CL.DEST.stack != NULL)\n"
   "10183\t       error=!closeCall(cl,DESTINATION);\n"
   "10184\t     if (error)\n"
   "10185\t       CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8699, cl,\"Cant close destination side at terminateDestination\"));\n"
   "10186\t     CL.DEST.stack=(HCALL)NULL;\n"
   "10187\t     if ((CL.DEST.ARQ==NULL) && 
(CL.state==CAL_EXPECTING_DRQ_TO_HUNT))\n"
   "10188\t       CHANGE_STATE(CL.previousState,\"resuming previous state after 
DRQ\");\n"
   "10189\t\t\n"
   "10190\t\t/*sarit 15/6/00 - when the destination initialte the 
disconnecting, the origin can \n"
   "10191\t\tbe in state offering or waitAddressAck - in this situation the 
call was not \n"
   "10192\t\tconnected and the core will send cannot complete to the 
application*/\n"
   "10193\t\tif((CL.ORIG.state==cmCallStateOffering || 
CL.ORIG.state==cmCallStateWaitAddressAck)\n"
   "10194\t\t\t&& (CL.state==CAL_WAIT_DEST_DISCONNECT) && (CL.destState == 
DEST_APP_INITIATED_DISCONNECT))\t{ \n"
   "10195\t\t\t/* the application initiated the disconnect on its own. Send 
cannot complete and wait for answer */\n"
   "10196\t\t\tgkcciReason_t reason;\n"
   "10197\t\t\tif (CL.alertingTOExpired) {\n"
   "10198\t\t\t\tCL.alertingTOExpired = FALSE;\n"
   "10199\t\t\t\treason = gkcciRsnNoAnswer;\n"
   "10200\t\t\t}\n"
   "10201\t       else\n"
   "10202\t         reason = gkcciRsnAppDisconnectDestination;\n"
   "10203\t       CALL_NOTIFY(\"Finish disconnecting after application 
initiated disconnect for destination\",GEN_NA, 10,cl);\n"
   "10204\t\n"
   "10205\t       return handleCannotComplete( cl, RSN_APP_DISCONNECT_DEST, 
reason,\n"
   "10206\t         \"The application disconnected the destination\");         
\n"
   "10207\t     }\n"
   "10208\t     \n"
   "10209\t\tif((( CL.state==CAL_WAIT_DEST_ADMISSION) || (CL.state == 
CAL_WAIT_DEST_CONNECT)) &&\n"
   "10210\t\t\t( CL.destState != DEST_APP_DISCONNECTED ))\t{\n"
   "10211\t\t\t /* disconnecting from destination before fully connecting the 
call (not initiated by application) */ \n"
   "10212\t\t\tCALL_NOTIFY(\"Finish disconnecting because of 
destination\",GEN_NA, 10,cl);\n"
   "10213\t\t\t/* switch back to line hunting. Allow for call to continue */\n"
   "10214\t\t\tCHANGE_STATE(CAL_HUNTING,\"resuming hunting after DRQ\");       
\n"
   "10215\t\t}\n"
   "10216\t\tif ((CL.state==CAL_HUNTING) &&  /*sarit 15/6/00 - adding wait 
address ack*/\n"
   "10217\t\t\t    (((CL.ORIG.state==cmCallStateOffering || 
CL.ORIG.state==cmCallStateWaitAddressAck)\n"
   "10218\t\t    \t&& CL.ORIG.stack != (HCALL)NULL) || (CL.sideMap == 
ONE_SIDE_DEST))) {\n"
   "10219\t\t\t/*disconnect destination in hunting */\n"
   "10220\t\t\t/*newnatan23/11.ensures that linehunting will not continue if 
the source dropped*/\n"
   "10221\t\t\tCALL_NOTIFY(\"Hunting for available line after 
disconnecting\",GEN_NA, 10,cl);\n"
   "10222\t\t\treturn checkLineHunting(cl, FALSE);\n"
   "10223\t\t}\n"
   "10224\t\telse  \n"
   "10225\t\t\tif((CL.DEST.ARQ==NULL) &&"
<- " ((CL.state==CAL_WAIT_DEST_CONNECT) || (CL.state==CAL_EXPECTING_DRQ) ||\n"
   "10226\t\t\t\t(CL.state==CAL_WAIT_DEST_ADMISSION )|| (CL.state 
==CAL_WAIT_DEST_DISCONNECT)) &&\n"
   "10227\t\t\t\t(CL.destState == DEST_APP_DISCONNECTED) && \n"
   "10228\t\t\t\t(CL.ORIG.state==cmCallStateOffering || 
CL.ORIG.state==cmCallStateWaitAddressAck)) /* disconnect destination because of 
application reroute */\n"
   "10229\t\t\t\treturn appRerouteCall(cl, CL.appDisconnectReason);\n"
   "10230\t\t\telse /* call disconnected */\n"
   "10231\t\t\t{\n"
   "10232\t\t\t\tif (CL.ORIG.stack==(HCALL)NULL)\n"
   "10233\t\t\t\t{\n"
   "10234\t\t\t\t\tCHANGE_STATE(CAL_APP_HANDLE, \"wait for the application to 
free call\");\n"
   "10235\t\t\t\t\tif(!sendStateEvent(cl, gkcciSttIdle, gkcciRsnUndefined))\n"
   "10236\t\t\t\t\t{\n"
   "10237\t\t\t\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8763, cl,\"terminateDestination: Failed in sending idle request to the 
application\"));\n"
   "10238\t\t\t\t\t\tCL.reason = RSN_FAILURE_EVENT_HANDLER;\n"
   "10239\t\t\t\t\t\t(void)freeCall(cl);\n"
   "10240\t\t\t\t\t\treturn FALSE;\n"
   "10241\t\t\t\t\t}\n"
   "10242\t\t\t\t}\n"
   "10243\t\t\t\telse if (CL.ORIG.ARQ != NULL) /* destination is terminated. 
make sure origin is as well. */\n"
   "10244\t\t\t\t{\n"
   "10245\t\t\t\t\tCALL_NOTIFY(\"setting expectDRQTOForOrigin timer (for 
origin)\",GEN_NA,30,cl);\n"
   
"10246\t\t\t\t\tgkTiTimerSet(expectDRQTOForOrigin,(void*)cl,EXPECT_DRQ_TO_DELAY);\n"
   "10247\t\t\t\t\tCHANGE_STATE(CAL_EXPECTING_DRQ,\"Destination terminated\");  
              \n"
   "10248\t\t\t\t\t\n"
   "10249\t\t\t\t}\n"
   "10250\t\t\t}\n"
   "10251\t\t\t\n"
   "10252\t\treturn !error;\n"
   "10253\t}\n"
   "10254\t\n"
   
"10255\t/*----------------------------------------------------------------------------*/
         \n"
   "10256\tvoid CALLCONV alertingTimerExpired(/* Alerting timer expired. 
Destination has been ringing for\n"
   "10257\t                          allowed seconds. Terminate call to current 
destination and allow\n"
   "10258\t                          application to choose an alternative 
destination */\n"
   "10259\t                          IN void* call)\n"
   "10260\t{\n"
   "10261\t  int cl = (int)call;\n"
   "10262\t  cmReasonType cmRsn;\n"
   "10263\t\n"
   "10264\t  gkTiTimerKill(alertingTimerExpired, call);\n"
   "10265\t  if (!VALID(cl))\n"
   "10266\t  {\n"
   "10267\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 0, 
cl,\"alertingTimerExpired: Invalid call\"));\n"
   "10268\t    return;\n"
   "10269\t  }\n"
   "10270\t  if (CL.state != CAL_HUNTING)\n"
   "10271\t  {\n"
   "10272\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 0, 
cl,\"alertingTimerExpired: Call is not in HUNTING state\"));\n"
   "10273\t    return;\n"
   "10274\t  }\n"
   "10275\t  CHANGE_STATE(CAL_WAIT_DEST_DISCONNECT, \"application initiated 
disconnection of destination\");\n"
   "10276\t  CL.destState = DEST_APP_INITIATED_DISCONNECT;\n"
   "10277\t  CL.round=HUNT_DONE;\n"
   "10278\t  CL.alertingTOExpired = TRUE;\n"
   "10279\t  if(!sendMsgEvent(cl, gkcciMsgSendDisconnect, gkcciSideDest))\n"
   "10280\t  {       \n"
   "10281\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 0, 
cl, \"alertingTimerExpired: Failed in sending disconnect send message 
notification for destination\"));     \n"
   "10282\t  }\n"
   "10283\t  disconnectRsnApp2CM(cl,&cmRsn,CL.DEST.disconnectReason);\n"
   "10284\t\n"
   "10285\t\t/* let the app hook to the disconnect message before sending it - 
NL_9_26 */\n"
   "10286\t\thookToCall((gkHCALL)CL.handle, (gkHAPPCALL *)&CL.appHandle, 
CL.DEST.stack,\n"
   "10287\t\t\t(HRAS)GKCCI_NO_HSRAS,  gkcciMsgSendDisconnect, gkcciSideDest);\n"
   "10288\t\n"
   "10289\t  if(callDropParam(cl, DESTINATION,CL.DEST.stack,cmRsn)!=0)\n"
   "10290\t  {\n"
   "10291\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 0, 
cl,\"alertingTimerExpired: error in disconnecting destination\"));\n"
   "10292\t  }\n"
   "10293\t}\n"
   "10294\t\n"
   
"10295\t/*----------------------------------------------------------------------------*/\n"
   "10296\tBOOL handleCannotComplete( /* sets the state and reason of the call 
and notify the application\n"
   "10297\t                          that the call cannot be completed */\n"
   "10298\t                          IN int cl,\n"
   "10299\t                          IN calReason_t   callRsn,\n"
   "10300\t                          IN gkcciReason_t gkcciRsn,\n"
   "10301\t                          IN char          *rsnStr)\n"
   "10302\t{\n"
   "10303\t  CL.reason = callRsn;\n"
   "10304\t  CHANGE_STATE(CAL_CANNOT_COMPLETE, rsnStr);\n"
   "10305\t  /* we need to send notification to the application and wait for 
its answer */\n"
   "10306\t  if(!sendStateEvent(cl, gkcciSttCannotComplete,  gkcciRsn))\n"
   "10307\t  {       \n"
   "10308\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8764, 
cl, \"handleCannotComplete: Failed in notifing the application about failure in 
completing\"));    \n"
   "10309\t    return FALSE;\n"
   "10310\t  }  \n"
   "10311\t  return TRUE;\n"
   "10312\t}\n"
   "10313\t\n"
   
"10314\t/*----------------------------------------------------------------------------*/\n"
   "10315\tBOOL releaseARQ(\n"
   "10316\t                IN int cl,\n"
   "10317\t                IN side_t side)\n"
   "10318\t                \n"
   "10319\t{\n"
   "10320\t  if (CL.SIDE.ARQ && rgtblValid(CL.SIDE.reg))\n"
   "10321\t  {\n"
   "10322\t    if (!rgtblDecrCallCount(CL.SIDE.reg))\n"
   "10323\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8696, cl, \"releaseARQ: Error in rgtblDecrCallCount\"));\n"
   "10324\t  }\n"
   "10325\t  CL.SIDE.ARQ=(HRAS)NULL;\n"
   "10326\t  CL.isARQ = NO_ARQ; \n"
   "10327\t  return TRUE;\n"
   "10328\t}\n"
   
"10329\t/*----------------------------------------------------------------------------*/\n"
   "10330\t \n"
   "10331\tBOOL appDisconnectDestination( /* the application descided to 
disconnect the\n"
   "10332\t                               destination and reroute the call, 
before \n"
   "10333\t                               sending ACF or connect to the origin. 
local function */\n"
   "10334\t                               IN   int                 cl ,\n"
   "10335\t                               IN   gkcciReplyReason_t  reason)\n"
   "10336\t{\n"
   "10337\t  \n"
   "10338\t  \n"
   "10339\t  CL.destState = DEST_APP_DISCONNECTED;\n"
   "10340\t  CL.round=HUNT_DONE;\n"
   "10341\t  CL.appDisconnectReason = reason;\n"
   "10342\t  \n"
   "10343\t  if(CL.state == CAL_WAIT_DEST_ADMISSION)\n"
   "10344\t  {\n"
   "10345\t    CALL_NOTIFY(\"Application requested ARJ to 
destination\",GEN_NA,10,cl);   \n"
   "10346\t    ARJ(CL.DEST.ARQ, cmRASReasonUndefined, cl, DESTINATION);\n"
   "10347\t  }\n"
   "10348\t  else\n"
   "10349\t    if((CL.state == CAL_WAIT_DEST_CONNECT) || (CL.state == 
CAL_WAIT_DEST_DISCONNECT))\n"
   "10350\t    {\n"
   "10351\t      CALL_NOTIFY(\"Application requested disconnection of 
destination for call \",GEN_NA,10,cl);\n"
   "10352\t      if (CL.DEST.stack!=(HCALL)NULL)\n"
   "10353\t      {\n"
   "10354\t        if ((CL.DEST.state!=cmCallStateDisconnected) && 
(CL.DEST.state!=cmCallStateIdle))\n"
   "10355\t        {\n"
   "10356\t          if(!sendMsgEvent(cl, gkcciMsgSendDisconnect, 
gkcciSideDest))\n"
   "10357\t          {       \n"
   "10358\t            CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8766, cl, \"appDisconnectDestination: Failed in sending 
disconnect send message notification for destination\"));     \n"
   "10359\t          }\n"
   "10360\t\n"
   "10361\t\t\t\t\t\t/* let the app hook to the disconnect message before 
sending it - NL_9_26 */\n"
   "10362\t\t\t\t\t\thookToCall((gkHCALL)CL.handle, (gkHAPPCALL 
*)&CL.appHandle, CL.DEST.stack,\n"
   "10363\t\t\t\t\t\t\t(HRAS)GKCCI_NO_HSRAS,  gkcciMsgSendDisconnect, 
gkcciSideDest);\n"
   "10364\t\n"
   "10365\t          if(callDropParam(cl, 
DESTINATION,CL.DEST.stack,cmReasonTypeUndefinedReason)!=0)\n"
   "10366\t            CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8767, cl,\"error in disconnecting destination\"));\n"
   "10367\t        }\n"
   "10368\t      }\n"
   "10369\t    }\n"
   "10370\t    /* reroute call will be done after terminating destination */\n"
   "10371\t    return TRUE;\n"
   "10372\t}\n"
   "10373\t\n"
   
"10374\t/*----------------------------------------------------------------------------*/\n"
   "10375\tBOOL appConfirmDisconnect(/* application approved disconnecting. 
local function */\n"
   "10376\t                          IN int cl)\n"
   "10377\t{\n"
   "10378\t  if((CL.reason == RSN_CANNOT_SEND_LRQ) || (CL.reason == 
RSN_LRQ_NOT_FOUND) || \n"
   "10379\t    (CL.reason == RSN_NO_DESTINATION) || (CL.reason == 
RSN_EXIT_ZONE_NOT_ALLOWED) )\n"
   "10380\t  { /* the call cannot complete because the destination cannot be 
reached */\n"
   "10381\t    \n"
   "10382\t    CALL_NOTIFY(\"Disconnecting call because destination is not 
reachable or not allowed\",GEN_NA,10,cl );\n"
   "10383\t    (void)stopCall(cl, CL.reason, 
cmReasonTypeUnreachableDestination, cmReasonTypeUndefinedReason, \n"
   "10384\t      cmRASReasonCalledPartyNotRegistered);\n"
   "10385\t  }\n"
   "10386\t  else\n"
   "10387\t    if( CL.reason == RSN_SERVICE_NOT_ALLOWED )\n"
   "10388\t    { /* the call cannot complete because the service is not allowed 
*/\n"
   "10389\t      \n"
   "10390\t      CALL_NOTIFY(\"Disconnecting call because service is not 
allowed\",GEN_NA,10,cl );\n"
   "10391\t      (void)stopCall(cl, CL.reason, 
cmReasonTypeUnreachableDestination, cmReasonTypeUndefinedReason, \n"
   "10392\t        cmRASReasonResourceUnavailable);\n"
   "10393\t    }\n"
   "10394\t    else\n"
   "10395\t      if(CL.reason == RSN_DESTINATION_FAILED )\n"
   "10396\t      { /* the call cannot complete because the destination cannot 
be reached */\n"
   "10397\t        \n"
   "10398\t        /* more accurate printing is already done before\n"
   "10399\t        CALL_NOTIFY(\"Disconnecting call because no endpoint 
currently support the required service or all lines are busy \", cl,10 );\n"
   "10400\t        */\n"
   "10401\t  \t\t\t\t  if ((CL.DEST.dropReason != cmReasonTypeUndefinedReason) 
|| \n"
   "10402\t              (CL.DEST.dropCause != UNDEFINED_DROP_CAUSE)) /* pass 
on the last reason of the destination */\n"
   "10403\t            {\n"
   "10404\t              disconnectCall(cl, 
origDropReason(cl),cmReasonTypeUndefinedReason,\n"
   "10405\t                CL.DEST.dropCause, UNDEFINED_DROP_CAUSE, TRUE);\n"
   "10406\t            }\n"
   "10407\t            else\n"
   "10408\t              
(void)disconnectCall(cl,cmReasonTypeUnreachableDestination, 
cmReasonTypeUndefinedReason, \n"
   "10409\t              UNDEFINED_DROP_CAUSE, UNDEFINED_DROP_CAUSE, FALSE);\n"
   "10410\t            \n"
   "10411\t      }\n"
   "10412\t      else\n"
   "10413\t      {\n"
   "10414\t        (void)stopCall(cl, CL.reason, cmReasonTypeUndefinedReason, 
cmReasonTypeUndefinedReason, \n"
   "10415\t          cmRASReasonUndefined);\n"
   "10416\t      }\n"
   "10417\t      return TRUE;\n"
   "10418\t}  \n"
   "10419\t\n"
   
"10420\t/*----------------------------------------------------------------------------*/\n"
   "10421\tBOOL gwIndicationUserBusy(/*returns TRUE if gw releaseComplete reply 
indicates that the called user is busy*/\n"
   "10422\t                          int cl)\n"
   "10423\t                          \n"
   "10424\t{\n"
   "10425\t  cmReasonType reason;\n"
   "10426\t  cmRASEndpointType type;\n"
   "10427\t  cmuMessage_t message;\n"
   "10428\t  
cmuLoadParams(message,CMU_Q931,(HRAS)0,(cmRASTrPart)0,CL.DEST.stack);\n"
   "10429\t  \n"
   "10430\t  if (CL.DEST.reg == RGTBL_REG_NOT_VALID)\n"
   "10431\t    return FALSE;\n"
   "10432\t  \n"
   "10433\t  rgtblEndpointType(RGTBL_GET,CL.DEST.reg,&type);\n"
   "10434\t  /* BUG3001*/\n"
   "10435\t  /* To support V1 service suppliers \'UserBusy\' algorithm  \n"
   "10436\t    \"||  CL.service != NET3_NOT_SERVICE\" test was added */\n"
   "10437\t  if (type == cmRASEndpointTypeGateway  ||  CL.service != 
NET3_NOT_SERVICE)\n"
   "10438\t  {\n"
   "10439\t    /* get release complete reason. If no reason is found return 
FALSE */\n"
   "10440\t    if 
(cmuGetParam(&message,cmParamReleaseCompleteReason,FALSE,0,(int*)&reason,NULL) 
< 0)\n"
   "10441\t      return FALSE;\n"
   "10442\t    if (reason != cmReasonTypeGatewayResource)\n"
   "10443\t      return TRUE;\n"
   "10444\t    else\n"
   "10445\t      return FALSE;\n"
   "10446\t  }\n"
   "10447\t  else\n"
   "10448\t    return FALSE;\n"
   "10449\t}\n"
   "10450\t\n"
   
"10451\t/*----------------------------------------------------------------------------*/\n"
   "10452\tcmReasonType origDropReason(/*decides what reason to send orig out 
of the drop reason the dest has recieved*/\n"
   "10453\t                            IN int cl)\n"
   "10454\t                            \n"
   "10455\t{\n"
   "10456\t  return CL.DEST.dropReason;         \n"
   "10457\t}\n"
   "10458\t\n"
   "10459\t\n"
   
"10460\t/*----------------------------------------------------------------------------*/\n"
   "10461\tcmReasonType destDropReason(/*decides what reason to send dest out 
of the drop reason the orig has recieved*/\n"
   "10462\t                            IN int cl)\n"
   "10463\t                            \n"
   "10464\t{\n"
   "10465\t  return CL.ORIG.dropReason;\n"
   "10466\t}\n"
   
"10467\t/*-----------------------------------------------------------------------------\n"
   "10468\t *  dropCallParam\n"
   "10469\t */\n"
   "10470\t/*new sarit - before the actual drop, set the drop reason in the 
database*/\n"
   "10471\tstatic int callDropParam(IN int cl,   IN   side_t   side,\n"
   "10472\t\t\t    \t\t     IN  HCALL\t        hsCall,\n"
   "10473\t                         IN  cmReasonType   cmReason) {\n"
   "10474\t    if(side == ORIGIN)\n"
   "10475\t\t\tCL.ORIG.dropReason = cmReason;\n"
   "10476\t\telse\n"
   "10477\t\t\tCL.DEST.dropReason = cmReason;\n"
   "10478\t      \n"
   "10479\t\treturn cmuCallDropParam(hsCall, cmReason);\n"
   "10480\t\t\n"
   "10481\t}\n"
   "10482\t    \n"
   "10483\t\t\t\t\t  \n"
   "10484\t\n"
   "10485\t  /*******************************************************/\n"
   "10486\t  /*  Auxilary Functions                                 */\n"
   "10487\t  /*******************************************************/ \n"
   "10488\t  BOOL handleEmptyTran"
<- "sport( /* if address resolution didn\'t find transport address check\n"
   "10489\t                             that the call is allowed to out of 
zone. \n"
   "10490\t                             Check the number of aliases in the call 
to see if LRQ is\n"
   "10491\t                             possible */\n"
   "10492\t                             IN int cl )\n"
   "10493\t  {\n"
   "10494\t    char buf[2*ADD_MAX_BUF];\n"
   "10495\t    int numOfAddresses=0,i;\n"
   "10496\t    \n"
   "10497\t    if (net3ExitZoneIsDefined() && CL.destZone != 
DEST_ZONE_EXTERNAL)\n"
   "10498\t    {\n"
   "10499\t      sprintf(buf,\"destination(%s) not in zone and exit-zone prefix 
was not dialed for call %i\",\n"
   "10500\t        addAliasToString(&(CL.destInfo[0])),cl);\n"
   "10501\t      CALL_NOTIFY(buf,GEN_NA,10,cl);\n"
   "10502\t      DBGL_CONDITION(40,calPrintCallTitles(cl));\n"
   "10503\t      DBGL_CONDITION(40,gkPAR());\n"
   "10504\t      return handleCannotComplete(cl, RSN_EXIT_ZONE_NOT_ALLOWED, \n"
   "10505\t        gkcciRsnExitZoneNotAllowed, \"Exit zone not allowed or not 
dialed\");\n"
   "10506\t    }\n"
   "10507\t    for (i=0;i<DESTINATION_NUMBER;i++)\n"
   "10508\t    {\n"
   "10509\t      if (!addEmptyAlias(&(CL.destInfo[i])))\n"
   "10510\t        numOfAddresses++;\n"
   "10511\t    }\n"
   "10512\t    if (numOfAddresses)\n"
   "10513\t    {\n"
   "10514\t\t\t\tint i;\n"
   "10515\t      sprintf(buf,\"destination (%s) not found in zone for call 
%i\",addAliasToString(&(CL.destInfo[0])),cl);\n"
   "10516\t      CALL_NOTIFY(buf,GEN_NA,10,cl);\n"
   "10517\t      DBGL_CONDITION(40,gkPAR());\n"
   "10518\t      CL.lrqStage = LRQ_INIT;\n"
   "10519\t      CL.reason = RSN_NEED_LRQ;\n"
   "10520\t\t\t\tfor (i = 0;i < GKCCI_MAX_SPECIFIED_GKS_FOR_LRQ;i++)\n"
   "10521\t\t\t\t\tCL.specifiedGksForLRQ[i][0] = 0;/*LDAP*/\n"
   "10522\t            for (i=0; i<GKCCI_MAX_NON_NEIGHBOR_GKS_FOR_LRQ;i++)\n"
   "10523\t                CL.nonNeighborGksforLRQ[i].ip=0; /*DNS*/\n"
   "10524\t      CL.waitFurtherLRQ=FALSE;\n"
   "10525\t      if(!sendStateEvent(cl, gkcciSttAddressResolutionDone, 
gkcciRsnNeedLRQ))\n"
   "10526\t      {\n"
   "10527\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8768, cl,\"handleEmptyTransport: Failed in sending Address Resolution Done 
request to the application\"));\n"
   "10528\t        (void)stopCall(cl, RSN_FAILURE_EVENT_HANDLER, 
cmReasonTypeUndefinedReason,\n"
   "10529\t          cmReasonTypeUndefinedReason, cmRASReasonUndefined); \n"
   "10530\t        return FALSE;\n"
   "10531\t      }         \n"
   "10532\t      return TRUE;\n"
   "10533\t    }\n"
   "10534\t    else\n"
   "10535\t    {\n"
   "10536\t      CALL_NOTIFY(\"both ip address and alias names of destination 
absent from call data\",GEN_NA,10,cl);\n"
   "10537\t      DBGL_CONDITION(30,calPrintCallTitles(cl));\n"
   "10538\t      return handleCannotComplete(cl, RSN_NO_DESTINATION, \n"
   "10539\t        gkcciRsnNoDestinationInCall, \"destination address is not 
supplied\");\n"
   "10540\t      \n"
   "10541\t    }\n"
   "10542\t  }\n"
   "10543\t\n"
   
"10544\t/*----------------------------------------------------------------------------*/\n"
   "10545\t  BOOL RIPPossible(/*returns TRUE if the specified side of the 
call\n"
   "10546\t    has a pending message of the specified type that a RIP can be 
sent to*/\n"
   "10547\t    IN  int\t\t\t\t\t\tcl,\n"
   "10548\t    IN \tgkcciRIPMsg_t msg,\n"
   "10549\t    IN  side_t\t\t\t\tside)\n"
   "10550\t  {\n"
   "10551\t    switch (msg) {\n"
   "10552\t    case gkcciRIPMsgARQ:\n"
   "10553\t\t\t\t\t\t\tif (side == ORIGIN)\n"
   "10554\t              return IS_ARQ_ORIG;\n"
   "10555\t            else\n"
   "10556\t              return IS_ARQ_DEST;\n"
   "10557\t            break;\n"
   "10558\t    case gkcciRIPMsgDRQ:\n"
   "10559\t      return (CL.SIDE.DRQ != 0);\n"
   "10560\t    case gkcciRIPMsgBRQ:\n"
   "10561\t      return bwBRQIsPending(cl,side);\n"
   "10562\t    default:\n"
   "10563\t      return FALSE;\n"
   "10564\t    }\n"
   "10565\t    return TRUE;\n"
   "10566\t  }\n"
   "10567\t\n"
   
"10568\t/*----------------------------------------------------------------------------*/\n"
   "10569\t  int cmHook245(int cl,HCALL c1,HCALL c2)\n"
   "10570\t  {\n"
   "10571\t    if(c1);\n"
   "10572\t    if(c2);\n"
   "10573\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8769, 
cl,\"replace this function 
=========================================cmHook245\"));\n"
   "10574\t    return ERROR;\n"
   "10575\t  }\n"
   
"10576\t/*----------------------------------------------------------------------------*/
 \n"
   "10577\t  BOOL sendMulticast(/*  decides according whether a to multicast a 
LRQ message.\n"
   "10578\t                         NOTE that FALSE id returned for 
unregistered endp */\n"
   "10579\t                         IN UINT16 endp)\n"
   "10580\t  {\n"
   "10581\t    UINT8 endpDistLimit;\n"
   "10582\t    if (!rgtblValid(endp))\n"
   "10583\t    { /* no endpoint. The call is from out of zone */\n"
   "10584\t      UINT8 * outOfZoneDist;\n"
   "10585\t      \n"
   "10586\t      if 
(!gkcfgGet(GKCFG_OUT_OF_ZONE_DISTANCE,0,(void**)&outOfZoneDist))\n"
   "10587\t        return FALSE;\n"
   "10588\t      endpDistLimit = *outOfZoneDist;\n"
   "10589\t    }\n"
   "10590\t    else\n"
   "10591\t      if (!rgtblAccessDistLimit(RGTBL_GET,endp,&endpDistLimit))\n"
   "10592\t        return FALSE;\n"
   "10593\t      return net3MulticastAvailable(endpDistLimit);\n"
   "10594\t  }\n"
   "10595\t \n"
   
"10596\t/*----------------------------------------------------------------------------*/
 \n"
   "10597\t  int getCmParam(/* gets the stack parameter out of the GK one */\n"
   "10598\t               IN   gkcciParameter_t  parameter)\n"
   "10599\t{\n"
   "10600\t  switch(parameter)\n"
   "10601\t  {\n"
   "10602\t  case gkcciParamSetupNonStandard: \n"
   "10603\t    return cmParamSetupNonStandard;\n"
   "10604\t  case gkcciParamAlertingNonStandard:\n"
   "10605\t    return cmParamAlertingNonStandard;\n"
   "10606\t  case gkcciParamConnectNonStandard:\n"
   "10607\t    return cmParamConnectNonStandard;\n"
   "10608\t  case gkcciParamReleaseCompleteNonStandard:\n"
   "10609\t    return cmParamReleaseCompleteNonStandard;\n"
   "10610\t  case gkcciParamARQNonStandard:            \n"
   "10611\t  case gkcciParamACFNonStandard:\t         \n"
   "10612\t  case gkcciParamARJNonStandard:\t         \n"
   "10613\t  case gkcciParamDRQNonStandard:              \n"
   "10614\t  case gkcciParamDCFNonStandard:\t         \n"
   "10615\t  case gkcciParamDRJNonStandard:\n"
   "10616\t  case gkcciParamBRQNonStandard:\n"
   "10617\t  case gkcciParamBCFNonStandard:\n"
   "10618\t  case gkcciParamBRJNonStandard:\n"
   "10619\t  case gkcciParamGKDRQNonStandard:            \n"
   "10620\t  case gkcciParamEndpointDCFNonStandard:\t \n"
   "10621\t  case gkcciParamEndpointDRJNonStandard:\t \n"
   "10622\t  case gkcciParamGKLRQNonStandard:          \n"
   "10623\t  case gkcciParamEndpointLCFNonStandard:\t \n"
   "10624\t  case gkcciParamEndpointLRJNonStandard:\n"
   "10625\t    return cmRASParamNonStandard;\n"
   "10626\t  default: break;\n"
   "10627\t  }\n"
   "10628\t  return -1;\n"
   "10629\t}\n"
   
"10630\t/*----------------------------------------------------------------------------*/
 \n"
   "10631\tBOOL paramCopy(/*copies param from message attached to origMsgHandle 
to message attached to destMsgHandle\n"
   "10632\t               supports only a limited set of param : 
cmParamDisplay, cmParamUserUser, cmParamNonStandard\n"
   "10633\t               FALSE returned when used with illegal parameter*/\n"
   "10634\t               IN int cl,\n"
   "10635\t               IN cmCallParam param,\n"
   "10636\t               IN HCALL destMsgHandle,\n"
   "10637\t               IN HCALL origMsgHandle)\n"
   "10638\t{\n"
   "10639\t  char buf[ADD_MAX_BUF], nonStandardBuf[255];\n"
   "10640\t  int len=sizeof(buf), nonStandardLen=sizeof(nonStandardBuf);\n"
   "10641\t  cmNonStandardParam   nonStandardInfo;\n"
   "10642\t  int  val = sizeof(cmNonStandardParam);\n"
   "10643\t  \n"
   "10644\t  if(cl);\n"
   "10645\t  buf[0] = 0;\n"
   "10646\t  nonStandardBuf[0] = 0;\n"
   "10647\t  \n"
   "10648\t  if((destMsgHandle == NULL) || (origMsgHandle == NULL))\n"
   "10649\t    return FALSE;\n"
   "10650\t  \n"
   "10651\t  switch (param)\n"
   "10652\t  {\n"
   "10653\t    \n"
   "10654\t  case cmParamDisplay:\n"
   "10655\t  case cmParamConnectDisplay:\n"
   "10656\t  case cmParamUserUser:\n"
   "10657\t  case cmParamConnectUserUser: /* newnaomi. both direction */\n"
   "10658\t    if(cmCallGetParam(origMsgHandle,param,0,&len,buf)<0)\n"
   "10659\t    {\n"
   "10660\t      /* CALL_NOTIFY(\"error in calling cmCallGetParam\", GEN_NA, 
40); */\n"
   "10661\t      return FALSE;\n"
   "10662\t    }\n"
   "10663\t    /* CALL_NOTIFY(buf,GEN_NA,40); */\n"
   "10664\t    buf[len] = 0;\n"
   "10665\t    \n"
   "10666\t    if (len>0)\n"
   "10667\t      cmCallSetParam(destMsgHandle,param,0,len,buf);\n"
   "10668\t    return TRUE;\n"
   "10669\t    \n"
   "10670\t  case cmParamSetupNonStandard:\n"
   "10671\t  case cmParamAlertingNonStandard:\n"
   "10672\t  case cmParamConnectNonStandard:\n"
   "10673\t  case cmParamReleaseCompleteNonStandard:\n"
   "10674\t    \n"
   "10675\t    nonStandardInfo.data = nonStandardBuf;\n"
   "10676\t    nonStandardInfo.length = nonStandardLen;\n"
   "10677\t    strcpy(nonStandardInfo.info.object, \"\");\n"
   "10678\t    nonStandardInfo.info.objectLength = 0;\n"
   "10679\t    
if(cmCallGetParam(origMsgHandle,param,0,&val,(char*)&nonStandardInfo) < 0)\n"
   "10680\t    {\n"
   "10681\t      return FALSE;\n"
   "10682\t    }\n"
   "10683\t    if(val>0)\n"
   "10684\t      
cmCallSetParam(destMsgHandle,param,0,sizeof(cmNonStandardParam),(char*)&nonStandardInfo);\n"
   "10685\t    \n"
   "10686\t    return TRUE;\n"
   "10687\t  default: CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 9213,-1, \"illegal parameter used with function paramCopy - 
\",(int)param ));return FALSE;\n"
   "10688\t  }\n"
   "10689\t}\n"
   "10690\t\n"
   
"10691\t/*----------------------------------------------------------------------------*/\n"
   "10692\t  BOOL checkParameterLegal( /* check if requested parameter is legal 
at this stage of call (or at all) */\n"
   "10693\t    IN   int                 cl,\n"
   "10694\t    IN   gkcciParameter_t    parameter,\n"
   "10695\t    IN   gkcciSide_t         side, \n"
   "10696\t    IN   calOperation_t      operation)\n"
   "10697\t  {\n"
   "10698\t    switch(parameter)\n"
   "10699\t    {\n"
   "10700\t    case gkcciParamARQNonStandard: \n"
   "10701\t    case gkcciParamDRQNonStandard:\n"
   "10702\t\t  case gkcciParamBRQNonStandard: \n"
   "10703\t    case gkcciParamEndpointDCFNonStandard:\n"
   "10704\t    case gkcciParamEndpointDRJNonStandard:\n"
   "10705\t    case gkcciParamEndpointLCFNonStandard:\n"
   "10706\t    case gkcciParamEndpointLRJNonStandard:\n"
   "10707\t      if(operation == OP_SET)\n"
   "10708\t        return FALSE;  /* cannot set non standard of incoming 
message */\n"
   "10709\t      break;\n"
   "10710\t    default: \n"
   "10711\t      break;\n"
   "10712\t    }\n"
   "10713\t\n"
   "10714\t\n"
   "10715\t    switch(parameter)\n"
   "10716\t    {\n"
   "10717\t    case gkcciParamCallSignal:  \n"
   "10718\t    case gkcciParamAliasBMP:\n"
   "10719\t    case gkcciParamAlias:\n"
   "10720\t    case gkcciParamCallModel:\n"
   "10721\t    case gkcciParamCid:\n"
   "10722\t    case gkcciParamCallID:\n"
   "10723\t    case gkcciParamCallState:\n"
   "10724\t    case gkcciParamCallStateReason:\n"
   "10725\t    case gkcciParamAdditionalNumber:\n"
   "10726\t    case gkcciParamAppLineHuntingIp:\n"
   "10727\t    case gkcciParamCanMapAlias:\n"
   "10728\t    case gkcciParamMediaWaitForConnect:\n"
   "10729\t    case gkcciParamCDRHandle:\n"
   "10730\t    case gkcciParamDestZone:\n"
   "10731\t    case gkcciParamSendingComplete:\n"
   "10732\t\tcase gkcciParamAccessTokenNodeID:\n"
   "10733\t    return TRUE;\n"
   "10734\t\n"
   "10735\t\n"
   "10736\t    case gkcciParamCallRate: \n"
   "10737\t    case gkcciParamCallMultirate: \n"
   "10738\t\t\t/*if (operation == OP_SET)\n"
   "10739\t\t\t\treturn CL.setupPending;\n"
   "10740\t      else*/\n"
   "10741\t      return TRUE;\n"
   "10742\t\n"
   "10743\t    case gkcciParamResolvedAlias:\n"
   "10744\t      return ((CL.resolvedIdx >= 0) && (operation == OP_GET));\n"
   "10745\t\n"
   "10746\t    case gkcciParamAlertingH245Address:\n"
   "10747\t    case gkcciParamConnectH245Address:\n"
   "10748\t    case gkcciParamCallProcH245Address:\n"
   "10749\t      if((!CL.setupArrived && !CL.setupSend) || ((operation == 
OP_GET) && (side == gkcciSideOrig)))\n"
   "10750\t        return FALSE;\n"
   "10751\t      return TRUE;\n"
   "10752\t\n"
   "10753\t    case gkcciParamSetupH245Address:\n"
   "10754\t      if((!CL.setupArrived && !CL.setupSend && CL.sideMap != 
ONE_SIDE_DEST) || ((operation == OP_GET) && (side == gkcciSideDest)))\n"
   "10755\t        return FALSE;\n"
   "10756\t      return TRUE;\n"
   "10757\t\n"
   "10758\t    case gkcciParamAlertingTimeout:\n"
   "10759\t      return (!CL.setupSend);\n"
   "10760\t\n"
   "10761\t    case gkcciParamMCConfHandle:\n"
   "10762\t    case gkcciParamMCConnHandle:\n"
   "10763\t    case gkcciParamMCCallHandle:\n"
   "10764\t    case gkcciParamMCH245Address:\n"
   "10765\t      return (CL.model != cmRASCallModelTypeDirect || 
CL.API_SIDE.recovered);\n"
   "10766\t\n"
   "10767\t    case gkcciParamConferenceGoal:\n"
   "10768\t      return (CL.setupArrived || CL.setupSend || (CL.sideMap | 
ONE_SIDE_DEST));\n"
   "10769\t\n"
   "10770\t    case gkcciParamRemoteExtensionAliasBMP:\n"
   "10771\t    case gkcciParamRemoteExtensionAlias:\n"
   "10772\t      return TRUE;\n"
   "10773\t      \n"
   "10774\t    case gkcciParamCanOverlapSend:\n"
   "10775\t      return CL.setupPending;\n"
   "10776\t    case gkcciParamTimeOfStart:\n"
   "10777\t\t\tif(CL.timeOfStart == 0)\n"
   "10778\t\t\t\treturn FALSE;\n"
   "10779\t\t\treturn TRUE;\n"
   "10780\t    case gkcciParamTimeOfArj:\n"
   "10781\t\t\tif(CL.timeOfARJ == 0)\n"
   "10782\t\t\t\treturn FALSE;\n"
   "10783\t\t\treturn TRUE;\n"
   "10784\t\t\n"
   "10785\t\tcase gkcciParamTimeOfDRQ:\n"
   "10786\t\t\tif(CL.timeOfDRQ == 0)\n"
   "10787\t\t\t\treturn FALSE;\n"
   "10788\t\t\treturn TRUE; \n"
   "10789\t\t\t\n"
   "10790\t\tcase gkcciParamTimeOfACF: \n"
   "10791\t\t\tif(CL.timeOfACF == 0)\n"
   "10792\t\t\t\treturn FALSE;\n"
   "10793\t\t\treturn TRUE;\n"
   "10794\t\t\t\n"
   "10795\t\t\t\n"
   "10796\t\tcase gkcciParamTimeOfRelease:\n"
   "10797\t\t\tif(CL.timeOfRelease == 0)\n"
   "10798\t\t\t\treturn FALSE;\n"
   "10799\t\t\treturn TRUE;\n"
   "10800\t\n"
   "10801\t\tcase gkcciParamUsecRingTime:            \n"
   "10"
<- "802\t\t\tif(CL.usecTimeOfStart == 0 || CL.usecTimeOfAlert == 0)\n"
   "10803\t\t\t\treturn FALSE;\n"
   "10804\t\t\treturn TRUE;\n"
   "10805\t\n"
   "10806\t\tcase gkcciParamUsecEstablishmentTime:\n"
   "10807\t\t\tif(CL.usecTimeOfACF == 0 || CL.usecTimeOfStart == 0)\n"
   "10808\t\t\t\treturn FALSE;\n"
   "10809\t\t\treturn TRUE;\n"
   "10810\t\t\n"
   "10811\t\tcase gkcciParamRequestedBandwidth:\n"
   "10812\t    case gkcciParamApprovedBandwidth:\n"
   "10813\t      return TRUE;\n"
   "10814\t      \n"
   "10815\t    case gkcciParamARJReason:  /*sarit - check if these restriction 
are important*/\n"
   "10816\t      /*if (operation == OP_GET)*/\n"
   "10817\t      /*  return FALSE; no get for this parameter*/\n"
   "10818\t\t/* return (CL.API_SIDE.ARQ != NULL);*/\n"
   "10819\t      return TRUE;\n"
   "10820\t    case gkcciParamDisconnectReasonOutGoing:\n"
   "10821\t      if (operation == OP_GET)\n"
   "10822\t        return FALSE;/*no get for this parameter*/\n"
   "10823\t      return TRUE;\n"
   "10824\t    \n"
   "10825\t    /*new Sarit - get only for the release couse*/\n"
   "10826\t\tcase gkcciParamReleaseCompleteCause:\n"
   "10827\t      if (operation == OP_SET)\n"
   "10828\t        return FALSE;/*no set for this parameter*/\n"
   "10829\t      return TRUE; \n"
   "10830\t\t  \n"
   "10831\t    case gkcciParamDisconnectReasonInComing:\n"
   "10832\t      if (operation == OP_SET)\n"
   "10833\t        return FALSE;/*no set for this parameter*/\n"
   "10834\t      /* return (CL.API_SIDE.state == cmCallStateDisconnected); 
sarit - check if nessacerry*/\n"
   "10835\t      return TRUE;\n"
   "10836\t    case gkcciParamTotalBandwidth: \n"
   "10837\t    /*sarit : this if disables the option to get the bw after\n"
   "10838\t\t  arq transaction is over */\n"
   "10839\t\t/*if((CL.ORIG.ARQ == NULL) && (CL.DEST.ARQ == NULL))\n"
   "10840\t         return FALSE; */\n"
   "10841\t      return TRUE;\n"
   "10842\t\t\t\t\t\t\t\t\t   \n"
   "10843\t    case gkcciParamAppLineHuntingAliasBMP:\n"
   "10844\t    case gkcciParamAppLineHuntingAlias:\n"
   "10845\t      if(operation == OP_SET)\n"
   "10846\t        return TRUE;\n"
   "10847\t      return FALSE;\n"
   "10848\t\n"
   "10849\t    case gkcciParamSetupNonStandard:\n"
   "10850\t    case gkcciParamAlertingNonStandard:\n"
   "10851\t    case gkcciParamConnectNonStandard:\n"
   "10852\t    case gkcciParamReleaseCompleteNonStandard:\n"
   "10853\t      return(CL.API_SIDE.stack != NULL);\n"
   "10854\t\n"
   "10855\t    case gkcciParamARQNonStandard:  \n"
   "10856\t      if(side == gkcciSideOrig)\n"
   "10857\t        return (IS_ARQ_ORIG);\n"
   "10858\t      else\n"
   "10859\t        return (IS_ARQ_DEST);\n"
   "10860\t      break;\n"
   "10861\t    case gkcciParamACFNonStandard:\t         \n"
   "10862\t    case gkcciParamARJNonStandard:\t \n"
   "10863\t      if(side == gkcciSideOrig)\n"
   "10864\t        return (IS_ARQ_ORIG);\n"
   "10865\t      else\n"
   "10866\t        return (IS_ARQ_DEST);\n"
   "10867\t      break;\n"
   "10868\t    case gkcciParamDRQNonStandard:    \n"
   "10869\t      return (CL.API_SIDE.DRQ != NULL);\n"
   "10870\t    case gkcciParamDCFNonStandard:\t         \n"
   "10871\t    case gkcciParamDRJNonStandard:\t\n"
   "10872\t      return (CL.API_SIDE.DRQ != NULL);\n"
   "10873\t    case gkcciParamBRQNonStandard:\n"
   "10874\t    case gkcciParamBCFNonStandard:\t         \n"
   "10875\t    case gkcciParamBRJNonStandard:\n"
   "10876\t      if (side == gkcciSideOrig)\n"
   "10877\t        return bwBRQIsPending(cl,ORIGIN);\n"
   "10878\t      else\n"
   "10879\t        return bwBRQIsPending(cl,DESTINATION);\n"
   "10880\t      break;\n"
   "10881\t    case gkcciParamGKDRQNonStandard:\n"
   "10882\t      return (CL.API_SIDE.GKDRQ != NULL);\n"
   "10883\t    case gkcciParamEndpointDCFNonStandard:\n"
   "10884\t      return (CL.API_SIDE.EPDCF != NULL);\n"
   "10885\t    case gkcciParamEndpointDRJNonStandard:\n"
   "10886\t      return (CL.API_SIDE.EPDRJ != NULL);\n"
   "10887\t    case gkcciParamLRQSourceInfo:\n"
   "10888\t    case gkcciParamGKLRQNonStandard:    \n"
   "10889\t      return (CL.GKLRQ != NULL);\n"
   "10890\t    case gkcciParamLRQCanMapAlias:\n"
   "10891\t      return (CL.GKLRQ != NULL && operation == OP_SET);\n"
   "10892\t    case gkcciParamLCFDestInfo:\n"
   "10893\t    case gkcciParamLCFDestExtra:\n"
   "10894\t    case gkcciParamLCFRemoteExtension:\n"
   "10895\t    case gkcciParamEndpointLCFNonStandard:\n"
   "10896\t      return ((CL.EPLCF != NULL) && (operation == OP_GET));\n"
   "10897\t    case gkcciParamEndpointLRJNonStandard:\n"
   "10898\t      return (CL.EPLRJ != NULL);\n"
   "10899\t    case gkcciParamARJAlternateGk:\n"
   "10900\t    case gkcciParamARJAltGKisPermanent:\n"
   "10901\t      return (CL.API_SIDE.ARQ != NULL);\n"
   "10902\t    case gkcciParamBRJAlternateGk:\n"
   "10903\t    case gkcciParamBRJAltGKisPermanent:\n"
   "10904\t      return (CL.API_SIDE.bw.hsRas != NULL);\n"
   "10905\t    case gkcciParamDRJAlternateGk:\n"
   "10906\t    case gkcciParamDRJAltGKisPermanent:\n"
   "10907\t      return (CL.API_SIDE.DRQ != NULL);\n"
   "10908\t    case gkcciParamLRJAlternateGk:\n"
   "10909\t    case gkcciParamLRJAltGKisPermanent:\n"
   "10910\t      return ((operation != OP_SET) && (CL.EPLRJ != NULL));\n"
   "10911\t    case gkcciParamAlternateEP:\n"
   "10912\t      return (CL.API_SIDE.ARQ != NULL);\n"
   "10913\t    case gkcciParamEndpointType:\n"
   "10914\t      return TRUE;\n"
   "10915\t    case gkcciParamACFDestinationType:\n"
   "10916\t    case gkcciParamACFEndpointVendor:\n"
   "10917\t    case gkcciParamACFGatewayProtocol:\n"
   "10918\t      return (CL.API_SIDE.ARQ != NULL);\n"
   "10919\t    case gkcciParamLCFDestinationType:\n"
   "10920\t    case gkcciParamLCFEndpointVendor:\n"
   "10921\t    case gkcciParamLCFGatewayProtocol:\n"
   "10922\t      return (CL.EPLCF != NULL);\n"
   "10923\t      \n"
   "10924\t      \n"
   "10925\t    default:\n"
   "10926\t      return FALSE;\n"
   "10927\t\n"
   "10928\t    }\n"
   "10929\t  }\n"
   "10930\t\n"
   "10931\t  
/*----------------------------------------------------------------------------*/
 \n"
   "10932\t            \n"
   "10933\t  BOOL checkParameterLegalForDelete( /* check if requested parameter 
is legal at this stage of call (or at all) for\n"
   "10934\t    delete of an alias */\n"
   "10935\t    IN   int                 cl,\n"
   "10936\t    IN   gkcciParameter_t    parameter)\n"
   "10937\t  {\n"
   "10938\t    if(cl);\n"
   "10939\t    switch(parameter)\n"
   "10940\t    {\n"
   "10941\t    case gkcciParamAliasBMP:\n"
   "10942\t    case gkcciParamAlias:\n"
   "10943\t    case gkcciParamAdditionalNumber:\n"
   "10944\t    case gkcciParamRemoteExtensionAliasBMP:\n"
   "10945\t    case gkcciParamRemoteExtensionAlias:\n"
   "10946\t    case gkcciParamAppLineHuntingIp:\n"
   "10947\t      return TRUE;\n"
   "10948\t    default:\n"
   "10949\t      return FALSE;\n"
   "10950\t    }\n"
   "10951\t  }    \n"
   "10952\t  \n"
   "10953\t  
/*----------------------------------------------------------------------------*/
 \n"
   "10954\t            \n"
   "10955\t            \n"
   "10956\t  BOOL checkOperationLegal( /* check if set operation is legal at 
this stage of call (or at all) */\n"
   "10957\t    IN   int                 cl,\n"
   "10958\t    IN   gkcciParameter_t    parameter,\n"
   "10959\t    IN   gkcciSide_t         side)\n"
   "10960\t  {\n"
   "10961\t    switch(parameter)\n"
   "10962\t    {\n"
   "10963\t    case gkcciParamCallSignal:  \n"
   "10964\t    /*   \n"
   "10965\t    case gkcciParamName:\n"
   "10966\t    case gkcciParamPhone:\n"
   "10967\t      */\n"
   "10968\t    case gkcciParamAliasBMP:\n"
   "10969\t    case gkcciParamAlias:\n"
   "10970\t    case gkcciParamAdditionalNumber:\n"
   "10971\t    /*   \n"
   "10972\t    case gkcciParamRemoteExtensionName:\n"
   "10973\t    case gkcciParamRemoteExtensionPhone:\n"
   "10974\t      */\n"
   "10975\t    case gkcciParamRemoteExtensionAliasBMP:\n"
   "10976\t    case gkcciParamRemoteExtensionAlias:\n"
   "10977\t      return TRUE;\n"
   "10978\t    case gkcciParamAppLineHuntingIp:\n"
   "10979\t    case gkcciParamAppLineHuntingAliasBMP:\n"
   "10980\t    case gkcciParamAppLineHuntingAlias:\n"
   "10981\t      if((    (CL.setupSend) && (CL.state != CAL_WAIT_DEST_CONNECT) 
&& (CL.state != CAL_WAIT_DEST_ADMISSION) \n"
   "10982\t        && (CL.state != CAL_WAIT_DEST_DISCONNECT) && (CL.state != 
CAL_WAIT_HUNTING)) \n"
   "10983\t        || (!CL.canMapAliasForCall && (CL.model == 
cmRASCallModelTypeDirect)))\n"
   "10984\t        return FALSE;\n"
   "10985\t      return TRUE;\n"
   "10986\t    case gkcciParamCanMapAlias:\n"
   "10987\t    case gkcciParamCallModel:\n"
   "10988\t      return TRUE;\n"
   "10989\t\n"
   "10990\t    case gkcciParamResolvedAlias:\n"
   "10991\t    case gkcciParamCid:\n"
   "10992\t    case gkcciParamCallState:\n"
   "10993\t    case gkcciParamCallStateReason:\n"
   "10994\t    case gkcciParamConferenceGoal:\n"
   "10995\t    case gkcciParamRequestedBandwidth:\n"
   "10996\t    case gkcciParamApprovedBandwidth:\n"
   "10997\t    case gkcciParamTotalBandwidth:\n"
   "10998\t    case gkcciParamDestZone:\n"
   "10999\t    case gkcciParamTimeOfStart:\n"
   "11000\t\tcase gkcciParamTimeOfArj:\n"
   "11001\t    case gkcciParamTimeOfDRQ:\n"
   "11002\t\tcase gkcciParamTimeOfACF:            \n"
   "11003\t\tcase gkcciParamTimeOfRelease:\n"
   "11004\t\tcase gkcciParamUsecRingTime:            \n"
   "11005\t\tcase gkcciParamUsecEstablishmentTime:\n"
   "11006\t    case gkcciParamLRJAlternateGk:\n"
   "11007\t    case gkcciParamLRJAltGKisPermanent:\n"
   "11008\t      return FALSE;\n"
   "11009\t\n"
   "11010\t    case gkcciParamSetupNonStandard:\n"
   "11011\t    case gkcciParamAlertingNonStandard:\n"
   "11012\t    case gkcciParamConnectNonStandard:\n"
   "11013\t    case gkcciParamReleaseCompleteNonStandard:\n"
   "11014\t    case gkcciParamACFNonStandard:\t         \n"
   "11015\t    case gkcciParamARJNonStandard:\t         \n"
   "11016\t    case gkcciParamDCFNonStandard:\t         \n"
   "11017\t    case gkcciParamDRJNonStandard:\n"
   "11018\t    case gkcciParamBCFNonStandard:\n"
   "11019\t    case gkcciParamBRJNonStandard:\n"
   "11020\t    case gkcciParamGKDRQNonStandard:            \n"
   "11021\t    case gkcciParamGKLRQNonStandard: \n"
   "11022\t    case gkcciParamARJAlternateGk:\n"
   "11023\t    case gkcciParamBRJAlternateGk:\n"
   "11024\t    case gkcciParamDRJAlternateGk:\n"
   "11025\t    case gkcciParamARJAltGKisPermanent:\n"
   "11026\t    case gkcciParamBRJAltGKisPermanent:\n"
   "11027\t    case gkcciParamDRJAltGKisPermanent:\n"
   "11028\t    case gkcciParamLRQSourceInfo:\n"
   "11029\t    case gkcciParamLRQCanMapAlias:\n"
   "11030\t    case gkcciParamAlternateEP:\n"
   "11031\t    case gkcciParamCDRHandle:\n"
   "11032\t\tcase gkcciParamAccessTokenNodeID:\n"
   "11033\t      return TRUE;\n"
   "11034\t      \n"
   "11035\t    case gkcciParamAlertingTimeout:\n"
   "11036\t      return (CL.state != CAL_CONNECT);\n"
   "11037\t\n"
   "11038\t    case gkcciParamCanOverlapSend:\n"
   "11039\t    case gkcciParamSendingComplete:\n"
   "11040\t    case gkcciParamMediaWaitForConnect:\n"
   "11041\t    case gkcciParamCallRate:\n"
   "11042\t    case gkcciParamCallMultirate:\n"
   "11043\t     /* return (CL.setupPending && !CL.setupSend && \n"
   "11044\t         (CL.state == CAL_WAIT_OFFERING || CL.state == 
CAL_ADDRESS_RESOLUTION)); */\n"
   "11045\t      return TRUE;\n"
   "11046\t      \n"
   "11047\t    case gkcciParamConnectH245Address:\n"
   "11048\t    /* meir GK-MC: no use in setting H.245 address for Q.931 
messages when call is routed\n"
   "11049\t      via MC. These addresses will not be used. */\n"
   "11050\t      return(CL.connectPending && side == gkcciSideOrig && 
CL.mcRoutedMode == FALSE);\n"
   "11051\t\n"
   "11052\t    case gkcciParamSetupH245Address:\n"
   "11053\t      return(CL.setupPending && side == gkcciSideDest && 
CL.mcRoutedMode == FALSE);\n"
   "11054\t\n"
   "11055\t    case gkcciParamAlertingH245Address:\n"
   "11056\t      return(CL.alertingPending && side == gkcciSideOrig && 
CL.mcRoutedMode == FALSE);\n"
   "11057\t\n"
   "11058\t    case gkcciParamCallProcH245Address:\n"
   "11059\t      return (!CL.callProcSent && side == gkcciSideOrig && 
CL.mcRoutedMode == FALSE);\n"
   "11060\t    case gkcciParamMCConfHandle:\n"
   "11061\t    case gkcciParamMCCallHandle:\n"
   "11062\t      return TRUE;\n"
   "11063\t    case gkcciParamMCConnHandle:\n"
   "11064\t    case gkcciParamCallID:\n"
   "11065\t      return (CL.setupPending || (side == gkcciSideDest && 
CL.sideMap == ONE_SIDE_DEST));\n"
   "11066\t\n"
   "11067\t    case gkcciParamMCH245Address:\n"
   "11068\t      return TRUE;\n"
   "11069\t\n"
   "11070\t    case gkcciParamEndpointType:\n"
   "11071\t      return (side == gkcciSideDest);\n"
   "11072\t    case gkcciParamACFDestinationType:\n"
   "11073\t    case gkcciParamACFEndpointVendor:\n"
   "11074\t    case gkcciParamACFGatewayProtocol:\n"
   "11075\t      return TRUE;\n"
   "11076\t    case gkcciParamLCFDestinationType:\n"
   "11077\t    case gkcciParamLCFEndpointVendor:\n"
   "11078\t    case gkcciParamLCFGatewayProtocol:\n"
   "11079\t      return FALSE;\n"
   "11080\t      \n"
   "11081\t    \n"
   "11082\t    case gkcciParamARJReason:\n"
   "11083\t      /*return (CL.API_SIDE.ARQ != NULL);  sarit - no 
restriction*/\n"
   "11084\t\t\treturn TRUE;\n"
   "11085\t    case gkcciParamDisconnectReasonOutGoing:\n"
   "11086\t      return TRUE;\n"
   "11087\t    case gkcciParamReleaseCompleteCause:\n"
   "11088\t\t\treturn TRUE;\n"
   "11089\t    default:\n"
   "11090\t      return FALSE;\n"
   "11091\t\n"
   "11092\t    }\n"
   "11093\t  }\n"
   "11094\t\n"
   "11095\t  \n"
   "11096\t  
/*****************************************************************************/\n"
   "11097\t  /* Implementation of application memory management in the calls 
table        */\n"
   "11098\t  
/*****************************************************************************/\n"
   "11099\t    INT32 calGetAppMemblock(IN gkHCALL  hCall,\n"
   "11100\t      IN OUT UINT16   *size,\n"
   "11101\t      IN UINT8    *buffer) \n"
   "11102\t    {\n"
   "11103\t      memRecord_t record;\n"
   "11104\t      int cl;\n"
   "11105\t      \n"
   "11106\t      /* get call index from handle */\n"
   "11107\t      if (!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "11108\t        return gkcciInvalidHandle;\n"
   "11109\t      \n"
   "11110\t      \n"
   "11111\t      /* get the data from the records in memory. */\n"
   "11112\t      record = CL.appMemblockHandle;\n"
   "11113\t      if (!memValidRecord(&memHandler, record))\n"
   "11114\t        return gkcciInvalidOperation;\n"
   "11115\t      \n"
   "11116\t      if (*size < memRecordLength(&memHandler, record))\n"
   "11117\t        return gkcciOutOfBounds;\n"
   "11118\t      \n"
   "11119\t      if (!memGet(&memHandler, record, buffer, size))\n"
   "11120\t        return gkcciFailure;\n"
   "11121\t      \n"
   "11122\t      return gkcciOK;\n"
   "11123\t    }\n"
   "11124\t    \n"
   "11125\t    INT32 calPutAppMemblock(IN gkHCALL  hCall,\n"
   "11126\t      IN UINT16  size,\n"
   "11127\t      IN UINT8*  buffer) \n"
   "11128\t    {\n"
   "11129\t      int cl;\n"
   "11130\t      memRecord_t record;\n"
   "11131\t      \n"
   "11132\t      /* get call index from handle */\n"
   "11133\t      if (!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "11134\t        return gkcciFailure;\n"
   "11135\t      \n"
   "11136\t      \n"
   "11137\t      /* delete the old information and write instead the new one 
*/\n"
   "11138\t      record = CL.appMemblockHandle;\n"
   "11139\t      if (!memDeleteRecord(&memHandler, record))\n"
   "11140\t        return gkcciFailure;\n"
   "11141\t      \n"
   "11142\t      record =  CL.appMemblockHandle = memPut(&memHandler, buffer, 
size);\n"
   "11143\t      if (!memValidRecord(&memHandler, record))\n"
   "11144\t        return gkcciFailure;\n"
   "11145\t      return gkcciOK;\n"
   "11146\t    }\n"
   "11147\t    \n"
   "11148\t    INT32 calFreeAppMemblock(IN gkHCALL  hCall)\n"
   "11149\t    {\n"
   "11150\t      int cl;\n"
   "11151\t      \n"
   "11152\t      /* get call index from handle */\n"
   "11153\t      if (!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "11154\t        return gkcciFailure;\n"
   "11155\t      \n"
   "11156\t      if (!memDeleteRecord(&memHandler, CL.appMemblockHandle))\n"
   "11157\t        return gkcciFailure;\n"
   "11158\t      \n"
   "11159\t      CL.appMemblockHandle = INVALID_CELL;\n"
   "11160\t      return gkcciOK;\n"
   "11161\t    }\n"
   "11162\t    \n"
   "11163\t\n"
   "11164\t\n"
   "11165\t  /*******************************************************/\n"
   "11166\t  /*  Display and Log Functions                          */\n"
   "11167\t  /*******************************************************/ \n"
   "11168\t  RVAPI void CALLCONV gkPAC()   \n"
   "11169\t  {\n"
   "11170\t    int cl;\n"
   "11171\t    semSemaphoreTake();\n"
   "11172\t    GK_NOTIFY(\"block\",GEN_NA,0);\n"
   "11173\t    GK_NOTIFY(\"************************* Calls Table 
***************************\",GEN_NA,0);\n"
   "11174\t    callTitlesHeaders();\n"
   "11175\t    for(cl=0;VALID(cl);cl++)\n"
   "11176\t      callTitlesData(cl);\n"
   "11177\t    
GK_NOTIFY(\"****************************************************************\",GEN_NA,0);\n"
   "11178\t    semSemaphoreGive();\n"
   "11179\t  }\n"
   "11180\t  \n"
   "11181\t  \n"
   "11182\t  BOOL calPrintCallTitles(/*prints basic information of call 
\'cl\'*/\n"
   "11183\t    IN int cl)\n"
   "11184\t  {\n"
   "11185\t    if (VACENT(cl))\n"
   "11186\t      return TRUE;/* naomi merge */\n"
   "11187\t    callTitlesHeaders();\n"
   "11188\t    return callTitlesData(cl);\n"
   "11189\t  }\n"
   "11190\t  \n"
   "11191\t\t\tstatic void callTitlesHeaders()\n"
   "11192\t    {\n"
   "11193\t      char buf[ADD_MAX_BUF*8];\n"
   "11194\t      sprintf(buf,\" %-3.3s %-20.20s  %-35.35s  %-14.14s 
%-7.7s\",\"No.\",\"From\",\"To\",\"State\",\"Service\");/* maomi merge*/\n"
   "11195\t      GK_NOTIFY(buf,GEN_NA,9);\n"
   "11196\t      sprintf(buf,\" %-3.3s %-20.20s  %-35.35s  %-14.14s 
%-7.7s\",\"~~~\",\n"
   "11197\t        
\"~~~~~~~~~~~~~~~~~~~~\",\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\",\"~~~~~~~~~~~~~~\",\"~~~~~~~\");/*
 maomi merge*/\n"
   "11198\t      GK_NOTIFY(buf,GEN_NA,9);\n"
   "11199\t    }\n"
   "11200\t    \n"
   "11201\t    \n"
   "11202\t    static BOOL callTitlesData(\n"
   "11203\t      IN int cl)\n"
   "11204\t    {\n"
   "11205\t      \n"
   "11206\t      int i,cidSum=0;\n"
   "11207\t      char buf[ADD_MAX_BUF*8];\n"
   "11208\t      char serviceBuf[50];\n"
   "11209\t      char srcInfoBuf[ADD_MAX_BUF];\n"
   "11210\t      char destInfoBuf[ADD_MAX_BUF];\n"
   "11211\t      char srcIPBuf[100];\n"
   "11212\t      char destIPBuf[100];\n"
   "11213\t      char cidString[50];\n"
   "11214\t      \n"
   "11215\t      serviceBuf[0] = 0;\n"
   "11216\t      destInfoBuf[0] = 0;\n"
   "11217\t      \n"
   "11218\t      if (!VACENT(cl))\n"
   "11219\t      {\n"
   "11220\t        {\n"
   "11221\t          int charBuf;\n"
   "11222\t          sprintf(cidString,\"0x\");\n"
   "11223\t          for (i=0;i<GUID_LEN;i++)\n"
   "11224\t          {\n"
   "11225\t            cidSum = cidSum+(UINT8)CL.cid[i];\n"
   "11226\t            charBuf=(UINT8)CL.cid[i];\n"
   "11227\t            sprintf(cidString,\"%s%02x\",cidString,charBuf);\n"
   "11228\t          }\n"
   "11229\t        }\n"
   "11230\t        if (CL.service != NET3_NOT_SERVICE)\n"
   "11231\t        {\n"
   "11232\t#ifdef GK_EXPOSE\n"
   "11233\t          sprintf(serviceBuf,\"%s\",net3ServiceName(CL.service));/* 
naomi merge*/\n"
   "11234\t#endif\n"
   "11235\t        }\n"
   "11236\t        if (CL.callService != SRV_INV"
<- "ALID_SERV)\n"
   "11237\t        {\n"
   "11238\t          cmRASAlias alias;\n"
   "11239\t          char string[GKCFGI_SERVICE_NAME_LEN];\n"
   "11240\t          alias.string = string;\n"
   "11241\t          srvServiceGetPrefix(CL.callService, &alias);\n"
   "11242\t          string[alias.length] = 0;\n"
   "11243\t          sprintf(serviceBuf,\"%s\",alias.string);/* naomi merge*/\n"
   "11244\t        }\n"
   "11245\t        \n"
   "11246\t        strcpy(srcIPBuf,addIpToString(&(CL.srcCallSignal)));\n"
   "11247\t        strcpy(srcInfoBuf,addAliasToString(&(CL.srcInfo[0])));\n"
   "11248\t        strcpy(destIPBuf,addIpToString(&(CL.destCallSignal)));\n"
   "11249\t        \n"
   "11250\t        if(!CL.appLineHunting)\n"
   "11251\t          strcpy(destInfoBuf,addAliasToString(&(CL.destInfo[0])));\n"
   "11252\t        \n"
   "11253\t        sprintf(buf,\" %-3i %-20.20s  %-20.20s,%-15.15s %-14.14s 
%-8.8s\",cl,srcIPBuf,destIPBuf,destInfoBuf,stateName[CL.state],serviceBuf);\n"
   "11254\t        GK_NOTIFY(buf,GEN_NA,0);\n"
   "11255\t        \n"
   "11256\t      }\n"
   "11257\t      return TRUE;\n"
   "11258\t    }\n"
   "11259\t    \n"
   "11260\t    \n"
   "11261\t\n"
   "11262\t    RVAPI void CALLCONV gkPC(/* print call entry.*/\n"
   "11263\t      IN int cl)\n"
   "11264\t    {\n"
   "11265\t      int i,cidSum=0;\n"
   "11266\t      char buf[8*ADD_MAX_BUF],cidString[50];\n"
   "11267\t      semSemaphoreTake();\n"
   "11268\t      if (!VALID(cl))\n"
   "11269\t      {\n"
   "11270\t        GK_NOTIFY(\"Invalid call in gkPC\",GEN_NA,0);\n"
   "11271\t      }\n"
   "11272\t      else\n"
   "11273\t      {\n"
   "11274\t        sprintf(buf,\"**************************** Call %-3i  
**************************\",cl);\n"
   "11275\t        GK_NOTIFY(buf,GEN_NA,0);\n"
   "11276\t#ifdef GK_EXPOSE\n"
   "11277\t        if (CL.service != NET3_NOT_SERVICE)\n"
   "11278\t        {\n"
   "11279\t          sprintf(buf,\"Call is to V1 service : 
%s\",net3ServiceName(CL.service));\n"
   "11280\t          GK_NOTIFY(buf,GEN_NA,0);\n"
   "11281\t        }\n"
   "11282\t        if (CL.callService != SRV_INVALID_SERV)\n"
   "11283\t        {\n"
   "11284\t          cmRASAlias alias;\n"
   "11285\t          char string[GKCFGI_SERVICE_NAME_LEN];\n"
   "11286\t          alias.string = string;\n"
   "11287\t          srvServiceGetPrefix(CL.callService, &alias);\n"
   "11288\t          string[alias.length] = 0;\n"
   "11289\t          sprintf(buf,\"Call is to V2 service : 
%s\",alias.string);/* naomi merge*/\n"
   "11290\t        }\n"
   "11291\t        if (CL.service == NET3_NOT_SERVICE  &&  CL.callService == 
SRV_INVALID_SERV)\n"
   "11292\t        {\n"
   "11293\t          GK_NOTIFY(\"Call is not to a service\",GEN_NA,0);\n"
   "11294\t        }\n"
   "11295\t#endif\n"
   "11296\t        sprintf(buf,\"Call is in state: %s\",stateName[CL.state]);\n"
   "11297\t        GK_NOTIFY(buf,GEN_NA,0);\n"
   "11298\t        sprintf(buf,\"%-4.4s 
%-20.20s\",\"From\",addIpToString(&(CL.srcCallSignal)));\n"
   "11299\t        for(i=0;i<SOURCE_NUMBER;i++)\n"
   "11300\t        {\n"
   "11301\t          if (!addEmptyAlias(&(CL.srcInfo[i])))\n"
   "11302\t            sprintf(&(buf[strlen(buf)]),\" 
%s\",addAliasToString(&(CL.srcInfo[i])));\n"
   "11303\t        }\n"
   "11304\t        GK_NOTIFY(buf,GEN_NA,0);\n"
   "11305\t        \n"
   "11306\t        sprintf(buf,\"%-4.4s 
%-20.20s\",\"to\",addIpToString(&(CL.destCallSignal)));\n"
   "11307\t        for(i=0;i<DESTINATION_NUMBER;i++)\n"
   "11308\t        {\n"
   "11309\t          if (!addEmptyAlias(&(CL.destInfo[i])) )\n"
   "11310\t            sprintf(&(buf[strlen(buf)]),\" 
%s\",addAliasToString(&(CL.destInfo[i])));\n"
   "11311\t        }\n"
   "11312\t        GK_NOTIFY(buf,GEN_NA,0);\n"
   "11313\t        \n"
   "11314\t        {\n"
   "11315\t          int charBuf;\n"
   "11316\t          sprintf(cidString,\"0x\");\n"
   "11317\t          for (i=0;i<GUID_LEN;i++)\n"
   "11318\t          {  \n"
   "11319\t            cidSum = cidSum+(UINT8)CL.cid[i];\n"
   "11320\t            charBuf=(UINT8)CL.cid[i];\n"
   "11321\t            sprintf(cidString,\"%s%02x\",cidString,charBuf);\n"
   "11322\t          }\n"
   "11323\t        }\n"
   "11324\t        sprintf(buf,\"CID Sum:%i. CID:%s\",cidSum,cidString);\n"
   "11325\t        GK_NOTIFY(buf,GEN_NA,0);\n"
   "11326\t        \n"
   "11327\t        switch(CL.infoSrc)\n"
   "11328\t        {\n"
   "11329\t        case NO_INFORMATION: sprintf(buf,\"No information source. 
\");\n"
   "11330\t          break;\n"
   "11331\t        case ARQ_INFORMATION: sprintf(buf,\"Information from ARQ. 
\");\n"
   "11332\t          break;\n"
   "11333\t        case SETUP_INFORMATION: sprintf(buf,\"Information from 
setup. \");\n"
   "11334\t          break;\n"
   "11335\t        }\n"
   "11336\t        GK_NOTIFY(buf,GEN_NA,0);\n"
   "11337\t        sprintf(buf,\"Setup h245-channel address 
%s\",addIpToString(&(CL.setupH245Add)));\n"
   "11338\t        GK_NOTIFY(buf,GEN_NA,0);\n"
   "11339\t        sprintf(buf,\"Connect h245-channel address 
%s\",addIpToString(&(CL.connectH245Add)));\n"
   "11340\t        GK_NOTIFY(buf,GEN_NA,0);\n"
   "11341\t        GK_NOTIFY(\"Information of origin\",GEN_NA,0);\n"
   "11342\t        sprintf(buf,\" Reg:%-3i Bandwidth:%-4i Stack:%-10i ARQ:%-10i 
State:%-7.7s 
Mode:%-13.13s\",CL.ORIG.reg,CL.ORIG.bw.bwApp,(int)CL.ORIG.stack,(int)CL.ORIG.ARQ,cmuStateName((cmCallState_e)CL.ORIG.state),cmuStateModeName((cmCallStateMode_e)CL.ORIG.stateMode));/*naomi
 merge*/\n"
   "11343\t        GK_NOTIFY(buf,GEN_NA,0);\n"
   "11344\t        GK_NOTIFY(\"Information of destination\",GEN_NA,0);\n"
   "11345\t        sprintf(buf,\" Reg:%-3i Bandwidth:%-4i Stack:%-10i ARQ:%-10i 
State %-7.7s Mode 
%-13.13s\",CL.ORIG.reg,CL.ORIG.bw.bwApp,(int)CL.DEST.stack,(int)CL.DEST.ARQ,cmuStateName((cmCallState_e)CL.DEST.state),cmuStateModeName((cmCallStateMode_e)CL.DEST.stateMode));/*naomi
 merge*/\n"
   "11346\t        GK_NOTIFY(buf,GEN_NA,0);\n"
   "11347\t        \n"
   "11348\t        
GK_NOTIFY(\"****************************************************************\",GEN_NA,0);\n"
   "11349\t      }\n"
   "11350\t      \n"
   "11351\t    }\n"
   "11352\t\n"
   "11353\tvoid call_notify(\n"
   "11354\t                   IN const char* str,\n"
   "11355\t                   IN int num,\n"
   "11356\t                   IN int level,\n"
   "11357\t                   IN int cl)\n"
   "11358\t{\n"
   "11359\t  char buf[2000];\n"
   "11360\t  if (strcmp(str, \"block\"))\n"
   "11361\t  {\n"
   "11362\t    formatTheMessage(buf,str,cl,level);\n"
   "11363\t    GK_NOTIFY(buf,num,level);\n"
   "11364\t  }\n"
   "11365\t  else\n"
   "11366\t    GK_NOTIFY(str,num,level);\n"
   "11367\t}\n"
   "11368\t\n"
   "11369\tvoid call_exception(\n"
   "11370\t              IN const char* str,\n"
   "11371\t              IN int cl)\n"
   "11372\t{\n"
   "11373\t  char buf[2000];\n"
   "11374\t  formatTheMessage(buf,str,cl,0);\n"
   "11375\t  GK_EXEP(buf);\n"
   "11376\t}\n"
   "11377\t\n"
   "11378\tvoid call_exceptionInt(\n"
   "11379\t              IN const char* str,\n"
   "11380\t              IN int num,\n"
   "11381\t              IN int cl)\n"
   "11382\t{\n"
   "11383\t  char buf[2000];\n"
   "11384\t  formatTheMessage(buf,str,cl,0);\n"
   "11385\t  GK_EXEP_INT(buf,num);\n"
   "11386\t} \n"
   "11387\t\n"
   "11388\t/*--------------------- HUGO EXCEPTION 
---------------------------*/\n"
   "11389\tvoid CALLCONV callException(IN gkmainExcepSeverity\tseverity,        
\n"
   "11390\t\t\t\t\t\t\t\tIN gkmainExcepImportance\timportance,\n"
   "11391\t\t\t\t\t\t\t\tIN int\t\t\t\t\terrorCode, \n"
   "11392\t\t\t\t\t\t\t\tIN int\t\t\t\t\tcl,\n"
   "11393\t\t\t\t\t\t\t\tIN char *\t\t\t\tline,...)\n"
   "11394\t{\n"
   "11395\t    static char fBuff[300];\n"
   "11396\t    char buf[2000];\n"
   "11397\t    va_list v;\n"
   "11398\t\n"
   "11399\t    va_start(v,line);\n"
   "11400\t    sprintf(fBuff,line,v);\n"
   "11401\t    formatTheMessage(buf,fBuff,cl,0);\n"
   "11402\t    gkException(severity, importance, errorCode, buf);\n"
   "11403\t    va_end(v);\n"
   "11404\t}\n"
   "11405\t\n"
   "11406\tstatic void formatTheMessage(\n"
   "11407\t                              IN char* buf,\n"
   "11408\t                              IN const char* str,\n"
   "11409\t                              IN int cl,\n"
   "11410\t                              IN int level)\n"
   "11411\t{\n"
   "11412\t  char* spaces;\n"
   "11413\t\n"
   "11414\t  if (level <= 10)       spaces = \"\";\n"
   "11415\t  else if (level <= 20)  spaces = \" \";\n"
   "11416\t  else if (level <= 30)  spaces = \"  \";\n"
   "11417\t  else                   spaces = \"   \";\n"
   "11418\t\n"
   "11419\t  if (!VALID(cl) || VACENT(cl))\n"
   "11420\t    sprintf(buf,\"<%73.73s>| %s\",\"\",str);\n"
   "11421\t  else\n"
   "11422\t  {\n"
   "11423\t    sprintf(buf,\"<c:%-3i s:%-20.20s s:%-8.8s 
\",cl,addIpToString(&(CL.srcCallSignal)),addAliasToString(&(CL.srcInfo[0])));\n"
   "11424\t    sprintf(&(buf[strlen(buf)]),\"d:%-20.20s d:%-8.8s>| 
%s%s\",addIpToString(&(CL.destCallSignal)),addAliasToString(&(CL.destInfo[0])),spaces,str);\n"
   "11425\t  }\n"
   "11426\t}\n"
   "11427\t\n"
   "11428\t/*----------------------------------\n"
   "11429\tremove after debug*/\n"
   "11430\t#ifdef INFO_DEBUG\n"
   "11431\tvoid calprintInfoQueue(IN gkHCALL\t            hCall,\n"
   "11432\t                    IN gkcciSide_t\t\t\t\t  msgside)\n"
   "11433\t{\n"
   "11434\t  char buf[256];\n"
   "11435\t  int i;\n"
   "11436\t  int cl = -1;\n"
   "11437\t  side_t side = (msgside==gkcciSideOrig) ? ORIGIN :DESTINATION;\n"
   "11438\t\n"
   "11439\t  if (!getCallCheckAuth((UINT32)hCall, &cl) || !VALID(cl))\n"
   "11440\t  {\n"
   "11441\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8770, 
cl,\"Error: Can\'t find call entry for print info queue\"));\n"
   "11442\t    return;\n"
   "11443\t  }\n"
   "11444\t\n"
   "11445\t  sprintf(buf, \"***** Info Queue for Call %d ***\", cl);\n"
   "11446\t  CALL_NOTIFY(buf, GEN_NA, 0);\n"
   "11447\t  sprintf(buf, \"Most recent = %d Being send = %d\", 
CL.SIDE.infoMsg.mostRecent, CL.SIDE.infoMsg.beingSent);\n"
   "11448\t  CALL_NOTIFY(buf, GEN_NA, 0);\n"
   "11449\t  for (i=0; i < INFO_MSG_STORAGE_SIZE; i++)\n"
   "11450\t  {\n"
   "11451\t    sprintf(buf, \"Entry %d is %s\", i, 
(CL.SIDE.infoMsg.info[i].occupied ? \"OCCUPIED\" : \"FREE\"));\n"
   "11452\t    CALL_NOTIFY(buf, GEN_NA, 0);\n"
   "11453\t\n"
   "11454\t    if (CL.SIDE.infoMsg.info[i].occupied)\n"
   "11455\t    {\n"
   "11456\t      char *pdata = CL.SIDE.infoMsg.info[i].ns.data;\n"
   "11457\t      char tmp[10];\n"
   "11458\t\n"
   "11459\t      if (!pdata)\n"
   "11460\t        pdata = \"NULL\";\n"
   "11461\t      else\n"
   "11462\t      {\n"
   "11463\t        strncpy(tmp, pdata, 9); \n"
   "11464\t        tmp[9] = 0; \n"
   "11465\t        pdata = tmp;\n"
   "11466\t      }\n"
   "11467\t\n"
   "11468\t\n"
   "11469\t      sprintf(buf, \"Node = %x , TOC = %d, data = %10s\", 
CL.SIDE.infoMsg.info[i].node, CL.SIDE.infoMsg.info[i].TOCounter, pdata);\n"
   "11470\t      CALL_NOTIFY(buf, GEN_NA, 0);\n"
   "11471\t    }\n"
   "11472\t  }\n"
   "11473\t}\n"
   "11474\t#endif\n"
   "11475\t\n"
   "11476\t  \n"
   "11477\t\n"
   
"11478\t/*******************************************************************/\n"
   "11479\t/* Line Hunting                                                    
*/\n"
   
"11480\t/*******************************************************************/\n"
   "11481\tint lineHunt(/*hunt for next free service. return: 1 if a line was 
found\n"
   "11482\t             (might be zero=>line hunting done)\n"
   "11483\t             or ERROR if problem occured.  It calls cmCallMake if \n"
   "11484\t             makeCall is TRUE, otherwise returns */\n"
   "11485\t             IN int cl,\n"
   "11486\t             IN BOOL makeCall)\n"
   "11487\t{\n"
   "11488\t\tstatic UINT16 endpoint;\n"
   "11489\t  UINT16\t\t\t\t\t\t\tnextV1Supplier;\n"
   "11490\t\tsrvSupplierRecord_t nextSupplier;\n"
   "11491\t\tBOOL isService = 0; /* if regular call = 0, if service call = 1 
*/\n"
   "11492\t\tif (CL.round==HUNT_DONE)\n"
   "11493\t\t\treturn 0;\n"
   "11494\t  \n"
   "11495\t\tif(!CL.appLineHunting) {     \n"
   "11496\t\t\tif (CL.service == NET3_NOT_SERVICE && CL.callService == 
SRV_INVALID_SERV) { /* regualr call */\n"
   "11497\t\t\t\tCALL_NOTIFY(\"searching for destination of regular 
call\",GEN_NA,30,cl);\n"
   "11498\t\t\t\tCL.destState = DEST_FAILURE_OR_BUSY; /* adding this here so 
I\'ll know later if the call was to a\n"
   "11499\t\t\t\t\t\t\t\t\t\t\t\t\t\tservice supplier or not */\n"
   "11500\t\t\t\tCL.round=HUNT_DONE;\n"
   "11501\t\t\t\tif (addEmptyTransport(&(CL.destCallSignal))) {\n"
   "11502\t\t\t\t\tCALL_NOTIFY(\"Line Hunt did not find 
destination\",GEN_NA,10,cl);\n"
   "11503\t\t\t\t\tDBGL_CONDITION(30,gkPAR())\n"
   "11504\t\t\t\t\treturn 0;\n"
   "11505\t\t\t\t}\n"
   "11506\t\t\t}\n"
   "11507\t\t\telse {/* service call */\n"
   "11508\t\n"
   "11509\t\t\t\tchar tmp[100];\n"
   "11510\t\n"
   "11511\t\t\t\tchar data[HASH_DATA_SIZE];\t\t\t\t\n"
   "11512\t\t\t\tchar dataHandle[HASH_DATA_HANDLE_SIZE];\n"
   "11513\t\t\t\tint aliasIndex;\n"
   "11514\t\t\t\tint rr;\n"
   "11515\t\t\t\tcmRASTransport transport;\n"
   "11516\t\t\t\tint count;\n"
   "11517\t\t\t\tBOOL addressFound;\n"
   "11518\t      BOOL servicePermitted = TRUE;\n"
   "11519\t      BOOL callServicePermitted = TRUE;\n"
   "11520\t      endpoint = RGTBL_REG_NOT_VALID;\n"
   "11521\t\t\t\n"
   "11522\t\t\t\tCALL_NOTIFY(\"hunting for available service supplier. hunt 
counter = \",CL.round,30,cl);\n"
   "11523\t\t\t\tif (CL.service != NET3_NOT_SERVICE)\n"
   "11524\t\t\t\t\tif 
(!rgutilSrvcAllowed(CL.ORIG.reg,CL.service)/*serviceAvail*/)\n"
   "11525\t        {\n"
   "11526\t          servicePermitted = FALSE;\n"
   "11527\t\t\t\t\t\tCALL_NOTIFY(\"stopping V1 service line hunting because of 
lack of permission\",GEN_NA,10,cl);\n"
   "11528\t        }\n"
   "11529\t      if (CL.callService != SRV_INVALID_SERV)\n"
   "11530\t\t\t\t\tif 
(!rgutilDynSrvcAllowed(CL.ORIG.reg,CL.callService)/*serviceAvail*/)\n"
   "11531\t        {\n"
   "11532\t          callServicePermitted = FALSE;\n"
   "11533\t\t\t\t\t\tCALL_NOTIFY(\"stopping V2 service line hunting because of 
lack of permission\",GEN_NA,10,cl);\n"
   "11534\t        }\n"
   "11535\t\t\t\tif (callServicePermitted == FALSE  && servicePermitted == 
FALSE) \n"
   "11536\t      {\n"
   "11537\t\t\t\t\t\tCL.round=HUNT_DONE;\n"
   "11538\t\t\t\t\t\tDBGL_CONDITION(30,gkPR(CL.ORIG.reg));\n"
   "11539\t\t\t\t\t\treturn 0;\n"
   "11540\t      }\n"
   "11541\t\t\t\tCALL_NOTIFY(\"find next address\",GEN_NA,45,cl);\n"
   "11542\t      \n"
   "11543\t\t\t\t\n"
   "11544\t\t\t\t/* Avi: 7/2000\n"
   "11545\t\t\t\t * now check if this is an \"Mcu Style\" service, and if we 
already have a call \n"
   "11546\t\t\t\t *  to this type of service, \n"
   "11547\t\t\t\t *  if so don\'t perform line hunting, just try to connect to 
this service\n"
   "11548\t\t\t\t */\n"
   "11549\t\n"
   "11550\t\t\t\taddressFound = FALSE;\n"
   "11551\t\t\t\t\n"
   "11552\t\t\t\t/* The special service handling relevant only to specially 
marked MCU Style services */\n"
   "11553\t\t\t\tif (ConferenceHuntingService(cl)){\t\n"
   "11554\t\t\t\t\trr = findInHash(cl,data,dataHandle,&aliasIndex);\n"
   "11555\t\n"
   "11556\t\t\t\t\tif (rr) { /* We have managed to find an apropriate entry in 
the hash */\n"
   "11557\t\t\t\t\t\tCL.round = HUNT_DONE; /* Indicate that the line hunt is 
done, do not \n"
   "11558\t\t\t\t\t\t\t\t\t\t\t  search any further */\n"
   "11559\t\t\t\t\t\tdataHandleDecodeMCUHash(&transport,&count,dataHandle);\n"
   "11560\t\t\t\t\t\tsprintf(tmp,\"Found LINEHUNT in hash for ConferenceHunting 
Service: %s\",addIpToString(&transport));\n"
   "11561\t\t\t\t\t\tGK_NOTIFY(tmp,GEN_NA,10);\n"
   "11562\t\t\t\t\t\tCL.destCallSignal = transport;\n"
   "11563\t\t\t\t\t\taddressFound = TRUE;\n"
   "11564\t\t\t\t\t}\n"
   "11565\t\t\t\t\t\n"
   "11566\t\t\t\t}\n"
   "11567\t\t\t\t\n"
   "11568\t\t\t\t\n"
   "11569\t\t\t\t\n"
   "11570\t\t\t\tif (!addressFound) { /* could not find in hash, or not MCU 
Style service, \n"
   "11571\t\t\t\t\t                    perform regular line hunting */\n"
   "11572\t        if (CL.service != NET3_NOT_SERVICE) \n"
   "11573\t            nextV1Supplier = CL.lhStartSupplier;\n"
   "11574\t\t\t    if (CL.callService != SRV_INVALID_SERV)\n"
   "11575\t            nextSupplier = CL.lhStartGwServiceSupplier;\n"
   "11576\t\n"
   "11577\t\t\t\t\tif (CL.round == 0) {    /* round 0 */\n"
   "11578\t\t\t\t\t\tUINT16 islandName,foundAt;\n"
   "11579\t\t\t\t\t\tislandName = NETP_NOT_ISLAND;\n"
   
"11580\t\t\t\t\t\tnetpIslandName(CL.srcCallSignal.ip,0,&islandName,&foundAt);\n"
   "11581\t\t\t\t\t\tif (islandName == NETP_NOT_ISLAND) {\n"
   "11582\t\t\t\t\t\t\tCALL_NOTIFY(\"caller does not belong to any specified 
island. Changing to round 1\",GEN_NA,30,cl);\n"
   "11583\t\t\t\t\t\t\tCL.round = 1;\n"
   "11584\t\t\t\t\t\tCL.nextScan = RGTBL_REG_NOT_VALID;\n"
   "11585\t\t\t\t\t\tCL.nextGwServiceScan = SRV_INVALID_SUPP;\n"
   "11586\t\t\t\t\t\t}\n"
   "11587\t\t\t\t\t\telse {\n"
   "11588\t          CALL_NOTIFY(\"linehunting round 0 for service in island 
name : \",islandName,20,cl);\n"
   "11589\t          if (CL.service != NET3_NOT_SERVICE  &&  servicePermitted 
== TRUE)\n"
   "11590\t            
rgsrFindSrvcSupplierInOutIsland(CL.service,TRUE,CL.lhStartSupplier,(UINT16)CL.nextScan,&endpoint,&nextV1Supplier,islandName,&(CL.destCallSignal),
 &CL.lhPass);\n"
   "11591\t\t\t      if (CL.callService != SRV_INVALID_SERV  &&  
callServicePermitted == TRUE  \n"
   "11592\t                                                  &&  endpoint == 
RGTBL_REG_NOT_VALID) /* If V1 service supplier was not found, seek for V2 
supplier*/\n"
   "11593\t            rgsrSrvFindSupplier(CL.callService,TRUE,islandName, 
CL.lhStartGwServiceSupplier 
,CL.nextGwServiceScan,&endpoint,&(CL.destCallSignal), &nextSupplier, 
&CL.lhGwServicePass);\n"
   "11594\t          \n"
   "11595\t          if (endpoint == RGTBL_REG_NOT_VALID)\n"
   "11596\t          {\n"
   "11597\t\t\t\t\t\t\t\tCALL_NOTIFY(\"no service in specified island. Changing 
to round 2\",GEN_NA,30,cl);\n"
   "11598\t\t\t\t\t\t\t\tCL.round=2;\n"
   "11599\t\t\t\t\t\t\t  CL.nextScan = RGTBL_REG_NOT_VALID;\n"
   "11600\t\t\t\t\t\t\t  CL.nextGwServiceScan = SRV_INVALID_SUPP;\n"
   "11601\t\t\t\t\t\t\t\tCL.destCallSignal.ip = 0;\n"
   "11602\t\t\t\t\t\t\t}\n"
   "11603\t\t\t\t\t\t}\n"
   "11604\t\t\t\t\t}\n"
   "11605\t      if (CL.round == 1)\n"
   "11606\t      {\n"
   "11607\t        if (CL.service != NET3_NOT_SERVICE  &&  servicePermitted == 
TRUE)\n"
   "11608\t          
rgsrFindServiceSupplier(CL.service,CL.lhStartSupplier,(UINT16)CL.nextScan,&endpoint,&nextV1Supplier,&(CL.destCallSignal),
 &CL.lhPass);\n"
   "11609\t\t\t    if (CL.callService != SRV_INVALID_SERV  &&  
callServicePermitted == TRUE\n"
   "11610\t                                                &&  endpoint == 
RGTBL_REG_NOT_VALID) /* If V1 service supplier was not found, seek for V2 
supplier*/\n"
   "11611\t          rgsrSrvFindSupplier(CL.callService,TRUE,NETP_NOT_ISLAND, 
CL.lhStartGwServiceSupplier 
,CL.nextGwServiceScan,&endpoint,&(CL.destCallSignal), &nextSupplier, 
&CL.lhGwServicePass);\n"
   "11612\t      }\n"
   "11613\t      else\n"
   "11614\t      {\n"
   "11615\t\t\t\t\tif (CL.round == 2)\n"
   "11616\t\t\t\t\t{\n"
   "11617\t\t\t\t\t\t\tUINT16 islandName,foundAt;\n"
   "11618\t\t\t\t\t\t\tislandName = NETP_NOT_ISLAND;\n"
   
"11619\t\t\t\t\t\t\tnetpIslandName(CL.srcCallSignal.ip,0,&islandName,&foundAt);\n"
   "11620\t\t\t\t\t\tif (CL.service != NET3_NOT_SERVICE  &&  servicePermitted 
== TRUE)\n"
   
"11621\t\t\t\t\t\t\trgsrFindSrvcSupplierInOutIsland(CL.service,FALSE,CL.lhStartSupplier,(UINT16)CL.nextScan,&endpoint,&nextV1Supplier,islandName,&(CL.destCallSignal),
 &CL.lhPass);\n"
   "11622\t\t\t      if (CL.ca"
<- "llService != SRV_INVALID_SERV  &&  callServicePermitted == TRUE  \n"
   "11623\t                                                  &&  endpoint == 
RGTBL_REG_NOT_VALID) /* If V1 service supplier was not found, seek for V2 
supplier*/\n"
   "11624\t\t\t\t\t\t\trgsrSrvFindSupplier(CL.callService,FALSE,islandName, 
CL.lhStartGwServiceSupplier 
,CL.nextGwServiceScan,&endpoint,&(CL.destCallSignal), &nextSupplier, 
&CL.lhGwServicePass);\n"
   "11625\t\t\t\t\t\t}\n"
   "11626\t\t\t\t\t}\n"
   "11627\t      \n"
   "11628\t\t\t\t\tif (endpoint == RGTBL_REG_NOT_VALID) {\n"
   "11629\t\t\t\t\t\tchar buf[256];\n"
   "11630\t\t\t\t\t\tif (CL.service != NET3_NOT_SERVICE  &&  servicePermitted 
== TRUE)\n"
   "11631\t\t\t\t\t  {\n"
   "11632\t\t\t\t\t\t  sprintf(buf,\"could not find supplier of service 
%s\",net3ServiceName(CL.service));\n"
   "11633\t\t\t\t\t\t  CL.nextScan = RGTBL_REG_NOT_VALID;\n"
   "11634\t\t\t\t\t  }\n"
   "11635\t\t\t      if (CL.callService != SRV_INVALID_SERV  &&  
callServicePermitted == TRUE)\n"
   "11636\t          {\n"
   "11637\t\t\t\t\t\t\tcmRASAlias alias;\n"
   "11638\t\t\t\t\t\t\tchar string[256];\n"
   "11639\t\t\t\t\t\t\talias.string = string;\n"
   "11640\t\t\t\t\t\t\tsrvServiceGetPrefix(CL.callService, &alias);\n"
   "11641\t\t\t\t\t\t\tsprintf(buf,\"could not find supplier of service 
%s\",addAliasToString(&alias));\n"
   "11642\t\t\t\t\t\tCL.nextGwServiceScan = SRV_INVALID_SUPP;\n"
   "11643\t\t\t\t\t\t}\n"
   "11644\t          \n"
   "11645\t\t\t\t\t\tDBGL_CONDITION(30,gkPAR());\n"
   "11646\t\t\t\t\t\tCALL_NOTIFY(buf,GEN_NA,10,cl);\n"
   "11647\t\t\t\t\t\tCALL_NOTIFY(\"nextScan = \",CL.nextScan,40,cl);\n"
   "11648\t\t\t\t\t\tCALL_NOTIFY(\"nextGwServiceScan = 
\",CL.nextGwServiceScan,40,cl);\n"
   "11649\t\t\t\t\t\tCL.round = HUNT_DONE;\n"
   "11650\t\t\t\t\t\treturn 0;\n"
   "11651\t\t\t\t\t}\n"
   "11652\t\t\t\t\telse {\n"
   "11653\t\t\t\t\t\tif (CL.service != NET3_NOT_SERVICE  &&  servicePermitted 
== TRUE)     \n"
   "11654\t\t\t\t\t\t  CL.nextScan = nextV1Supplier;\n"
   "11655\t\t\t      if (CL.callService != SRV_INVALID_SERV  &&  
callServicePermitted == TRUE)\n"
   "11656\t\t\t\t\t\t\tCL.nextGwServiceScan = nextSupplier;\n"
   "11657\t\t\t\t\t\tCL.DEST.reg=endpoint;\n"
   "11658\t\t\t\t\t\trgtblEndpointType(RGTBL_GET, CL.DEST.reg, 
&(CL.DEST.endpointType));\n"
   "11659\t\t\t\t\t}\n"
   "11660\t\t\tisService = 1;\n"
   "11661\t\t\t\t} /* (!addressFound) */\n"
   "11662\t\t\t} /* service call */\n"
   "11663\t\t}\n"
   "11664\t\telse  {/* line hunting  is controled by application */\n"
   "11665\t  \n"
   "11666\t\t\tCL.destCallSignal.ip = 0;\n"
   "11667\t\t\tlnhFindNextAppLineHuntingEndpoint(cl,&CL.destCallSignal);\n"
   "11668\t\t\tif(addEmptyTransport(&CL.destCallSignal)) {\n"
   "11669\t\t\t\tCALL_NOTIFY(\"Line Hunt could not find any more application 
destinations\",GEN_NA,10,cl);\n"
   "11670\t\t\t\tCL.round = HUNT_DONE;\n"
   "11671\t\t\t\treturn 0;\n"
   "11672\t\t\t}\n"
   "11673\t\t}\n"
   "11674\t  \n"
   "11675\t\tif (CL.state!=CAL_HUNTING)\n"
   "11676\t\t\tCHANGE_STATE(CAL_HUNTING,\"line hunt\");\n"
   "11677\t\tCALL_NOTIFY(\"block\",GEN_NA,30,cl);\n"
   "11678\t\tif(makeCall) {/* actually make the call */  \n"
   "11679\t\t\tCALL_NOTIFY(\"gk sending setup to destination. Present 
parameters\",GEN_NA,10,cl);\n"
   "11680\t\t}\n"
   "11681\t\telse {\n"
   "11682\t\t\tCALL_NOTIFY(\"gk found destination (or supplier) for the call. 
The call will be completed after application approval\", GEN_NA ,10,cl);\n"
   "11683\t\t\tCALL_NOTIFY(\"Present parameters\",GEN_NA,10,cl);\n"
   "11684\t\t}\n"
   "11685\t\tif (genGetDbgL() >= 40)\n"
   "11686\t\t\tgkPC(cl);\n"
   "11687\t\telse \n"
   "11688\t\t\tif (genGetDbgL() >= 10)\n"
   "11689\t\t\t\tcalPrintCallTitles(cl);\n"
   "11690\t\tif(makeCall)  { /* actually make the call */  \n"
   "11691\t\t\treturn makeDestCall(cl, isService);\n"
   "11692\t    }          \n"
   "11693\t    return TRUE;\n"
   "11694\t}\n"
   "11695\t\n"
   "11696\t\n"
   "11697\t\n"
   "11698\tBOOL checkLineHunting( /* Check if line hunting cannot go on and 
notify the application about it. \n"
   "11699\t                       Otherwise, if makeCall is TRUE we\'ll make 
new call in the function lineHunt \n"
   "11700\t                       if not, we\'ll ask for application permission 
to resume hunting  */\n"
   "11701\t                       IN int cl,\n"
   "11702\t                       IN BOOL makeCall)\n"
   "11703\t{\n"
   "11704\t  int huntCount; \n"
   "11705\t  gkcciReason_t gkreason;\n"
   "11706\t  char buf[256];\n"
   "11707\t  \n"
   "11708\t  if(CL.destState == DEST_FAILURE_OR_BUSY ) /* error at real 
destination */\n"
   "11709\t  {\n"
   "11710\t    gkreason = dropRsnToAppRsn(cl);\n"
   "11711\t    sprintf(buf, \"call cannot be completed because of reject 
reason: %s\", gkcciReasonName(gkreason));\n"
   "11712\t    CALL_NOTIFY(buf, GEN_NA, 10, cl);\n"
   "11713\t    /*CALL_NOTIFY(\"call cannot be completed because destination is 
busy\" , GEN_NA, 10,cl);\n"
   "11714\t    CALL_NOTIFY(\"(or rejected the call for other reason)\",GEN_NA, 
10,cl);*/\n"
   "11715\t    return handleCannotComplete( cl, RSN_DESTINATION_FAILED, 
gkreason, \"Cannot complete call \");                  \n"
   "11716\t  }\n"
   "11717\t  if(CL.round==HUNT_DONE) /* no more lines for hunting */\n"
   "11718\t  {\n"
   "11719\t    gkcciReason_t reason;\n"
   "11720\t    if (CL.alertingTOExpired)\n"
   "11721\t    {\n"
   "11722\t      CL.alertingTOExpired = FALSE;\n"
   "11723\t      reason = gkcciRsnNoAnswer;\n"
   "11724\t    }\n"
   "11725\t    else\n"
   "11726\t      reason = gkcciRsnLinesBusy;\n"
   "11727\t    CALL_NOTIFY(\"call cannot be completed because no line is 
available\",GEN_NA, 10,cl);\n"
   "11728\t    return handleCannotComplete( cl, RSN_DESTINATION_FAILED, reason, 
\"Cannot complete call \");  \n"
   "11729\t  }\n"
   "11730\t  if( (huntCount=lineHunt(cl, makeCall)) ==  ERROR)\n"
   "11731\t  {\n"
   "11732\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8771, 
cl,\"checkLineHunting: Disconnecting call because of error in line hunt\"));\n"
   "11733\t    (void)stopCall(cl, RSN_FAILURE_INTERNAL, 
cmReasonTypeUndefinedReason,\n"
   "11734\t      cmReasonTypeUndefinedReason, cmRASReasonUndefined); \n"
   "11735\t    return FALSE;\n"
   "11736\t  }\n"
   "11737\t  if(huntCount == 0)\n"
   "11738\t  {\n"
   "11739\t    CALL_NOTIFY(\"call cannot be completed because no line is 
available\",GEN_NA, 10,cl);\n"
   "11740\t    return handleCannotComplete( cl, RSN_DESTINATION_FAILED, 
gkcciRsnLinesBusy, \"Cannot complete call \");\n"
   "11741\t  }\n"
   "11742\t  else\n"
   "11743\t  {\n"
   "11744\t    if(!makeCall)\n"
   "11745\t    { /* ask the application whether to proceed with line hunting */ 
\n"
   "11746\t\t  CL.setupPending = TRUE;\n"
   "11747\t      CHANGE_STATE(CAL_WAIT_HUNTING, \"request application approval 
to continue hunting\");\n"
   "11748\t      if(!sendStateEvent(cl, gkcciSttWaitLineHunting, 
gkcciRsnUndefined))\n"
   "11749\t      {\n"
   "11750\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8772, cl,\"checkLineHunting: Failed in sending line hunting request to the 
application\"));\n"
   "11751\t        (void)stopCall(cl, RSN_FAILURE_EVENT_HANDLER, 
cmReasonTypeUndefinedReason,\n"
   "11752\t          cmReasonTypeUndefinedReason, cmRASReasonUndefined); \n"
   "11753\t        return FALSE;\n"
   "11754\t      }         \n"
   "11755\t      return TRUE;\n"
   "11756\t    }\n"
   "11757\t  }\n"
   "11758\t  return TRUE;\n"
   "11759\t}\n"
   "11760\t            \n"
   "11761\t            \n"
   "11762\t            \n"
   "11763\t/*******************************************************/\n"
   "11764\t/*  Call Services                                      */\n"
   "11765\t/*******************************************************/ \n"
   "11766\t  INT32 calAppIsServiceAllowed( /* return whether the call is to a 
service, and if so whether the service\n"
   "11767\t                                 is allowed for the call and the 
service prefix */\n"
   "11768\t                                 IN   gkHCALL              hCall,\n"
   "11769\t                                 OUT  BOOL                 
*isServiceCall,\n"
   "11770\t                                 OUT  BOOL                 
*serviceAllowed, \n"
   "11771\t                                 OUT  gktypeServicePrefix_t 
servicePrefix)\n"
   "11772\t  {\n"
   "11773\t    int cl;\n"
   "11774\t    int i;\n"
   "11775\t    BOOL exactMatch;\n"
   "11776\t    UINT8 service = NET3_NOT_SERVICE;\n"
   "11777\t    srvServiceRecord_t serv;\n"
   "11778\t    \n"
   "11779\t    *isServiceCall = FALSE;\n"
   "11780\t    *serviceAllowed = FALSE;\n"
   "11781\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "11782\t    {\n"
   "11783\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
9214,-1, \"calAppIsServiceAllowed: Illegal handle: \", (UINT32)hCall ));\n"
   "11784\t      return gkcciInvalidHandle;\n"
   "11785\t    } \n"
   "11786\t    \n"
   "11787\t    /* try to found allowed V1 service */\n"
   "11788\t    if(CL.service != NET3_NOT_SERVICE)\n"
   "11789\t    {\n"
   "11790\t      service = CL.service;\n"
   "11791\t      *isServiceCall = TRUE;\n"
   "11792\t      strcpy((char*)servicePrefix, net3ServiceName(service));\n"
   "11793\t      if(rgutilSrvcAllowed(CL.ORIG.reg, service))\n"
   "11794\t      {\n"
   "11795\t          *serviceAllowed = TRUE;\n"
   "11796\t          return gkcciOK;\n"
   "11797\t      }\n"
   "11798\t    }\n"
   "11799\t    /* if there is no allowed V1 service, try to found V2 service 
*/\n"
   "11800\t    if (CL.callService != SRV_INVALID_SERV)\n"
   "11801\t    {\n"
   "11802\t      cmRASAlias alias;\n"
   "11803\t      serv = CL.callService;\n"
   "11804\t      *isServiceCall = TRUE;\n"
   "11805\t      alias.string = servicePrefix;\n"
   "11806\t      *serviceAllowed = rgutilDynSrvcAllowed(CL.ORIG.reg, 
service);\n"
   "11807\t      srvServiceGetPrefix(serv, &alias);\n"
   "11808\t\t\t  servicePrefix[alias.length] = \'\\0\'; /*sarit 3/10/00 
terminating the prefix string*/\n"
   "11809\t      if (*serviceAllowed == TRUE)\n"
   "11810\t          return gkcciOK;\n"
   "11811\t    }\n"
   "11812\t    /* seek for allowed V1/V2 service for the Call, that doesn\'t 
reach the AddressResolutionDone state */\n"
   "11813\t    if (CL.service == NET3_NOT_SERVICE  &&  CL.callService == 
SRV_INVALID_SERV)\n"
   "11814\t    {\n"
   "11815\t      for (i=0;i<DESTINATION_NUMBER;i++)\n"
   "11816\t      {\n"
   "11817\t        /* V1 service seek */\n"
   "11818\t        
net3LocateService(&(CL.destInfo[i]),&service,&exactMatch);\t\n"
   "11819\t        if (service!=NET3_NOT_SERVICE)\n"
   "11820\t        {\n"
   "11821\t          *isServiceCall = TRUE;\n"
   "11822\t          if(rgutilSrvcAllowed(CL.ORIG.reg, service)) \n"
   "11823\t          {\n"
   "11824\t            *serviceAllowed = TRUE;\n"
   "11825\t            strcpy((char*)servicePrefix, 
net3ServiceName(service));\n"
   "11826\t            if (*serviceAllowed == TRUE) \n"
   "11827\t              break;\n"
   "11828\t          }\n"
   "11829\t        }\n"
   "11830\t        /* V2 service seek */\n"
   "11831\t        if (srvPrefixFind(&(CL.destInfo[i]), &serv) != SUCCESS)\n"
   "11832\t          return FALSE;\n"
   "11833\t        else if (serv !=SRV_INVALID_SERV)\n"
   "11834\t        {\n"
   "11835\t          cmRASAlias alias;\n"
   "11836\t          alias.string = servicePrefix;\n"
   "11837\t          *serviceAllowed = rgutilDynSrvcAllowed(CL.ORIG.reg, 
service);\n"
   "11838\t          srvServiceGetPrefix(serv, &alias);\n"
   "11839\t\t\t      servicePrefix[alias.length] = \'\\0\'; /*sarit 3/10/00 
terminating the prefix string*/\n"
   "11840\t          *isServiceCall = TRUE;\n"
   "11841\t          if (*serviceAllowed == TRUE) \n"
   "11842\t            break;\n"
   "11843\t        }\n"
   "11844\t      }\n"
   "11845\t    }\n"
   "11846\t    \n"
   "11847\t    return gkcciOK;\n"
   "11848\t  }\n"
   "11849\t\n"
   
"11850\t/*----------------------------------------------------------------------------------------*/\n"
   "11851\t  \n"
   "11852\t  /* This function forward a call for version 2 aliases */\n"
   "11853\t  /* The function is really a temporary solution, until */\n"
   "11854\t  /* the stack will support v2 aliases in a text format */\n"
   "11855\t  INT32 calAppTransferVer2Call(IN   gkHCALL           hCall,\n"
   "11856\t    IN   gkaddTransport_t  *address, \n"
   "11857\t    IN   gkaddAlias_t      *aliases, \n"
   "11858\t    IN   INT32             size)\n"
   "11859\t  {\n"
   "11860\t    int cl;\n"
   "11861\t    gkcciFacility_t f;\n"
   "11862\t    \n"
   "11863\t    /* verify that the transfer is feasible according to call\n"
   "11864\t    state and the correctness of the handle */\n"
   "11865\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "11866\t    {\n"
   "11867\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
9215,-1, \"calAppTransferCall: illegal handle: \", (UINT32)hCall ));\n"
   "11868\t      return gkcciInvalidHandle;\n"
   "11869\t    }\n"
   "11870\t    if (!CL.setupArrived)\n"
   "11871\t    {\n"
   "11872\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8773, cl,\"calAppTransferCall: transfer request before setup arrived\"));\n"
   "11873\t      return gkcciInvalidOperation;\n"
   "11874\t    }\n"
   "11875\t    if((CL.ORIG.stack == NULL) || 
(CL.ORIG.state==cmCallStateDisconnected) || (CL.ORIG.state==cmCallStateIdle))\n"
   "11876\t    {\n"
   "11877\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8774, cl,\"calAppTransferCall: transfer request after disconnecting\"));\n"
   "11878\t      return gkcciInvalidOperation;\n"
   "11879\t    }\n"
   "11880\t    \n"
   "11881\t    /* place the forward using facility message */\n"
   "11882\t    if (size > FACILITY_ALIAS_NUM)\n"
   "11883\t      size = FACILITY_ALIAS_NUM;\n"
   "11884\t    memset(&f, 0, sizeof(f));\n"
   "11885\t    iutilGkCid2AppCid(f.cid,CL.cid);\n"
   "11886\t    if(address)\n"
   "11887\t\t\tmemcpy((char *)&f.alternativeTransport, address, 
sizeof(gkaddTransport_t));\n"
   "11888\t    if(aliases)\n"
   "11889\t\t\tmemcpy((char *)f.alternativeAlias, aliases, 
size*sizeof(gkaddAlias_t));\n"
   "11890\t    f.alternativeAliasSize = size;\n"
   "11891\t    f.reason = gkcciFacilityRsnCallForwarded;\n"
   "11892\t    return calAppFacilitySend(hCall, gkcciSideOrig, &f);\n"
   "11893\t  }\n"
   "11894\t\n"
   
"11895\t/*------------------------------------------------------------------------------------------*/
          \n"
   "11896\t \n"
   "11897\t  BOOL exchangeForwardInfo(/*replaces destInfo field with the 
forwarded aliasname*/\n"
   "11"
<- "898\t    IN int cl)\n"
   "11899\t    \n"
   "11900\t  {\n"
   "11901\t    int i;\n"
   "11902\t    for (i=0; i<DESTINATION_NUMBER;i++)\n"
   "11903\t      CL.destInfo[i].length=CL.destExtra[i].length=0;\n"
   "11904\t    \n"
   "11905\t    if (CL.destInfo[0].string==NULL)\n"
   "11906\t    { \n"
   "11907\t      CALL_NOTIFY(\"assign destInfo buffer in exchangeforwardInfo 
--------------------------\",GEN_NA,40,cl);\n"
   "11908\t      cmuAssignBuffer(&(CL.destInfo[0]));\n"
   "11909\t    }\n"
   "11910\t    if (CL.destExtra[0].string==NULL)\n"
   "11911\t    { \n"
   "11912\t      CALL_NOTIFY(\"assign destExtra buffer in exchangeforwardInfo 
--------------------------\",GEN_NA,40,cl);\n"
   "11913\t      cmuAssignBuffer(&(CL.destExtra[0]));\n"
   "11914\t    }\n"
   "11915\t    \n"
   "11916\t    if 
(!rgutilForwardInfo(CL.DEST.reg,&(CL.destInfo[0]),&(CL.destExtra[0])) )\n"
   "11917\t    {\n"
   "11918\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8775, cl,\"error in endpForwardInfo\"));\n"
   "11919\t      return FALSE;\n"
   "11920\t    }\n"
   "11921\t    CL.destCallSignal.ip = 0;\n"
   "11922\t    CL.DEST.reg = RGTBL_REG_NOT_VALID;\n"
   "11923\t    \n"
   "11924\t    \n"
   "11925\t    return TRUE;\n"
   "11926\t  }\n"
   "11927\t  \n"
   "11928\t  BOOL locateService(/*test if destination is a call adjust call 
serive number\n"
   "11929\t                       for both propriety and V2 (GW prefixes) 
services */\n"
   "11930\t    IN int cl)\n"
   "11931\t  {\n"
   "11932\t    int i;\n"
   "11933\t    BOOL exactMatch;\n"
   "11934\t    srvServiceRecord_t serv;\n"
   "11935\t    BOOL serviceWasFound=FALSE, callServiceWasFound=FALSE;\n"
   "11936\t\n"
   "11937\t    for (i=0;i<DESTINATION_NUMBER;i++)\n"
   "11938\t    {\n"
   "11939\t      if (serviceWasFound == FALSE)\n"
   "11940\t      {\n"
   "11941\t\n"
   "11942\t        
net3LocateService(&(CL.destInfo[i]),&(CL.service),&exactMatch);\t\n"
   "11943\t        if ((CL.service!=NET3_NOT_SERVICE) &&\n"
   "11944\t            (CL.destZone != DEST_ZONE_LOCAL || CL.service < 
NET3_SER_ZONE_NUM_PREFIX))\n"
   "11945\t        {\n"
   "11946\t          char tmp[60];\n"
   "11947\t          CL.servicePlace = i;\n"
   "11948\t          sprintf(tmp,\"Call is to V1 service : 
%s\",net3ServiceName(CL.service));\n"
   "11949\t          CALL_NOTIFY(tmp,GEN_NA,10,cl);\n"
   "11950\t          serviceWasFound = TRUE;\n"
   "11951\t        }\n"
   "11952\t      }\n"
   "11953\t      \n"
   "11954\t      if (srvPrefixFind(&(CL.destInfo[i]), &serv) != SUCCESS)\n"
   "11955\t        return FALSE;\n"
   "11956\t      if (serv !=SRV_INVALID_SERV  &&  callServiceWasFound == 
FALSE)\n"
   "11957\t      {\n"
   "11958\t        cmRASAlias alias;\n"
   "11959\t        char string[GKCFGI_SERVICE_NAME_LEN];\n"
   "11960\t        char tmp[GKCFGI_SERVICE_NAME_LEN+60];\n"
   "11961\t        alias.string = string;\n"
   "11962\t        CL.servicePlace = i;\n"
   "11963\t        CL.callService = serv;\n"
   "11964\t        srvServiceGetPrefix(serv, &alias);\n"
   "11965\t        string[alias.length] = 0;\n"
   "11966\t        sprintf(tmp, \"Call is to V2 service : 
%s\",addAliasToString(&alias));\n"
   "11967\t        CALL_NOTIFY(tmp, GEN_NA, 10, cl);\n"
   "11968\t        callServiceWasFound = TRUE;\n"
   "11969\t      }                    \n"
   "11970\t    }\n"
   "11971\t    return TRUE;\n"
   "11972\t  }\n"
   "11973\t  \n"
   "11974\t  void locateDestInZone(/*test if destination is in zone and adjust 
destination address */\n"
   "11975\t    IN int cl)\n"
   "11976\t  {\n"
   "11977\t    int i=0;\n"
   "11978\t    rgtblRecord_t rec;\n"
   "11979\t    UINT16 reg;\n"
   "11980\t    CL.destCallSignal.ip=0;\n"
   "11981\t    CL.DEST.reg=RGTBL_REG_NOT_VALID;\n"
   "11982\t    \n"
   "11983\t    for (i=0;i<DESTINATION_NUMBER;i++)\n"
   "11984\t    {\n"
   "11985\t      if (!addEmptyAlias(&(CL.destInfo[i])) )\n"
   "11986\t      {\n"
   "11987\t        INT32 hash_found;\n"
   "11988\t        if 
(!rgsrFindAddress(ADD_CMPLT_AL_PRCSN,ADD_ALIAS,&(CL.destInfo[i]),rgtblDynamicMask(),-1,&hash_found,&reg,&rec))\n"
   "11989\t          CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8776, cl,\"rgsrFindAddress failed at locateDestInZone at calls\"));\n"
   "11990\t        if (rec!=RGTBL_NULL) \n"
   "11991\t        { \n"
   "11992\t          CL.DEST.reg=reg;\n"
   "11993\t          CL.resolvedIdx = i;\n"
   "11994\t          rgutilGetFirstDynamic(ADD_IP,reg,&CL.destCallSignal);\n"
   "11995\t          if (!addEmptyTransport(&(CL.destCallSignal)))\n"
   "11996\t          {\n"
   "11997\t            \n"
   "11998\t\t\t\tchar buf[256];\n"
   "11999\t            CL.addressChange = CHNG_IP_ADDRESS_SET;\n"
   "12000\t\t\t\tsprintf(buf,\"located destination %s as registration 
%i\",addIpToString(&CL.destCallSignal),reg);\n"
   "12001\t            CALL_NOTIFY(buf,GEN_NA,20,cl);\n"
   "12002\t            return;\n"
   "12003\t          }\n"
   "12004\t        }\n"
   "12005\t      }\n"
   "12006\t    }\n"
   "12007\t  }\n"
   "12008\t/* Start sohan */\n"
   "12009\tstatic BOOL\n"
   "12010\tlog_msg(IN UINT32 log_class, IN const char      *given_msg)\n"
   "12011\t{\n"
   "12012\t        INT32   level = 0;\t\n"
   "12013\t\t/*LEVEL0; sohan*/\n"
   "12014\t#if 0\n"
   "12015\t        if (log_class == LOG_APPLICATION) \n"
   "12016\t        {\n"
   "12017\t                level = 3;\n"
   "12018\t\t\t/*LEVEL3;sohan */\n"
   "12019\t        }\n"
   "12020\t#endif\n"
   "12021\t#if 0\n"
   "12022\t        int                     level = LEVEL0;\n"
   "12023\t        switch(log_class)\n"
   "12024\t        {\n"
   "12025\t                case  LOG_WARNING:\n"
   "12026\t                        level = LEVEL0;\n"
   "12027\t                        break;\n"
   "12028\t                case  LOG_EXCEPTION:\n"
   "12029\t                        level = LEVEL0;\n"
   "12030\t                        break;\n"
   "12031\t                case  LOG_MC:\n"
   "12032\t                        level = LEVEL3;\n"
   "12033\t                        break;\n"
   "12034\t                case  LOG_APPLICATION:\n"
   "12035\t                        level = LEVEL3;\n"
   "12036\t                        break;\n"
   "12037\t                case  LOG_CHANNEL:\n"
   "12038\t                        level = LEVEL4;\n"
   "12039\t                        break;\n"
   "12040\t                case  LOG_CALL:\n"
   "12041\t                        level = LEVEL4;\n"
   "12042\t                        break;\n"
   "12043\t                case  LOG_CONFERENCE:\n"
   "12044\t                        level = LEVEL4;\n"
   "12045\t                        break;\n"
   "12046\t                case  LOG_STACK:\n"
   "12047\t                        level = LEVEL4;\n"
   "12048\t                        break;\n"
   "12049\t\t}\n"
   "12050\t#endif\n"
   "12051\t        if(strchr(given_msg, \'\\n"
   "\'))\n"
   "12052\t        {\n"
   "12053\t                /*LOG_MESSAGE(level, (char *) given_msg);*/\n"
   "12054\t        }\n"
   "12055\t        else\n"
   "12056\t        {\n"
   "12057\t                /*LOG_MESSAGE(level, (char *) \"%s\\n"
   "\", given_msg);*/\n"
   "12058\t        }\n"
   "12059\t\n"
   "12060\tReturn:\n"
   "12061\t        return TRUE;\n"
   "12062\t}\n"
   "12063\tstatic BOOL\n"
   "12064\tget_alias_mediaproxy_mapping_tbl_shm()\n"
   "12065\t{\n"
   "12066\t        key_t           shm_key = GKMC_DMGR_ALIAS_TO_MP_MAP_KEY;\n"
   "12067\t        char            *p;\n"
   "12068\t        BOOL            ret = FALSE;\n"
   "12069\t\n"
   "12070\t        p = (char *) getenv(\"CL_DEBUG\");\n"
   "12071\t        if(p && *p == \'1\')\n"
   "12072\t        {\n"
   "12073\t                shm_key += (key_t) getuid();\n"
   "12074\t        }\n"
   "12075\t\n"
   "12076\t        if((shm_id = shmget(shm_key, sizeof(struct 
alias_mediaproxy_mapping_tbl),\n"
   "12077\t                                0)) < 0)\n"
   "12078\t        {\n"
   "12079\t                sprintf(message,\n"
   "12080\t                \"failed to get shm_id for 
alias_mediaproxy_mapping_tbl; errno (%d)\\n"
   "\", errno);\n"
   "12081\t                /*log_msg(LOG_APPLICATION, message);*/\n"
   "12082\t                ret = FALSE;\n"
   "12083\t                goto Return;\n"
   "12084\t        }\n"
   "12085\t\n"
   "12086\t        if((shmp = (struct alias_mediaproxy_mapping_tbl *) 
shmat(shm_id, 0, 0)) < 0)\n"
   "12087\t        {\n"
   "12088\t                sprintf(message,\n"
   "12089\t                \"failed to attach to alias_mediaproxy_mapping_tbl 
shm; errno (%d)\\n"
   "\", errno);\n"
   "12090\t                /*log_msg(LOG_APPLICATION, message);*/\n"
   "12091\t                ret = FALSE;\n"
   "12092\t                goto Return;\n"
   "12093\t        }\n"
   "12094\t        ret = TRUE;\n"
   "12095\tReturn:\n"
   "12096\t        return ret;\n"
   "12097\t}\n"
   "12098\tstatic INT32\n"
   "12099\toutput_alias_mediaproxy_mapping_tbl_shm()\n"
   "12100\t{\n"
   "12101\t\n"
   "12102\t        INT32 i;\n"
   "12103\t\n"
   "12104\t        /*log_msg(LOG_APPLICATION, 
\"output_alias_mediaproxy_mapping_tbl_shm : Start\\n"
   "\");*/\n"
   "12105\t        for(i = 0; i < shmp->max_occupied/*10*/; i++)\n"
   "12106\t        {\n"
   "12107\t\n"
   "12108\t                
sprintf(message,\"output_alias_mediaproxy_mapping_tbl_shm : 
shmp->alias_to_MP_map[%d]= (%x).... \", i, shmp->alias_to_MP_map[i]);\n"
   "12109\t                /*log_msg(LOG_APPLICATION, message);*/\n"
   "12110\t\n"
   "12111\t                /*sprintf(message, 
\"output_alias_mediaproxy_mapping_tbl_shm : Number(Alias) - %s , Call Manager 
ip - (%s),  ,\\\n"
   "12112\tAssigned Vsu ip - %s, :\", shmp->alias_to_MP_map[i].alias, 
gkaddIp2String(shmp->alias_to_MP_map[i].call_mngr_ip, ip_address),  
shmp->alias_to_MP_map[i].media_proxy_ip);\n"
   "12113\t                log_msg(LOG_APPLICATION, message);\n"
   "12114\t                log_msg(LOG_APPLICATION, \"\\n"
   "\");*/\n"
   "12115\t\n"
   "12116\t        "
<- "}\n"
   "12117\t        sprintf(message,\"output_alias_mediaproxy_mapping_tbl_shm : 
Total number of nodes = %d \", i);\n"
   "12118\t        /*log_msg(LOG_APPLICATION, message);*/\n"
   "12119\t        /*log_msg(LOG_APPLICATION, 
\"output_alias_mediaproxy_mapping_tbl_shm: End\\n"
   "\");*/\n"
   "12120\t        return (i);\n"
   "12121\t}\n"
   "12122\t\n"
   "12123\tchar *Ip2String(IN UINT32 ipAddr, OUT char* buf)\n"
   "12124\t{\n"
   "12125\t\n"
   "12126\t  struct in_addr in;\n"
   "12127\t  in.s_addr=ipAddr;\n"
   "12128\t  sprintf(buf, \"%s\", (char *)inet_ntoa(in));\n"
   "12129\t  return (buf);\n"
   "12130\t\n"
   "12131\t/*  BYTE* ip=(BYTE*)&ipAddr;\n"
   "12132\t  sprintf(buf,\"%d.%d.%d.%d\", 
(int)ip[0],(int)ip[1],(int)ip[2],(int)ip[3]);\n"
   "12133\t  return buf;*/\n"
   "12134\t}\n"
   "12135\t\n"
   "12136\tstatic BOOL is_mainGK()\n"
   "12137\t{\n"
   "12138\t  BOOL ret = FALSE;\n"
   "12139\t\n"
   "12140\t  GK_NOTIFY(\"is_mainGK() - Start\",GEN_NA,10);\n"
   "12141\t  if(shm_id < 0 || !shmp || shmp->memory_status == 
MEMORY_IS_STALE)\n"
   "12142\t  {\n"
   "12143\t        ret = get_alias_mediaproxy_mapping_tbl_shm();\n"
   "12144\t  }\n"
   "12145\t\n"
   "12146\t  if (shm_id < 0 || !shmp)\n"
   "12147\t        ret = FALSE;\n"
   "12148\t  else {\n"
   "12149\t        if (shmp &&  shmp->max_occupied >0)\n"
   "12150\t                ret = TRUE;\n"
   "12151\t        else\n"
   "12152\t                ret = FALSE;\n"
   "12153\t        }\n"
   "12154\t\n"
   "12155\t  return ret;\n"
   "12156\t}\n"
   "12157\t\n"
   "12158\tstatic BOOL search_source_alias(IN char *alias_string, IN UINT32 
alias_len, OUT struct alias_media_proxy **alias_vsu)\n"
   "12159\t{\n"
   "12160\t\n"
   "12161\t  BOOL ret = FALSE;\n"
   "12162\t  INT32  total = TOTAL_ELEMENTS(shmp->alias_to_MP_map),i;\n"
   "12163\t  GK_NOTIFY(\"search_source_alias() - Start\",GEN_NA,10);\n"
   "12164\t  if(shm_id < 0 || !shmp || shmp->memory_status == 
MEMORY_IS_STALE)\n"
   "12165\t  {\n"
   "12166\t        ret = get_alias_mediaproxy_mapping_tbl_shm();\n"
   "12167\t  }\n"
   "12168\t\n"
   "12169\t  if (shm_id < 0 || !shmp)\n"
   "12170\t        return ret;\n"
   "12171\t\n"
   "12172\t  for(i = 0; i < shmp->max_occupied; i++)\n"
   "12173\t  {\n"
   "12174\t        if 
(strncmp(shmp->alias_to_MP_map[i].alias,alias_string,alias_len) == 0)\n"
   "12175\t        {\n"
   "12176\t                *alias_vsu = &shmp->alias_to_MP_map[i];\n"
   "12177\t                ret = TRUE;\n"
   "12178\t                break;\n"
   "12179\t        }\n"
   "12180\t  }\n"
   "12181\t  return ret;\n"
   "12182\t}\n"
   "12183\t\n"
   "12184\t/* End   sohan   */ \n"
   "12185\t \n"
   "12186\t/* Start sohan */\n"
   "12187\t  BOOL locateSrcInZone(/*test if source is in zone  */\n"
   "12188\t    IN int cl, OUT cmRASTransport *srcCallSignal)\n"
   "12189\t  {\n"
   "12190\t    int i=0;\n"
   "12191\t    rgtblRecord_t rec;\n"
   "12192\t    UINT16 reg;\n"
   "12193\t    BOOL ret = FALSE;\n"
   "12194\t  \n"
   "12195\t  \n"
   "12196\t    GK_NOTIFY(\"locateSrcInZone() - Start\",GEN_NA,10);\n"
   "12197\t    for (i=0;i<SOURCE_NUMBER;i++)\n"
   "12198\t    {\n"
   "12199\t      if (!addEmptyAlias(&(CL.srcInfo[i])) )\n"
   "12200\t      {\n"
   "12201\t        INT32 hash_found;\n"
   "12202\t        if 
(!rgsrFindAddress(ADD_CMPLT_AL_PRCSN,ADD_ALIAS,&(CL.srcInfo[i]),rgtblDynamicMask(),-1,&hash_found,&reg,&rec))\n"
   "12203\t          CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8776, cl,\"rgsrFindAddress failed at locateSrcInZone at calls\"));\n"
   "12204\t        if (rec!=RGTBL_NULL) \n"
   "12205\t        {\n"
   "12206\t          rgutilGetFirstDynamic(ADD_IP,reg,srcCallSignal);\n"
   "12207\t          if (!addEmptyTransport(srcCallSignal))\n"
   "12208\t          {\n"
   "12209\t            char buf[256];\n"
   "12210\t            sprintf(buf,\"located source  %s as registration 
%i\",addIpToString(srcCallSignal),reg);\n"
   "12211\t            CALL_NOTIFY(buf,GEN_NA,20,cl);\n"
   "12212\t\t    ret = TRUE;\n"
   "12213\t            return ret;\n"
   "12214\t          }\n"
   "12215\t        }\n"
   "12216\t      }\n"
   "12217\t    }\n"
   "12218\t    return ret;\n"
   "12219\t  }\n"
   "12220\t/* End sohan */\n"
   "12221\t  \n"
   "12222\t  \n"
   "12223\t      \n"
   "12224\t  BOOL forwardIsAForwardService(/*returns true if the service 
\'serviceNum\' is one of the various forward services*/\n"
   "12225\t    IN UINT8 serviceNum)\n"
   "12226\t    \n"
   "12227\t  {\n"
   "12228\t    switch(serviceNum)\n"
   "12229\t    {\n"
   "12230\t    case NET3_SER_FORWARD: return TRUE;\n"
   "12231\t    case NET3_SER_FORWARD_BUSY: return TRUE;\n"
   "12232\t    case NET3_SER_FORWARD_NO_ANS: return TRUE;\n"
   "12233\t    default : return FALSE;\n"
   "12234\t    }\n"
   "12235\t  }\n"
   "12236\t            \n"
   "12237\t            \n"
   "12238\t            \n"
   "12239\t  BOOL forwardDispatch(/*handles the different forward types*/\n"
   "12240\t    IN int cl)\n"
   "12241\t    \n"
   "12242\t  {\n"
   "12243\t    switch(CL.service)\n"
   "12244\t    {\n"
   "12245\t    case NET3_SER_FORWARD:\n"
   "12246\t\t\treturn forwardHandleRegularForward(cl);\n"
   "12247\t    case NET3_SER_FORWARD_BUSY: \n"
   "12248\t    case NET3_SER_FORWARD_NO_ANS: \n"
   "12249\t    default:\n"
   "12250\t\t\treturn 
disconnectCall(cl,cmReasonTypeUndefinedReason,cmReasonTypeUndefinedReason,\n"
   "12251\t\t\t\t\t\t\t\t  UNDEFINED_DROP_CAUSE, UNDEFINED_DROP_CAUSE, TRUE);\n"
   "12252\t    }\n"
   "12253\t  }\n"
   "12254\t  \n"
   "12255\t  BOOL forwardHandleRegularForward(\n"
   "12256\t    IN int cl)\n"
   "12257\t    \n"
   "12258\t  {\n"
   "12259\t    char tmp[ADD_MAX_BUF];\n"
   "12260\t    cmRASAlias alias;\n"
   "12261\t    BOOL success=TRUE;\n"
   "12262\t    alias.string = tmp;\n"
   "12263\t    \n"
   "12264\t    if (CL.servicePlace>DESTINATION_NUMBER)\n"
   "12265\t    {\n"
   "12266\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8777, cl,\"call to forwardHandleForward with no service\"));\n"
   "12267\t      return FALSE;\n"
   "12268\t    }\n"
   "12269\t    \n"
   "12270\t    if (CL.ORIG.ARQ==NULL)\n"
   "12271\t    {\n"
   "12272\t      CALL_NOTIFY(\"Rejecting forward without 
Admission\",GEN_NA,10,cl);\n"
   "12273\t      return 
(disconnectCall(cl,cmReasonTypeUndefinedReason,cmReasonTypeUndefinedReason,\n"
   "12274\t        UNDEFINED_DROP_CAUSE, UNDEFINED_DROP_CAUSE, TRUE));\n"
   "12275\t    }\n"
   "12276\t    if 
(!net3ParseService(&alias,&(CL.destInfo[CL.servicePlace]),CL.service))\n"
   "12277\t    {\n"
   "12278\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8778, cl,\"error in net3ParseService\"));\n"
   "12279\t      return FALSE;\n"
   "12280\t    }\n"
   "12281\t    if (addEmptyAlias(&alias))\n"
   "12282\t      success=cancelForward(cl,CL.ORIG.reg);\n"
   "12283\t    else\n"
   "12284\t    {\n"
   "12285\t      BOOL saveFlag = TRUE;\n"
   "12286\t      success=placeForward(cl,CL.ORIG.reg,&alias);\n"
   "12287\t      gkNVAccessSaveFlag(GKNV_SET,&saveFlag);\n"
   "12288\t    }\n"
   "12289\t    return 
(disconnectCall(cl,cmReasonTypeUndefinedReason,cmReasonTypeUndefinedReason,\n"
   "12290\t      UNDEFINED_DROP_CAUSE, UNDEFINED_DROP_CAUSE,TRUE) && 
success);\n"
   "12291\t    \n"
   "12292\t  }\n"
   "12293\t            \n"
   "12294\t            \n"
   "12295\t  \n"
   "12296\t  \n"
   "12297\t  BOOL placeForward(/*to be a local function in forward module*/\n"
   "12298\t    IN int cl,\n"
   "12299\t    IN UINT16 reg,\n"
   "12300\t    IN cmRASAlias * alias)\n"
   "12301\t  {\n"
   "12302\t    int index;\n"
   "12303\t    char tmp[ADD_MAX_BUF];\n"
   "12304\t    cmRASAlias secondForward;\n"
   "12305\t    addAddress_t addType;\n"
   "12306\t    net3GkService_t forwardType = NET3_SER_FORWARD;\n"
   "12307\t    secondForward.string = tmp;\n"
   "12308\t    secondForward.length = 0;\n"
   "12309\t    \n"
   "12310\t    if (!locateSecondForward(cl,&index))\n"
   "12311\t    {\n"
   "12312\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8779, cl,\"error in locateSecondForward\"));\n"
   "12313\t      return FALSE;\n"
   "12314\t    }\n"
   "12315\t    if (index != DESTINATION_NUMBER)\n"
   "12316\t    {\n"
   "12317\t      if 
(!net3ParseService(&secondForward,&(CL.destExtra[index]),NET3_SER_FORWARD))\n"
   "12318\t      {\n"
   "12319\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8780, cl,\"error in net3ParseService for second forward\"));\n"
   "12320\t        return FALSE;\n"
   "12321\t      }\t\n"
   "12322\t    }\n"
   "12323\t        \n"
   "12324\t#ifndef GK_SHUT_NOTIFY\n"
   "12325\t    {\n"
   "12326\t      char buf[2*ADD_MAX_BUF];\n"
   "12327\t      CALL_NOTIFY(\"placing forward service for reg \",reg,10,cl);\n"
   "12328\t      sprintf(buf,\"first forward to 
%s\",addAliasToString(alias));\n"
   "12329\t      CALL_NOTIFY(buf,GEN_NA,40,cl);\n"
   "12330\t      if (index != DESTINATION_NUMBER)\n"
   "12331\t      { \n"
   "12332\t        sprintf(buf,\"second forward to 
%s\",addAliasToString(&secondForward));\n"
   "12333\t        CALL_NOTIFY(buf,GEN_NA,40,cl);\n"
   "12334\t      }\n"
   "12335\t    }\n"
   "12336\t#endif\n"
   "12337\t    \n"
   "12338\t        \n"
   "12339\t    if 
(rgtblForward(RGTBL_SET,reg,addRasAliasType2Add(alias->type),alias,&secondForward)
 == FALSE)\n"
   "12340\t    {\n"
   "12341\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8781, cl,\"error in endpForward\"));\n"
   "12342\t      return FALSE;\n"
   "12343\t    }\n"
   "12344\t    if (!addEmptyAlias(alias))\n"
   "12345\t    {\n"
   "12346\t      addType = addRasAliasType2Add(alias->type);\n"
   "12347\t      switch(addType)\n"
   "12348\t      {\n"
   "12349\t      case ADD_E164:\n"
   "12350\t        addType = ADD_H323ID;\n"
   "12351\t        break;\n"
   "12352\t      case ADD_H323ID:\n"
   "12353\t        addType = ADD_E164;\n"
   "12354\t        break;\n"
   "12355\t      default:CALL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE, 8782, cl,\"wrong addType in place forward\"));return 
FALSE;\n"
   "12356\t      }\n"
   "12357\t      \n"
   "12358\t      if (!rgtblValid(reg))\n"
   "12359\t      {\n"
   "12360\t        CALL_NOTIFY(\"forward requested by unregistered endpoint. 
Forward not placed\",GEN_NA,0,cl);\n"
   "12361\t        return TRUE;\n"
   "12362\t      }\n"
   "12363\t      if (rgtblForward(RGTBL_SET,reg,addType,NULL,NULL) == FALSE)\n"
   "12364\t      {\n"
   "12365\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8783, cl,\"error in endpForward\"));\n"
   "12366\t        return FALSE;\n"
   "12367\t      }\n"
   "12368\t    }\n"
   "12369\t    \n"
   "12370\t    \n"
   "12371\t    if (!rgtblForwardType(RGTBL_SET,reg,&forwardType))\n"
   "12372\t    {\n"
   "12373\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8784, cl,\"error in endpForwardType\"));\n"
   "12374\t      return FALSE;\n"
   "12375\t    }\n"
   "12376\t    \n"
   "12377\t    return TRUE;\n"
   "12378\t  }\n"
   "12379\t    \n"
   "12380\t  BOOL locateSecondForward(/*searches destExtra array for second 
forward.\n"
   "12381\t                           if found, index will be the index in the 
array.\n"
   "12382\t                           if not index will be 
DESTINATION_NUMBER*/\n"
   "12383\t                           IN int cl,\n"
   "12384\t                           IN int* index)\n"
   "12385\t  {\n"
   "12386\t    int i;\n"
   "12387\t    BOOL exactMatchDummyVariable;\n"
   "12388\t    UINT8 service;\n"
   "12389\t    *index = DESTINATION_NUMBER;\n"
   "12390\t    for (i=0;i<DESTINATION_NUMBER;i++)\n"
   "12391\t    {\n"
   "12392\t      
net3LocateService(&(CL.destExtra[i]),&service,&exactMatchDummyVariable);\t\n"
   "12393\t      if (service==NET3_SER_FORWARD)\n"
   "12394\t      {\n"
   "12395\t        char tmp[60];\n"
   "12396\t        *index = i;\n"
   "12397\t        sprintf(tmp,\"located second forward : 
%s\",net3ServiceName(service));\n"
   "12398\t        CALL_NOTIFY(tmp,GEN_NA,20,cl);\n"
   "12399\t        return TRUE;\n"
   "12400\t      }\n"
   "12401\t    }\n"
   "12402\t    return TRUE;\n"
   "12403\t  }\n"
   "12404\t  \n"
   "12405\t  \n"
   "12406\t  BOOL cancelForward(/*to be a local function in forward module*/\n"
   "12407\t    IN int cl,\n"
   "12408\t    IN UINT16 reg)\n"
   "12409\t    \n"
   "12410\t  {\n"
   "12411\t    net3GkService_t forwardType = NET3_NOT_SERVICE;\n"
   "12412\t    cmRASAlias alias;\n"
   "12413\t    char tmp[ADD_MAX_BUF];\n"
   "12414\t    alias.string = tmp;\n"
   "12415\t    alias.length = 0;\n"
   "12416\t    CALL_NOTIFY(\"cancelling forward registration of endpoint 
\",reg,10,cl);\n"
   "12417\t    if (rgtblForward(RGTBL_SET,reg,ADD_E164,NULL,NULL) == FALSE)\n"
   "12418\t    {\n"
   "12419\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8785, cl,\"error in endpForward\"));\n"
   "12420\t      return FALSE;\n"
   "12421\t    }\n"
   "12422\t    if (rgtblForward(RGTBL_SET,reg,ADD_H323ID,NULL,NULL) == FALSE)\n"
   "12423\t    {\n"
   "12424\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8786, cl,\"error in endpForward\"));\n"
   "12425\t      return FALSE;\n"
   "12426\t    }\n"
   "12427\t    if (!rgtblForwardType(RGTBL_SET,reg,&forwardType))\n"
   "12428\t    {\n"
   "12429\t      CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8787, cl,\"error in endpForward\"));\n"
   "12430\t      return FALSE;\n"
   "12431\t    }\n"
   "12432\t    return TRUE;\n"
   "12433\t  }  \n"
   "12434\t            \n"
   "12435\t  BOOL handleZonePrefixedCall(/*  removes the prefix from all the 
numbers requested in this call.NOTE that permission\n"
   "12436\t    is not verified*/\n"
   "12437\t    IN int cl)\n"
   "12438\t    \n"
   "12439\t  {\n"
   "12440\t    int i;\n"
   "12441\t    BOOL success = TRUE;\n"
   "12442\t    for(i=0;i<DESTINATION_NUMBER;i++)\n"
   "12443\t    {\n"
   "12444\t      if ( (!addEmptyAlias(&CL.destInfo[i]) ) && 
(net3AliasIsPrefixed(&(CL.destInfo[i]),CL.service)))\n"
   "12445\t      {\n"
   "12446\t        success = net3DeletePrefix(&(CL.destInfo[i]),CL.service) && 
success;\n"
   "12447\t        CL.addressChange = CHNG_ZONE_PREFIX_REMOVED;\n"
   "12448\t        CL.destZone = DEST_ZONE_LOCAL;\n"
   "12449\t      }\n"
   "12450\t      if ( (!addEmptyAlias(&(CL.destExtra[i])) ) && 
(net3AliasIsPrefixed(&(CL.destExtra[i]),CL.service)))\n"
   "12451\t      {\n"
   "12452\t        success = net3DeletePrefix(&(CL.destExtra[i]),CL.service) && 
success;\n"
   "12453\t        CL.addressChange = CHNG_ZONE_PREFIX_REMOVED;\n"
   "12454\t        CL.destZone = DEST_ZONE_LOCAL;\n"
   "12455\t      }\n"
   "12456\t    }\n"
   "12457\t    if (net3ExitZone(CL.service))\n"
   "12458\t    {\n"
   "12459\t      CL.destZone = DEST_ZONE_EXTERNAL;\n"
   "12460\t      CL.addressChange = CHNG_EXIT_ZONE_PREFIX_REMOVED;\n"
   "12461\t    }\n"
   "12462\t    /*\n"
   "12463\t    if((CL.exitZone = net3ExitZone(CL.service)))\n"
   "12464\t      CL.addressChange = CHNG_EXIT_ZONE_PREFIX_REMOVED;*/\n"
   "12465\t    CL.service=NET3_NOT_SERVICE;\n"
   "12466\t    CL.servicePlace=DESTINATION_NUMBER+1;\n"
   "12467\t    return success;\n"
   "12468\t  }\n"
   "12469\t  \n"
   "12470\t \n"
   "12471\t\n"
   
"12472\t/*----------------------------------------------------------------------------------*/\n"
   "12473\t#ifdef GK_SET_DEST \n"
   "12474\t  RVAPI int CALLCONV calSetDest(IN char * dest1,\n"
   "12475\t    IN char * dest2)\n"
   "12476\t    \n"
   "12477\t  {\n"
   "12478\t    memset(calDest1,0,sizeof(calDest1));\n"
   "12479\t    memset(calDest2,0,sizeof(calDest2));\n"
   "12480\t    memcpy(calDest1,dest1,strlen(dest1));\n"
   "12481\t    memcpy(calDest2,dest2,strlen(dest2));\n"
   "12482\t    return 0;\n"
   "12483\t  }\n"
   "12484\t#endif\n"
   "12485\t  \n"
   "12486\t  \n"
   "12487\t#ifdef GK_RAS_BYPASS\n"
   "12488\t  RVAPI void CALLCONV gkRBON()\n"
   "12489\t  {\n"
   "12490\t    CALL_NOTIFY(\"setting calRASBypassFlag to 
true\",GEN_NA,10,-1);\n"
   "12491\t    calRASBypassFlag = TRUE;\n"
   "12492\t  }\n"
   "12493\t  \n"
   "12494\t  RVAPI void CALLCONV gkRBOFF()\n"
   "12495\t  {\n"
   "12496\t    CALL_NOTIFY(\"removing calRASBypassFlag - back to regular 
mode\",GEN_NA,10,-1);\n"
   "12497\t    calRASBypassFlag = FALSE;\n"
   "12498\t  }\n"
   "12499\t  \n"
   "12500\t  RVAPI BOOL CALLCONV calRASBypassValue()\n"
   "12501\t  {\n"
   "12502\t    return calRASBypassFlag;\n"
   "12503\t  }\n"
   "12504\t  \n"
   "12505\t#endif\n"
   "12506\t\n"
   "12507\t\n"
   "12508\t/*******************************************************/\n"
   "12509\t/* H.450 Support                                       */\n"
   "12510\t/*******************************************************/\n"
   "12511\t\n"
   "12512\t/*--------------------calAppNewCall----------------------*/\n"
   "12513\tINT32 calAppNewCall(IN gkHAPPCALL \t\t\t haCall,\n"
   "12514\t                     OUT gkHCALL         *hCall)\n"
   "12515\t{\n"
   "12516\t  int cl = -1;\n"
   "12517\t\n"
   "12518\t  /* assign a new call */\n"
   "12519\t  if (!assignCall(&cl))\n"
   "12520\t      return gkcciFailure;\n"
   "12521\t  CL.handle = generateHandle(cl); \n"
   "12522\t  CL.appHandle = (gkHAPPCALL)haCall;\n"
   "12523\t  CL.DEST.callNo = CL.ORIG.callNo = cl;\n"
   "12524\t  CL.model=cmRASCallModelTypeGKRouted;\n"
   "12525\t  CL.DEST.callNo = CL.ORIG.callNo = cl;\n"
   "12526\t  CALL_NOTIFY(\"GK Initiates new call\", GEN_NA, 10, cl);\n"
   "12527\t  CHANGE_STATE(CAL_WAIT_OFFERING, \"Initate new call by the GK\");\n"
   "12528\t  CL.wasAlertBeforeDisconnect = FALSE;\n"
   "12529\t  CL.setupSend = FALSE;\n"
   "12530\t  CL.setupArrived = FALSE;\n"
   "12531\t  CL.infoSrc = NO_INFORMATION;\n"
   "12532\t  \n"
   "12533\t  *hCall = (gkHCALL)CL.handle;\n"
   "12534\t  \n"
   "12535\t  /* start a new call */\n"
   "12536\t  CL.DEST.stack = NULL;\n"
   "12537\t  CL.ORIG.stack = NULL;\n"
   "12538\t  CL.setupPending = FALSE;\n"
   "12539\t  CL.sideMap = NO_SIDES;\n"
   "12540\t  *hCall = (gkHCALL)CL.handle;\n"
   "12541\t   return gkcciOK;\n"
   "12542\t\n"
   "12543\t}\n"
   "12544\t\n"
   "12545\t\n"
   "12546\t\n"
   "12547\t/*sarit 18/5/00: returns the backup hanlde of a call*/\n"
   "12548\t\n"
   "12549\tINT32 CALLCONV calAppGetBackupCallHandle(IN  gkHCALL   hCall,\n"
   "12550\t\t\t\t\t\t\t\t\t\t\t OUT gkHCALL   *hBackup) { \n"
   "12551\t\tint cl = -1;\n"
   "12552\t\tif(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "12553\t\t\treturn gkcciInvalidHandle;\n"
   "12554\t\t*hBackup = calls[cl].hBackup;\n"
   "12555\t\treturn gkcciOK;\n"
   "12556\t}\n"
   "12557\t\n"
   
"12558\t/*------------------------------------------------------------------\n"
   "12559\tassignBackupCallRec\n"
   "12560\t-------------------\n"
   "12561\tassign new backup record from call pool return FALSE if all 
backups\n"
   "12562\trecords are occupied.\n"
   
"12563\t---------------------------------------------------------------------*/\n"
   "12564\tBOOL assignBackupCallRec(OUT int *back,OUT gkHCALL   *hBackup) {\n"
   "12565\t    int cl=0;\n"
   "12566\t    *back=-1;\n"
   "12567\t\t*hBackup=NULL;\n"
   "12568\t\t/*if all the backup records are taken return false*/\n"
   "12569\t\tif(usedBackups >= maxBackups)\n"
   "12570\t\t\treturn FALSE;\n"
   "12571\t\n"
   "12572\t\tfor(cl=0; cl<globalMaxCalls-1; cl++) {\n"
   "12573\t\t\tif (VACENT(cl)) {\n"
   "12574\t\t\t\tCL.nextScan = 0;\n"
   "12575\t\t\t\t*back=cl;\n"
   "12576\t\t\t\tbreak;\n"
   "12577\t\t\t}\n"
   "12578\t    }\n"
   "12579\t\tif(*back != -1) { /* a new backup was allocated*/\n"
   "12580\t\t\tcalls[*back].handle = generateHandle(cl);\n"
   "12581\t\t\t*hBackup = (gkHCALL)calls[*back].handle;\n"
   "12582\t\t\tusedBackups++;\n"
   "12583\t\t\treturn TRUE;\n"
   "12584\t\t}\n"
   "12585\t\treturn FALSE;\n"
   "12586\t}\n"
   "12587\t\n"
   "12588\t/*-------------------backupCall----------------------------*/\n"
   "12589\t/*sarit 18/5/00: backup a call record into the hBackup handle*/\n"
   "12590\tstatic INT32 backupCall(IN  gkHCALL   hCall) {\n"
   "12591\t\t\n"
   "12592\t\tint cl, back;\n"
   "12593\t\tUINT16 auth;\n"
   "12594\t\tgkHCALL   hBackup;\n"
   "12595\t\t/*get the original call index*/\n"
   "12596\t\tif(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "12597\t\t\treturn gkcciInvalidHandle;\n"
   "12598\t\t\n"
   "12599\t\t/*create a backup call inside the original call*/\n"
   "12600\t\tif (!assignBackupCallRec(&back,&hBackup) < 0)\n"
   "12601\t      return gkcciFailure;\n"
   "12602\t\t/*save parameters before memcpy*/\t\n"
   "12603\t\tauth = calls[back].auth;\n"
   "12604\t\t\n"
   "12605\t\tmemcpy(&(calls[back]),&(calls[cl]),sizeof(callInfo_t));\n"
   "12606\t\t\n"
   "12607\t\tcalls[cl].hBackup = hBackup; /*set the back up for the original 
call*/\n"
   "12608\t\tcalls[back].handle = hBackup;\n"
   "12609\t\tcalls[back].hBackup = NULL;\n"
   "12610\t\tcalls[back].auth = auth; /*return the parameters to the call 
record*/\n"
   "12611\t\treturn gkcciOK;\n"
   "12612\t}\n"
   "12613\t\n"
   "12614\t\n"
   "12615\tINT32 calAppCallDial(IN gkHCALL          hCall,\n"
   "12616\t                     IN gkaddTransport_t *destCSAddress,\n"
   "12617\t                     IN gkaddAlias_t     *destAlias,\n"
   "12618\t                     IN int              destAliasNum,\n"
   "12619\t                     IN gkHCALL          refCallHandle)\n"
   "12620\t{\n"
   "12621\t  cmAlias alias;\n"
   "12622\t  gkaddAlias_t *pAlias;\n"
   "12623\t  cmRASTransport trans;\n"
   "12624\t  char addbuf[ADD_MAX_BUF];\n"
   "12625\t  int idx, i, maxAddress;\n"
   "12626\t  int cl = -1;\n"
   "12627\t\n"
   "12628\t  alias.string = addbuf; \n"
   "12629\t  if (!destCSAddress && !destAliasNum)\n"
   "12630\t    return gkcciInvalidParam;\n"
   "12631\t\n"
   "12632\t  if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "12633\t    return gkcciInvalidHandle;\n"
   "12634\t\n"
   "12635\t  CALL_NOTIFY(\"GK Dial\", GEN_NA, 10, cl);\n"
   "12636\t  /* set the refernce call attributes */\n"
   "12637\t  if (refCallHandle != GKCCI_CALL_NOT_VALID)\n"
   "12638\t  {\n"
   "12639\t    int rcl;\n"
   "12640\t    \n"
   "12641\t    if(!getCallCheckAuth((UINT32)refCallHandle, &rcl))\n"
   "12642\t      return gkcciInvalidHandle;\n"
   "12643\t\n"
   "12644\t    /* Copy key elements from the reference call */\n"
   "12645\t    CL.rate = calls[rcl].rate;\n"
   "12646\t    CL.multirate = calls[rcl].multirate;\n"
   "12647\t    CL.irrFrequency = calls[rcl].irrFrequency;\n"
   "12648\t    CL.callType = calls[rcl].callType;\n"
   "12649\t    CL.model = calls[rcl].model;\n"
   "12650\t    CL.mediaWaitForConnect = calls[rcl].mediaWaitForConnect;\n"
   "12651\t    CL.canMapAliasForCall = calls[rcl].canMapAliasForCall;\n"
   "12652\t    CL.canOverlapSend = calls[rcl].canOverlapSend;\n"
   "12653\t    CL.alertingTimeout = calls[rcl].alertingTimeout;\n"
   "12654\t    CL.mcConnHandle = calls[rcl].mcConnHandle;\n"
   "12655\t    memcpy(CL.cid, calls[rcl].cid, sizeof(CL.cid));\n"
   "12656\t  }\n"
   "12657\t\n"
   "12658\t  /* Set the new call parameters */\n"
   "12659\t  CL.ORIG.stack = NULL;\n"
   "12660\t  CL.sideMap &= ONE_SIDE_DEST;\n"
   "12661\t  CL.state = CAL_HANDLES;\n"
   "12662\t  CL.previousState = CAL_NO_CALL;\n"
   "12663\t  CL.appState = (gkcciState_t)-1;\n"
   "12664\t\n"
   "12665\t  /* load parameters */\n"
   "12666\t  idx = 0;\n"
   "12667\t  if (destAlias && destAliasNum > 0)\n"
   "12668\t  {  \n"
   "12669\t    maxAddress = (destAliasNum < DESTINATION_NUMBER ? destAliasNum : 
DESTINATION_NUMBER);\n"
   "12670\t    for (i=idx, pAlias = destAlias; i < maxAddress ; i++)\n"
   "12671\t    {\n"
   "12672\t      if (!CL.destInfo[i].string) {\n"
   "12673\t        if (!cmuAssignBuffer(&CL.destInfo[i]))\n"
   "12674\t        {\n"
   "12675\t          stopCall(cl, RSN_FAILURE_INTERNAL, \n"
   "12676\t            cmReasonTypeUndefinedReason,cmReasonTypeUndefinedReason, 
\n"
   "12677\t            cmRASReasonUndefined);\n"
   "12678\t          return gkcciFailure;\n"
   "12679\t        }\n"
   "12680\t      } \n"
   "12681\t      \n"
   "12682\t      iutilAppAlias2GkAlias(&CL.destInfo[i], pAlias++);\n"
   "12683\t    }\n"
   "12684\t  }\n"
   "12685\t  \n"
   "12686\t  if (destCSAddress) \n"
   "12687\t  {\n"
   "12688\t    if (iutilAppIp2GkIp(&trans, destCSAddress))\n"
   "12689\t      memcpy(&CL.destCallSignal, &trans, sizeof(trans));\n"
   "12690\t  }\n"
   "12691\t  \n"
   "12692\t  /* fill a default src callSignalAddress */\n"
   "12693\t  cmGetLocalCallSignalAddress(dispStack, &CL.srcCallSignal);\n"
   "12694\t  \n"
   "12695\t  /* in any case start address resolution after this setup */\n"
   "12696\t  CL.reason = RSN_NEW_GK_CALL;\n"
   "12697\t  /* CL.infoSrc = SETUP_INFORMATION;*/\n"
   "12698\t  CHANGE_STATE(CAL_ADDRESS_RESOLUTION, \"Address resolution request 
was sent to application for GK setup\");                       \n"
   "12699\t  \n"
   "12700\t  if(!sendStateEvent(cl, gkcciSttAddressResolution, 
gkcciRsnGKInitiatedCall))\n"
   "12701\t  {\n"
   "12702\t    stopCall(cl, RSN_FAILURE_EVENT_HANDLER,\n"
   "12703\t      cmReasonTypeUndefinedReason,cmReasonTypeUndefinedReason, \n"
   "12704\t      cmRASReasonUndefined);\n"
   "12705\t    retu"
<- "rn gkcciFailure;\n"
   "12706\t  }\n"
   "12707\t  return gkcciOK;\n"
   "12708\t}\n"
   "12709\t\n"
   "12710\t\n"
   
"12711\t/*-----------------------------------------------------------------------*/\n"
   "12712\t/* move one side of existing call to the vacant place in one-sided 
call  */\n"
   "12713\t/* the move itself should be performed in a critical section         
    */\n"
   "12714\tINT32 CALLCONV calAppMoveCall(IN gkHCALL hCallsrc,\n"
   "12715\t                             IN gkcciSide_t srcSide,\n"
   "12716\t                             IN gkHCALL hCalldest)\n"
   "12717\t{\n"
   "12718\t    int clsrc, cl, i;\n"
   "12719\t    side_t sidesrc, side;\n"
   "12720\t\n"
   "12721\t    if(!getCallCheckAuth((UINT32)hCallsrc, &clsrc))\n"
   "12722\t        return gkcciInvalidHandle;\n"
   "12723\t\n"
   "12724\t    if(!getCallCheckAuth((UINT32)hCalldest, &cl))\n"
   "12725\t        return gkcciInvalidHandle;\n"
   "12726\t\n"
   "12727\t    if (CL.sideMap == JOINED) {\n"
   "12728\t        CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 
8788, cl,\"Illegal attempt to move call to a joined call\"));\n"
   "12729\t        return gkcciInvalidOperation;\n"
   "12730\t    }\n"
   "12731\t\n"
   "12732\t    sidesrc = (side_t)srcSide;\n"
   "12733\t    side = (DEST_ONLY_CALL(cl) ? ORIGIN : DESTINATION);\n"
   "12734\t\n"
   "12735\t    semSemaphoreTake();\n"
   "12736\t\n"
   "12737\t    /*set a backup call record for the original call*/\n"
   "12738\t    backupCall(hCallsrc);\n"
   "12739\t   \n"
   "12740\t    /* move src to dest and clear dest*/\n"
   "12741\t    memcpy(&(CL.SIDE), &(calls[clsrc].sideInfo[sidesrc]) 
,sizeof(perSideInfo_t));\n"
   "12742\t    memset(&(calls[clsrc].sideInfo[sidesrc]), 0, 
sizeof(perSideInfo_t));\n"
   "12743\t    CL.SIDE.callNo = cl;\n"
   "12744\t    cmSetCallHandle(CL.SIDE.stack ,(HAPPCALL)&(CL.SIDE.callNo));\n"
   "12745\t\n"
   "12746\t    CL.state = CAL_CONNECT;\n"
   "12747\t    CL.previousState = CAL_HUNTING;\n"
   "12748\t    CL.round = HUNT_DONE;\n"
   "12749\t    CL.model = cmCallModelTypeGKRouted;\n"
   "12750\t    CL.sideMap &= ((side == DESTINATION) ? ONE_SIDE_DEST : 
ONE_SIDE_ORIG); \n"
   "12751\t    CL.setupArrived = TRUE; \n"
   "12752\t\n"
   "12753\t    if (CL.rate > calls[clsrc].rate) {\n"
   "12754\t        CL.rate = calls[clsrc].rate;\n"
   "12755\t\t    CL.multirate = calls[clsrc].multirate;\n"
   "12756\t    }\n"
   "12757\t    if (CL.DEST.stack != NULL) {\n"
   "12758\t\t    cmCallSetRate(CL.DEST.stack, CL.rate);\n"
   "12759\t        cmCallSetParam(CL.DEST.stack, cmParamMultiRate, 1, 
CL.multirate, NULL);\n"
   "12760\t    }\n"
   "12761\t    if (CL.ORIG.stack != NULL) {\n"
   "12762\t\t    cmCallSetRate(CL.ORIG.stack, CL.rate);\n"
   "12763\t\t    cmCallSetParam(CL.ORIG.stack, cmParamMultiRate, 1, 
CL.multirate, NULL);\n"
   "12764\t    }\n"
   "12765\t\n"
   "12766\t    if (sidesrc == DESTINATION) {\n"
   "12767\t\n"
   "12768\t        /* Avi : deassign buffers first*/ \n"
   "12769\t        for (i=0;i<SOURCE_NUMBER;i++)\n"
   "12770\t\t\t    cmuFreeAlias(&(CL.srcInfo[i]));\n"
   "12771\t\n"
   "12772\t        memcpy(CL.srcInfo, calls[clsrc].destInfo, 
SOURCE_NUMBER*sizeof(cmRASAlias));\n"
   "12773\t        memcpy(&CL.srcCallSignal, &calls[clsrc].destCallSignal, 
sizeof(cmRASTransport));\n"
   "12774\t\n"
   "12775\t        memcpy(&CL.alertingH245Add, &calls[clsrc].alertingH245Add, 
sizeof(cmRASTransport));\n"
   "12776\t        memcpy(&CL.connectH245Add, &calls[clsrc].connectH245Add, 
sizeof(cmRASTransport));\n"
   "12777\t        memcpy(&CL.callProcH245Add, &calls[clsrc].callProcH245Add, 
sizeof(cmRASTransport));\n"
   "12778\t\n"
   "12779\t        calls[clsrc].alertingH245Add.ip = 0; 
calls[clsrc].alertingH245Add.port = 0;\n"
   "12780\t        calls[clsrc].connectH245Add.ip = 0;  
calls[clsrc].connectH245Add.port = 0;\n"
   "12781\t        /* calls[clsrc].srcCallSignal.ip = 0;   
calls[clsrc].srcCallSignal.port = 0;*/\n"
   "12782\t        calls[clsrc].destCallSignal.ip = 0;   
calls[clsrc].destCallSignal.port = 0;\n"
   "12783\t        calls[clsrc].sideMap |= ONE_SIDE_ORIG;\n"
   "12784\t\n"
   "12785\t        /* the alias buffer are now in use in the new call entry 
*/\n"
   "12786\t        /* clean the reference to them in the old entry so they  
*/\n"
   "12787\t        /* won\'t be free when the old call entry is cleared      
*/\n"
   "12788\t        for (i=0; i < DESTINATION_NUMBER; i++) {\n"
   "12789\t\n"
   "12790\t            calls[clsrc].destInfo[i].string = NULL; \n"
   "12791\t            calls[clsrc].destInfo[i].length = 0;\n"
   "12792\t        }\n"
   "12793\t    }\n"
   "12794\t    else {\n"
   "12795\t        /* Avi : deassign buffers first*/ \n"
   "12796\t        for (i=0;i<SOURCE_NUMBER;i++)\n"
   "12797\t\t\t    cmuFreeAlias(&(CL.srcInfo[i]));\n"
   "12798\t\n"
   "12799\t        memcpy(CL.srcInfo, calls[clsrc].srcInfo, 
SOURCE_NUMBER*sizeof(cmRASAlias));\n"
   "12800\t        memcpy(&CL.srcCallSignal, &calls[clsrc].srcCallSignal, 
sizeof(cmRASTransport));\n"
   "12801\t\n"
   "12802\t        for(i=0; i< SOURCE_NUMBER; i++) {\n"
   "12803\t            calls[clsrc].srcInfo[i].string = NULL;\n"
   "12804\t            calls[clsrc].srcInfo[i].length = 0;\n"
   "12805\t        }\n"
   "12806\t\n"
   "12807\t        calls[clsrc].srcCallSignal.ip = 0;   \n"
   "12808\t        calls[clsrc].srcCallSignal.port = 0;\n"
   "12809\t        calls[clsrc].sideMap |= ONE_SIDE_DEST;\n"
   "12810\t    }\n"
   "12811\t\n"
   "12812\t    semSemaphoreGive();\n"
   "12813\t    return gkcciOK;   \n"
   "12814\t}\n"
   "12815\t\n"
   "12816\t\n"
   "12817\t\n"
   "12818\t\n"
   "12819\t\n"
   
"12820\t/*----------------------------------------------------------------------------*/\n"
   "12821\tINT32 appendSupplementaryServices(IN int cl,\n"
   "12822\t                                    IN side_t side)\n"
   "12823\t                                    \n"
   "12824\t{\n"
   "12825\t#define SSE_H450_MAX_BUF_SIZE 2048\n"
   "12826\t  UINT8 h450buf[SSE_H450_MAX_BUF_SIZE];\n"
   "12827\t  UINT16 h450size;\n"
   "12828\t  sseH450Record_t record, nextRecord;\n"
   "12829\t  UINT8 frc;\n"
   "12830\t\n"
   "12831\t  nextRecord = CL.SIDE.h450.queueHead;\n"
   "12832\t  while((record = nextRecord) != SSE_INVALID_BUF)\n"
   "12833\t  {\n"
   "12834\t    if (memRecordLength(&memHandler, record) > 
SSE_H450_MAX_BUF_SIZE)\n"
   "12835\t      return gkcciOutOfBounds;\n"
   "12836\t    \n"
   "12837\t    if (!memGet(&memHandler, record, h450buf, &h450size))\n"
   "12838\t      return gkcciFailure;\n"
   "12839\t    \n"
   "12840\t    if (!memAdditionalInfoGet(&memHandler, record, &frc))\n"
   "12841\t      return gkcciFailure;\n"
   "12842\t    \n"
   "12843\t    if (cmCallSendSupplementaryService(CL.SIDE.stack,h450buf, 
h450size, (BOOL)frc) < 0)\n"
   "12844\t      return gkcciGKFailure;\n"
   "12845\t    \n"
   "12846\t    if (!memGetNextRecord(&memHandler, record, &nextRecord))\n"
   "12847\t      return gkcciFailure;\n"
   "12848\t\n"
   "12849\t  }\n"
   "12850\t  return gkcciOK;\n"
   "12851\t}\n"
   "12852\t\n"
   
"12853\t/*----------------------------------------------------------------------------*/\n"
   "12854\tINT32 CALLCONV gkcciSendSupplementaryServices(IN gkHCALL   hCall,\n"
   "12855\t                                             IN gkcciSide_t 
callSide,\n"
   "12856\t                                             IN void *buffer,\n"
   "12857\t                                             IN int size,\n"
   "12858\t                                             IN BOOL force)\n"
   "12859\t{\n"
   "12860\t  int cl;\n"
   "12861\t  sseH450Record_t record;\n"
   "12862\t  side_t side = (callSide == gkcciSideOrig ? ORIGIN : 
DESTINATION);\n"
   "12863\t  \n"
   "12864\t\n"
   "12865\t  if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "12866\t  {\n"
   "12867\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 9216, 
-1 ,\"gkcciSendSupplementaryServices: Illegal handle: \", (UINT32)hCall ));\n"
   "12868\t    return gkcciInvalidHandle;\n"
   "12869\t  }\n"
   "12870\t\t\t\t\t\t\t\t\n"
   "12871\t  if (CL.SIDE.stack == NULL || (side == ORIGIN && !CL.callProcSent 
&& force))\n"
   "12872\t  {\n"
   "12873\t    CALL_NOTIFY(\"storing h450Msg in gkcciSendSupplementaryService 
on side\",side,20,cl);\n"
   "12874\t\n"
   "12875\t    record = memPut(&memHandler, (UINT8*)buffer, (UINT16)size);\n"
   "12876\t    if (!memAdditionalInfoSet(&memHandler, record, (UINT8)force))\n"
   "12877\t      return gkcciFailure;\n"
   "12878\t\n"
   "12879\t    if (CL.SIDE.h450.queueTail != SSE_INVALID_BUF)\n"
   "12880\t    {\n"
   "12881\t      if (!memSetNextRecord(&memHandler, CL.SIDE.h450.queueTail, 
record))\n"
   "12882\t        return gkcciFailure;\n"
   "12883\t    }\n"
   "12884\t    else\n"
   "12885\t    {\n"
   "12886\t      CL.SIDE.h450.queueHead = record;\n"
   "12887\t    }\n"
   "12888\t    CL.SIDE.h450.queueTail = record;\n"
   "12889\t  }\n"
   "12890\t\n"
   "12891\t  else\n"
   "12892\t  {\n"
   "12893\t    if 
(cmCallSendSupplementaryService(CL.SIDE.stack,buffer,size,force) < 0)\n"
   "12894\t      return gkcciGKFailure;\n"
   "12895\t  }\n"
   "12896\t\n"
   "12897\t  return gkcciOK;\n"
   "12898\t}\n"
   "12899\t\n"
   
"12900\t/*----------------------------------------------------------------------------*/\n"
   "12901\tRVAPI\n"
   "12902\tINT32 CALLCONV gkcciExchangeSusHandles(IN  gkHCALL  hCall,\n"
   "12903\t                                       IN  gkHSuS   hSus)\n"
   "12904\t{\n"
   "12905\t    INT32 res;\n"
   "12906\t  int cl;\n"
   "12907\t  semSemaphoreTake();\n"
   "12908\t  if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "12909\t    return gkcciInvalidHandle;\n"
   "12910\t\n"
   "12911\t  CL.gksusHandle = hSus;\n"
   "12912\t  ReturnAndGiveSem(gkcciOK);\n"
   "12913\t}\n"
   "12914\t\n"
   "12915\tRVAPI\n"
   "12916\tINT32 CALLCONV gkcciGetSuSHan"
<- "dle(IN  gkHCALL  hCall,\n"
   "12917\t                                 OUT gkHSuS*  hSus)\n"
   "12918\t{\n"
   "12919\t    INT32 res;\n"
   "12920\t  int cl;\n"
   "12921\t\n"
   "12922\t  semSemaphoreTake();\n"
   "12923\t  if(!getCallCheckAuth((UINT32)hCall, &cl)){\n"
   "12924\t    ReturnAndGiveSem(gkcciInvalidHandle);\n"
   "12925\t  }\n"
   "12926\t\n"
   "12927\t  *hSus = CL.gksusHandle;\n"
   "12928\t  ReturnAndGiveSem(gkcciOK);\n"
   "12929\t}\n"
   "12930\t\n"
   "12931\t\n"
   "12932\t/*\n"
   "12933\t\n"
   "12934\tINT32 CALLCONV gkcciSplitCall(IN  gkHCALL hCall,\n"
   "12935\t                              OUT gkHCALL *hCallOrigOnly,\n"
   "12936\t                              OUT gkHCALL *hCallDestOnly)\n"
   "12937\t{\n"
   "12938\t  int cl2, cl;\n"
   "12939\t\n"
   "12940\t  if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "12941\t    return gkcciInvalidHandle;\n"
   "12942\t\n"
   "12943\t  if (!assignCall(&cl2))\n"
   "12944\t      return gkcciFailure;\n"
   "12945\t\n"
   "12946\t  memcpy(&calls[cl2], &calls[cl], sizeof(callInfo_t));\n"
   "12947\t  memset(&calls[cl].sideInfo[DESTINATION], 0, 
sizeof(perSideInfo_t));\n"
   "12948\t  memset(&calls[cl2].sideInfo[ORIGIN], 0, sizeof(perSideInfo_t));\n"
   "12949\t  calls[cl2].handle = generateHandle(cl2); \n"
   "12950\t  calls[cl2].sideInfo[DESTINATION].callNo = cl2;\n"
   "12951\t  cmSetCallHandle(calls[cl2].sideInfo[DESTINATION].stack 
,(HAPPCALL)&(calls[cl2].sideInfo[DESTINATION].callNo));\n"
   "12952\t  *hCallOrigOnly = hCall;\n"
   "12953\t  *hCallDestOnly = (gkHCALL)calls[cl2].handle;\n"
   "12954\t  return gkcciOK;\n"
   "12955\t}\n"
   "12956\t*/\n"
   "12957\t\n"
   
"12958\t/****************************************************************************************************\n"
   "12959\t\n"
   "12960\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGK RECOVERY MANAGEMENT\n"
   "12961\t\n"
   
"12962\t*****************************************************************************************************/\n"
   "12963\t\n"
   "12964\tINT32 calAppRMCallBackup(\n"
   "12965\t\tIN\t\t\tgkHCALL\t\t\t\thCall,\n"
   "12966\t\tOUT\t\t\tgkcciRMCall*\torigin,/*set to NULL if only destination 
information is desired*/\n"
   "12967\t\tOUT\t\t\tgkcciRMCall*\tdestination/*set to NULL if only origin 
information is desired*/)\n"
   "12968\t{\n"
   "12969\t\tINT32 tmp,rr=gkcciOK;\t\n"
   "12970\t\tint cl = 0;\n"
   "12971\t\tif(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "12972\t  {\n"
   "12973\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 9216, 
-1 ,\"calAppRMCallBackup: Illegal handle: \", (UINT32)hCall ));\n"
   "12974\t    return gkcciInvalidHandle;\n"
   "12975\t  }\n"
   "12976\t\t/*optional - dont backup a side that is in middle of ARQ DRQ or 
BRQ*/\n"
   "12977\t\tif (origin)\n"
   "12978\t\t\tif ((tmp = RMCallBackup(cl,hCall,gkcciSideOrig,origin)) < 0) rr 
= tmp;\n"
   "12979\t\tif (destination)\n"
   "12980\t\t\tif ((tmp = RMCallBackup(cl,hCall,gkcciSideDest,destination)) < 
0) rr = tmp;\n"
   "12981\t\treturn rr;\n"
   "12982\t}\n"
   "12983\t\n"
   "12984\tRVAPI\n"
   "12985\tINT32 CALLCONV calAppRMCallRestore(/*restores the specified call 
according to the data in the RMCall structures.\n"
   "12986\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGK will then update this call so 
it can recover its RAS activity.\n"
   "12987\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgkcci error value returned if none 
of the specified sides has RAS control,\n"
   "12988\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tor if such a call already exists 
in the call table.*/\n"
   "12989\t\tOUT\t\t\tgkHCALL*\t\t\thCall,/*handle to the call entry that was 
restored*/\n"
   "12990\t\tIN\t\t\tgkHAPPCALL\t\thaCall,\n"
   "12991\t\tIN\t\t\tgkcciRMCall*\torigin,/*set to NULL if setting only 
destination information*/\n"
   "12992\t\tIN\t\t\tgkcciRMCall*\tdestination/*set to NULL if setting only 
origin information*/)\n"
   "12993\t\n"
   "12994\t{\n"
   "12995\t\tint cl=NOT_CALL,cl_a=NOT_CALL,cl_b=NOT_CALL;\n"
   "12996\t\tINT32 res,tmp,rr=gkcciOK;\n"
   "12997\t\tcmRASTransport tr_a,tr_b;\n"
   "12998\t\n"
   "12999\t   semSemaphoreTake();\n"
   "13000\t/*TBD: locate call by the identifier field and recover the data to 
that entry.*/\n"
   "13001\t\n"
   "13002\t\t/*verify such a call does not yet exist*/\n"
   "13003\t\tif (origin && origin->valid) {\n"
   "13004\t\t\tiutilAppIp2GkIp(&tr_a,&(origin->UDPAddress));\n"
   "13005\t\t\tcl_a = 
locateCallByCRV(origin->CRVras,&tr_a,origin->callID,origin->confID,ORIGIN);\n"
   "13006\t\t}\n"
   "13007\t\tif (destination && destination->valid) {\n"
   "13008\t\t\tiutilAppIp2GkIp(&tr_b,&(destination->UDPAddress));\n"
   "13009\t\t\tcl_b = 
locateCallByCRV(destination->CRVras,&tr_b,destination->callID,destination->confID,DESTINATION);\n"
   "13010\t\t}\n"
   "13011\t\tif (VALID(cl_a) || VALID(cl_b))\n"
   "13012\t\t{\n"
   "13013\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 9216, 
-1 ,\"CallRestore on existing call. : \"));\n"
   "13014\t     ReturnAndGiveSem(gkcciFailure);\n"
   "13015\t  }\n"
   "13016\t\n"
   "13017\t\n"
   "13018\t\tif (!((origin && origin->valid && origin->RASControlled) || \n"
   "13019\t\t\t\t\t(destination && destination->valid && 
destination->RASControlled))) {\n"
   "13020\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 9216, 
-1 ,\"gkcciRMCallRestore:NO RAS on call\"));\n"
   "13021\t\t\t ReturnAndGiveSem(gkcciFailure);/*Do not recover calls with no 
RAS*/\n"
   "13022\t\t\t/*optional - dont restore a side that is in middle of ARQ DRQ or 
BRQ*/\n"
   "13023\t\t}\n"
   "13024\t\tif (!assignCall(&cl))\n"
   "13025\t\t\t ReturnAndGiveSem(gkcciGKFailure);\n"
   "13026\t\t*hCall = generateHandle(cl);\n"
   "13027\t\t\n"
   "13028\t\tif (origin && origin->valid) {\n"
   "13029\t\t\tif ((tmp = RMLinkToRegtable(cl,ORIGIN,origin)) < 0) rr = tmp;\n"
   "13030\t\t\tif ((tmp = RMRestoreData(cl,gkcciSideOrig,origin)) < 0) rr = 
tmp;\n"
   "13031\t\t}\n"
   "13032\t\n"
   "13033\t\tif (destination && destination->valid) {\n"
   "13034\t\t\tif ((tmp = RMLinkToRegtable(cl,DESTINATION,destination)) < 0) rr 
= tmp;\n"
   "13035\t\t\tif ((tmp = RMRestoreData(cl,gkcciSideDest,destination)) < 0) rr 
= tmp;\n"
   "13036\t\t}\n"
   "13037\t\tif ((tmp = 
RMRestoreFunctionality(cl,*hCall,haCall,origin,destination)) < 0) rr = tmp;\n"
   "13038\t\t ReturnAndGiveSem(rr);\n"
   "13039\t}\n"
   "13040\t\n"
   "13041\tBOOL calAppRMIsRecovered(/*returns TRUE if specified call is a 
recovered call.\n"
   "13042\t\t\t\t\t\t\t\t\t\t\t\t\t\totherwise, or if call does not exist 
returns FALSE*/\n"
   "13043\t\tOUT\t\t\tgkHCALL\t\t\t\thCall,\n"
   "13044\t\tIN\t\t\tgkcciSide_t\t\tsd)\n"
   "13045\t{\n"
   "13046\t\tint cl = 0;\n"
   "13047\t\tside_t side = (sd == gkcciSideOrig ? ORIGIN : DESTINATION);\n"
   "13048\t\tif(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "13049\t  {\n"
   "13050\t    CALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 9216, 
-1 ,\"calAppRMCallBackup: Illegal handle: \", (UINT32)hCall ));\n"
   "13051\t    return FALSE;\n"
   "13052\t  }\n"
   "13053\t\treturn CL.SIDE.recovered;\n"
   "13054\t}\n"
   "13055\t\n"
   "13056\tBOOL calValid(\n"
   "13057\t\t\t\t\t\t\t\tIN int cl) \n"
   "13058\t{\n"
   "13059\t\treturn VALID(cl);\n"
   "13060\t}\n"
   "13061\t\n"
   "13062\tUINT16 calCRV(int\t\t\t\t\tcl,\n"
   "13063\t\t\t\t\t\t\t\tgkcciSide_t\tside)\n"
   "13064\t{\n"
   "13065\t\tif (!VALID(cl)) {\n"
   "13066\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8700, 
-1,\"invalid cl in calCRV\"));\n"
   "13067\t\t\treturn 0;\n"
   "13068\t\t}\n"
   "13069\t\treturn CL.API_SIDE.CRVras;\n"
   "13070\t}\n"
   "13071\t\n"
   "13072\tBOOL calCallID(/*FALSE returned if cl is not valid or callID is 
empty.*/\n"
   "13073\t\t\t\t\t\t\t\t\t IN\t\tint\t\t\t\t\tcl,\n"
   "13074\t                 IN   gkcciSide_t side,\n"
   "13075\t\t\t\t\t\t\t\t\t OUT\tguid_t\t\t\tcallID)\n"
   "13076\t{\n"
   "13077\t\tif (!VALID(cl))\n"
   "13078\t\t\treturn FALSE;\n"
   "13079\t\tmemcpy(callID,CL.SIDE.callID,GUID_LEN);\n"
   "13080\t\treturn (memcmp(CL.SIDE.callID,emptyGuid,GUID_LEN) != 0);\n"
   "13081\t}\n"
   "13082\t\n"
   "13083\tBOOL calConfID(/*FALSE returned if cl is not valid or callID is 
empty.*/\n"
   "13084\t\t\t\t\t\t\t\t\t IN\t\tint\t\t\t\t\tcl,\n"
   "13085\t\t\t\t\t\t\t\t\t OUT\tguid_t\t\t\tconfID)\n"
   "13086\t{\n"
   "13087\t\tif (!VALID(cl))\n"
   "13088\t\t\treturn FALSE;\n"
   "13089\t\tmemcpy(confID,CL.cid,GUID_LEN);\n"
   "13090\t\treturn (memcmp(CL.cid,emptyGuid,GUID_LEN) != 0);\n"
   "13091\t}\n"
   "13092\t\n"
   "13093\t/*\n"
   "13094\tBOOL calUDP(FALSE returned if cl is not valid\n"
   "13095\t\t\t\t\t\t\t\t\t IN\t\tint\t\t\t\t\t\t\tcl,\n"
   "13096\t\t\t\t\t\t\t\t\t IN\t\tgkcciSide_t\t\t\tside,\n"
   "13097\t\t\t\t\t\t\t\t\t OUT\tcmRASTransport*\tudp)\n"
   "13098\t{\n"
   "13099\t\tif (!VALID(cl))\n"
   "13100\t\t\treturn FALSE;\n"
   "13101\t\tmemcpy(udp,&(CL.API_SIDE.UDPAddress),sizeof(cmRASTransport));\n"
   "13102\t\treturn TRUE;\n"
   "13103\t}*/\n"
   "13104\t\n"
   "13105\t\n"
   "13106\tBOOL calRASControlledSide(/*TRUE if specified side is valid and its 
ARQ flag is on, \n"
   "13107\t\t\t\t\t\t\t\t\t\t\t\t\t\tand the associated reg is RASCapable*/\n"
   "13108\t\t\t\t\t\t\t\t\t\t\t\tIN int\t\t\t\t\tcl,\n"
   "13109\t\t\t\t\t\t\t\t\t\t\t\tIN gkcciSide_t\tside) \n"
   "13110\t{\n"
   "13111\t\tif (VALID(cl) && !VACENT(cl)    && \n"
   "13112\t      CL.API_SIDE.ARQ             && \n"
   "13113\t      CL.API_SIDE.GKDRQ == NULL   &&\n"
   "13114\t      rgtblValid(CL.API_SIDE.reg) && \n"
   "13115\t      rgtblRASCapable(CL.API_SIDE.reg) &&\n"
   "13116\t      (CL.state == CAL_CONNECT || (CL.state == CAL_RAS_CONNECT && 
CL.model == cmRASCallModelTypeDirect)))\n"
   "13117\t  {\n"
   "13118\t    BOOL isDynamic;\n"
   "13119\t    
rgtblRegistrationType(RGTBL_GET,CL.API_SIDE.reg,&isDynamic,RGTBL_DYNAMIC);\n"
   "13120\t    return isDynamic;\n"
   "13121\t  }\n"
   "13122\t  return FALSE;\n"
   "13123\t\n"
   "13124\t}\n"
   "13125\t\n"
   "13126\tINT32 calRASControlledCalls(/*returns number of RASControlled 
calls*/) \n"
   "13127\t{\n"
   "13128\t\tint calls = 0;\n"
   "13129\t\tint cl = 0;\n"
   "13130\t\tfor (cl = 0;cl < globalMaxCalls-1;cl++) {\n"
   "13131\t\t\tif (RASControlled(cl))\n"
   "13132\t\t\t\tcalls++;\n"
   "13133\t\t}\n"
   "13134\t\treturn calls;\n"
   "13135\t}\n"
   "13136\t\n"
   "13137\t\n"
   "13138\tBOOL calNextRASControlledCall(/*searches callTable from entry cl 
inclusive, until a RASControlled entry is found.\n"
   "13139\t\t\t\t\t\t\t\t\t\t\t\t\t\tIf not, res is set to NOT_CALL. Returns 
FALSE upon error*/\n"
   "13140\t\t\t\t\t\t\t\t\t\t\t\t\t\tIN\t\tint\t\tcl,\n"
   "13141\t\t\t\t\t\t\t\t\t\t\t\t\t\tOUT\t\tint*\tres) \n"
   "13142\t{\n"
   "13143\t\tint tmp;\n"
   "13144\t\t*res = NOT_CALL;\n"
   "13145\t\tfor (tmp = cl;tmp < globalMaxCalls-1;tmp++) {\n"
   "13146\t\t\tif (RASControlled(tmp)) {\n"
   "13147\t\t\t\t*res = tmp;\n"
   "13148\t\t\t\treturn TRUE;\n"
   "13149\t\t\t}\n"
   "13150\t\t}\n"
   "13151\t\treturn TRUE;\n"
   "13152\t}\n"
   "13153\t\n"
   "13154\tBOOL calFailedActivityTest(/*TRUE if either side of the call exceeds 
the unanswered limit. If so, the reason\n"
   "13155\t\t\t\t\t\t\t\t\t\t\t\t\t\t is set to specify which side failed*/\n"
   "13156\t\t\t\t\t\t\t\t\t\t\t\t\t\t IN\t\tint\t\t\t\t\t\t\tcl,\n"
   "13157\t\t\t\t\t\t\t\t\t\t\t\t\t\t IN\t\tint\t\t\t\t\t\t\tIRQLimit,\n"
   "13158\t\t\t\t\t\t\t\t\t\t\t\t\t\t OUT\tgkcciReason_t*\treason) \n"
   "13159\t{\n"
   "13160\t\tif (!VALID(cl))\n"
   "13161\t\t\treturn FALSE;\n"
   "13162\t\t*reason = gkcciRsnUndefined;\n"
   "13163\t\tif (CL.ORIG.unansweredIRQs > IRQLimit)\n"
   "13164\t\t\t*reason = gkcciRsnIRQFailureAtOrig;\n"
   "13165\t\tif (CL.DEST.unansweredIRQs > IRQLimit) {\n"
   "13166\t\t\tif (*reason == gkcciRsnIRQFailureAtOrig)\n"
   "13167\t\t\t\t*reason = gkcciRsnIRQFailOrigAndDest;\n"
   "13168\t\t\telse\n"
   "13169\t\t\t\t*reason = gkcciRsnIRQFailAtDest;\n"
   "13170\t\t}\n"
   "13171\t\treturn (!(*reason == gkcciRsnUndefined));\n"
   "13172\t}\n"
   "13173\t\n"
   "13174\tBOOL calAccessUnansweredIRQs(\n"
   "13175\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tIN\t\t\tcalOperation_t\tmode,\n"
   "13176\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tIN\t\t\tint\t\t\t\t\t\t\tcl,\n"
   "13177\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tIN\t\t\tgkcciSide_t\t\t\tside,\n"
   "13178\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tIN OUT\tUINT8*\t\t\t\t\tunansweredIRQs) 
\n"
   "13179\t{\n"
   "13180\t\tif (!VALID(cl))\n"
   "13181\t\t\treturn FALSE;\n"
   "13182\t\tif (mode == OP_GET)\n"
   "13183\t\t\t*unansweredIRQs = CL.API_SIDE.unansweredIRQs;\n"
   "13184\t\tif (mode == OP_SET)\n"
   "13185\t\t\tCL.API_SIDE.unansweredIRQs = *unansweredIRQs;\n"
   "13186\t\treturn TRUE;\n"
   "13187\t}\n"
   "13188\t\n"
   "13189\tBOOL calSendExpirationEvent(\n"
   "13190\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t IN int\t\t\t\t\t\tcl,\n"
   "13191\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t IN gkcciState_t\tstate,\n"
   "13192\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t IN\tgkcciReason_t\treason) \n"
   "13193\t{\n"
   "13194\t\treturn sendStateEvent(cl,state,reason);\n"
   "13195\t}\n"
   "13196\t\n"
   "13197\tUINT16 calReg(\n"
   "13198\t\t\t\t\t\t\t\tIN int\t\t\t\t\tcl,\n"
   "13199\t\t\t\t\t\t\t\tIN gkcciSide_t\tside) \n"
   "13200\t{\n"
   "13201\t\tif (!VALID(cl))\n"
   "13202\t\t\treturn RGTBL_REG_NOT_VALID;\n"
   "13203\t\treturn CL.API_SIDE.reg;\n"
   "13204\t}\n"
   "13205\t\n"
   "13206\tint calDecodeIRQ(/*extracts the call and side from the IRQ 
handle*/\n"
   "13207\t\t\t\t\t\t\t\t\t IN\t\tHAPPRAS\t\t\t\thaRas,\n"
   "13208\t\t\t\t\t\t\t\t\t OUT\tgkcciSide_t*\tsd) \n"
   "13209\t{\n"
   "13210\t\tside_t side;\n"
   "13211\t\tint cl;\n"
   "13212\t\tcl = getCall((HAPPCALL)haRas,&side);\n"
   "13213\t\tif (side == ORIGIN)\n"
   "13214\t\t\t*sd = gkcciSideOrig;\n"
   "13215\t\tif (side == DESTINATION)\n"
   "13216\t\t\t*sd = gkcciSideDest;\n"
   "13217\t\treturn cl;\n"
   "13218\t}\n"
   "13219\t\n"
   "13220\tHAPPRAS calEncodeIRQ(/*generates the IRQ handle from the specified 
cl and side*/\n"
   "13221\t\t\t\t\t\t\t\t\t IN\tint\t\t\t\t\tcl,\n"
   "13222\t\t\t\t\t\t\t\t\t IN\tgkcciSide_t\tside) \n"
   "13223\t{\n"
   "13224\t\tif (!VALID(cl))\n"
   "13225\t\t\treturn (HAPPRAS)0;\n"
   "13226\t\treturn (HAPPRAS)&(CL.API_SIDE.callNo);\n"
   "13227\t}\n"
   "13228\t\n"
   "13229\t\n"
   "13230\t\n"
   "13231\t\n"
   "13232\t/*private*/\n"
   "13233\t\n"
   "13234\tINT32 RMCallBackup(/*sets data with call data of the specified side. 
If the side\n"
   "13235\t\t\t\t\t\t\t\t\t\t contains no information the valid field of data 
will be set to FALSE.\n"
   "13236\t\t\t\t\t\t\t\t\t\t If side has not completed an ARQ transaction or 
disengaged it, it will not be backed up\n"
   "13237\t\t\t\t\t\t\t\t\t\t and valid field of data will be set to FALSE.*/\n"
   "13238\t\tIN\t\t\tint\t\t\t\t\t\tcl,\n"
   "13239\t\tIN\t\t\tgkHCALL\t\t\t\thCall,\n"
   "13240\t\tIN\t\t\tgkcciSide_t\t\tsd,\n"
   "13241\t\tOUT\t\t\tgkcciRMCall*\tdata)\n"
   "13242\t{\t\n"
   "13243\t\tINT32 tmp,rr=gkcciOK;\t\n"
   "13244\t\tside_t side = (sd == gkcciSideOrig ? ORIGIN : DESTINATION);\n"
   "13245\t\n"
   "13246\t\tif ((side == ORIGIN && IS_ARQ_ORIG) || (side == DESTINATION && 
IS_ARQ_DEST)) {\n"
   "13247\t\t\tCALL_NOTIFY(\"side in middle of the ARQ transaction. Can\'t back 
up at this stage\",GEN_NA,10,cl);\n"
   "13248\t\t\tdata->valid = FALSE;\n"
   "13249\t\t\treturn gkcciOK;\n"
   "13250\t\t}\n"
   "13251\t\tif (CL.SIDE.ARQ == NULL) {\n"
   "13252\t\t\tdata->valid = FALSE;\n"
   "13253\t\t\treturn gkcciOK;\n"
   "13254\t\t}\n"
   "13255\t\n"
   "13256\t\tdata->endpID[0] = 0;\n"
   "13257\t\tif (rgtblValid(CL.SIDE.reg)) {\n"
   "13258\t\t\tif (!getEndpointID(CL.SIDE.reg,data->endpID)) rr = 
gkcciGKFailure;\n"
   "13259\t\t}\n"
   "13260\t\telse data->endpID[0] = 0;\n"
   "13261\t\n"
   "13262\t\tif ((tmp = 
calAppGetParameter(hCall,gkcciParamCallID,sd,0,0,&(data->"
<- "callID))) < 0) rr = tmp;\n"
   "13263\t\tif ((tmp = 
calAppGetParameter(hCall,gkcciParamCid,sd,0,0,&(data->confID))) < 0) rr = 
tmp;\n"
   "13264\t\tdata->CRVras = CL.SIDE.CRVras;\n"
   "13265\t\tif (!iutilGkIp2AppIp(&(data->UDPAddress),&(CL.SIDE.UDPAddress))) 
rr = gkcciFailure;\n"
   "13266\t\tif ((tmp = 
calAppGetParameter(hCall,gkcciParamCallModel,sd,0,0,&(data->callModel))) < 0) 
rr = tmp;\n"
   "13267\t\tif ((tmp = 
calAppGetParameter(hCall,gkcciParamCallState,sd,0,0,&(data->callState))) < 0) 
rr = tmp;\n"
   "13268\t\tif ((tmp = 
calAppGetParameter(hCall,gkcciParamApprovedBandwidth,sd,0,0,&(data->bwUsage))) 
< 0) rr = tmp;\n"
   "13269\t\tdata->RASControlled = calRASControlledSide(cl,sd);/*(CL.SIDE.ARQ 
!= NULL);*/\n"
   "13270\t\tdata->valid = TRUE;\n"
   "13271\t\tdata->identifier = cl;\n"
   "13272\t\tdata->h245conf = CL.mcConfHandle;\n"
   "13273\t\treturn rr;\n"
   "13274\t\t/*Each call of calAppGetParameter contains a decoding of the 
hCall. Consider adding a getParameter with cl.*/\n"
   "13275\t\t/*It will be callid y the calAppGetParameter after the decode.*/\n"
   "13276\t\t\n"
   "13277\t\t/*BTW should\'nt #define gkccibw_t int be typedef gkccibw_t 
int*/\n"
   "13278\t}\n"
   "13279\t\n"
   "13280\tBOOL getEndpointID(\n"
   "13281\t\t\t\tIN\t\tUINT16 reg,\n"
   "13282\t\t\t\tOUT\tgkaddEndpointId_t endpID)\n"
   "13283\t{\n"
   "13284\t\t/*this replicates part of the gkrgiGetParameter. This could be 
avoided if that function is split into\n"
   "13285\t\t  two parts: the first extracts the reg from hReg, the other uses 
reg for accessing the regTable*/\n"
   "13286\t\tcmRASAlias alias;\n"
   "13287\t  char aliasBuf[ADD_MAX_BUF];\n"
   "13288\t  alias.string = aliasBuf;\n"
   "13289\t  addAliasInit(&alias);\n"
   "13290\t\tif (!rgtblEndpointId(RGTBL_GET,(UINT16)reg,&alias) || 
addEmptyAlias(&alias))\n"
   "13291\t\t\treturn FALSE;\n"
   "13292\t  if (!iutilGkEndpId2AppEndpId((char*)endpID,&alias))\n"
   "13293\t\t\treturn FALSE;\n"
   "13294\t   return TRUE;\n"
   "13295\t}\n"
   "13296\t\n"
   "13297\tINT32 RMRestoreData(\n"
   "13298\t\tIN\t\t\tint\t\t\t\t\t\tcl,\n"
   "13299\t\tIN\t\t\tgkcciSide_t\t\tsd,\n"
   "13300\t\tIN\t\t\tgkcciRMCall*\tdata)\n"
   "13301\t{\n"
   "13302\t\tINT32 tmp,rr=gkcciOK;\n"
   "13303\t\tside_t side = (sd == gkcciSideOrig ? ORIGIN : DESTINATION);\n"
   "13304\t\n"
   
"13305\t\tiutilAppCallID2GkCallID((char*)CL.SIDE.callID,(char*)(data->callID));\n"
   "13306\t\tiutilAppCid2GkCid((char*)CL.cid,(char*)(data->confID));\n"
   "13307\t\tCL.SIDE.CRVras = data->CRVras;\n"
   "13308\t\tif (!iutilAppIp2GkIp(&(CL.SIDE.UDPAddress),&(data->UDPAddress))) 
rr = gkcciFailure;\n"
   "13309\t\tCL.isARQ = ARQ_ORIG;\n"
   "13310\t\tif ((tmp = setCallModel(cl,data->callModel)) < 0 ) rr = tmp;\n"
   "13311\t\tCL.isARQ = NO_ARQ;\n"
   "13312\t\n"
   "13313\t\n"
   "13314\t\tCL.appState = data->callState;\n"
   
"13315\t\tbwAllocateBandwidth(cl,side,data->bwUsage,gkcciRsnUndefined,TRUE);\n"
   "13316\t\tCL.SIDE.callNo = cl;\n"
   "13317\t\tCL.mcConfHandle = data->h245conf;\n"
   "13318\t\tCL.SIDE.recovered = TRUE;\n"
   "13319\t\treturn rr;\n"
   "13320\t}\n"
   "13321\t\n"
   "13322\tINT32 RMLinkToRegtable(\n"
   "13323\t\tIN\t\t\tint\t\t\t\t\t\tcl,\n"
   "13324\t\tIN\t\t\tside_t\t\t\t\tside,\n"
   "13325\t\tIN\t\t\tgkcciRMCall*\tdata)\n"
   "13326\t{\n"
   "13327\t\tUINT16 reg;\n"
   "13328\t\tif (!strlen(data->endpID))\n"
   "13329\t\t\treturn gkcciOK;\n"
   "13330\t\trgutilEndpointIdDecodeReg(data->endpID,&reg);\n"
   "13331\t\tCL.SIDE.reg = reg;\n"
   "13332\t\tif (!rgtblIncrCallCount(reg))\n"
   "13333\t  {\n"
   "13334\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 8613, 
cl, \"RMLinkToRegtable: Failed to increment registration\'s call count\"));\n"
   "13335\t  }\n"
   "13336\t\treturn gkcciOK;\n"
   "13337\t}\n"
   "13338\t\n"
   "13339\tINT32 RMRestoreFunctionality(\n"
   "13340\t\tIN\t\t\tint\t\t\t\t\t\tcl,\n"
   "13341\t\tIN\t\t\tgkHCALL\t\t\t\thCall,\n"
   "13342\t\tIN\t\t\tgkHAPPCALL\t\thaCall,\n"
   "13343\t\tIN\t\t\tgkcciRMCall*\torigin,/*set to NULL if setting only 
destination information*/\n"
   "13344\t\tIN\t\t\tgkcciRMCall*\tdestination/*set to NULL if setting only 
origin information*/)\n"
   "13345\t{\n"
   "13346\t\tINT32 tmp;\n"
   "13347\t\tCL.handle = hCall;\n"
   "13348\t\tCL.appHandle = haCall;\n"
   "13349\t\tCL.state = CAL_RAS_CONNECT;\n"
   "13350\t\t/*Consider recovering calls that were only at the stage of ACF to 
origin, and such scenarios. \n"
   "13351\t\tThe state should be set appropriately*/\n"
   "13352\t\n"
   "13353\t\tCL.model = cmCallModelTypeDirect;\n"
   "13354\t\tCL.sideMap = JOINED;/*All recovered calls should be handled as 
joined*/\n"
   "13355\t\tif (CL.ORIG.recovered && origin && origin->valid && 
origin->RASControlled) {\n"
   "13356\t\t\tif ((tmp = RMRestroreStackHandle(cl,ORIGIN)) < 0)\n"
   "13357\t\t\t\treturn tmp;\n"
   "13358\t\t\tCL.ORIG.ARQ = (HRAS)1;\n"
   "13359\t\t}\n"
   "13360\t/*indeed very wierd.This stems from the somewhat dangerous method in 
the GK of using this field\n"
   "13361\tboth for storing the active hsRAS, and keeping it even after it is 
closed, to mark that the\n"
   "13362\tARQ occured*/\n"
   "13363\t\tif (CL.DEST.recovered && destination && destination->valid && 
destination->RASControlled) {\n"
   "13364\t\t\tif ((tmp = RMRestroreStackHandle(cl,DESTINATION)) < 0)\n"
   "13365\t\t\t\treturn tmp;\n"
   "13366\t\t\tCL.DEST.ARQ = (HRAS)1;\n"
   "13367\t\t}\n"
   "13368\t\treturn gkcciOK;\n"
   "13369\t}\n"
   "13370\t\n"
   "13371\tINT32 RMRestroreStackHandle(\n"
   "13372\t\tIN int cl,\n"
   "13373\t\tIN side_t side)\n"
   "13374\t{\n"
   "13375\t\tHCALL hsCall;\n"
   "13376\t\tif (cmCallNew(dispStack,(HAPPCALL)&(CL.SIDE.callNo),&hsCall) < 0) 
{\n"
   "13377\t\t\tCALL_EXCEPTION((GK_EXCP_INDETERMINATE, GK_EXCP_DISPOSABLE, 9216, 
-1 ,\"RMRestoreFunctionality:cmCallNew failed \",cl));\n"
   "13378\t\t\treturn gkcciFailure;\n"
   "13379\t  }\n"
   "13380\t  CL.SIDE.stack = hsCall;\n"
   "13381\t\tCL.SIDE.dummyStack = TRUE;\n"
   "13382\t  return gkcciOK;\n"
   "13383\t}\n"
   "13384\t\n"
   "13385\tBOOL RASControlled(/*TRUE if call is calRASControlledSide*/\n"
   "13386\t\t\t\t\t\t\t\t\t\t\t\tIN int\t\tcl) \n"
   "13387\t{\n"
   "13388\t\treturn (calRASControlledSide(cl,gkcciSideOrig) || 
calRASControlledSide(cl,gkcciSideDest));\n"
   "13389\t}\n"
   "13390\t\n"
   "13391\t#include        <sys/time.h>\n"
   "13392\t#include        <sys/types.h>\n"
   "13393\t#include        <sys/utsname.h>\n"
   "13394\t#include        <sys/socket.h>\n"
   "13395\t#include        <netinet/in.h>\n"
   "13396\t#include        <netinet/ip.h>\n"
   "13397\t\n"
   "13398\t#include        \"../mcapi/mci_types.h\"\n"
   "13399\t#include        \"../mcapi/mci_report.h\"\n"
   "13400\t#include        \"../mcapi/mci_general.h\"\n"
   "13401\t#include        \"../mcapi/mci_call.h\"\n"
   "13402\t#include        \"../mcapi/mci_conf.h\"\n"
   "13403\t#include        \"../mcapi/mci_mc.h\"\n"
   "13404\t#include        \"../mcapi/gkmc.h\"\n"
   "13405\t#include        \"../mcapi/gkmci.h\"\n"
   "13406\t\n"
   "13407\t#include        \"media_router.h\"\n"
   "13408\t\n"
   "13409\tvoid\n"
   "13410\tsend_endpoint_info_to_mc(struct gk_to_mc_msg    *intended_msg)\n"
   "13411\t{\n"
   "13412\t        gkmcMCAppDefinedNotif   generic_msg;\n"
   "13413\t        char                    message[BUFSIZ];\n"
   "13414\t        char                    ip_address[BUFSIZ];\n"
   "13415\t\n"
   "13416\t        genNotify(\"send_endpoint_info(): start\", GEN_NA, 10);\n"
   "13417\t        sprintf(message, \"mcHConf(0x%x)\", 
intended_msg->mcHConf);\n"
   "13418\t        genNotify(message, GEN_NA, 10);\n"
   "13419\t        sprintf(message, \"gkHCall(0x%x)\", 
intended_msg->gkHCall);\n"
   "13420\t        genNotify(message, GEN_NA, 10);\n"
   "13421\t        sprintf(message, \"Source mc call handle 
(0x%x)\",intended_msg->src_mc_call_handle);\n"
   "13422\t        genNotify(message, GEN_NA, 10);\n"
   "13423\t        sprintf(message, \"Source IP (%s)\",\n"
   "13424\t                gkaddIp2String(intended_msg->src_ip, ip_address));\n"
   "13425\t        genNotify(message, GEN_NA, 10);\n"
   "13426\t        sprintf(message, \"Source Number (%s)\",\n"
   "13427\t                intended_msg->src_number);\n"
   "13428\t        genNotify(message, GEN_NA, 10);\n"
   "13429\t        sprintf(message, \"Destination mc call handle 
(0x%x)\",intended_msg->dest_mc_call_handle);\n"
   "13430\t        genNotify(message, GEN_NA, 10);\n"
   "13431\t        sprintf(message, \"Destination IP (%s)\",\n"
   "13432\t                gkaddIp2String(intended_msg->dest_ip, 
ip_address));\n"
   "13433\t        genNotify(message, GEN_NA, 10);\n"
   "13434\t        sprintf(message, \"Destination Number (%s)\",\n"
   "13435\t                intended_msg->dest_number);\n"
   "13436\t        genNotify(message, GEN_NA, 10);\n"
   "13437\t        sprintf(message, \"Call index (%d)\", 
intended_msg->call_index);\n"
   "13438\t        genNotify(message, GEN_NA, 10);\n"
   "13439\t        sprintf(message,\"Conference ID  = (%16s)\", 
StrToHex((char*) intended_msg->conf_id, GUID_LEN));\n"
   "13440\t        genNotify(message, GEN_NA, 10);\n"
   "13441\t        sprintf(message, \"Call originator (%d)\", 
intended_msg->call_originator);\n"
   "13442\t        genNotify(message, GEN_NA, 10);\n"
   "13443\t        sprintf(message, \"Event (%s)\", 
intended_msg->event?\"Setup\":\"Disconnect\");\n"
   "13444\t        genNotify(message, GEN_NA, 10);\n"
   "13445\t\n"
   "13446\t        generic_msg.size = sizeof(*intended_msg);\n"
   "13447\t        generic_msg.messageData = (BYTE *) intended_msg;\n"
   "13448\t\n"
   "13449\t        gkmciNotifyMC(gkmcGatekeeperAppDefined, &generic_msg, 0);\n"
   "13450\t\n"
   "13451\t        genNotify(\"send_endpoint_info(): end\", GEN_NA, 10);\n"
   "13452\t        return;\n"
   "13453\t}\n"
   "13454\t\n"
   "13455\tvoid\n"
   "13456\tget_source_ip(HRAS      hsRas,  cmRASTransport  *source)\n"
   "13457\t{\n"
   "13458\t        UINT16          endpoint;\n"
   "13459\t        rgtblRecord_t   firstRas;\n"
   "13460\t        cmuMessage_t    message;\n"
   "13461\t\n"
   "13462\t        
cmuLoadParams(message,CMU_RAS,hsRas,cmRASTrPartRequest,NULL);\n"
   "13463\t        rgsrIdentify(&message,&endpoint);\n"
   "13464\t\n"
   "13465\t        if(endpoint == RGTBL_REG_NOT_VALID)\n"
   "13466\t        {\n"
   "13467\t                RGTBL_NOTIFY(\n"
   "13468\t                        \"setReplyAddress called for unregistered 
endpoint\",\n"
   "13469\t                        GEN_NA,0,RGTBL_REG_NOT_VALID);\n"
   "13470\t                goto Return;\n"
   "13471\t        }\n"
   "13472\t\n"
   "13473\t        
rgtblGetFirstMaskedAddress(RGTBL_DYNAMIC,ADD_RAS,endpoint,&firstRas);\n"
   "13474\t        rgtblAccessRecord(RGTBL_GET, ADD_RAS, (void *) source, 
&firstRas);\n"
   "13475\t\n"
   "13476\t        if(addEmptyTransport(source))\n"
   "13477\t        {\n"
   "13478\t                RGTBL_EXCEPTION((GK_EXCP_INDETERMINATE, 
GK_EXCP_DISPOSABLE,\n"
   "13479\t                        8335, endpoint,\n"
   "13480\t                \"endpoint does not have ras address in 
setReplyAddress\" ));\n"
   "13481\t                goto Return;\n"
   "13482\t        }\n"
   "13483\t\n"
   "13484\tReturn:\n"
   "13485\t        return;\n"
   "13486\t}\n"
   "13487\t\n"
   "13488\t\n"
   "13489\t/***************************************** \n"
   "13490\t                   DNS\n"
   "13491\t******************************************/\n"
   "13492\t\n"
   "13493\tBOOL calAppNonNeighborGksForLRQ(/*For specifying non-neighbor Gks to 
send LRQ for this call. Can only be called\n"
   "13494\t\t\t\t\t\t\t\t\t  after receiving the stateReason gkcciRsnNeedLRQ 
and before the LRQ has been sent*/\n"
   "13495\t\tIN\t\t\tgkHCALL\t\t\t\t\thCall,\n"
   "13496\t\tIN\t\t\tconst gkcfgiNonNeighbor_t\t*gks,\n"
   "13497\t\tIN\t\t\tint\t\t\t\t\t\tnumGks,\n"
   "13498\t    IN          BOOL                    waitMoreLRQs)\n"
   "13499\t{\n"
   "13500\t\n"
   "13501\t  int cl,i,j=0;\n"
   "13502\t  if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "13503\t  {\n"
   "13504\t    CALL_NOTIFY(\"calAppNonNeighborGksForLRQ: Illegal handle: \", 
(UINT32)hCall, 30,-1);\n"
   "13505\t    return gkcciInvalidHandle;\n"
   "13506\t  } \n"
   "13507\t  if(!(\n"
   "13508\t\t\t\t\t(CL.appState == gkcciSttAddressResolutionDone && 
CL.appReason == gkcciRsnNeedLRQ) || \n"
   "13509\t\t\t\t\t(CL.appState == gkcciSttWaitLRQ)\n"
   "13510\t\t\t\t))\n"
   "13511\t  {   \n"
   "13512\t    char str[200];\n"
   "13513\t    sprintf(str, \"calAppNonNeighborGksForLRQ: called at wrong 
state: %s\",stateName[CL.state]);\n"
   "13514\t    CALL_NOTIFY(str, GEN_NA, 40,cl);\n"
   "13515\t    return gkcciInvalidOperation;\n"
   "13516\t  }\n"
   "13517\t  CL.waitFurtherLRQ=waitMoreLRQs;\n"
   "13518\t  /* advance to first free entry, nonNeighborGksforLRQ can be filled 
by different DNS queries */\n"
   "13519\t  while (CL.nonNeighborGksforLRQ[j].ip)\n"
   "13520\t      j++; \n"
   "13521\t  for (i = j; i < GKCCI_MAX_NON_NEIGHBOR_GKS_FOR_LRQ && i < 
numGks;i++)\n"
   "13522\t\tCL.nonNeighborGksforLRQ[i] = gks[i];\n"
   "13523\t  CL.nonNeighborGksforLRQ[i+1].ip = 0;\n"
   "13524\t  return gkcciOK;\n"
   "13525\t}\n"
   "13526\t\n"
   "13527\t\n"
   "13528\tBOOL calApplrqNonNeighborGk (\n"
   "13529\t    IN gkHCALL              hCall,\n"
   "13530\t    IN gkcfgiNonNeighbor_t  *Gk)\n"
   "13531\t\n"
   "13532\t{\n"
   "13533\t    BOOL *lrqDNS;\n"
   "13534\t    int cl;\n"
   "13535\t    UINT16 i=0;\n"
   "13536\t    if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "13537\t    {\n"
   "13538\t        CALL_NOTIFY(\"lrqNonNeighborGk: Illegal handle: \", 
(UINT32)hCall, 30,-1);\n"
   "13539\t        return gkcciInvalidHandle;\n"
   "13540\t    } \n"
   "13541\t\n"
   "13542\t    if (Gk == NULL) { /*no more Gk\'s to LRQ */\n"
   "13543\t        CL.waitFurtherLRQ = FALSE;\n"
   "13544\t        if (CL.waitForLRQanswer)\n"
   "13545\t            return gkcciOK;\n"
   "13546\t        /* no pending LRQs, close the call */\n"
   "13547\t        return handleCannotComplete( cl, RSN_LRQ_NOT_FOUND, 
gkcciRsnLRQAddressNotFound,\"Address not found by LRQ\");\n"
   "13548\t    }\n"
   "13549\t    /* adding the GK to the end of the list of non-neighbor gks to 
lrq */\n"
   "13550\t    while (CL.nonNeighborGksforLRQ[i].ip != 0 && 
i<GKCCI_MAX_NON_NEIGHBOR_GKS_FOR_LRQ)\n"
   "13551\t        i++;\n"
   "13552\t    if (i==GKCCI_MAX_NON_NEIGHBOR_GKS_FOR_LRQ) {\n"
   "13553\t        CALL_NOTIFY(\"lrqNonNeighborGk: Table of nonNeighbor Gk\'s 
to LRQ is full: \", (UINT32)hCall, 30,-1);\n"
   "13554\t        return gkcciInvalidOperation;\n"
   "13555\t    }        \n"
   "13556\t    CL.nonNeighborGksforLRQ[i]=(*Gk);\n"
   "13557\t    \n"
   "13558\t/* if Lrq has not been sent at all , or has not been sent to dns 
gk\'s yet, our work is done for now */\n"
   "13559\t\n"
   "13560\t    if"
<- "((CL.appState == gkcciSttAddressResolutionDone && CL.appReason == 
gkcciRsnNeedLRQ) || \n"
   "13561\t       (CL.appState == gkcciSttWaitLRQ) ||\n"
   "13562\t       ((CL.appState==gkcciSttLRQSent || 
CL.appState==gkcciSttSendingLRQ) && CL.lrqStage < LRQ_DNS))\n"
   "13563\t    {\n"
   "13564\t      return gkcciOK;\n"
   "13565\t    }\n"
   "13566\t    /* LRQ was sent to DNS gks, initiate lrq to the Gk provided */\n"
   "13567\t    if ((CL.appState==gkcciSttLRQSent || 
CL.appState==gkcciSttSendingLRQ) && CL.lrqStage >= LRQ_DNS)\n"
   "13568\t    {\n"
   "13569\t        /* check that LRQ_DNS is TRUE, if not don\'t LRQ this Gk 
*/\n"
   "13570\t        gkcfgGet(GKCFG_LRQ_DNS,0,(void**)&lrqDNS); \n"
   "13571\t        if (*lrqDNS == FALSE)\n"
   "13572\t            return gkcciOK;\n"
   "13573\t        if (!sendLRQ2NonNbr(i,cl))\n"
   "13574\t            return gkcciGKFailure;\n"
   "13575\t        return gkcciOK;\n"
   "13576\t    }\n"
   "13577\t    /* call is not in one of the valid the lrq states */\n"
   "13578\t    else {\n"
   "13579\t    char str[200];\n"
   "13580\t    sprintf(str, \"lrqNonNeighborGk: called at wrong state: 
%s\",stateName[CL.state]);\n"
   "13581\t    CALL_NOTIFY(str, GEN_NA, 40,cl);\n"
   "13582\t    return gkcciInvalidOperation;\n"
   "13583\t    }\n"
   "13584\t    \n"
   "13585\t}\n"
   "13586\t/*LDAP*/\n"
   
"13587\t/****************************************************************************************************\n"
   "13588\t\n"
   "13589\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLDAP\n"
   "13590\t\n"
   
"13591\t*****************************************************************************************************/\n"
   "13592\t\n"
   "13593\t\n"
   "13594\tBOOL calAppSpecifyGksForLRQ(/*For specifying addresses to send LRQ 
for this call. Can only be called\n"
   "13595\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tafter receiving the stateReason 
gkcciRsnNeedLRQ and before the LRQ has been sent*/\n"
   "13596\t\tIN\t\t\tgkHCALL\t\t\t\t\t\thCall,\n"
   "13597\t\tIN\t\t\tconst gkcfgiGkid\t*gks,\n"
   "13598\t\tIN\t\t\tint\t\t\t\t\t\t\t\tnumGks,\n"
   "13599\t\tIN\t\t\tgkcciLRQPolicy_t\t\tlrqPolicy)\n"
   "13600\t{\n"
   "13601\t\tint cl,i;\n"
   "13602\t  if(!getCallCheckAuth((UINT32)hCall, &cl))\n"
   "13603\t  {\n"
   "13604\t    CALL_NOTIFY(\"calAppSpecifyGksForLRQ: Illegal handle: \", 
(UINT32)hCall, 30,-1);\n"
   "13605\t    return gkcciInvalidHandle;\n"
   "13606\t  } \n"
   "13607\t  if(!(\n"
   "13608\t\t\t\t\t(CL.appState == gkcciSttAddressResolutionDone && 
CL.appReason == gkcciRsnNeedLRQ) || \n"
   "13609\t\t\t\t\t(CL.appState == gkcciSttWaitLRQ)\n"
   "13610\t\t\t\t))\n"
   "13611\t  {   \n"
   "13612\t    char str[200];\n"
   "13613\t    sprintf(str, \"calAppSpecifyGksForLRQ: called at wrong state: 
%s\",stateName[CL.state]);\n"
   "13614\t    CALL_NOTIFY(str, GEN_NA, 40,cl);\n"
   "13615\t    return gkcciInvalidOperation;\n"
   "13616\t  }\n"
   "13617\t\tCL.lrqPolicy = lrqPolicy;\n"
   "13618\t\tfor (i = 0; i < GKCCI_MAX_SPECIFIED_GKS_FOR_LRQ && i < 
numGks;i++)\n"
   "13619\t\t\tstrcpy(CL.specifiedGksForLRQ[i],gks[i]);\n"
   "13620\t\treturn gkcciOK;\n"
   "13621\t}\n"
   "13622\t\n"
   
"13623\t/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/\n"
   
"13624\t/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/\n"
   "13625\t\n"
   "13626\t/* 
--------------------------------------------------------------------------------------------*/\n"
   "13627\t/*                                      Hash related functions       
                          */\n"
   "13628\t/* 
--------------------------------------------------------------------------------------------*/\n"
   "13629\t\n"
   "13630\t\n"
   "13631\t/* \n"
   "13632\t * generateKeyHash: Call-back used by hash-table module.\n"
   "13633\t * This call-back will turn a hash-table key into an index.\n"
   "13634\t *  Implements the hash function.\n"
   "13635\t */\n"
   "13636\tINT32 CALLCONV generateKeyHash(                                  \n"
   "13637\t          IN void* handle,\n"
   "13638\t          IN char* data,\n"
   "13639\t          IN INT32 dataSize_chars,\n"
   "13640\t          IN char* dataHandle)\n"
   "13641\t{\n"
   "13642\t  static int base = 1 << (sizeof(char)*8);\n"
   "13643\t  INT32 mod;\n"
   "13644\t  UINT32 s = 0;\n"
   "13645\t\n"
   "13646\t  int i;\n"
   "13647\t\n"
   "13648\t  if(dataHandle);\n"
   "13649\t  mod = gkhashCapacity(handle);    /* The result must be in the 
range 0..mod */\n"
   "13650\t  \n"
   "13651\t  for (i=0; i<dataSize_chars; ++i) {\n"
   "13652\t    s = (s*base+data[i])%mod;\n"
   "13653\t  }\n"
   "13654\t\n"
   "13655\t  return s;\n"
   "13656\t\n"
   "13657\t}\n"
   "13658\t\n"
   "13659\t\n"
   "13660\t/* \n"
   "13661\t * identifyHash: call-back used by hash-table when trying to compare 
hash-table\n"
   "13662\t *   data entries \n"
   "13663\t */\n"
   "13664\tBOOL CALLCONV identifyHash(\n"
   "13665\t          IN void* handle,\n"
   "13666\t          IN gkhashOperation operation,\n"
   "13667\t          IN char* data_a,\n"
   "13668\t          IN INT32 dataSize_chars_a,\n"
   "13669\t          IN char* dataHandle_a,\n"
   "13670\t          IN char* dataHandle_b)\n"
   "13671\t{\n"
   "13672\t\tchar queryData[HASH_DATA_SIZE];\n"
   "13673\t\t\n"
   "13674\t\tif(handle);\n"
   "13675\t\tif(operation);\n"
   "13676\t\t\n"
   "13677\t \n"
   "13678\t\tif (dataHandle_a == NULL) /* The Query did not specify handle to 
match */\n"
   "13679\t\t\treturn TRUE;\n"
   "13680\t\telse {\n"
   "13681\t\t\t/* We perform a trick here */\n"
   "13682\t\t\t/* we use the query data as the query information, instead of 
providing \n"
   "13683\t\t\t   a handle, and checking the information in an array */\n"
   "13684\t\t\tdataDecodeMCUHash(dataHandle_a,queryData);\n"
   "13685\t\t\t/* compare it to data;   */\n"
   "13686\t\t\treturn (memcmp(queryData,data_a,HASH_DATA_SIZE) == 0);  \n"
   "13687\t\t}\n"
   "13688\t\n"
   "13689\t}\n"
   "13690\t\n"
   "13691\t\n"
   "13692\t\n"
   "13693\t/*\n"
   "13694\t * dataEncodeMCUHash: Encode of the hash key, just transfer it to 
char. \n"
   "13695\t */ \n"
   "13696\tstatic void dataEncodeMCUHash(\n"
   "13697\t        IN  char* alias, \n"
   "13698\t\t\tOUT char* data)\n"
   "13699\t{\n"
   "13700\t\n"
   "13701\t\t/* memset to data - clean the entire memory since it is used in 
genrating \n"
   "13702\t\t   the hash key, and we can\'t use uninitialized data */\n"
   "13703\t\tmemset(data,0,HASH_DATA_SIZE);\n"
   "13704\t\n"
   "13705\t\tmemcpy(data,alias,strlen(alias));\n"
   "13706\t}\n"
   "13707\t\n"
   "13708\t/*\n"
   "13709\t * dataDecodeMCUHash : Decode of the hash key, just transfer from 
bytes to specific structure\n"
   "13710\t */ \n"
   "13711\tstatic void dataDecodeMCUHash(\n"
   "13712\t        IN  char* data,\n"
   "13713\t        OUT char* alias)\n"
   "13714\t{\n"
   "13715\t  memcpy(alias,data,HASH_DATA_SIZE);\n"
   "13716\t}\n"
   "13717\t\n"
   "13718\t\n"
   "13719\t/* \n"
   "13720\t *  dataHandleEncodeMCUHash : Encode the actual data to be stored in 
the hash table\n"
   "13721\t */\n"
   "13722\tvoid dataHandleEncodeMCUHash (\n"
   "13723\t\t\tIN  cmRASTransport* transport, \n"
   "13724\t\t\tIN  int\t\t\t    count, \n"
   "13725\t\t\tOUT char*           dataHandle)\n"
   "13726\t{\n"
   "13727\t\t\n"
   "13728\t\t/* Clear The memory */\n"
   "13729\t\tmemset(dataHandle,0,HASH_DATA_HANDLE_SIZE);\n"
   "13730\t\n"
   "13731\t\t/* Store transport, count, alias in dataHandle */\n"
   "13732\t\tmemcpy(dataHandle,transport,sizeof(cmRASTransport));\n"
   "13733\t\tdataHandle += sizeof(cmRASTransport);\n"
   "13734\t\tmemcpy(dataHandle,&(count),sizeof(int));\n"
   "13735\t\t\n"
   "13736\t}\n"
   "13737\t\n"
   "13738\t\n"
   "13739\t/* \n"
   "13740\t *  dataHandleDecodeMCUHash: Decode the data handle that was stored 
in the hash table\n"
   "13741\t */\n"
   "13742\tvoid dataHandleDecodeMCUHash (\n"
   "13743\t\t\tOUT  cmRASTransport* transport, \n"
   "13744\t\t\tOUT  int*   \t\t count, \n"
   "13745\t\t\tIN   char*           dataHandle)\n"
   "13746\t{\n"
   "13747\t\tmemcpy(transport,dataHandle,sizeof(cmRASTransport));\n"
   "13748\t\tdataHandle +=sizeof(cmRASTransport);\n"
   "13749\t\tmemcpy(count,dataHandle,sizeof(int));\n"
   "13750\t\t\n"
   "13751\t}\n"
   "13752\t\n"
   "13753\t\n"
   "13754\t\n"
   "13755\t/*\n"
   "13756\t * findAliasIndex: given a call index, locate the first service 
prefix applicable to \n"
   "13757\t *   an alias, and return this alias index to the caller. \n"
   "13758\t * This is the same handling when trying to locate a service. \n"
   "13759\t *\n"
   "13760\t */\n"
   "13761\t\n"
   "13762\tBOOL findAliasIndex(int cl, int *index)\n"
   "13763\t{\n"
   "13764\t\tBOOL found;\n"
   "13765\t\tint i;\n"
   "13766\t\tUINT8 service = NET3_NOT_SERVICE;\n"
   "13767\t\tBOOL exactMatch;\n"
   "13768\t\tsrvServiceRecord_t serv;\n"
   "13769\t\n"
   "13770\t\tfound = FALSE;\n"
   "13771\t\t\t\t\t\n"
   "13772\t\t/*  Search for the alias that the ep will connect with */\n"
   "13773\t\tfor (i=0 ; i < DESTINATION_NUMBER ; i++) {\n"
   "13774\t\t\tnet3LocateService(&(CL.destInfo[i]),&service,&exactMatch);\t\n"
   "13775\t\t\tif (service!=NET3_NOT_SERVICE) {\n"
   "13776\t\t\t\tfound = TRUE;\n"
   "13777\t\t\t\t*index = i;\n"
   "13778\t\t\t\tbreak;\n"
   "13779\t\t\t}\n"
   "13780\t\t\telse if (srvPrefixFind(&(CL.destInfo[i]), &serv) != SUCCESS) /* 
if it returns error\n"
   "13781\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t the alias is wrong */\n"
   "13782\t\t\t\treturn FALSE;\n"
   "13783\t        else if (serv !=SRV_INVALID_SERV) {\n"
   "13784\t\t\t\tfound = TRUE;\n"
   "13785\t\t\t\t*index = i;\n"
   "13786\t\t\t\tbreak;\n"
   "13787\t        }\n"
   "13788\t      \n"
   "13789\t\t}\n"
   "13790\t\n"
   "13791\t\n"
   "13792\t\treturn found;\n"
   "13793\t}\n"
   "13794\t\n"
   "13795\t\n"
   "13796\t/*\n"
   "13797\t * findInHash:  given a call index, find if that given call tries to 
call a service, \n"
   "13798\t *  Assumption : the call is to a service (we don\'t check it in 
here).\n"
   "13799\t *\n"
   "13800\t */\n"
   "13801\t\n"
   "13802\tBOOL findInHash(\n"
   "13803\t\t\t\t\tIN int cl,\n"
   "13804\t\t\t\t\tOUT char* data,\n"
   "13805\t\t\t\t\tOUT char* dataHandle,\n"
   "13806\t\t\t\t\tint* aliasIndex)\n"
   "13807\t{\n"
   "13808\t\t\n"
   "13809\t\tBOOL rr;\n"
   "13810\t\tchar queryData[HASH_DATA_HANDLE_SIZE];\n"
   "13811\t\t\n"
   "13812\t\tINT32 placeLastFound;\n"
   "13813\t\tINT32 probes;\n"
   "13814\t\tINT32 placeFound;\n"
   "13815\t\n"
   "13816\t\n"
   "13817\t\tif (!findAliasIndex(cl,aliasIndex)) {\n"
   "13818\t\t\tGK_EXEP(\"findInHash: Failed in locating service alias\");\n"
   "13819\t\t\treturn FALSE;\n"
   "13820\t\t}\n"
   "13821\t\n"
   "13822\t\t/* \n"
   "13823\t\t * With this alias search in the hash \n"
   "13824\t\t */\n"
   "13825\t\tdataEncodeMCUHash(CL.destInfo[*aliasIndex].string,data);\n"
   "13826\t\t\n"
   "13827\t\tplaceLastFound = -1; /* start searching from beginning */\n"
   "13828\t\t\n"
   "13829\t\t/* We do a trick HERE */\n"
   "13830\t\t/* We insert into the query data the alias we are looking for */\n"
   "13831\t\tdataEncodeMCUHash(CL.destInfo[*aliasIndex].string,queryData);\n"
   "13832\t\n"
   "13833\t\trr = 
gkhashFind(serviceHashH,data,HASH_DATA_SIZE,queryData,placeLastFound,dataHandle,&placeFound,&probes);\n"
   "13834\t\t\n"
   "13835\t\tif (rr) \n"
   "13836\t\t\tGK_NOTIFY(\"findInHash: Found the desired entry in 
hash\",GEN_NA,20);\n"
   "13837\t\treturn rr;\n"
   "13838\t\n"
   "13839\t}\n"
   "13840\t\n"
   "13841\t/*\n"
   "13842\t * addToMcuHash - insert the call to the MCU hash,\n"
   "13843\t *   the key to the data will be the alias used to access the 
service\n"
   "13844\t *   and the actual data will be number of calls connected, and \n"
   "13845\t */\n"
   "13846\tvoid addToMcuHash(IN int cl)\n"
   "13847\t{\n"
   "13848\t\n"
   "13849\t\tint aliasIndex;\n"
   "13850\t\tBOOL rr;\n"
   "13851\t\tchar data[HASH_DATA_SIZE];\n"
   "13852\t\tchar dataHandle[HASH_DATA_HANDLE_SIZE];\n"
   "13853\t\t\n"
   "13854\t\n"
   "13855\t\t/* Try to locate the alias in the hash */\n"
   "13856\t\trr = findInHash(cl,data,dataHandle,&aliasIndex);\n"
   "13857\t\tif (!rr) {/* could not find in hash */\n"
   "13858\t\t\trr = insertNewMcuHash(cl,data);\n"
   "13859\t\t\tif (!rr) \n"
   "13860\t\t\t\tGK_EXEP(\"Failed to insert a new entry to MCU service 
Hash\");\n"
   "13861\t\t}\n"
   "13862\t\telse {\n"
   "13863\t\t\trr = updateMcuHash(cl,aliasIndex,data,dataHandle,TRUE);\n"
   "13864\t\t\tif (!rr) {\n"
   "13865\t\t\t\tGK_EXEP(\"addition to MCUHash entry failed !!!\"); \n"
   "13866\t\t\t}\n"
   "13867\t\t}\n"
   "13868\t\t\n"
   "13869\t}\n"
   "13870\t\n"
   "13871\t\n"
   "13872\t/* \n"
   "13873\t * insertNewMcuHash - insert a new entry to the MCU hash\n"
   "13874\t *    insert the alias as key, transport as data (and count = 0) \n"
   "13875\t *    as additional data\n"
   "13876\t */\n"
   "13877\tBOOL insertNewMcuHash(\n"
   "13878\t\t\t\t\t\t  IN int cl,\n"
   "13879\t\t\t\t\t\t  char * data)\n"
   "13880\t{\n"
   "13881\t\n"
   "13882\t\tINT32 rr;\n"
   "13883\t\tchar dataHandle[HASH_DATA_HANDLE_SIZE];\n"
   "13884\t\n"
   "13885\t\t/* insert into hash, tha alias according to aliasIndex, and the 
destsignal according to cl */\n"
   "13886\t\tdataHandleEncodeMCUHash(&(CL.destCallSignal),0,dataHandle);\n"
   "13887\t\t\n"
   "13888\t\trr = gkhashInsert(serviceHashH,data,HASH_DATA_SIZE,dataHandle);\n"
   "13889\t\t\n"
   "13890\t\tif (rr)\n"
   "13891\t\t\tGK_NOTIFY(\"inserted an MCU service to the hash\",GEN_NA,20);\n"
   "13892\t\t\n"
   "13893\t\treturn rr;\n"
   "13894\t\n"
   "13895\t}\n"
   "13896\t\n"
   "13897\t/* \n"
   "13898\t * updateMcuHash - updates an  entry to the MCU hash\n"
   "13899\t *    the change would be changing the count stored in hash \n"
   "13900\t *    (incremenet or decrement by 1)\n"
   "13901\t */\n"
   "13902\tBOOL updateMcuHash(IN int cl,\n"
   "13903\t\t\t\t\t   IN int aliasIndex,\n"
   "13904\t\t\t\t\t   char *data,\n"
   "13905\t\t\t\t\t   char *dataHandle, \n"
   "13906\t\t\t\t\t   BOOL  add) /* Indicates if the update adds or subtracts  
*/\n"
   "13907\t{\n"
   "13908\t\t\n"
   "13909\t\tcmRASTransport transport;\n"
   "13910\t\tchar dataHandleUpdate[HASH_DATA_HANDLE_SIZE];\n"
   "13911\t\tchar dataHandleDeleted[HASH_DATA_HANDLE_SIZE];\n"
   "13912\t\tchar queryData[HASH_DATA_HANDLE_SIZE];\n"
   "13913\t\n"
   "13914\t\tint count;\n"
   "13915\t\tint placeLastDeleted;\n"
   "13916\t\tint placeDeleted,probes;\n"
   "13917\t\tBOOL rr;\n"
   "13918\t\t\n"
   "13919\t\t/* Extract the information from the datahandle */\n"
   "13920\t\tdataHandleDecodeMCUHash(&transport,&count,dataHandle);\n"
   "13921\t\t\n"
   "13922\t\t/* update the count variable */\n"
   "13923\t\tif (add) \n"
   "13924\t\t\tcount = count + 1;\n"
   "13925\t\telse \n"
   "13926\t\t\tcount = count - 1;\n"
   "13927\t\n"
   "13928\t\t\n"
   "13929\t\t/* Insert new information to new handle*/\n"
   "13930\t\tdataHandleEncodeMCUHash(&transport,count,dataHandleUpdate);\n"
   "13931\t\n"
   "13932\t\t/* Since we do a trick with identify, we can\'t use update 
function of the hash. \n"
   "13933\t\t   so we will delete and insert\n"
   "13934\t\t */\n"
   "13935\t\t\n"
   "13936\t\t/* Delete old hash entry */\n"
   "13937\t\tdataEncodeMCUHash(CL.destInfo[aliasIndex].string,queryData); /* 
query data verifies it is the \n"
   "13938\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t    correct key */\n"
   "13939\t\n"
   "13940\t\tplaceLastDeleted = -1; \n"
   "13941\t\trr = 
gkhashDelete(serviceHashH,data,HASH_DATA_SIZE,queryData,placeLastDeleted,\n"
   "13942\t\t\t\t\t\t\tdataHandleDeleted, &placeDeleted,&probes);\n"
   "13943\t\t\n"
   "13944\t\tif (!rr) {\n"
   "13945\t\t\tGK_EXEP(\"UpdateMCUHash : delete FAILED !!!\");\n"
   "13946\t\t\treturn rr;   /* There is no need to continue */\n"
   "13947\t\t}\n"
   "13948\t\t\n"
   "13949\t\t/* Insert new hash entry */\n"
   "13950\t\t/* Actually the condition needs to be count > 0 */\n"
   "13951\t\tif (count >= 0 ) { /* The entry needs to \"stay alive\" */\n"
   "13952\t\t\trr = 
gkhashInsert(serviceHashH,data,HASH_DATA_SIZE,dataHandleUpdate);\t\n"
   "13953\t\t}\n"
   "13954\t\n"
   "13955\t\t/* if count < 0, then the entry should be deleted, \n"
   "13956\t\t   so we simply don\'t perform the insertion */\n"
   "13957\t\n"
   "13958\t\treturn rr;\n"
   "13959\t}\n"
   "13960\t\n"
   "13961\t\n"
   "13962\t/*\n"
   "13963\t * traverse_function: this callback defines the action done when 
traversing the hash\n"
   "13964\t *  (in our case, we print the full hash entries)\n"
   "13965\t */ \n"
   "13966\tvoid CALLCONV traverse_function (\n"
   "13967\t          IN void* handle,\n"
   "13968\t          IN int flag,/*indicates if the entry is occupied(0) 
markedAsDeleted(1) or vacant(2)*/ \n"
   "13969\t          IN char*dataHandle,/*if not occupied, will be set to 
NULL*/ \n"
   "13970\t          INT32 place)\n"
   "13971\t{\n"
   "13972\t\tcmRASTransport transport;\n"
   "13973\t\tint count;\n"
   "13974\t\tchar buf[100];\n"
   "13975\t\n"
   "13976\t\t/* first check if this is occupied*/\n"
   "13977\t\tif (!flag) {  /* Occupied*/\n"
   "13978\t\t\tif (dataHandle != NULL) { /* Make sure, in case the handle is 
invalid */\n"
   "13979\t\t\t\tdataHandleDecodeMCUHash(&transport,&count,dataHandle);\n"
   "13980\t\t\t\tsprintf(buf,\"MCUHash: Entry: %d, %s, count: %d\",place,\n"
   "13981\t\t\t\t\taddIpToString(&transport),count);\n"
   "13982\t\n"
   "13983\t\t\t\tGK_NOTIFY(buf,GEN_NA,20);\n"
   "13984\t\t\t}\n"
   "13985\t\t}\n"
   "13986\t}\n"
   "13987\t\n"
   "13988\t/*\n"
   "13989\t * printHash - debug function that will print all the hash table\n"
   "13990\t *\n"
   "13991\t */\n"
   "13992\tvoid printHash()\n"
   "13993\t{\n"
   "13994\t\tgkhashTraverse(serviceHashH);\n"
   "13995\t}\n"
   "13996\t\n"
   "13997\t\n"
   "13998\t\n"
   "13999\t\n"
   "14000\t/*\n"
   "14001\t * disconnectCallMCUHash - remove the call from the MCUhash table 
(assuming it \n"
   "14002\t *   was there in the first place).\n"
   "14003\t */\n"
   "14004\tvoid disconnectCallMCUHash(IN int cl)\n"
   "14005\t{\n"
   "14006\t\n"
   "14007\t\tint aliasIndex;\n"
   "14008\t\tBOOL rr;\n"
   "14009\t\tchar data[HASH_DATA_SIZE];\n"
   "14010\t\tchar dataHandle[HASH_DATA_HANDLE_SIZE];\n"
   "14011\t\n"
   "14012\t\t/* try to find the call alias in the hash */\n"
   "14013\t\trr = findInHash(cl,data,dataHandle,&aliasIndex);\n"
   "14014\t\n"
   "14015\t\tif (rr) { /* Found the entry in the hash, continue with update 
*/\n"
   "14016\t\t\trr = updateMcuHash(cl,aliasIndex,data,dataHandle,FALSE);\n"
   "14017\t\t\tif (!rr) { /* Something failed in update */\n"
   "14018\t\t\t\tGK_EXEP(\"update of MCUHash entry failed, when disconnecting 
call!!!\");\n"
   "14019\t\t\t}\n"
   "14020\t\t}\n"
   "14021\t\telse { /* could not find in hash */\n"
   "14022\t\t\tGK_EXEP(\"Could find the call in the hash, and it SHOULD be 
there!!!\");\n"
   "14023\t\t}\n"
   "14024\t\n"
   "14025\t\t\n"
   "14026\t}\n"
   "14027\t\n"
   "14028\t\n"
   "14029\t\n"
   "14030\t/*\n"
   "14031\t * ConferenceHunting Service: check if proprietary service, or V2 
prefix service is \n"
   "14032\t *  used for \"Conference hunting\"\n"
   "14033\t */\n"
   "14034\tBOOL ConferenceHuntingService(IN int cl)\n"
   "14035\t{\n"
   "14036\t\tBOOL ConferenceHunting;\n"
   "14037\t\n"
   "14038\t\t/* Check V1 */\n"
   "14039\t\tif (CL.service != NET3_NOT_SERVICE)\n"
   "14040\t\t\tif (net3ConferenceHuntingService(CL.service)) \n"
   "14041\t\t\t\treturn TRUE;\n"
   "14042\t\n"
   "14043\t\t/* If not V1, check V2 */\n"
   "14044\t\tif ((CL.callService != SRV_INVALID_SERV) ) {\n"
   "14045\t\t\tif 
(!srvServiceGetConferenceHunting(CL.callService,&ConferenceHunting))\n"
   "14046\t\t\t\tGK_EXEP(\"Service is invalid\");\n"
   "14047\t\t\t\t\n"
   "14048\t\t\tif (ConferenceHunting) \n"
   "14049\t\t\t\treturn TRUE;\n"
   "14050\t\t}\n"
   "14051\t\n"
   "14052\t\treturn FALSE;\n"
   "14053\t\t\t\t\n"
   "14054\t}\n"
   "14055\t/*\n"
   "14056\t * The function gets call id, and puts in destInfo the first alias 
of the \n"
   "14057\t * destination of the call with the appropriate call id\n"
   "14058\t */\n"
   "14059\tBOOL calAppSupplyDestinationInfoFromCallID(IN char *callID, \n"
   "14060\t\t\t\t\t\t\t\t\t\t\t   OUT char *destInfo) {\n"
   "14061\t\tint counter, i;\n"
   "14062\t\tguid_t cid;\n"
   "14063\t\tgkaddAlias_t destinationInfo[DESTINATION_NUMBER];\n"
   "14064\t\tgkHCALL hCall;\n"
   "14065\t\tfor(counter = 0; counter < maxRegularCalls ; counter++) {\n"
   "14066\t\t\thCall = calls[counter].handle;\n"
   "14067\t\t\tgkcciGetParameter(hCall, gkcciParamCid, gkcciSideOrig, 0, 0, 
(void *)cid);\n"
   "14068\t\t\tif(strcmp(cid, callID) == 0) {\n"
   "14069\t\t\t\tgkcciGetParameter(hCall, gkcciParamAlias, gkcciSideDest, 0, 
DESTINATION_NUMBER-1, (void *)destinationInfo);\n"
   "14070\t\t\t\tfor(i = 0 ; i < DESTINATION_NUMBER ; i++) {\n"
   "14071\t\t\t\t\tif(destinationInfo[i].type > 0) {\n"
   "14072\t\t\t\t\t\tstrcpy(destInfo, destinationInfo[i].aliasStr);\t\n"
   "14073\t\t\t\t\t\treturn TRUE;\n"
   "14074\t\t\t\t\t}\n"
   "14075\t\t\t\t}\n"
   "14076\t\t\t}\n"
   "14077\t\t}\n"
   "14078\t\treturn FALSE;\n"
   "14079\t}\n"
   "14080\t\n"
   "14081\t\n"
   "14082\t\n"
   "14083\t             \n"
   "14084\t\n"
   "14085\t\n"
   "14086\t#ifdef __cplusplus\n"
   "14087\t}\n"
   "14088\t#endif\n"
   "14089\t\n"
   "(gdb) "
#  Reading file "calls.c" from GDB...done.
#  Source "calls.c" (from GDB) 14089 lines, 650659 characters
-> "x /i 0x8056d90\n"
<- "0x8056d90 <calInit>:\tpush   %ebp\n"
   "(gdb) "
-> "x /i 0x8056e90\n"
<- "0x8056e90 <calInit+256>:\ttest   %edx,%edx\n"
   "(gdb) "
#  Disassembling location 0x8056d90 to 0x8056e90...
-> "disassemble 0x8056d90 0x8056e90\n"
<- "Dump of assembler code from 0x8056d90 to 0x8056e90:\n"
   "0x8056d90 <calInit>:\tpush   %ebp\n"
   "0x8056d91 <calInit+1>:\tmov    %esp,%ebp\n"
   "0x8056d93 <calInit+3>:\tsub    $0x10,%esp\n"
   "0x8056d96 <calInit+6>:\tmov    0x8(%ebp),%eax\n"
   "0x8056d99 <calInit+9>:\tmov    %eax,0xfffffff0(%ebp)\n"
   "0x8056d9c <calInit+12>:\tmov    0xfffffff0(%ebp),%eax\n"
   "0x8056d9f <calInit+15>:\tmov    %eax,0x825746c\n"
   "0x8056da4 <calInit+20>:\tcmpl   $0x9,0x8(%ebp)\n"
   "0x8056da8 <calInit+24>:\tjg     0x8056db6 <calInit+38>\n"
   "0x8056daa <calInit+26>:\tmovl   $0x2,0x8257468\n"
   "0x8056db4 <calInit+36>:\tjmp    0x8056de0 <calInit+80>\n"
   "0x8056db6 <calInit+38>:\tmov    0x8(%ebp),%eax\n"
   "0x8056db9 <calInit+41>:\tmov    %eax,0xfffffff0(%ebp)\n"
   "0x8056dbc <calInit+44>:\tmov    $0x66666667,%ecx\n"
   "0x8056dc1 <calInit+49>:\tmov    0xfffffff0(%ebp),%eax\n"
   "0x8056dc4 <calInit+52>:\timul   %ecx,%eax\n"
   "0x8056dc6 <calInit+54>:\tmov    %edx,%ecx\n"
   "0x8056dc8 <calInit+56>:\tsar    $0x1,%ecx\n"
   "0x8056dcb <calInit+59>:\tmov    0xfffffff0(%ebp),%edx\n"
   "0x8056dce <calInit+62>:\tsar    $0x1f,%edx\n"
   "0x8056dd1 <calInit+65>:\tmov    %ecx,%eax\n"
   "0x8056dd3 <calInit+67>:\tsub    %edx,%eax\n"
   "0x8056dd5 <calInit+69>:\tmov    %eax,0xfffffff0(%ebp)\n"
   "0x8056dd8 <calInit+72>:\tmov    0xfffffff0(%ebp),%eax\n"
   "0x8056ddb <calInit+75>:\tmov    %eax,0x8257468\n"
   "0x8056de0 <calInit+80>:\tmov    0x8257468,%eax\n"
   "0x8056de5 <calInit+85>:\tinc    %eax\n"
   "0x8056de6 <calInit+86>:\tmov    %eax,0xfffffff0(%ebp)\n"
   "0x8056de9 <calInit+89>:\tmov    0xfffffff0(%ebp),%eax\n"
   "0x8056dec <calInit+92>:\tadd    0x8(%ebp),%eax\n"
   "0x8056def <calInit+95>:\tmov    %eax,0x8257464\n"
   "0x8056df4 <calInit+100>:\tmov    0x8257464,%eax\n"
   "0x8056df9 <calInit+105>:\tmov    %eax,0xfffffff0(%ebp)\n"
   "0x8056dfc <calInit+108>:\tmov    0xfffffff0(%ebp),%eax\n"
   "0x8056dff <calInit+111>:\tpush   %eax\n"
   "0x8056e00 <calInit+112>:\tcall   0x80c95d0 <cmuInit>\n"
   "0x8056e05 <calInit+117>:\tadd    $0x4,%esp\n"
   "0x8056e08 <calInit+120>:\tmov    %eax,0xfffffff0(%ebp)\n"
   "0x8056e0b <calInit+123>:\tcmpl   $0x0,0xfffffff0(%ebp)\n"
   "0x8056e0f <calInit+127>:\tjne    0x8056e30 <calInit+160>\n"
   "0x8056e11 <calInit+129>:\tpush   $0x815bea0\n"
   "0x8056e16 <calInit+134>:\tpush   $0xffffffff\n"
   "0x8056e18 <calInit+136>:\tpush   $0x21fc\n"
   "0x8056e1d <calInit+141>:\tpush   $0x0\n"
   "0x8056e1f <calInit+143>:\tpush   $0x5\n"
   "0x8056e21 <calInit+145>:\tcall   0x807d514 <callException>\n"
   "0x8056e26 <calInit+150>:\tadd    $0x14,%esp\n"
   "0x8056e29 <calInit+153>:\txor    %eax,%eax\n"
   "0x8056e2b <calInit+155>:\tjmp    0x8057105 <calInit+885>\n"
   "0x8056e30 <calInit+160>:\tpush   $0xa\n"
   "0x8056e32 <calInit+162>:\tpush   $0xfffe\n"
   "0x8056e37 <calInit+167>:\tpush   $0x815bec5\n"
   "0x8056e3c <calInit+172>:\tcall   0x808faf4 <genNotify>\n"
   "0x8056e41 <calInit+177>:\tadd    $0xc,%esp\n"
   "0x8056e44 <calInit+180>:\tpush   $0x430\n"
   "0x8056e49 <calInit+185>:\tpush   $0x815becd\n"
   "0x8056e4e <calInit+190>:\tmov    0x8257464,%edx\n"
   "0x8056e54 <calInit+196>:\tmov    %edx,0xfffffff0(%ebp)\n"
   "0x8056e57 <calInit+199>:\tshll   $0x2,0xfffffff0(%ebp)\n"
   "0x8056e5b <calInit+203>:\tadd    %edx,0xfffffff0(%ebp)\n"
   "0x8056e5e <calInit+206>:\tshll   $0x1,0xfffffff0(%ebp)\n"
   "0x8056e62 <calInit+210>:\tadd    %edx,0xfffffff0(%ebp)\n"
   "0x8056e65 <calInit+213>:\tmov    0xfffffff0(%ebp),%edx\n"
   "0x8056e68 <calInit+216>:\tshl    $0x8,%edx\n"
   "0x8056e6b <calInit+219>:\tsub    0xfffffff0(%ebp),%edx\n"
   "0x8056e6e <calInit+222>:\tlea    0x0(,%edx,8),%eax\n"
   "0x8056e75 <calInit+229>:\tmov    %eax,0xfffffff0(%ebp)\n"
   "0x8056e78 <calInit+232>:\tmov    0xfffffff0(%ebp),%eax\n"
   "0x8056e7b <calInit+235>:\tpush   %eax\n"
   "0x8056e7c <calInit+236>:\tcall   0x80fcc14 <memfAlloc>\n"
   "0x8056e81 <calInit+241>:\tadd    $0xc,%esp\n"
   "0x8056e84 <calInit+244>:\tmov    %eax,0xfffffff0(%ebp)\n"
   "0x8056e87 <calInit+247>:\tmov    0xfffffff0(%ebp),%edx\n"
   "0x8056e8a <calInit+250>:\tmov    %edx,0x8257460\n"
   "End of assembler dump.\n"
   "(gdb) "
#  Disassembling location 0x8056d90 to 0x8056e90...done.
-> "info source\n"
<- "Current source file is calls.c\n"
   "Compilation directory is 
/home2/sohan/rel4/build/loads/mrc/voice/gatekeeper/\n"
   "Located in /users/sohan/rel4/build/loads/mrc/voice/gatekeeper/calls.c\n"
   "Contains 14089 lines.\n"
   "Source language is c.\n"
   "Compiled with stabs debugging format.\n"
   "(gdb) "
-> "# reset\n"
<- "(gdb) "
-> "info breakpoints\n"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "display\n"
<- "(gdb) "
-> "info display\n"
<- "There are no auto-display expressions now.\n"
   "(gdb) "
-> "info files\n"
<- "Symbols from \"/voice_app/bin/RVGK\".\n"
   "Local exec file:\n"
   "\t`/voice_app/bin/RVGK\', file type elf32-i386.\n"
   "\tEntry point: 0x8049d70\n"
   "\t0x080480f4 - 0x08048107 is .interp\n"
   "\t0x08048108 - 0x08048128 is .note.ABI-tag\n"
   "\t0x08048128 - 0x080484b4 is .hash\n"
   "\t0x080484b4 - 0x08048cb4 is .dynsym\n"
   "\t0x08048cb4 - 0x08049161 is .dynstr\n"
   "\t0x08049162 - 0x08049262 is .gnu.version\n"
   "\t0x08049264 - 0x080492b4 is .gnu.version_r\n"
   "\t0x080492b4 - 0x080492bc is .rel.got\n"
   "\t0x080492bc - 0x080492ec is .rel.bss\n"
   "\t0x080492ec - 0x08049654 is .rel.plt\n"
   "\t0x08049654 - 0x08049683 is .init\n"
   "\t0x08049684 - 0x08049d64 is .plt\n"
   "\t0x08049d70 - 0x08157ce8 is .text\n"
   "\t0x08157ce8 - 0x08157d02 is .fini\n"
   "\t0x08157d20 - 0x0819b150 is .rodata\n"
   "\t0x0819c160 - 0x08226120 is .data\n"
   "\t0x08226120 - 0x0824da50 is .eh_frame\n"
   "\t0x0824da50 - 0x0824dc28 is .gcc_except_table\n"
   "\t0x0824dc28 - 0x0824dc30 is .ctors\n"
   "\t0x0824dc30 - 0x0824dc38 is .dtors\n"
   "\t0x0824dc38 - 0x0824ddfc is .got\n"
   "\t0x0824ddfc - 0x0824deb4 is .dynamic\n"
   "\t0x0824dec0 - 0x082624c4 is .bss\n"
   "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
   "(gdb) "
#  Opening session "RVGK"...done.
-> "output ebp\n"
<- "No symbol \"ebp\" in current context.\n"
   "(gdb) "
-> "output $ebp\n"
<- "No registers.\n"
   "(gdb) "
-> "lust gkStack.c:1\n"
<- "Undefined command: \"lust\".  Try \"help\".\n"
   "(gdb) "
-> "info breakpoints\n"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "info line gkStack.c:1\n"
<- "Line 1 of \"gkStack.c\" is at address 0x8053360 <gkGetHandle> but contains 
no code.\n"
<- 
"\032\032/users/sohan/rel4/build/loads/mrc/voice/samapp/gkStack.c:1:0:beg:0x8053360\n"
   "(gdb) "
#  Reading file "/voice_app/bin/gkStack.c"...
#  Reading file "/voice_app/bin/gkStack.c"...No such file or directory.
-> "info source\n"
<- "Current source file is gkStack.c\n"
   "Compilation directory is /home2/sohan/rel4/build/loads/mrc/voice/samapp/\n"
   "Located in /users/sohan/rel4/build/loads/mrc/voice/samapp/gkStack.c\n"
   "Contains 1086 lines.\n"
   "Source language is c.\n"
   "Compiled with stabs debugging format.\n"
   "(gdb) "
#  Reading file "gkStack.c" from GDB...
-> "list gkStack.c:1,1000000\n"
<- "1\t//\n"
   "2\t// Copyright 2000 by Prominence Networks Inc.\n"
   "3\t// All rights reserved.\n"
   "4\t//\n"
   "5\t// This software is the confidential and proprietary information\n"
   "6\t// of Prominence Networks, Inc. (\"Confidential Information\"). No\n"
   "7\t// part of this Confidential Information may be disclosed or\n"
   "8\t// reproduced in any form without prior written approval from\n"
   "9\t// Prominence Networks Inc.\n"
   "10\t//\n"
   "11\t#ifdef __cplusplus\n"
   "12\textern \"C\" {\n"
   "13\t#endif\n"
   "14\t\n"
   "15\t/*\n"
   "16\t  gkStack.c\n"
   "17\t  Gk Stack handling.\n"
   "18\t\n"
   "19\t  */\n"
   "20\t\n"
   "21\t#ifdef GKLD_PLUGIN\n"
   "22\t#include \"ldapcfg.h\"\n"
   "23\t#endif\n"
   "24\t  \n"
   "25\t#include \"cdr.h\"  \n"
   "26\t\n"
   "27\t#ifdef GKDNS_PLUGIN\n"
   "28\t#include \"samappDns.h\"\n"
   "29\t#endif\n"
   "30\t\n"
   "31\t#ifdef GKSEC_PLUGIN\n"
   "32\t#include \"security.h\"\n"
   "33\t#include \"databaseInterface.h\"\n"
   "34\t#endif\n"
   "35\t\n"
   "36\t#include \"dialplan.h\"\n"
   "37\t\n"
   "38\t#include \"rvcommon.h\"\n"
   "39\t#include \"gkadd.h\"\n"
   "40\t#include \"cfgapi.h\"\n"
   "41\t#include \"gkrgi.h\"\n"
   "42\t#include \"gklrqi.h\"\n"
   "43\t#include \"gkTypes.h\"\n"
   "44\t#include \"gkcci.h\"\n"
   "45\t#include \"gkmain.h\"\n"
   "46\t#include \"seli.h\"\n"
   "47\t\n"
   "48\t#include \"gkpli.h\"\n"
   "49\t  \n"
   "50\t#include \"apptypes.h\"\n"
   "51\t#include \"utilities.h\"\n"
   "52\t#include \"allocations.h\"\n"
   "53\t#include \"services.h\"\n"
   "54\t#include \"parameters.h\"\n"
   "55\t#include \"neighbors.h\"\n"
   "56\t#include \"islands.h\"\n"
   "57\t#include \"endpoints.h\"\n"
   "58\t#include \"commands.h\"\n"
   "59\t#include \"appgrq.h\"\n"
   "60\t#include \"apprrq.h\"\n"
   "61\t#include \"applrq.h\"\n"
   "62\t#include \"appcalls.h\"\n"
   "63\t\n"
   "64\t#ifdef GKSUS_PLUGIN\n"
   "65\t#include \"gksusi.h\"\n"
   "66\t\n"
   "67\t#include \"h450icfg.h\"\n"
   "68\t#include \"h450pcfg.h\"\n"
   "69\t#endif\n"
   "70\t\n"
   "71\t#ifdef GKMC_PLUGIN\n"
   "72\t#include \"mci_report.h\"\n"
   "73\t#include \"mci_types.h\"\n"
   "74\t#include \"mci_call.h\"\n"
   "75\t\n"
   "76\t\n"
   "77\t#include \"gkmc.h\"\n"
   "78\t#include \"gkmci.h\"\n"
   "79\t#include \"h245.h\"\n"
   "80\t#endif\n"
   "81\t\n"
   "82\t\n"
   "83\t#include        <stdio.h>\n"
   "84\t#include        <stdlib.h>\n"
   "85\t#include        <string.h>\n"
   "86\t#include        <errno.h>\n"
   "87\t#include        <unistd.h>\n"
   "88\t#include        <sys/types.h>\n"
   "89\t#include        <netinet/in.h>\n"
   "90\t\n"
   "91\t/*\n"
   "92\t#include        <netinet/ip.h>\n"
   "93\t#include        <sys/utsname.h>\n"
   "94\t#include        <sys/socket.h>\n"
   "95\t#include        <sys/shm.h>\n"
   "96\t#include        <sys/ipc.h>\n"
   "97\t#include        <signal.h>\n"
   "98\t#include        \"seli.h\"\n"
   "99\t*/\n"
   "100\t\n"
   "101\t#include        \"our_tools_space.h\"\n"
   "102\t/*#include        \"media_router.h\"\n"
   "103\t#include        \"our_tools_space.h\"*/\n"
   "104\t#include\t\"gkStack.h\"\n"
   "105\t#include\t\"gkLocation.h\"\n"
   "106\t#include\t\"gkCall.h\"\n"
   "107\t#include\t\"gkHook.h\"\n"
   "108\t#include\t\"gkNonstandard.h\"\n"
   "109\t\n"
   "110\t\n"
   
"111\t/*------------------------------------------------------------------------------------------*/\n"
   "112\t/*\n"
   "113\tstatic char                             
ip_address[IP_ADDRESS_STRING_SIZE + 1];\n"
   "114\tstatic char                             message[BUFSIZ];\n"
   "115\tstatic uint32_t                        \tlocal_ip = 0;\n"
   "116\t*/\n"
   "117\tgkStruct\tgk;\n"
   "118\t\n"
   
"119\t/*------------------------------------------------------------------------------------------*/\n"
   "120\t\n"
   "121\t\n"
   "122\t#if 0\n"
   "123\tRVAPI INT32 CALLCONV mrcGKNotifHandler (IN gkmcGKNotification ,\n"
   "124\t                                                IN UINT8 *,\n"
   "125\t                                                IN mcgkConnHandle_t 
,\n"
   "126\t                                                IN mcMCHandle );\n"
   "127\t\n"
   "128\tRVAPI   MciRV  CALLCONV mrcGetConf (IN gkmcGKNotification , IN 
gkmcGKNotification* , IN mcMCHandle , IN mcgkConnHandle_t , OUT 
mciConfHandleType *);\n"
   "129\t\n"
   "130\t\n"
   "131\tstatic Conference *\n"
   "132\tAddConference(mciConfHandleType\t);\n"
   "133\t\n"
   "134\tstatic Conference *\n"
   "135\tGetConfFromId(mciConfHandleType    );\n"
   "136\t\n"
   "137\tstatic Conference *\n"
   "138\tGetConfFromCID(mciCIDType );\n"
   "139\t\n"
   "140\tstatic void\n"
   "141\tClearConf(Conference           *);\n"
   "142\t\n"
   "143\tstatic void\n"
   "144\tClearConferenceDataList();\n"
   "145\t\n"
   "146\tRVAPI\n"
   "147\tMciRV  CALLCONV mrcInitializeCallLeg(IN   mciCallHandleType);  \n"
   "148\t#endif\n"
   "149\t\n"
   "150\t\n"
   
"151\t/*------------------------------------------------------------------------------------------*/\n"
   "152\t/* the application structure */\n"
   "153\tgkStruct* gkGetHandle()\n"
   "154\t{ \n"
   "155\t\treturn &gk;\n"
   "156\t}\n"
   "157\t\n"
   
"158\t/*------------------------------------------------------------------------------------------*/\n"
   "159\tuint32_t gkGetLocalIp()\n"
   "160\t{ \n"
   "161\t\treturn gk.local_ip;\n"
   "162\t}\n"
   "163\t\n"
   
"164\t/*____________________________________________quit______________________________________*/\n"
   "165\tvoid\n"
   "166\tgkQuit(void)\n"
   "167\t{\n"
   "168\t  seliEnd();\n"
   "169\t}\n"
   "170\t\n"
   
"171\t/*------------------------------------------------------------------------------------------*/\n"
   "172\tRVAPI\n"
   "173\tINT32  CALLCONV gkInitialize(int argc, char *argv[])\n"
   "174\t{\n"
   "175\t  char \t\t\t*p;\n"
   "176\t  int \t\t\ti,res;\n"
   "177\t\n"
   "178\t  GKRGIEVENT \t\tregHandler;\n"
   "179\t  GKLRQIEVENT \t\tlrqHandler;\n"
   "180\t  GKCCIEVENT \t\tcallHandler;\n"
   "181\t  GKNSMEVENT\t\tnsmHandler;\t\n"
   "182\t\n"
   "183\t  memset(&regHandler,0,sizeof(GKRGIEVENT));\n"
   "184\t  regHandler.gkrgiEvent = gkregEventHandler;\n"
   "185\t  //regHandler.gkrgiHook = NULL;\n"
   "186\t  regHandler.gkrgiHook = gkrgiHookHandler;\n"
   "187\t  \n"
   "188\t  memset(&lrqHandler,0,sizeof(GKLRQIEVENT));\n"
   "189\t  lrqHandler.gklrqiEvent = gklrqEventHandler;\n"
   "190\t  //lrqHandler.gklrqiHook = NULL;\n"
   "191\t  lrqHandler.gklrqiHook = gklrqiHookHandler;\n"
   "192\t  \n"
   "193\t  /* don\'t register on the message event*/\n"
   "194\t\n"
   "195\t  memset(&callHandler,0,sizeof(GKCCIEVENT));\n"
   "196\t  callHandler.gkcciStateEvent = gkcallStateEventHandler;\n"
   "197\t  callHandler.gkcciMsgEvent = NULL;\n"
   "198\t  //callHandler.gkcciHook = NULL;\n"
   "199\t  callHandler.gkcciHook = gkCallHookHandler;\n"
   "200\t\n"
   "201\t  callHandler.gkcciBandwidthEvent = NULL;\n"
   "202\t  callHandler.gkcciFacilityEvent = gkfacilityHandler;\n"
   "203\t  callHandler.gkcciInfoMsgEvent = NULL;\n"
   "204\t  \n"
   "205\t  memset(&nsmHandler,0,sizeof(GKNSMEVENT));\n"
   "206\t  nsmHandler.gkrgiNSMHandler = gkNonstandardMessageHandler;\n"
   "207\t\n"
   "208\t  gkrgiSetEventHandler(&regHandler,sizeof(regHandler));\n"
   "209\t  gklrqiSetEventHandler(&lrqHandler,sizeof(lrqHandler));\n"
   "210\t  gkcciSetEventHandler(&callHandler,sizeof(callHandler));\n"
   "211\t  gkrgiSetNSMHandler(&nsmHandler,sizeof(nsmHandler));\n"
   "212\t}\n"
   "213\t\n"
   "214\t\n"
   "215\t\n"
   
"216\t/*------------------------------------------------------------------------------------------*/\n"
   "217\t\n"
   "218\tINT32 CALLCONV gkregEventHandler(\n"
   "219\t\t\t\t       IN gkHREG hReg,\n"
   "220\t\t\t\t       IN OUT gkHAPPREG* haReg,\n"
   "221\t\t        \t       IN gkrgiEvent_t event,\n"
   "222\t\t\t\t       IN gkrgiReason_t reason)\n"
   "223\t     \n"
   "224\t{  \n"
   "225\t  BOOL replied = FALSE;\n"
   "226\t  gkpliTransaction trans;\n"
   "227\t\n"
   "228\t  INT32 res;\n"
   "229\t\n"
   "230\t  if (hReg == GKRGI_REG_NULL)\n"
   "231\t    return GKRGI_OK;\n"
   "232\t\n"
   "233\t  //semSemaphoreTake();\n"
   "234\t\n"
   "235\t  if(haReg);\n"
   "236\t  if(reason);\n"
   "237\t\n"
   "238\t  /*if (hReg == GKRGI_REG_NULL)\n"
   "239\t    ReturnAndGiveSem( GKRGI_OK)*/\n"
   "240\t\n"
   "241\t  LOG_MESSAGE(LEVEL3, \"------- regEventHandler: hReg (0x%X) 
haReg(0X%X), Event(%d : %s), reason(%d : %s) \\n"
   "\",\n"
   "242\t                      hReg, haReg, event, gkrgiEventName(event), 
reason, gkrgiReasonName(reason));\n"
   "243\t\n"
   "244\t  switch (event)\n"
   "245\t  {\n"
   "246\t    case gkrgiEvApprovedGRQ       :\n"
   "247\t    case gkrgiEvDisapprovedGRQ    :\n"
   "248\t    case gkrgiEvApprovedRRQ       :\n"
   "249\t    case gkrgiEvDisapprovedRRQ    :\n"
   "250\t    case gkrgiEvApprovedURQ       :\n"
   "251\t    case gkrgiEvDisapprovedURQ    :\n"
   "252\t    case gkrgiEvRegistrationUpdate:\n"
   "253\t    case gkrgiEvSendingMessage    :\n"
   "254\t    case gkrgiEvReceivedResponse  : \n"
   "255\t    case gkrgiEvTransIdle         : \n"
   "256\t    case gkrgiEvTTLExpired        :\n"
   "257\t    case gkrgiEvInactivityExpired :\n"
   "258\t    case gkrgiEvIRQExpired        : \n"
   "259\t    case gkrgiEvNoPendingTrans    : \n"
   "260\t    case gkrgiEvGRJSent           :\n"
   "261\t    case gkrgiEvRRJSent           :\n"
   "262\t    case gkrgiEvURJSent           :\n"
   "263\t    case gkrgiEvRegVacant         : \n"
   "264\t           break;\n"
   "265\t    default                       : \n"
   "266\t  \tLOG_MESSAGE(LEVEL3, \"------- unhandled event %d in 
gkregEventHandler \\n"
   "\",event);\n"
   "267\t  }\n"
   "268\t\n"
   "269\t  //ReturnAndGiveSem( GKRGI_OK)\n"
   "270\t\n"
   "271\t\n"
   "272\t\n"
   "273\t#ifdef GKLD_PLUGIN\n"
   "274\t  if(LDAP_ON) {\n"
   "275\t  if(gkldiRegEvent(hReg, event, reason) < 0)\n"
   "276\t      utilErrorHandler(\"Error in regEventHandler\\n"
   "\");\n"
   "277\t  replied = TRUE;\n"
   "278\t  }\n"
   "279\t#endif\n"
   "280\t#ifdef GKSEC_PLUGIN\n"
   "281\t  if(SECURITY_ON) {\n"
   "282\t    securityRegEvent(hReg, event, reason);\n"
   "283\t    replied = TRUE;\n"
   "284\t  }\n"
   "285\t#endif\n"
   "286\t  if(replied == TRUE)\n"
   "287\t  {\n"
   "288\t    trans.coreHandle = (void*)hReg;\n"
   "289\t    trans.transType = gkpliTransTypeReg;\n"
   "290\t    trans.HTrans = 0;\n"
   "291\t    gkpliRegTransaction(hReg, event, reason, &trans); \n"
   "292\t    gkpliReplyEnable(&trans);      \n"
   "293\t  }\n"
   "294\t#ifdef GKLD_PLUGIN\n"
   "295\t    if(LDAP_ON)\n"
   "296\t      return GKRGI_OK;\n"
   "297\t#endif\n"
   "298\t\n"
   "299\t#ifdef GKSEC_PLUGIN\n"
   "300\t   if(SECURITY_ON)\n"
   "301\t    return GKRGI_OK;\n"
   "302\t#endif\n"
   "303\t\n"
   "304\t\n"
   "305\t\n"
   "306\t\n"
   "307\t  if (event == gkrgiEvApprovedGRQ || event == gkrgiEvDisapprovedGRQ)\n"
   "308\t    return appgrqEventHandler(hReg,haReg,event,reason);\n"
   "309\t  if (event == gkrgiEvApprovedRRQ)\n"
   "310\t    return apprrqEventHandler(hReg,haReg,event,reason); \n"
   "311\t  return gkrgiDefaultRegHandler(hReg,haReg,event,reason);\n"
   "312\t}\n"
   "313\t\n"
   "314\t\n"
   "315\t\n"
   
"316\t/*------------------------------------------------------------------------------------------*/\n"
   "317\tINT32 CALLCONV gkfacilityHandler(\n"
   "318\t                IN      gkHCALL\t           hCall,           /* GK 
handle to the call */\n"
   "319\t                IN OUT  gkHAPPCALL *\t   haCall,          /* 
application handle to the call */\n"
   "320\t\t      \tIN\tINT32\t\t   facilityHandle,  /*handle to the facility 
message*/\t\n"
   "321\t                IN      gkcciFacilityEvent_t  event,        /* the 
facility management event */\n"
   "322\t                IN      gkcciSide_t        side,            /* the 
side of the event*/\n"
   "323\t                IN      gkcciFacilityReason_t  reason\t    /* the 
reason associated with the event */\n"
   "324\t                )\n"
   "325\t{\n"
   "326\t  BOOL replied = FALSE;\n"
   "327\t\n"
   "328\t  INT32 res;\n"
   "329\t\n"
   "330\t  /*semSemaphoreTake();     */\n"
   "331\t  if(haCall);\n"
   "332\t  if(reason);\n"
   "333\t  LOG_MESSAGE(LEVEL3, \"------- facilityHandler: hCall (0x%X) 
haCall(0X%X), Event(%d), side(%d), reason(%d) \\n"
   "\",\n"
   "334\t                      hCall, haCall, event, side, reason);\n"
   "335\t  switch (event) \n"
   "336\t  {\n"
   "337\t  \tcase gkcciFacilityReceived:\n"
   "338\t           break;\n"
   "339\t        default:\n"
   "340\t           break;\n"
   "341\t  }\n"
   "342\t  /* ReturnAndGiveSem( gkcciOK);*/\n"
   "343\t\n"
   "344\t \n"
   "345\t#ifdef GKSUS_PLUGIN\n"
   "346\t  {\n"
   "347\t    gksusiRV susRV;\n"
   "348\t    \n"
   "349\t    if ((susRV = gksusiFacilityEvent(hCall, facilityHandle, event, 
side, reason)) < 0)\n"
   "350\t      {\n"
   "351\t\tprtException(\"facilityHandler: gksusiFacilityEvent failed\");\n"
   "352\t\treturn gkcciGKFailure;\n"
   "353\t      }\n"
   "354\t    else if (susRV != GKSuSI_RV_UNHANDLED_CALL_EVENT) \n"
   "355\t      {\n"
   "356\t\tprtNotify(\"Facility event handled by GKSuS\", 20);\n"
   "357\t\treplied = TRUE;\n"
   "358\t      }\n"
   "359\t  }\n"
   "360\t#endif\n"
   "361\t  \n"
   "362\t  if (replied) /* Any of the plugins involved ? */\n"
   "363\t    {\n"
   "364\t      gkpliTransaction trans;\n"
   "365\t      trans.coreHandle = (void*)hCall;\n"
   "366\t      trans.transType = gkpliTransTypeFacility;\n"
   "367\t      trans.HTrans = facilityHandle*2+(INT32)side;\n"
   "368\t      gkpliReplyEnable(&trans);\n"
   "369\t    }\n"
   "370\t  \n"
   "371\t  if (!replied)\n"
   "372\t    return gkcciDefaultFacilityEventHandler(hCall, haCall, 
facilityHandle, event, side, reason);\n"
   "373\t  \n"
   "374\t   return gkcciOK;\n"
   "375\t}\n"
   "376\t\n"
   "377\t\n"
   "378\t\n"
   
"379\t/*------------------------------------------------------------------------------------------*/\n"
   "380\t\n"
   "381\t#if 0\n"
   "382\tint\n"
   "383\tmain(int        argc, char              **argv)\n"
   "384\t/*  main function for unixthe sample application. return 0 on success 
or ERROR */\n"
   "385\t{\n"
   "386\t\n"
   "387\t\n"
   "388\t\n"
   "389\t  /* set notification and exception printing functions */\n"
   "390\t  initLogFile();\n"
   "391\t\n"
   "392\t\n"
   "393\t\n"
   "394\t  if (!initAppDataBase())\n"
   "395\t    return utilErrorHandler(\"error in initAppDataBase\");\n"
   "396\t  if (!allocationsInit())\n"
   "397\t    return utilErrorHandler(\"allocationsInit returned FALSE\");\n"
   "398\t\n"
   "399\t  if (gkmainInit()==ERROR)\n"
   "400\t    return utilErrorHandler(\"Erorr in gkInit\");\n"
   "401\t  if (gkpliInit(100,2) < 0)\n"
   "402\t    return utilErrorHandler(\"Erorr in gkpliInit\");\n"
   "403\t  if(!loadConf())\n"
   "404\t    return ERROR;\n"
   "405\t \n"
   "406\t  \n"
   "407\t  while (1)\n"
   "408\t    {\n"
   "409\t      seliSelect();\n"
   "410\t    }     \n"
   "411\t  return 0;\n"
   "412\t}\n"
   "413\t\n"
   "414\t\n"
   
"415\t/*------------------------------------------------------------------------------------------*/\n"
   "416\tRVAPI\n"
   "417\tMciRV CALLCONV mrcEvPTPConfStateHandler (IN mciConfAppHandleType 
haConf, \n"
   "418\t                                            IN mciConfHandleType       
 hConf,\n"
   "419\t                                            IN mciConfStateType        
 confState,\n"
   "420\t                                            IN mciConfReasonType       
 confReason)\n"
   "421\t{\n"
   "422\t        BOOL validHandle;\n"
   "423\t        \n"
   "424\t        if (haConf)\n"
   "425\t          ;       \n"
   "426\t        if (confReason)\n"
   "427\t          ;       \n"
   "428\t        \n"
   "429\t        LOG_MESSAGE(LEVEL3, \"------- ConfStateHandler: hConf (0x%X) 
haConf(0X%X), confState(%d) \\n"
   "\",\n"
   "430\t                        hConf, haConf, confState);\n"
   "431\t        mciConfIsValidHandle (hConf, &validHandle);\n"
   "432\t        if (validHandle)\n"
   "433\t      \t{\n"
   "434\t        \tswitch(confState)\n"
   "435\t        \t{\n"
   "436\t        \t\tcase mciConfSttInactive:\n"
   "437\t\t\t\t{\n"
   "438\t\t\t\t\tConference *conf=(Conference *)0;\n"
   "439\t\t\t\t\t/* Getting the application handle in the Call record */\n"
   "440\t  \t\t\t\tif (mccDbGetConfPrm (hConf, mciConfPrmAppHandle, 
(void*)&conf) != MCI_RV_OK)\n"
   "441\t\t\t\t\t{\n"
   "442\t        \t\t\t\tLOG_MESSAGE(LEVEL3, \"!!Exception: Failed retreiving 
application handle of Conf record (CALL = %X)\", hConf); \n"
   "443\t\t\t\t\t}\n"
   "444\t\t\t\t\telse\n"
   "445\t\t        \t\t{\n"
   "446\t\t\t\t\t\tLOG_MESSAGE(LEVEL3, \"Successfully retreived app 
handle(0x%X) of Conf record (CONF = %X)\", conf, hConf); \n"
   "447\t\t        \t\t\tlog_msg(LEVEL5,message);\n"
   "448\t\t\t\t\t\tClearConf(conf);\n"
   "449\t\t\t\t\t}\n"
   "450\t\t\t\t}\n"
   "451\t       \t        \t\tbreak;\n"
   "452\t        \t\tcase mciConfSttActive:\n"
   "453\t\t\t\t{\n"
   "454\t\t\t\t\tConference *conf=(Conference *)0;\n"
   "455\t\t\t\t\tif (! (conf = AddConference(hConf)))\n"
   "456\t\t\t\t\t{\n"
   "457\t\t\t\t\t\tLOG_MESSAGE(LEVEL3, \"Failed to add Conference node for 
(0x%X) \", hConf); \n"
   "458\t\t\t\t\t}\n"
   "459\t\t\t\t\telse\n"
   "460\t        \t\t\t{\n"
   "461\t\t\t\t\t\tLOG_MESSAGE(LEVEL3, \"Successfully Added conference node 
(0x%X) for conf handle (CONF = %X)\", conf, hConf); \n"
   "462\t        \t\t\t\tlog_msg(LEVEL5,message);\n"
   "463\t\t\t\t\t}\n"
   "464\t\n"
   "465\t\t\t\t\t/* Setting the application handle in the Call record */\n"
   "466\t  \t\t\t\tif (mccDbSetConfPrm (hConf, mciConfPrmAppHandle, 
(void*)&conf) != MCI_RV_OK)\n"
   "467\t       \t\t\t\t{\n"
   "468\t\t\t\t\t\tLOG_MESSAGE(LEVEL3, \"!!Exception: Failed updating 
application handle of Conf record (CALL = %X)\", hConf); \n"
   "469\t\t\t\t\t}\n"
   "470\t\t\t\t\telse\n"
   "471\t       \t\t\t\t{\n"
   "472\t\t\t\t\t\tLOG_MESSAGE(LEVEL3, \"Successfully updated app handle(0x%X) 
for conf handle (CONF = %X)\", conf, hConf); \n"
   "473\t        \t\t\t\tlog_msg(LEVEL5,message);\n"
   "474\t\t\t\t\t}\n"
   "475\t\t\t\t}\n"
   "476\t        \t       \t\tbreak;\n"
   "477\t        \t\tcase mciConfSttTransfer:\n"
   "478\t               \t\t\tbreak;\n"
   "479\t        \t\tdefault:\n"
   "480\t\t               \t\tbreak;\n"
   "481\t        \t}\n"
   "482\t\t}  \n"
   "483\t\n"
   "484\t        /* Calling the event handler */\n"
   "485\t        return (mciDefEvPTPConfStateHandler(haConf, hConf, confState, 
confReason));\n"
   "486\t}\n"
   "487\t\n"
   
"488\t/*------------------------------------------------------------------------------------------*/\n"
   "489\tRVAPI\n"
   "490\tMciRV  mrcEvPTPCallStateHandler(IN   mciCallAppHandleType   haCall, \n"
   "491\t                                 IN   mciCallHandleType      hCall,  
\n"
   "492\t                                 IN   mciCallStateType       
callState,\n"
   "493\t                                 IN   mciCallStateReasonType 
callReason)\n"
   "494\t{\n"
   "495\t\tHCALL                 hsCall;\n"
   "496\t\tHPROTCONN\t      hConn = NULL;\n"
   "497\t\n"
   "498\t        LOG_MESSAGE(LEVEL3, \"------- CallStateHandler: hCall (0x%X) 
haCall(0X%X), callState(%d) \\n"
   "\",\n"
   "499\t                        hCall, haCall, callState);\n"
   "500\t\n"
   "501\t        switch(callState)\n"
   "502\t        {\n"
   "503\t       \t\tcase mciCallSttInitialized:\n"
   "504\t\t\t{\t\t\n"
   "505\t\t\t\tmrcInitializeCallLeg(hCall);  \n"
   "506\t\t\t}\n"
   "507\t\t\t\tbreak;\n"
   "508\t\t        case mciCallSttH245Connected:\n"
   "509\t        \t        break;\n"
   "510\t\t        case mciCallSttReady:\n"
   "511\t        \t        break;\n"
   "512\t\t