通信人家园

标题: H.248的关联的疑问  [查看完整版帖子] [打印本页]

时间:  2010-1-24 21:59
作者: gxh_luck     标题: H.248的关联的疑问

H.248的关联的疑问

在248方面就上在论坛上的等级一样,我是新手上路,有些问题我实在是琢磨不透,故发此贴,期待达人相助!
    关于 context,国家标准里翻译的是 关联。
    场景:A 呼叫 B。
    刚开始我一直将关联理解为 把A端和 B端连接起来,A和B之间的“那根线”就是关联,后来我发现我错了,因为在看消息流的时候我蓦然发现原来A端的ContextID和B端的ContextID不一样!
    这就是说我以前的理解是错误的,否则A端的ContextID和B端的ContextID应该是一样的。
    那现在我只能理解成,关联是把A端的半永久性终端和RTP流终端连接起来了。
    但是我看了相关的标准,觉得他们写的实在是没有办法不让你理解成 关联是把A和B连接起来了!
    下面是我从RFC3015上copy的。  
   The maximum number of Terminations in aContext is a MG property. Media gateways that offer only point-to-pointconnectivity might allow at most two Terminations per Context. Media gatewaysthat support multipoint conferences might allow three or more terminations perContext.


这段话很容易让你理解为关联是连接AB两端的终结点。

哪位能给我解释解释这段话的意思啊?或者给我讲讲怎么来理解 关联。谢谢!
时间:  2010-1-25 14:50
作者: ppcorn

如果A,B都在一个context中,contextid应该是一样的,你可以理解context是一个房间,把A和B都放在这么一个房间里面,他们就可以互相说话了。
时间:  2010-1-25 16:10
作者: gxh_luck

楼上的理解是不是和我刚开始的理解一样啊,
userA和UserB不属于同一个关联
时间:  2010-1-25 16:46
作者: ppcorn

把你的消息流贴出来
时间:  2010-1-25 20:44
作者: gxh_luck

