[h323plus] Need help to read Remote Port numbers in simph323

Ashwani Kumar ash1412 at gmail.com
Thu Apr 5 14:49:51 EDT 2012


Hi Simon,


My Compilation problem has solved.

I have implement the code same way as explained in h323con.h +1528 file.

modified main.cxx (simph323) code is given below:

PBoolean SimpleH323Connection::OnStartLogicalChannel(H323Channel & channel)
{
  if (!H323Connection::OnStartLogicalChannel(channel))
    return FALSE;

  cout << "I am on Started logical channel: \n";

        PIPSocket::Address ip;
        WORD dataPort;

  switch (channel.GetDirection()) {
    case H323Channel::IsTransmitter :
     cout << "sending ";
      break;

    case H323Channel::IsReceiver :
      cout << "AK:receiving ";
      break;

    default :
      break;
  }

  cout << channel.GetCapability() << endl;

*
  H323_ExternalRTPChannel & external = (H323_ExternalRTPChannel &)channel;

  cout << "H323_ExternalRTPChannel params**\n";

        if(external.GetSessionID()==1) {
         external.GetRemoteAddress(ip, dataPort);
        }
*
   *cout << "***********Remote IP =\n" << ip;**
   cout << "***********Remote dataPort=\n" << dataPort;
*  return TRUE;
}

But simph323 application stop at *H323_ExternalRTPChannel params*  message
and getting segmentation fault problem.

Regards
Ashwani

On Thu, Apr 5, 2012 at 7:44 PM, Ashwani Kumar <ash1412 at gmail.com> wrote:

>
>
> On Thu, Apr 5, 2012 at 7:11 PM, Ashwani Kumar <ash1412 at gmail.com> wrote:
>
>> Hi Simon.
>>
>> I implement the code as follows:
>>
>> H323_ExternalRTPChannel *a = (H323_ExternalRTPChannel *)&channel;
>> PIPSocket::Address x;
>> WORD y;
>>                 if (a->GetSessionID()==1) {
>>                 a->GetRemoteAddress(x, y);
>>          }
>>                if (a->GetSessionID()==2) {
>>                 a->GetRemoteAddress(x, y);
>>          }
>>
>>
>> inside the "PBoolean
>> SimpleH323Connection::OnStartLogicalChannel(H323Channel & channel) "
>>
>>
>> function. but I am not able to compile the code.
>> Getting following errors:
>>
>> main.cxx: In member function 'virtual PBoolean
>> SimpleH323Connection::OnStartLogicalChannel(H323Channel&)':
>> main.cxx:1563:27: error: 'a' was not declared in this scope
>> main.cxx:1563:57: error: expected primary-expression before ')' token
>>
>>
>>
>>
>> Please help to rectify the problem/suggest code to read remote address &
>> port number.
>>
>> Regards,
>> Ashwani
>>
>>
>> On Thu, Apr 5, 2012 at 4:19 PM, Ashwani Kumar <ash1412 at gmail.com> wrote:
>>
>>> Hi simon,
>>>
>>> I want to implement code to read remote end audio and video port numbers
>>> in simph323 (when call established).
>>>
>>> Can you please suggest the code added to be in simph323 application.
>>>
>>>
>>>
>>> --
>>>
>>>
>>> Thanks in Advance.
>>> *Ashwani Kumar
>>> *
>>>
>>
>>
>>
>> --
>>
>


-- 


Regards.
*Ashwani Kumar
Embedded Engg.
Mob:+91-9880631584
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.packetizer.com/pipermail/h323plus/attachments/20120406/b3ac3b56/attachment.htm>


More information about the h323plus mailing list