Author: derek Date: Tue Jun 19 21:40:42 2007 New Revision: 330 Modified: sofaswitch/trunk/overview/chap2.sgml Log: Put in new log of an outgoing voip call. This log better illustrates preallocated nodes. Modified: sofaswitch/trunk/overview/chap2.sgml ============================================================================== --- sofaswitch/trunk/overview/chap2.sgml (original) +++ sofaswitch/trunk/overview/chap2.sgml Tue Jun 19 21:40:42 2007 @@ -632,45 +632,70 @@ repeated, because the log below shows incoming and outgoing messages to the server. <programlisting> +20/ 6/2007 10:31:25.582597 Recv New node of voip +20/ 6/2007 10:31:25.586112 Recv New node of voip1 +20/ 6/2007 10:31:25.586585 Recv New node of voip2 +20/ 6/2007 10:31:25.586962 Recv New node of voip3 +20/ 6/2007 10:31:25.587423 Recv New node of voip4 +20/ 6/2007 10:31:25.587715 Recv New node of voip5 +20/ 6/2007 10:31:25.588115 Recv New node of voip6 +20/ 6/2007 10:31:25.588520 Recv New node of voip7 +20/ 6/2007 10:31:25.588935 Recv New node of voip8 +20/ 6/2007 10:31:25.589782 Recv New node of voip9 +20/ 6/2007 10:31:25.590308 Recv New node of voip10 +20/ 6/2007 10:32:58.645980 Recv New node of sound +20/ 6/2007 10:33:28. 93320 Recv New node of ? +20/ 6/2007 10:33:28. 93480 Recv from c1 whoami +20/ 6/2007 10:33:28. 93556 Send to c1 c1 +20/ 6/2007 10:33:28. 94871 Recv from c1 voip:reporttome +20/ 6/2007 10:33:28. 95018 Send to voip c1:reporttome +20/ 6/2007 10:33:28. 95058 Recv from c1 voip:REQUESTNEWID +20/ 6/2007 10:33:28. 95099 Send to voip c1:REQUESTNEWID +20/ 6/2007 10:33:28. 95122 Recv from c1 sound:REQUESTNEWID +20/ 6/2007 10:33:28. 95171 Send to sound c1:REQUESTNEWID +20/ 6/2007 10:33:28. 95615 Recv from voip AdviseOnTermination c1 +20/ 6/2007 10:33:28. 95652 Recv from voip c1:REQUESTNEWID voip1 +20/ 6/2007 10:33:28. 95699 Send to c1 voip:REQUESTNEWID voip1 +20/ 6/2007 10:33:28. 95837 Recv from voip1 AdviseOnTermination c1 +20/ 6/2007 10:33:28. 95954 Recv from sound AdviseOnTermination c1 +20/ 6/2007 10:33:28. 95982 Recv from sound c1:REQUESTNEWID sound +20/ 6/2007 10:33:28. 96018 Send to c1 sound:REQUESTNEWID sound +20/ 6/2007 10:33:28. 96490 Recv New node of voip11 +20/ 6/2007 10:33:28. 99172 Recv from c1 voip1:CALLNODE iax2:guest@conference.freeswitch.org/42 +20/ 6/2007 10:33:28. 99269 Send to voip1 c1:CALLNODE iax2:guest@conference.freeswitch.org/42 +20/ 6/2007 10:33:28. 99296 Recv from c1 voip1:TRANSFERUDP sound +20/ 6/2007 10:33:28. 99336 Send to voip1 c1:TRANSFERUDP sound +20/ 6/2007 10:33:28. 99622 Recv from voip1 AdviseOnTermination c1 +20/ 6/2007 10:33:33.754578 Recv from voip1 sound:TRANSFERUDP sound 192.168.1.109:60000 +20/ 6/2007 10:33:33.754679 Send to sound voip1:TRANSFERUDP sound 192.168.1.109:60000 +20/ 6/2007 10:33:33.756003 Recv from sound voip1:TRANSFERUDP sound 192.168.1.108:63000 done +20/ 6/2007 10:33:33.756074 Send to voip1 sound:TRANSFERUDP sound 192.168.1.108:63000 done +20/ 6/2007 10:33:34. 39595 Recv from voip1 c1:CallEstablished voip1 +20/ 6/2007 10:33:34. 39690 Send to c1 voip1:CallEstablished voip1 +20/ 6/2007 11:23:22.196723 Send to c1 sound:Terminating +20/ 6/2007 11:23:22.199184 Recv from c1 sound:TRANSFERUDP sound +20/ 6/2007 11:23:22.199243 Recv from c1 voip1:HANGUP +20/ 6/2007 11:23:22.199307 Send to voip1 c1:HANGUP +20/ 6/2007 11:23:23.200669 Send to c1 voip1:Terminating +20/ 6/2007 11:23:23.203249 Recv from c1 sound:TRANSFERUDP sound +20/ 6/2007 11:23:23.203308 Recv from c1 voip1:HANGUP -19/ 6/2007 9:52:25.980656 Recv New node of sound -19/ 6/2007 9:52:49.562018 Recv New node of ? -19/ 6/2007 9:52:49.562316 Recv from c83 whoami -19/ 6/2007 9:52:49.562376 Send to c83 c83 -19/ 6/2007 9:52:49.570221 Recv from c83 voip:reporttome -19/ 6/2007 9:52:49.570343 Send to voip c83:reporttome -19/ 6/2007 9:52:49.570371 Recv from c83 voip:REQUESTNEWID -19/ 6/2007 9:52:49.570424 Send to voip c83:REQUESTNEWID -19/ 6/2007 9:52:49.570446 Recv from c83 sound:REQUESTNEWID -19/ 6/2007 9:52:49.571467 Send to sound c83:REQUESTNEWID -19/ 6/2007 9:52:49.572196 Recv from sound AdviseOnTermination c83 -19/ 6/2007 9:52:49.572238 Recv from sound c83:REQUESTNEWID sound -19/ 6/2007 9:52:49.572288 Send to c83 sound:REQUESTNEWID sound -19/ 6/2007 9:52:49.885411 Recv from voip AdviseOnTermination c83 -19/ 6/2007 9:52:49.965734 Recv from voip22 AdviseOnTermination c83 -19/ 6/2007 9:52:49.966074 Recv from voip c83:REQUESTNEWID voip22 -19/ 6/2007 9:52:49.966137 Send to c83 voip:REQUESTNEWID voip22 -19/ 6/2007 9:52:49.967668 Recv from c83 voip22:CALLNODE iax2:guest@conference.freeswitch.org/42 -19/ 6/2007 9:52:49.967791 Send to voip22 c83:CALLNODE iax2:guest@conference.freeswitch.org/42 -19/ 6/2007 9:52:49.967820 Recv from c83 voip22:TRANSFERUDP sound -19/ 6/2007 9:52:49.967862 Send to voip22 c83:TRANSFERUDP sound -19/ 6/2007 9:52:49.976023 Recv from voip22 AdviseOnTermination c83 -19/ 6/2007 9:52:50. 91997 Recv New node of voip32 -19/ 6/2007 9:52:55.641031 Recv from voip22 sound:TRANSFERUDP sound 192.168.1.109:60010 -19/ 6/2007 9:52:55.641122 Send to sound voip22:TRANSFERUDP sound 192.168.1.109:60010 -19/ 6/2007 9:52:55.642802 Recv from sound voip22:TRANSFERUDP sound 192.168.1.108:63000 done -19/ 6/2007 9:52:55.642878 Send to voip22 sound:TRANSFERUDP sound 192.168.1.108:63000 done -19/ 6/2007 9:52:56. 74599 Recv from voip22 c83:CallEstablished voip22 -19/ 6/2007 9:52:56. 74687 Send to c83 voip22:CallEstablished voip22 -19/ 6/2007 10:43:33.733437 Send to c83 sound:Terminating -19/ 6/2007 10:43:33.735661 Recv from c83 sound:TRANSFERUDP sound -19/ 6/2007 10:43:33.735691 Recv from c83 voip22:HANGUP -19/ 6/2007 10:43:33.735739 Send to voip22 c83:HANGUP </programlisting> </para> <para> The key events in the above log can be summarized by the list below +<listitem><para> +The voip node starts, and registers the supervisor with the label +<literal>voip</literal>. The voip supervisor then preallocates 10 nodes, ready +to be assigned to an incoming our outgoing call. By having preallocated nodes, +we minimise the delay in setting up a new call. Note also that it is entirely +wrong for any other node to start using one of these preallocated +calls. Indeed, it is only the server who knows about these preallocated +nodes. Information on these preallocated nodes is not made available to any +other &sofaswitch; entity. +</para></listitem> + <itemizedlist><listitem><para> The sound node is started, and connects to the server. The server reports that a new node has started, where the new node has identified itself as @@ -678,9 +703,9 @@ </para></listitem> <listitem><para> A controller script is started, which has no fixed/preset identity. It -therefore connects to the server with no id (and uses <literal>?</literal>). In -the third and fourth line, we see how the controller script requests the server -to tell the script what its identity is. +therefore connects to the server with no id (and uses <literal>?</literal>). We +see (at time <literal> 10:33:28. 93480</literal>) how the controller script requests the server +to provide identity information. </para></listitem> <listitem><para> @@ -694,52 +719,49 @@ </para></listitem> <listitem><para> -The nodes <literal>sound</literal>, <literal>voip</literal>, and -<literal>voip22</literal> advise the server that on termination, node -<literal>c83</literal> should receive a message that they died. +Node <literal>c1</literal> will receive a message from the server when the +nodes <literal>sound</literal>, <literal>voip</literal>, and +<literal>voip1</literal> terminate, because of the +<literal>AdviseOnTermination</literal> command. </para></listitem> <listitem><para> -<literal>voip</literal> sends a message to <literal>c83</literal> stating that -it has created a new worker node (<literal>voip22</literal>) for use. +<literal>voip</literal> sends a message to <literal>c1</literal> stating that +it has created a new worker node (<literal>voip1</literal>) for use. </para></listitem> <listitem><para> -<literal>voip22</literal> is asked to make a voip call to +<literal>voip1</literal> is asked to make a voip call to <literal>iax2:guest@conference.freeswitch.org/42</literal>. In this case, the call will use the IAX2 voip protocol. </para></listitem> <listitem><para> Immediately after the call is created, the <literal>transferudp</literal> -process is initiated. The controller (<literal>c83</literal>) causes the audio -input&output of <literal>voip22</literal> and <literal>sound</literal> to be connected. +process is initiated. The controller (<literal>c1</literal>) causes the audio +input&output of <literal>voip1</literal> and <literal>sound</literal> to be connected. </para></listitem> <listitem><para> In the middle of the <literal>transferudp</literal> message exchange, there is -a comment about a new node, <literal>voip32</literal>. This new node is created -by the <literal>voip</literal> supervisor ahead of time. In this setup, the -<literal>voip</literal> supervisor has a total of 10 nodes prebuilt, already -connected to the server which are ready for use. Thus, the moment the -<literal>voip</literal> supervisor receives a request for a new worker, it can -reply with an available worker. +a comment about a new node, <literal>voip11</literal>. This new node is created +by the <literal>voip</literal> supervisor which has responded to assigning +<literal>voip1</literal> to a call. </para></listitem> <listitem><para> -The voip worker <literal>voip22</literal> sends a message at <literal> -9:52:56. 74687</literal> to say that the call is established. +The voip worker <literal>voip1</literal> sends a message at <literal>10:33:34. 39595</literal> to say that the call is established. </para></listitem> <listitem><para> The worker <literal>sound</literal> is terminated by <literal>Ctrl-C</literal>. The server detects this and sends a message to the -controller at <literal>10:43:33.733437</literal> +controller at <literal>11:23:22.196723</literal> </para></listitem> <listitem><para> The call is disestablished. The controller closes down -<literal>voip22</literal> and directs <literal>sound</literal> to redirect +<literal>voip1</literal> and directs <literal>sound</literal> to redirect audio to itself. Since the <literal>sound</literal> node is already dead, this <literal>transferudp</literal> command is dropped. </para></listitem>