1. An MG registers with an MGC using the ServiceChange command:

   MG1 to MGC:
   MEGACO/1 [124.124.124.222]
   Transaction = 9998 {
       Context = - {
           ServiceChange = ROOT {Services {
               Method=Restart,
               ServiceChangeAddress=55555, Profile=ResGW/1}
           }

       }
   }

   2. The MGC sends a reply:

   MGC to MG1:
   MEGACO/1 [123.123.123.4]:55555
   Reply = 9998 {
      Context = - {ServiceChange = ROOT {
        Services {ServiceChangeAddress=55555, Profile=ResGW/1} } }
   }

   3. The MGC programs a Termination in the NULL context. The
   terminationId is A4444, the streamId is 1, the requestId in the
   Events descriptor is 2222. The   mId is the identifier of the sender
   of this message, in this case, it is the IP address and port
   [123.123.123.4]:55555. Mode for this stream is set to SendReceive.
   "al" is the analog line supervision package.

   MGC to MG1:
   MEGACO/1 [123.123.123.4]:55555
   Transaction = 9999 {
       Context = - {
           Modify = A4444 {
               Media { Stream = 1 {
                        LocalControl {
                            Mode = SendReceive,
                            tdmc/gain=2,  ; in dB,
                            tdmc/ec=on
                        },
                        Local {
   v=0
   c=IN IP4 $
   m=audio $ RTP/AVP 0
   a=fmtpCMU VAD=X-NNVAD ; special voice activity
                           ; detection algorithm
                        }
                    }
               },
               Events = 2222 {al/of}
           }
       }
   }

   The dialplan script could have been loaded into the MG previously.
   Its function would be to wait for the OffHook, turn on dialtone and
   start collecting DTMF digits. However in this example, we use the
   digit map, which is put into place after the offhook is detected
   (step 5 below).

   Note that the embedded EventsDescriptor could have been used to
   combine steps 3 and 4 with steps 8 and 9, eliminating steps 6 and 7.

   4. The MG1 accepts the Modify with this reply:

   MG1 to MGC:
   MEGACO/1 [124.124.124.222]:55555
   Reply = 9999 {
      Context = - {Modify = A4444}
   }

   5. A similar exchange happens between MG2 and the MGC, resulting in
   an idle Termination called A5555.

   The following builds upon the previously shown conditions.  It
   illustrates the transactions from the Media Gateway Controller and
   originating Media Gateway (MG1) to get the originating Termination
   (A4444) through the stages of digit collection required to initiate a
   connection to the terminating Media Gateway (MG2).

   6. MG1 detects an offhook event from User 1 and reports it to the
   Media Gateway Controller via the Notify Command.

   MG1 to MGC:
   MEGACO/1 [124.124.124.222]:55555
   Transaction = 10000 {
      Context = - {
          Notify = A4444 {ObservedEvents =2222 {
            19990729T22000000:al/of}}
      }
   }

   7. And the Notify is acknowledged.

   MGC to MG1:
   MEGACO/1 [123.123.123.4]:55555
   Reply = 10000 {
       Context = - {Notify = A4444}
   }

   8. The MGC Modifies the termination to play dial tone, to look for
   digits according to Dialplan0 and to look for the on-hook event now.
   MGC to MG1:

   MEGACO/1 [123.123.123.4]:55555
   Transaction = 10001 {
       Context = - {
           Modify = A4444 {
               Events = 2223 {
                   al/on, dd/ce {DigitMap=Dialplan0}
               },
               Signals {cg/dt},
               DigitMap= Dialplan0{
   (0| 00|[1-7]xxx|8xxxxxxx|Fxxxxxxx|Exx|91xxxxxxxxxx|9011x.)}
           }
       }
   }

   9. And the Modify is acknowledged.

   MG1 to MGC:
   MEGACO/1 [124.124.124.222]:55555
   Reply = 10001 {
       Context = - {Modify = A4444}
   }

   10. Next, digits are accumulated by MG1 as they are dialed by User 1.
   Dialtone is stopped upon detection of the first digit. When an
   appropriate match is made of collected digits against the currently
   programmed Dialplan for A4444, another Notify is sent to the Media
   Gateway Controller.

   MG1 to MGC:
   MEGACO/1 [124.124.124.222]:55555
   Transaction = 10002 {
      Context = - {
          Notify = A4444 {ObservedEvents =2223 {
            19990729T22010001:dd/ce{ds="916135551212",Meth=FM}}}
      }
   }

   11. And the Notify is acknowledged.

   MGC to MG1:
   MEGACO/1 [123.123.123.4]:55555
   Reply = 10002 {
       Context = - {Notify = A4444}
   }

   12. The controller then analyses the digits and determines that a
   connection needs to be made from MG1 to MG2. Both the TDM termination
   A4444, and an RTP termination are added to a new context in MG1. Mode
   is ReceiveOnly since Remote descriptor values are not yet specified.
   Preferred codecs are in the MGC's preferred order of choice.

   MGC to MG1:
   MEGACO/1 [123.123.123.4]:55555
   Transaction = 10003 {
       Context = $ {
          Add = A4444,
          Add = $ {
              Media {
                Stream = 1 {
                     LocalControl {
                         Mode = ReceiveOnly,

                         nt/jit=40 ; in ms
                     },
                     Local {
   v=0
   c=IN IP4 $
   m=audio $ RTP/AVP 4
   a=ptime:30
   v=0
   c=IN IP4 $
   m=audio $ RTP/AVP 0
                     }
                }
             }
          }
       }
   }

   NOTE -  The MGC states its preferred parameter values as a series of
   sdp blocks in  Local. The MG fills in the Local Descriptor in the
   Reply.

   13. MG1 acknowledges the new Termination and fills in the Local IP
   address and UDP port. It also makes a choice for the codec based on
   the MGC preferences in Local. MG1 sets the RTP port to 2222.
   MEGACO/1 [124.124.124.222]:55555
   Reply = 10003 {
      Context = 2000 {
         Add = A4444,
         Add=A4445{
            Media {
                Stream = 1 {
                    Local {
   v=0
   c=IN IP4 124.124.124.222
   m=audio 2222 RTP/AVP 4
   a=ptime:30
   a=recvonly
                    } ; RTP profile for G.723 is 4
                }
            }
         }
      }
   }

   14. The MGC will now associate A5555 with a new Context on MG2, and
   establish an RTP Stream (i.e, A5556 will be assigned), SendReceive
   connection through to the originating user, User 1. The MGC also sets
   ring on A5555.

   MGC to MG2:
   MEGACO/1 [123.123.123.4]:55555
   Transaction = 50003 {
       Context = $ {
          Add = A5555  { Media {
               Stream = 1 {
                    LocalControl {Mode = SendReceive} }},
                Events=1234{al/of},
               Signals {al/ri}
               },
          Add  = $ {Media {
               Stream = 1 {
                    LocalControl {
                       Mode = SendReceive,
                       nt/jit=40 ; in ms
                    },
                    Local {
   v=0
   c=IN IP4 $
   m=audio $ RTP/AVP 4
   a=ptime:30
                    },
                    Remote {
   v=0
   c=IN IP4 124.124.124.222
   m=audio 2222 RTP/AVP 4
   a=ptime:30
                    } ; RTP profile for G.723 is 4
                }
             }
         }
      }
   }

   15. This is acknowledged. The stream port number is different from
   the control port number. In this case it is 1111 (in the SDP).

   MG2 to MGC:
   MEGACO/1 [124.124.124.222]:55555
   Reply = 50003 {
      Context = 5000 {
        Add = A5555,
         Add = A5556{
            Media {
               Stream = 1 {
                   Local {
   v=0
   c=IN IP4 125.125.125.111
   m=audio 1111 RTP/AVP 4
   }
               } ; RTP profile for G723 is 4
            }
          }
      }
   }

   16. The above IPAddr and UDPport need to be given to MG1 now.

   MGC to MG1:
   MEGACO/1 [123.123.123.4]:55555
   Transaction = 10005 {
     Context = 2000 {
       Modify = A4444 {
         Signals {cg/rt}
       },
       Modify = A4445 {
          Media {
               Stream = 1 {
                   Remote {
   v=0
   c=IN IP4 125.125.125.111
   m=audio 1111 RTP/AVP 4
                   }
               } ; RTP profile for G723 is 4
           }
       }
     }
   }

   MG1 to MGC:
   MEGACO/1 [124.124.124.222]:55555
   Reply = 10005 {
      Context = 2000 {Modify = A4444, Modify = A4445}
   }

   17. The two gateways are now connected and User 1 hears the RingBack.
   The MG2 now waits until User2 picks up the receiver and then the
   two-way call is established.

   From MG2 to MGC:

   MEGACO/1 [125.125.125.111]:55555
   Transaction = 50005 {
      Context = 5000 {
          Notify = A5555 {ObservedEvents =1234 {
            19990729T22020002:al/of}}
      }
   }

   From MGC to MG2:

   MEGACO/1 [123.123.123.4]:55555
   Reply = 50005 {
       Context = - {Notify = A5555}
   }

   From MGC to MG2:

   MEGACO/1 [123.123.123.4]:55555
   Transaction = 50006 {
      Context = 5000 {
         Modify = A5555 {
            Events = 1235 {al/on},
            Signals { } ; to turn off ringing
         }
      }
   }

   From MG2 to MGC:

   MEGACO/1 [125.125.125.111]:55555
   Reply = 50006 {
    Context = 5000 {Modify = A4445}
   }

   18. Change mode on MG1 to SendReceive, and stop the ringback.

   MGC to MG1:
   MEGACO/1 [123.123.123.4]:55555
   Transaction = 10006 {
      Context = 2000 {
         Modify = A4445 {
            Media {
               Stream = 1 {
                  LocalControl {
                     Mode=SendReceive
                  }
               }
            }
         },
         Modify = A4444 {
            Signals { }
         }
      }
   }

   from MG1 to MGC:
   MEGACO/1 [124.124.124.222]:55555
   Reply = 10006 {
      Context = 2000 {Modify = A4445, Modify = A4444}}

   19. The M******ecides to Audit the RTP termination on MG2.

   MEGACO/1 [123.123.123.4]:55555
   Transaction = 50007 {
      Context = - {AuditValue = A5556{
         Audit{Media, DigitMap, Events, Signals, Packages, Statistics
   }}
      }
   }

   20. The MG2 replies.

   MEGACO/1 [125.125.125.111]:55555
   Reply = 50007 {
      Context = - {
   AuditValue = A5556 {
             Media {
                 TerminationState { ServiceStates = InService,
                        Buffer = OFF },
                Stream = 1 {
                    LocalControl { Mode = SendReceive,
                       nt/jit=40 },
                    Local {
   v=0
   c=IN IP4 125.125.125.111
   m=audio 1111 RTP/AVP  4
   a=ptime:30
                   },
                    Remote {
   v=0
   c=IN IP4 124.124.124.222
   m=audio 2222 RTP/AVP  4
   a=ptime:30
                    } } },
             Events,
             Signals,
             DigitMap,
             Packages {nt-1, rtp-1},
             Statistics { rtp/ps=1200,  ; packets sent
                          nt/os=62300, ; octets sent
                          rtp/pr=700, ; packets received
                          nt/or=45100, ; octets received
                          rtp/pl=0.2,  ; % packet loss
                          rtp/jit=20,
                          rtp/delay=40 } ; avg latency
          }
       }
   }

   21. When the MGC receives an onhook signal from one of the MGs, it
   brings down the call. In this example, the user at MG2 hangs up
   first.

   From MG2 to MGC:

   MEGACO/1 [125.125.125.111]:55555
   Transaction = 50008 {
      Context = 5000 {
          Notify = A5555 {ObservedEvents =1235 {
             19990729T24020002:al/on}
          }
      }
   }

   From MGC to MG2:

   MEGACO/1 [123.123.123.4]:55555
   Reply = 50008 {
       Context = - {Notify = A5555}
   }

   22. The MGC now sends both MGs a Subtract to take down the call. Only
   the subtracts to MG2 are shown here. Each termination has its own set
   of statistics that it gathers. An MGC may not need to request both to
   be returned. A5555 is a physical termination, and A5556 is an RTP
   termination.

   From MGC to MG2:

   MEGACO/1 [123.123.123.4]:55555
   Transaction = 50009 {
      Context = 5000 {
         Subtract = A5555 {Audit{Statistics}},
         Subtract = A5556 {Audit{Statistics}}
      }
   }

   From MG2 to MGC:

   MEGACO/1 [125.125.125.111]:55555
   Reply = 50009 {
      Context = 5000 {
        Subtract = A5555 {
             Statistics {
                nt/os=45123, ; Octets Sent
                nt/dur=40 ; in seconds
                }
          },
          Subtract = A5556 {
             Statistics {
                rtp/ps=1245, ; packets sent
                nt/os=62345, ; octets sent
                rtp/pr=780, ; packets received
                nt/or=45123, ; octets received
                rtp/pl=10, ;  % packets lost
                rtp/jit=27,
                rtp/delay=48 ; average latency
             }
          }
      }
   }

   23. The MGC now sets up both MG1 and MG2 to be ready to detect the
   next off-hook event. See step 1. Note that this could be the default
   state of a termination in the null context, and if this were the
   case, no message need be sent from the MGC to the MG. Once a
   termination returns to the null context, it goes back to the default
   termination values for that termination.
时间:  2010-1-26 18:21
作者: skyjiangch

你说的那个AB可能是互为远端的两个终端,刚2楼说的很对,关联就相当于一个房子,里面能放几个终端是mg的一种属性,当这个网关支持会议时,一个关联里可以放3个以上的终端
时间:  2010-1-28 12:48
作者: iuflex

原帖由 skyjiangch 于 2010-1-26 18:21 发表
你说的那个AB可能是互为远端的两个终端,刚2楼说的很对,关联就相当于一个房子,里面能放几个终端是mg的一种属性,当这个网关支持会议时,一个关联里可以放3个以上的终端


移动软交换里,对于你所说的A呼叫B,在某些情况下会出现两个context id;这时候,MGW内部再把这两个context连接起来(或者可以看成交换机里时分空分交换矩阵似的东东):context 1(termination A,termination X) <----> context 2(termination Y,termination B); 通过X,Y的连接,A和B接通。




通信人家园 (https://www.txrjy.com/) Powered by C114